Fixtures
Runtime bytecode of two wETH implementations on the allowlist, pulled straight
off mainnets so the tests exercise real code rather than a mock that resembles
it. vm.etch puts one of these at an address and its EXTCODEHASH is then, by
construction, the value WETHRegistry is looking for — which is the only way
to test the allowlist without weakening it for tests.
| file | source | bytes | codehash |
|---|---|---|---|
weth9-op-legacy.hex |
Base, 0x4200000000000000000000000000000000000006 |
2041 | 0x8a3a1f6a9f9dce633117adee5b458245835a8645a8c8726a26382a4622508b1c |
weth9-canonical.hex |
Ethereum, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 |
3124 | 0xd0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23 |
Refetch either with:
cast code 0x4200000000000000000000000000000000000006 --rpc-url https://base-rpc.publicnode.com
Both hashes appear in script/weth-codehashes.sh output and in the allowlist in
src/WETHRegistry.sol, so a fixture that has drifted shows up as a test
failure rather than as a silent pass.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|