build: pin Foundry version for make deploy - #173
Merged
Conversation
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>
Collaborator
✅ Heimdall Review Status
|
stevieraykatz
approved these changes
Jul 17, 2026
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.
Why
foundry.tomlpinssolc(0.8.23) but not theforge/castbinary, somake deployruns against whatever Foundry is on the operator's PATH. Because the deployed CREATE2 address depends on forge-level behavior (remappings resolution,evm_versionclamping, metadata), a drifting local toolchain can produce a non-canonical address — exactly the failure mode from #171, which only surfaced as a crypticpanic: assertion faileddeep 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-foundryprerequisite to thedeploytarget that fails fast unless the activeforgematches the pinnedFOUNDRY_VERSION(1.5.1), with an actionable hint:FOUNDRY_VERSIONis 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)inDeployFactory.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-foundrypasses on forge 1.5.1; fails (non-zero) on a mismatched version with the hint above.make -n deployconfirms the guard runs before the deploy command; deploy invocation unchanged.0x00000110…/0xBA5ED1…).