-
Notifications
You must be signed in to change notification settings - Fork 173
feat(CHAIN-3336): add Rust bindings and reorganize bindings directory #200
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
Open
xenoliss
wants to merge
7
commits into
bo/chain-3335
Choose a base branch
from
bo/chain-3336
base: bo/chain-3335
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
297a3ff
feat: setup rust bindings crate
xenoliss 1afe287
refactor: move bindings into bindings/go and bindings/rust
xenoliss e8f00b2
chore: strip binding artifacts and add justfile recipes for bindings
xenoliss babc6a7
chore: update semver-lock snapshot
xenoliss f92499c
fix: use robust PascalCase to snake_case conversion in bindings-add
xenoliss cbc31c9
chore: remove Cargo.lock from library crate
xenoliss 2e1afea
chore: add CI step to verify Rust bindings compile
xenoliss 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 hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| module github.com/base/contracts/bindings | ||
| module github.com/base/contracts/bindings/go | ||
|
|
||
| go 1.23.0 | ||
|
|
||
|
|
||
File renamed without changes.
This file contains hidden or 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,8 @@ | ||
| [package] | ||
| name = "base-contracts-bindings" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
|
|
||
| [dependencies] | ||
| alloy-contract = "1.5.0" | ||
jackchuma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| alloy-sol-types = { version = "1.5.0", features = ["json"] } | ||
jackchuma marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,118 @@ | ||
| { | ||
| "abi": [ | ||
| { | ||
| "type": "constructor", | ||
| "inputs": [ | ||
| { | ||
| "name": "builder", | ||
| "type": "address", | ||
| "internalType": "address" | ||
| } | ||
| ], | ||
| "stateMutability": "nonpayable" | ||
| }, | ||
| { | ||
| "type": "fallback", | ||
| "stateMutability": "nonpayable" | ||
| }, | ||
| { | ||
| "type": "function", | ||
| "name": "BUILDER", | ||
| "inputs": [], | ||
| "outputs": [ | ||
| { | ||
| "name": "", | ||
| "type": "address", | ||
| "internalType": "address" | ||
| } | ||
| ], | ||
| "stateMutability": "view" | ||
| }, | ||
| { | ||
| "type": "function", | ||
| "name": "get", | ||
| "inputs": [], | ||
| "outputs": [ | ||
| { | ||
| "name": "flashblockIndex", | ||
| "type": "uint8", | ||
| "internalType": "uint8" | ||
| }, | ||
| { | ||
| "name": "blockNumber", | ||
| "type": "uint48", | ||
| "internalType": "uint48" | ||
| } | ||
| ], | ||
| "stateMutability": "view" | ||
| }, | ||
| { | ||
| "type": "function", | ||
| "name": "initialize", | ||
| "inputs": [], | ||
| "outputs": [], | ||
| "stateMutability": "nonpayable" | ||
| }, | ||
| { | ||
| "type": "function", | ||
| "name": "version", | ||
| "inputs": [], | ||
| "outputs": [ | ||
| { | ||
| "name": "", | ||
| "type": "string", | ||
| "internalType": "string" | ||
| } | ||
| ], | ||
| "stateMutability": "view" | ||
| }, | ||
| { | ||
| "type": "event", | ||
| "name": "FlashblockIndexUpdated", | ||
| "inputs": [ | ||
| { | ||
| "name": "flashblockIndex", | ||
| "type": "uint8", | ||
| "indexed": true, | ||
| "internalType": "uint8" | ||
| }, | ||
| { | ||
| "name": "blockNumber", | ||
| "type": "uint48", | ||
| "indexed": true, | ||
| "internalType": "uint48" | ||
| } | ||
| ], | ||
| "anonymous": false | ||
| }, | ||
| { | ||
| "type": "event", | ||
| "name": "Initialized", | ||
| "inputs": [ | ||
| { | ||
| "name": "version", | ||
| "type": "uint8", | ||
| "indexed": false, | ||
| "internalType": "uint8" | ||
| } | ||
| ], | ||
| "anonymous": false | ||
| }, | ||
| { | ||
| "type": "error", | ||
| "name": "InvalidCalldata", | ||
| "inputs": [] | ||
| }, | ||
| { | ||
| "type": "error", | ||
| "name": "OnlyBuilder", | ||
| "inputs": [] | ||
| } | ||
| ], | ||
| "bytecode": { | ||
| "object": "0x60a060405234801561001057600080fd5b506040516105dc3803806105dc83398101604081905261002f9161010a565b6001600160a01b03811660805261004461004a565b5061013a565b600054610100900460ff16156100b65760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015610108576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60006020828403121561011c57600080fd5b81516001600160a01b038116811461013357600080fd5b9392505050565b60805161048161015b60003960008181606401526101fd01526104816000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806354fd4d50146101745780636d4ce63c146101c65780638129fc1c146101ee578063ecfd1b63146101f8575b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146100bb576040517f357a555d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600136146100f5576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000366000818110610109576101096103d2565b9091013560f81c43600881901b66ffffffffffff00169190911760015565ffffffffffff1690506000368181610141576101416103d2565b60405192013560f81c917f9e31f0bef6b07087c9e7d21830c330cc2d87343d2915024f0a0f832f45cf25779150600090a3005b6101b06040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516101bd9190610401565b60405180910390f35b600154600881901c6040805160ff909316835265ffffffffffff9091166020830152016101bd565b6101f6610244565b005b61021f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101bd565b600054610100900460ff16158080156102645750600054600160ff909116105b8061027e5750303b15801561027e575060005460ff166001145b61030e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840160405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b80156103cf57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208083528351808285015260005b8181101561042e57858101830151858201604001528201610412565b81811115610440576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fea164736f6c634300080f000a" | ||
| }, | ||
| "deployedBytecode": { | ||
| "object": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806354fd4d50146101745780636d4ce63c146101c65780638129fc1c146101ee578063ecfd1b63146101f8575b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146100bb576040517f357a555d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600136146100f5576040517f8129bbcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000366000818110610109576101096103d2565b9091013560f81c43600881901b66ffffffffffff00169190911760015565ffffffffffff1690506000368181610141576101416103d2565b60405192013560f81c917f9e31f0bef6b07087c9e7d21830c330cc2d87343d2915024f0a0f832f45cf25779150600090a3005b6101b06040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516101bd9190610401565b60405180910390f35b600154600881901c6040805160ff909316835265ffffffffffff9091166020830152016101bd565b6101f6610244565b005b61021f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101bd565b600054610100900460ff16158080156102645750600054600160ff909116105b8061027e5750303b15801561027e575060005460ff166001145b61030e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840160405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b80156103cf57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208083528351808285015260005b8181101561042e57858101830151858201604001528201610412565b81811115610440576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fea164736f6c634300080f000a" | ||
| } | ||
| } |
This file contains hidden or 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,10 @@ | ||
| use alloy_sol_types::sol; | ||
|
|
||
| sol!( | ||
| #[sol(rpc, abi)] | ||
| FlashblockIndex, | ||
| concat!( | ||
| env!("CARGO_MANIFEST_DIR"), | ||
| "/artifacts/FlashblockIndex.json" | ||
| ) | ||
| ); |
This file contains hidden or 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,2 @@ | ||
| mod flashblock_index; | ||
| pub use flashblock_index::FlashblockIndex; |
This file contains hidden or 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 @@ | ||
| pub mod l2; |
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.