-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arbitrum SDK #1116
Closed
Closed
Arbitrum SDK #1116
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f57b68b
nitro
trajan0x 2f67189
rm nitro
trajan0x 07e0c27
nitro-contracts
trajan0x 4796cd9
Revert "nitro-contracts"
trajan0x 9cd2969
Revert "Revert "nitro-contracts""
trajan0x 42105ed
node interface first pass
trajan0x b51a1b1
another one
trajan0x 1878483
more session
trajan0x 22d292a
Revert "more session"
trajan0x 81fbabe
more arbgas
trajan0x a7cac0e
Merge branch 'master' into feat/arb-sdk
trajan0x 81f5504
lint fix
trajan0x adc439b
add some new checks for ci flake
trajan0x 106e84e
backup
trajan0x 76278d9
Merge branch 'master' into feat/arb-sdk
trajan0x 1e07031
Merge branch 'master' into feat/arb-sdk
trajan0x a6f343b
Merge branch 'feat/arb-sdk' of https://github.com/synapsecns/sanguine…
trajan0x bb9e88c
Merge branch 'master' into feat/arb-sdk
trajan0x 865179e
Merge branch 'master' into feat/arb-sdk
trajan0x 53dae85
Merge branch 'master' into feat/arb-sdk
trajan0x f7d9992
Merge branch 'master' into feat/arb-sdk
dwasse f50c1a8
Fix: arbitrum sdk build
dwasse 8eb138d
Cleanup: lint
dwasse dadf7aa
Cleanup: lint
dwasse 3c147fd
Feat: only run anvil tests when CI is false
dwasse 1452abf
Add CI=true to go workflow
dwasse a4e3fa2
Fix: check for testDone in explorer tests
dwasse 75c7fc8
Merge branch 'master' into feat/arb-sdk
dwasse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Chain | ||
|
||
The chain module contains deprecated implementations of many commom utilities for interacting with the chain. While this module will be excised in due course from internal libs, it should not be used in any new code. | ||
|
||
Feel free to duplicate any functionality from this module on the assumption it will be deleted. |
Submodule nitro-contracts
added at
2ba206
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
746 changes: 746 additions & 0 deletions
746
ethergo/sdks/arbitrum/contracts/arbgasinfo/arbgasinfo.abigen.go
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
ethergo/sdks/arbitrum/contracts/arbgasinfo/arbgasinfo.contractinfo.json
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
ethergo/sdks/arbitrum/contracts/arbgasinfo/arbgasinfo.metadata.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Package arbgasinfo contains the interface to the pre-compiled gas price contract for the Arbitrum chain. | ||
// | ||
// ArbGasInfo contains the interface for a pre-compile used by arbitrum for l2 gas estimation. Documentation is here: https://developer.arbitrum.io/devs-how-tos/how-to-estimate-gas#an-example-of-how-to-apply-this-formula-in-your-code | ||
// therefore: this cannot be deployed w/ deployers, but merely mocked or called via rpc. For this same reason, we do not need to return Filterers. As this contract does not actually exist. | ||
package arbgasinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package arbgasinfo | ||
|
||
//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../internal/nitro-contracts/src/precompiles/ArbGasInfo.sol --pkg arbgasinfo --sol-version 0.8.17 --filename arbgasinfo | ||
// here we generate some interfaces we use in for our mocks. TODO this should be automated in abigen for all contracts + be condensed | ||
//go:generate go run github.com/vburenin/ifacemaker -f arbgasinfo.abigen.go -s ArbGasInfoCaller -i IArbGasInfoCaller -p arbgasinfo -o icaller_generated.go -c "autogenerated file" | ||
//go:generate go run github.com/vektra/mockery/v2 --name IArbGasInfoCaller --output ./mocks --case=underscore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package arbgasinfo | ||
|
||
import ( | ||
"fmt" | ||
"github.com/ethereum/go-ethereum/accounts/abi/bind" | ||
"github.com/ethereum/go-ethereum/common" | ||
) | ||
|
||
// ArbGasInfoRef is a reference to a ArbGasInfo contract. | ||
// | ||
// nolint: golint | ||
type ArbGasInfoRef struct { | ||
*ArbGasInfo | ||
address common.Address | ||
} | ||
|
||
// Address gets the address of the contract. | ||
func (a ArbGasInfoRef) Address() common.Address { | ||
return a.address | ||
} | ||
|
||
// NewArbGasInfoRef creates a new ArbGasInfoRef bound to a contract. | ||
func NewArbGasInfoRef(address common.Address, backend bind.ContractBackend) (IArbGasInfo, error) { | ||
gasInfo, err := NewArbGasInfo(address, backend) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to instantiate ArbGasInfo contract: %w", err) | ||
} | ||
|
||
return &ArbGasInfoRef{ | ||
ArbGasInfo: gasInfo, | ||
address: address, | ||
}, nil | ||
} | ||
|
||
// IArbGasInfo is a thin wrapper around ArbGasInfoCaller that allows interfacing with the contract. | ||
type IArbGasInfo interface { | ||
IArbGasInfoCaller | ||
} |
82 changes: 82 additions & 0 deletions
82
ethergo/sdks/arbitrum/contracts/arbgasinfo/icaller_generated.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the TODO comment regarding the automation of interface generation in
abigen
. Consider implementing the automation or creating a tracking issue to address this in the future.Would you like me to open a GitHub issue to track this task?