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