github foundry-rs/foundry v1.10.1

45 minutes ago

Foundry 1.10.1 fixes regressions from 1.10.0, including the linux/arm64 Docker image, and adds typed and machine-readable forge script workflows. Read Action required before upgrading, because some cheatcode results and gas numbers change.

What you get:

  • Working arm64 Docker image. The 1.10.0 linux/arm64 image shipped placeholder forge, cast and chisel binaries. This release ships real ones (#18727).
  • Scriptable forge script. --args-json passes typed arguments, --no-compile refuses to run stale sources, and --json reports failures as coded envelopes such as script.revert, rpc.error and compiler.stale.
  • vm.getStorageSlot returns a variable's base slot, byte offset and size from the storage layout, including packed, mapping, dynamic array and ERC-7201 namespaced variables.
  • About 70 fixes across cheatcodes, symbolic execution, Anvil forks, Cast, config and coverage.

Action required

  • vm.bound: it now reaches every value in range, so a given seed produces different values and later cheatcode RNG output in the same test shifts. Seeded fuzz runs and persisted failures may not replay as before (#18710).
  • Gas snapshots: a halting call under vm.expectRevert gives back its unused gas again, as on 1.9.0. This reverses the 1.10.0 change, so regenerate gas snapshots that you updated for 1.10.0 (#18674).
  • CREATE2 deployer access: contracts created through the CREATE2 deployer inherit cheatcode access from the caller. Allow-listing the factory with vm.allowCheatcodes(0x4e59b44847b379578588920cA78FbF26c0B4956C) no longer authorizes them (#18638).
  • Dependency configs: a dependency's foundry.toml is loaded without FOUNDRY_CONFIG, FOUNDRY_ROOT, FOUNDRY_SRC, DAPP_SRC or solc env overrides, which can change auto-detected remappings (#18686).
  • expectRevert on new: with dynamic linking, a test that expects a constructor to revert now runs the rest of its body instead of passing early, so such tests can start failing (#18717).
  • Building from source: the minimum Rust version is now 1.100 (#18721).

Features

  • Scripts: forge script --args-json passes typed script arguments and rejects JSON null. --no-compile runs existing artifacts and refuses stale sources. With --json, a failed run ends stdout with a failure envelope coded script.revert, rpc.error, rpc.transport, compiler.error or compiler.stale, results include broadcastable_transactions, and --skip-simulation keeps stdout clean (#18701, #18706, #18698, #18762, #18696, #18707, #18690, #18689) by @stevencartavia, @mablr.
  • Cheatcodes: vm.getStorageSlot(target, variableName) returns a variable's base slot, offset and size, and both storage-slot cheatcodes prefer an exact name over a case-insensitive match (#18382) by @SibghatUllah1997.
  • Anvil: trace_filter filters traces by block hash (#17360) by @figtracer.
  • Forge: solc 0.8.39 is supported, and Forge warns when build metadata contains absolute paths (#18619, #18715) by @mablr.

Bug fixes

Cheatcodes and execution

  • Cheatcodes: expectEmit counts add up across emitters, the expectCall value stipend saturates instead of overflowing, expectRevert matches deployCode creates, and contracts deployed through the CREATE2 deployer inherit their caller's cheatcode access (#18711, #18708, #18717, #18638) by @mablr.
  • Execution: created accounts are scoped to their fork and tracked through the transaction lifecycle (#18627, #18631) by @stevencartavia, @mablr.

Scripts, config and Forge

  • Scripts: the script contract deployed under the default sender is funded with initial_balance (#18757) by @mablr.
  • Config and remappings: chain is accepted as an alias for chain_id, dependencies that import from their own root are no longer scoped, and the nonexistent extends_strategy key is no longer suggested (#18675, #18614, #18111) by @mablr, @aelmanaa.
  • Coverage and lints: checks that jump around failures are ignored, --ir-minimum is ignored with a note under Solar, and symlinked inputs are linted (#18630, #18637, #18755) by @mablr, @DaniPopes.
  • Verify: creation-code matches of a different length are rejected (#18709) by @mablr.

Anvil and Cast

  • Anvil forks: fork transactions replay with the source block header, pre-fork raw headers and blocks are served, future raw blocks report not found, and Scroll forks accept headers without blob fields and skip EIP-4788 when replaying (#18724, #18730, #18740, #18625, #18624) by @mablr, @mortezashojaei, @stevencartavia.
  • Cast: cast call --curl forwards state overrides, the keychain root signer is checked against --from, and cast run rejects a receipt for a different transaction (#18756, #18754, #18733) by @mablr, @stevencartavia.

Security

  • JSON traces: raw calldata and return data of cheatcodes that carry keys, RPC URLs or env values are reduced to the selector in --json traces (#18639) by @mablr.

Symbolic execution

Docker, CI and refactors

Other behavior changes

  • forge script --json: stdout is JSON Lines. On failure, the last line is a failure envelope after the existing output (#18696).
  • Anvil: on a fork, debug_getRawHeader and debug_getRawBlock for future blocks return error -32001 instead of -32602 (#18740).
  • Cast: --tempo.configurable-account --from with a mismatched root signer now errors (#18754).
  • Config: FOUNDRY_CHAIN is ignored when FOUNDRY_CHAIN_ID is set (#18675).
  • Lints: symlinked files are now linted, so --deny warnings runs can newly fail (#18755).

Dependencies

New contributors

@SibghatUllah1997.

Full Changelog:

v1.10.0...v1.10.1

Don't miss a new foundry release

NewReleases is sending notifications on new releases.