# Love The official LOVE token. ## Install ```shell forge install cp .env.example .env ``` ## Build & test ```shell forge build # compile forge test # run tests forge test -vvv # with traces forge fmt # format anvil # local node ``` ## How wETH is chosen LOVE is pegged to wETH, and that wETH is not a constructor argument. It is read at construction time from `WETHRegistry`, which accepts an address only if its `EXTCODEHASH` is one of ten reviewed wETH implementations *and* it survives a one-wei deposit/withdraw round trip. Registration is permissionless, ownerless and write-once. Two things follow. A LOVE instance can never be bound to a typo, a lookalike ERC-20 or an unreviewed wrapper. And because wETH is no longer in the creation code, the creation code is byte-identical everywhere, so CREATE2 gives LOVE one address on every chain instead of one per wETH deployment. The allowlist covers 14 chains across 5 implementations. Deployment is blocked elsewhere, on purpose: the remaining chains either carry bridged ETH with no `deposit()`/`withdraw()`, or put wETH behind an upgradeable proxy, where a codehash commits to a forwarder rather than to behaviour. To re-derive the list from chain state: ```shell ./script/weth-codehashes.sh ``` One caveat worth knowing before you trust an instance: the gate proves a candidate *is* a reviewed wETH implementation, not that it is *the* wETH a chain's ecosystem uses. Anyone can deploy a fresh WETH9 copy — same bytecode, no liquidity — and register it first. Nothing is stealable, since it is real WETH9 and fully redeemable, but check `WETH()` against the chain's canonical address before treating a deployment as the real one. ## Deploy Deployment uses CREATE2, so the token has the same address on every EVM network. Bringing up a chain is registry, then registration, then token — `run()` does all three and skips whichever has already happened. ```shell forge script script/Love.s.sol:LoveScript --sig 'predict()' # print the address WETH=0x4200000000000000000000000000000000000006 \ forge script script/Love.s.sol:LoveScript \ --rpc-url base_sepolia \ --account "$DEPLOYER_ACCOUNT" \ --broadcast \ --verify ``` `WETH` defaults to the OP Stack predeploy and is ignored once a wETH is registered. Registration sends 1 wei, which stays in the registry. To check determinism for real, deploy on two local chains and compare: ```shell ./script/multichain-check.sh ``` It starts two anvil nodes (chain IDs 31337 and 31338), gives them *different* wETH implementations at *different* addresses, brings both up, and exits non-zero if the two LOVE addresses differ. Override `PORT_A`, `PORT_B`, `CHAIN_ID_A`, `CHAIN_ID_B` or `SALT` as needed. ## License GPL-3.0 ## Contact **Julien Béranger** ([GitHub](https://github.com/julienbrg)) - Element: [@julienbrg:matrix.org](https://matrix.to/#/@julienbrg:matrix.org) - Farcaster: [julien-](https://warpcast.com/julien-) - Telegram: [@julienbrg](https://t.me/julienbrg)