finds.dev

foundry-rs/forge-std

A collection of helpful contracts and libraries for use with Forge and Foundry

View on GitHubHomepage ↗

★ 1,045SolidityApache-2.0updated Jun 2026

// the take

The standard library for Foundry/Forge, providing test helpers, cheatcode wrappers, assertions, storage manipulation, and scripting utilities for Solidity development. This is essentially a required dependency for anyone doing serious Ethereum contract testing with Foundry — the Solidity equivalent of what jest-extended is to Jest.

- stdStorage is genuinely clever: it uses the record/accesses cheatcodes to find storage slots by function selector rather than requiring you to know the layout, which saves a lot of pain when testing contracts with complex or assembly-based storage.

- The Vm.sol interface file provides typed bindings to all Foundry cheatcodes, so you get compile-time checking on cheatcode calls instead of low-level ABI encoding.

- Assertion library covers the hard cases — assertApproxEqRel and assertApproxEqAbs are useful for fixed-point math testing where exact equality is impractical.

- Actively maintained by the core Foundry team with CI, a clear release checklist, and dependabot — not an abandoned side project.

- StdConfig/StdToml TOML parsing relies on Foundry cheatcodes that only work in a Forge environment, so any config-parsing logic is untestable outside that context and the error messages when the TOML structure doesn't match expectations are opaque.

- stdStorage silently fails or throws vague errors with packed storage slots unless you call enable_packed_slots() first — easy to get wrong and the failure mode isn't obvious to new users.

- The console.sol uint256/int256 decoding bug is a known issue that they've documented but not fixed, instead shipping two separate console implementations (console.sol vs console2.sol) which creates confusion about which one to use.

- Vm.sol is auto-generated from Foundry internals via a Python script, meaning the Solidity types are tightly coupled to the Foundry binary version — version mismatches between forge-std and the installed foundry binary can cause subtle test failures that are annoying to debug.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,045
Forks
500
Language
Solidity
License
Apache-2.0
Last commit
9 Jun 2026

// nearby

If forge-std isn't quite it.

All repos →