Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cheats: fix assume not precompile #594

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/StdCheats.sol
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ abstract contract StdCheatsSafe {
// Note: For some chains like Optimism these are technically predeploys (i.e. bytecode placed at a specific
// address), but the same rationale for excluding them applies so we include those too.

// These should be present on all EVM-compatible chains.
vm.assume(addr < address(0x1) || addr > address(0x9));
// These are reserved by Ethereum and may be on all EVM-compatible chains.
vm.assume(addr < address(0x1) || addr > address(0x100));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the larger upper bound so this is more future-proof. Do you have a source for the 0x100 value? I've only seen https://eips.ethereum.org/EIPS/eip-1352 which reserves through 0xffff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The genesis for testnets includes 1 wei for the precompiles in the range address(0) to address(0xff). See https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json

I meant to follow this standard, will update the PR to use address(0xff) rather than address(0x100)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in dab1435


// forgefmt: disable-start
if (chainId == 10 || chainId == 420) {
Expand Down