Skip to content

feat(CHAIN-3336): add Rust bindings and reorganize bindings directory#207

Open
xenoliss wants to merge 15 commits intomainfrom
bo/chain-3336
Open

feat(CHAIN-3336): add Rust bindings and reorganize bindings directory#207
xenoliss wants to merge 15 commits intomainfrom
bo/chain-3336

Conversation

@xenoliss
Copy link
Contributor

@xenoliss xenoliss commented Mar 17, 2026

Replaces #200

Summary

Set up Rust contract bindings under bindings/rust/ as a standalone crate and remove the legacy Go bindings.

  • Remove the old Go bindings under bindings/go/.
  • Add the Rust bindings crate (base-contracts-bindings) under bindings/rust/.
  • Generate Rust bindings for all contracts defined under src/ using forge bind.
  • Use a single global regex matcher derived from src/**/*.sol filenames to restrict forge bind to 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-generate workflow that regenerates the committed Rust bindings from the current src/ contract set.

To keep the new Rust bindings reliable, this PR adds validation recipes and CI coverage:

  • just bindings-check-no-build verifies that committed Rust bindings stay in sync with forge-artifacts by checking forge bind output without rewriting files.
  • just bindings-check runs the same consistency check and then cargo check in bindings/rust to ensure the crate compiles.
  • CI now installs Rust and runs just bindings-check.

@linear
Copy link

linear bot commented Mar 17, 2026

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Mar 17, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Copy link
Contributor

@jackchuma jackchuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

https://www.getfoundry.sh/reference/forge/bind#forge-bind

@jackchuma
Copy link
Contributor

I also think we should add bindings for all contracts under the src/ directory

@jackchuma
Copy link
Contributor

Oh and I think we can remove the go bindings

@cb-heimdall cb-heimdall dismissed jackchuma’s stale review March 17, 2026 14:39

Approved review 3960222222 from jackchuma is now dismissed due to new commit. Re-request for approval.

@xenoliss xenoliss requested a review from jackchuma March 17, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants