| @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
| 9 | | 9 | |
| 10 | ### Fixed | 10 | ### Fixed |
| 11 | | 11 | |
| | 12 | +- `WETHRegistry` no longer accepts a reviewed codehash on any chain that |
| | 13 | + reproduces it. Canonical WETH9 has no chain-specific logic, so its bytecode |
| | 14 | + is identical everywhere, and on a chain whose native gas token isn't ETH it |
| | 15 | + would have registered as wETH while wrapping the wrong asset: the |
| | 16 | + deposit/withdraw probe cannot tell, since "the native currency is ETH" is not |
| | 17 | + observable from inside the EVM. Each of the ten allowlisted hashes is now |
| | 18 | + paired with the chain IDs it was actually reviewed on. See |
| | 19 | + `docs/notes/native-currency-substitution.md`. |
| 12 | - `Love.deposit(bytes32 secretHash, uint256 wethAmount)` now reverts with | 20 | - `Love.deposit(bytes32 secretHash, uint256 wethAmount)` now reverts with |
| 13 | `ZeroSecretHash` when called with `secretHash == bytes32(0)`. `claim` uses | 21 | `ZeroSecretHash` when called with `secretHash == bytes32(0)`. `claim` uses |
| 14 | that same zero value as its "envelope doesn't exist" sentinel, so a | 22 | that same zero value as its "envelope doesn't exist" sentinel, so a |
| @@ -17,6 +25,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
| 17 | | 25 | |
| 18 | ### Changed | 26 | ### Changed |
| 19 | | 27 | |
| | 28 | +- `WETHRegistry.isKnownImplementation` takes a second `chainId` argument, and |
| | 29 | + `UnknownImplementation` carries the `chainId` it was rejected on. Its |
| | 30 | + creation code changed with them, so the registry's CREATE2 address moved from |
| | 31 | + `0x9Cf17430fEdEC487518416D1Cdc849b1eE9CDbA3` to |
| | 32 | + `0x33dF1Cd28c9d577224F9A79dD9541275BCa70998`, and `Love.REGISTRY` with it. |
| | 33 | + **Breaking:** any `Love` deployed from here lands at a different address than |
| | 34 | + before. Instances already deployed are immutable and unaffected. |
| | 35 | +- `Fixtures.setUpChain` takes the chain ID to register on, since the registry |
| | 36 | + now checks the codehash against `block.chainid`. |
| 20 | - `Love`'s constructor no longer takes wETH. It reads it from `WETHRegistry` at | 37 | - `Love`'s constructor no longer takes wETH. It reads it from `WETHRegistry` at |
| 21 | a fixed address and reverts with `RegistryNotDeployed` or `WethNotRegistered` | 38 | a fixed address and reverts with `RegistryNotDeployed` or `WethNotRegistered` |
| 22 | if there is nothing to read. The creation code is therefore byte-identical on | 39 | if there is nothing to read. The creation code is therefore byte-identical on |
| @@ -37,6 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
| 37 | | 54 | |
| 38 | ### Added | 55 | ### Added |
| 39 | | 56 | |
| | 57 | +- `test_RevertWhen_ReviewedHashOnWrongChain` and |
| | 58 | + `test_RevertWhen_RegisteringCanonicalWethOnWrongChain`, pinning the fix: |
| | 59 | + canonical WETH9's byte-identical bytecode registers on Ethereum and reverts |
| | 60 | + on Polygon PoS. |
| 40 | - `WETHRegistry`, naming the wETH LOVE pegs to on a chain. `register()` is | 61 | - `WETHRegistry`, naming the wETH LOVE pegs to on a chain. `register()` is |
| 41 | permissionless and payable, takes exactly 1 wei, and accepts a candidate only | 62 | permissionless and payable, takes exactly 1 wei, and accepts a candidate only |
| 42 | if its `EXTCODEHASH` is one of ten reviewed wETH implementations and a | 63 | if its `EXTCODEHASH` is one of ten reviewed wETH implementations and a |