julien/lovepublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/julien/love.git
git clone ssh://git@rickub.com/julien/love.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

README.md · 93 lines · 3.0 KBmarkdown Blame HistoryRaw
Merge 1-add-main-logic into main dded29a rickub 4h ago1# Love
document setup b1c9b0d julienbrg 5h ago2
Merge 1-add-main-logic into main dded29a rickub 4h ago3The official LOVE token.
document setup b1c9b0d julienbrg 5h ago4
Merge 1-add-main-logic into main dded29a rickub 4h ago5## Install
document setup b1c9b0d julienbrg 5h ago6
7```shell
8forge install
9cp .env.example .env
10```
11
Merge 1-add-main-logic into main dded29a rickub 4h ago12## Build & test
document setup b1c9b0d julienbrg 5h ago13
14```shell
15forge build # compile
16forge test # run tests
17forge test -vvv # with traces
18forge fmt # format
19anvil # local node
20```
21
Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago22## How wETH is chosen
23
24LOVE is pegged to wETH, and that wETH is not a constructor argument. It is read
25at construction time from `WETHRegistry`, which accepts an address only if its
26`EXTCODEHASH` is one of ten reviewed wETH implementations *and* it survives a
27one-wei deposit/withdraw round trip. Registration is permissionless, ownerless
28and write-once.
29
30Two things follow. A LOVE instance can never be bound to a typo, a lookalike
31ERC-20 or an unreviewed wrapper. And because wETH is no longer in the creation
32code, the creation code is byte-identical everywhere, so CREATE2 gives LOVE one
33address on every chain instead of one per wETH deployment.
34
35The allowlist covers 14 chains across 5 implementations. Deployment is blocked
36elsewhere, on purpose: the remaining chains either carry bridged ETH with no
37`deposit()`/`withdraw()`, or put wETH behind an upgradeable proxy, where a
38codehash commits to a forwarder rather than to behaviour. To re-derive the list
39from chain state:
40
41```shell
42./script/weth-codehashes.sh
43```
44
45One caveat worth knowing before you trust an instance: the gate proves a
46candidate *is* a reviewed wETH implementation, not that it is *the* wETH a
47chain's ecosystem uses. Anyone can deploy a fresh WETH9 copy — same bytecode,
48no liquidity — and register it first. Nothing is stealable, since it is real
49WETH9 and fully redeemable, but check `WETH()` against the chain's canonical
50address before treating a deployment as the real one.
51
document setup b1c9b0d julienbrg 5h ago52## Deploy
53
Merge 1-add-main-logic into main dded29a rickub 4h ago54Deployment uses CREATE2, so the token has the same address on every EVM network.
Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago55Bringing up a chain is registry, then registration, then token — `run()` does
56all three and skips whichever has already happened.
Merge 1-add-main-logic into main dded29a rickub 4h ago57
document setup b1c9b0d julienbrg 5h ago58```shell
Merge 1-add-main-logic into main dded29a rickub 4h ago59forge script script/Love.s.sol:LoveScript --sig 'predict()' # print the address
60
Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago61WETH=0x4200000000000000000000000000000000000006 \
document setup b1c9b0d julienbrg 5h ago62forge script script/Love.s.sol:LoveScript \
63 --rpc-url base_sepolia \
64 --account "$DEPLOYER_ACCOUNT" \
65 --broadcast \
66 --verify
67```
68
Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago69`WETH` defaults to the OP Stack predeploy and is ignored once a wETH is
70registered. Registration sends 1 wei, which stays in the registry.
71
Merge 2-multichain-check into main 7c6b16b rickub 4h ago72To check determinism for real, deploy on two local chains and compare:
73
74```shell
75./script/multichain-check.sh
76```
77
Merge 5-weth-bytecode-verification into main 2f6da5e rickub 1h ago78It starts two anvil nodes (chain IDs 31337 and 31338), gives them *different*
79wETH implementations at *different* addresses, brings both up, and exits
80non-zero if the two LOVE addresses differ. Override `PORT_A`, `PORT_B`,
Merge 2-multichain-check into main 7c6b16b rickub 4h ago81`CHAIN_ID_A`, `CHAIN_ID_B` or `SALT` as needed.
82
Merge 1-add-main-logic into main dded29a rickub 4h ago83## License
84
85GPL-3.0
86
87## Contact
88
89**Julien Béranger** ([GitHub](https://github.com/julienbrg))
90
91- Element: [@julienbrg:matrix.org](https://matrix.to/#/@julienbrg:matrix.org)
92- Farcaster: [julien-](https://warpcast.com/julien-)
93- Telegram: [@julienbrg](https://t.me/julienbrg)