feat(CHAIN-3336): add Rust bindings and reorganize bindings directory#207
Open
feat(CHAIN-3336): add Rust bindings and reorganize bindings directory#207
Conversation
Collaborator
🟡 Heimdall Review Status
|
jackchuma
previously requested changes
Mar 17, 2026
Contributor
jackchuma
left a comment
There was a problem hiding this comment.
Foundry actually provides a utility for this. This PR can basically be reduced to
bindings-generate: build-source
forge bind --select "..." --crate-name base-contracts-bindings -b bindings/rust --overwrite
bindings-check:
forge bind --select "..." --crate-name base-contracts-bindings -b bindings/rust --skip-build
Contributor
|
I also think we should add bindings for all contracts under the |
Contributor
|
Oh and I think we can remove the go bindings |
Approved review 3960222222 from jackchuma is now dismissed due to new commit. Re-request for approval.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces #200
Summary
Set up Rust contract bindings under
bindings/rust/as a standalone crate and remove the legacy Go bindings.bindings/go/.base-contracts-bindings) underbindings/rust/.src/usingforge bind.src/**/*.solfilenames to restrictforge bindto source contracts only.The Rust crate is set up so downstream Rust consumers can depend on it directly via Cargo without needing Foundry locally.
This PR also adds a
just bindings-generateworkflow that regenerates the committed Rust bindings from the currentsrc/contract set.To keep the new Rust bindings reliable, this PR adds validation recipes and CI coverage:
just bindings-check-no-buildverifies that committed Rust bindings stay in sync withforge-artifactsby checkingforge bindoutput without rewriting files.just bindings-checkruns the same consistency check and thencargo checkinbindings/rustto ensure the crate compiles.just bindings-check.