From 92e46643707d46116c842ec64d47931b9f7e9eba Mon Sep 17 00:00:00 2001 From: Zak G Date: Mon, 12 Oct 2026 22:07:12 -0600 Subject: [PATCH 1/2] fix: skip simulation for non-localhost foundry deploys Co-Authored-By: Claude Fable 5.1 --- .changeset/foundry-deploy-skip-simulation.md | 5 +++++ .../foundry/packages/foundry/Makefile.template.mjs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/foundry-deploy-skip-simulation.md diff --git a/.changeset/foundry-deploy-skip-simulation.md b/.changeset/foundry-deploy-skip-simulation.md new file mode 100644 index 0000000000..a590065d87 --- /dev/null +++ b/.changeset/foundry-deploy-skip-simulation.md @@ -0,0 +1,5 @@ +--- +"create-eth": patch +--- + +Skip local simulation for non-localhost Foundry deploys so gas limits come from the node's eth_estimateGas. Fixes out-of-gas deploy failures on Sepolia after the Glamsterdam fork repriced state creation (EIP-8037). diff --git a/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs b/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs index 5f070ccc88..c9239aa1ee 100644 --- a/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs +++ b/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs @@ -34,7 +34,7 @@ deploy: forge script $(DEPLOY_SCRIPT) --rpc-url localhost --broadcast --ffi; \ fi \ else \ - forge script $(DEPLOY_SCRIPT) --rpc-url $(RPC_URL) --broadcast --ffi; \ + forge script $(DEPLOY_SCRIPT) --rpc-url $(RPC_URL) --broadcast --ffi --skip-simulation; \ fi # Deploy and generate ABIs From 8a49f82166ab6d13cf02ba8684ae3e278dcc97fc Mon Sep 17 00:00:00 2001 From: Zak G Date: Tue, 13 Oct 2026 08:02:30 -0600 Subject: [PATCH 2/2] docs: explain --skip-simulation in foundry Makefile and changeset Forge simulates Ethereum chains with the evm_version from foundry.toml rather than the target chain's fork, so it under-estimates gas on Amsterdam chains (EIP-8037). Add a comment above the deploy target so generated projects know why the flag is there and when to drop it, and correct the changeset wording (evm_version = "amsterdam" exists since foundry 1.8.0; the issue is fork resolution, not a missing value). Co-Authored-By: Claude Fable 5.1 --- .changeset/foundry-deploy-skip-simulation.md | 2 +- .../foundry/packages/foundry/Makefile.template.mjs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.changeset/foundry-deploy-skip-simulation.md b/.changeset/foundry-deploy-skip-simulation.md index a590065d87..85b64036ff 100644 --- a/.changeset/foundry-deploy-skip-simulation.md +++ b/.changeset/foundry-deploy-skip-simulation.md @@ -2,4 +2,4 @@ "create-eth": patch --- -Skip local simulation for non-localhost Foundry deploys so gas limits come from the node's eth_estimateGas. Fixes out-of-gas deploy failures on Sepolia after the Glamsterdam fork repriced state creation (EIP-8037). +Add `--skip-simulation` to non-localhost Foundry deploys so gas limits come from the node's `eth_estimateGas`. Forge simulates Ethereum chains with the `evm_version` from `foundry.toml` rather than the target chain's active fork, so deploys to Amsterdam chains (EIP-8037, e.g. Sepolia) ran out of gas. Note: skipping simulation makes the broadcast sequential and drops the pre-broadcast cost summary. diff --git a/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs b/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs index c9239aa1ee..bfcf460ebf 100644 --- a/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs +++ b/templates/solidity-frameworks/foundry/packages/foundry/Makefile.template.mjs @@ -22,6 +22,10 @@ fork: setup-anvil-wallet anvil --fork-url \${FORK_URL} --chain-id 31337 # Deploy the contracts +# Non-localhost deploys use --skip-simulation: forge simulates with evm_version from +# foundry.toml, not the target chain's fork, so it under-estimates gas on Amsterdam +# chains (EIP-8037). Remove once forge resolves the Ethereum hardfork from the RPC +# or once Amsterdam is active on every network in foundry.toml. deploy: @if [ ! -f "$(DEPLOY_SCRIPT)" ]; then \ echo "Error: Deploy script '$(DEPLOY_SCRIPT)' not found"; \