foundry-rs / forge-std

Forge Standard Library is a collection of helpful contracts for use with forge and foundry. It leverages forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. For more in-depth usage examples checkout the tests.
Apache License 2.0
842 stars 333 forks source link

cheats: fix assume not precompile #594

Closed tynes closed 3 months ago

tynes commented 3 months ago

After the cancun hardfork, the point evaluation precompile was added at address(10) which the assumeNotPrecompile implementation did not take into account. Pectra is scheduled to include BLS precompiles and likely more precompiles will be introduced in other future hardforks. We might as well reserve the least significant byte for Ethereum precompiles, as the address space is large and there is no need to make calls from these addresses, and in return code will not break on new EVM specs.

This was causing test failures in the Optimism test suite when we updated the EVM version to cancun.