Skip to content

build: pin Foundry version for make deploy - #173

Merged
amiecorso merged 1 commit into
coinbase:mainfrom
amiecorso:makefile/pin-foundry-deploy
Jul 17, 2026
Merged

build: pin Foundry version for make deploy#173
amiecorso merged 1 commit into
coinbase:mainfrom
amiecorso:makefile/pin-foundry-deploy

Conversation

@amiecorso

Copy link
Copy Markdown
Contributor

Why

foundry.toml pins solc (0.8.23) but not the forge/cast binary, so make deploy runs against whatever Foundry is on the operator's PATH. Because the deployed CREATE2 address depends on forge-level behavior (remappings resolution, evm_version clamping, metadata), a drifting local toolchain can produce a non-canonical address — exactly the failure mode from #171, which only surfaced as a cryptic panic: assertion failed deep in the deploy script.

Companion to #172, which pins the same version in CI. Together they give matched local + CI toolchains.

What

Add a check-foundry prerequisite to the deploy target that fails fast unless the active forge matches the pinned FOUNDRY_VERSION (1.5.1), with an actionable hint:

forge 1.5.1 required (found: forge Version: 1.4.0-stable)
run: foundryup --install 1.5.1 && foundryup --use 1.5.1

FOUNDRY_VERSION is a single variable at the top of the Makefile. The deploy command itself is unchanged.

Why a guard (not auto-install)

Non-intrusive: it won't silently install toolchains or mutate the operator's global Foundry. It complements — doesn't replace — the assert(implementation == EXPECTED_IMPLEMENTATION) in DeployFactory.s.sol, which remains the hard correctness backstop. This just turns a cryptic panic into a clear "use v1.5.1" message.

Verification

  • make check-foundry passes on forge 1.5.1; fails (non-zero) on a mismatched version with the hint above.
  • make -n deploy confirms the guard runs before the deploy command; deploy invocation unchanged.
  • forge 1.5.1 reproduces the canonical addresses exactly (0x00000110… / 0xBA5ED1…).

foundry.toml pins solc (0.8.23) but not the forge/cast binary, so make
deploy runs against whatever Foundry is on PATH. Since the deployed CREATE2
address depends on forge-level behavior (remappings resolution, evm_version
clamping, metadata), a drifting local toolchain can produce a non-canonical
address -- the failure mode from the ds-test remappings fix, which only
surfaced as a cryptic panic deep in the deploy script.

Add a check-foundry prerequisite that fails fast unless the active forge
matches the pinned FOUNDRY_VERSION (1.5.1, verified to reproduce the
canonical addresses), with an actionable foundryup hint. Deploy command
unchanged. Companion to the CI pin.

Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
@cb-heimdall

cb-heimdall commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/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

@amiecorso
amiecorso merged commit a4e83fd into coinbase:main Jul 17, 2026
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants