| document setup b1c9b0d julienbrg 5h ago | 1 | # Changelog |
| 2 | |
| 3 | All notable changes to this project are documented in this file. |
| 4 | |
| 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | |
| 8 | ## [Unreleased] |
| 9 | |
| Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago | 10 | ### Changed |
| 11 | |
| 12 | - `Love`'s constructor no longer takes wETH. It reads it from `WETHRegistry` at |
| 13 | a fixed address and reverts with `RegistryNotDeployed` or `WethNotRegistered` |
| 14 | if there is nothing to read. The creation code is therefore byte-identical on |
| 15 | every chain, so CREATE2 gives LOVE one address everywhere rather than one per |
| 16 | wETH deployment — the previous behaviour, where the wETH argument was part of |
| 17 | the creation code, is gone. **Breaking:** the deployment interface and the |
| 18 | resulting address both change. |
| 19 | - `script/Love.s.sol` brings a chain up in three steps — deploy the registry, |
| 20 | register wETH, deploy the token — skipping whichever has already happened. |
| 21 | `predict()` and `initCode()` no longer take a wETH argument. |
| 22 | - `script/multichain-check.sh` now gives its two anvil nodes different wETH |
| 23 | implementations at different addresses, which is what makes a matching LOVE |
| 24 | address meaningful; it also fails if both nodes end up on the same wETH. |
| 25 | - Tests run against real WETH9 runtime bytecode etched from live chains rather |
| 26 | than against `MockWETH`, since a mock's codehash is not on the allowlist and |
| 27 | adding it would mean testing a different allowlist from the one that ships. |
| 28 | `MockWETH` is now the "correct behaviour, wrong bytecode" rejection case. |
| 29 | |
| document setup b1c9b0d julienbrg 5h ago | 30 | ### Added |
| 31 | |
| Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago | 32 | - `WETHRegistry`, naming the wETH LOVE pegs to on a chain. `register()` is |
| 33 | permissionless and payable, takes exactly 1 wei, and accepts a candidate only |
| 34 | if its `EXTCODEHASH` is one of ten reviewed wETH implementations and a |
| 35 | deposit/withdraw round trip of that wei succeeds. Ownerless, no setter, |
| 36 | write-once, so nothing can move the token under a live peg. The allowlist is |
| 37 | compile-time, so extending it means publishing a new registry and no key can |
| 38 | revoke an entry. The probe wei is kept rather than refunded, so a registrar |
| 39 | with no payable fallback can still register. `receive()` reverts outside a |
| 40 | probe, keeping the registry from becoming ether it cannot move. |
| 41 | - `IWETH`, the narrow wrapper interface the registry probes against. |
| 42 | - `script/weth-codehashes.sh` and `script/weth-chains.tsv`, surveying the wETH |
| 43 | on 27 chains and grouping them by implementation, so every allowlist entry is |
| 44 | reproducible from chain state. The survey found 23 distinct codehashes across |
| 45 | those chains, collapsing to 5 implementations over 14 chains once bridged-ETH |
| 46 | tokens, upgradeable proxies and non-EVM bytecode are excluded. |
| 47 | - `test/fixtures/`, real WETH9 runtime bytecode from Base and Ethereum, with |
| 48 | `test/Fixtures.sol` to stage a chain: registry, wETH, registration. |
| 49 | - `WETHRegistryTest`, covering both gates, the write-once rule, the exact probe |
| 50 | value, ether sent outside a probe, and all ten allowlist entries. |
| document setup b1c9b0d julienbrg 5h ago | 51 | - Foundry project scaffolding (`forge-std`, CI workflow, `.gitignore`). |
| Merge 3-peg-love-to-weth into main ce13509 rickub 3h ago | 52 | - `Love`, an ERC-20 token (`LOVE`, 18 decimals) on OpenZeppelin v5, pegged to |
| 53 | wETH at 100000 LOVE per wETH. No mint function and no owner: supply moves |
| 54 | only through the permissionless `deposit(uint256)` and `withdraw(uint256)`, |
| 55 | so circulating LOVE is always backed by wETH held by the contract. |
| 56 | `withdraw` reverts with `AmountNotDivisibleByRate` unless the amount is a |
| 57 | multiple of the rate, keeping the peg free of rounding dust. |
| 58 | - `MockWETH`, a test-only WETH9 stand-in, and tests covering deposit, withdraw, |
| 59 | the divisibility revert, backing invariants, round-trips, transfers, |
| 60 | approve/`transferFrom`, reverts and fuzzing. |
| Merge 1-add-main-logic into main dded29a rickub 4h ago | 61 | - Deployment script `script/Love.s.sol`, deploying with CREATE2 through the |
| Merge 3-peg-love-to-weth into main ce13509 rickub 3h ago | 62 | canonical deterministic deployer; salt defaults to `keccak256("LOVE")` and is |
| Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago | 63 | overridable via `SALT`, the wETH to register defaults to the OP-Stack address |
| 64 | and is overridable via `WETH`. Neither contract takes constructor arguments, |
| 65 | so both land at the same address on every chain. |
| Merge 1-add-main-logic into main dded29a rickub 4h ago | 66 | - `predict()` entrypoint printing the deployment address without broadcasting, |
| Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago | 67 | and CREATE2 tests pinning address determinism across chain IDs, including |
| 68 | that two chains with different wETH still give LOVE one address. |
| document setup b1c9b0d julienbrg 5h ago | 69 | - `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant |
| update docs for erc20 69c46a2 julienbrg 5h ago | 70 | defaults, and Base Sepolia RPC/Etherscan endpoints driven by env vars. |
| Merge 2-multichain-check into main 7c6b16b rickub 4h ago | 71 | - `script/multichain-check.sh`, deploying `Love` on two local anvil nodes with |
| 72 | different chain IDs and failing if the two addresses don't match. |
| update docs for erc20 69c46a2 julienbrg 5h ago | 73 | - `remappings.txt` for `@openzeppelin/contracts/` and `forge-std/`. |
| Merge 3-peg-love-to-weth into main ce13509 rickub 3h ago | 74 | - `.env.example` documenting required environment variables, including `WETH`. |