Peg LOVE to wETH with deposit and withdraw #3
Merged@julien wants to merge
3-peg-love-to-weth into mainMerged as
ce13509fab5b.- @julien opened this merge request · 4h agoedited
closes #3
Removes the unrestricted
mintand turns LOVE into a wETH wrapper at a fixed rate of 100000 LOVE per wETH.deposit(uint256 wethAmount)pulls wETH withSafeERC20.safeTransferFromand mintswethAmount * RATE.withdraw(uint256 loveAmount)burns first, then releasesloveAmount / RATEwETH, and reverts withAmountNotDivisibleByRateunless the amount is a multiple of the rate.- wETH is an immutable constructor argument, so the CREATE2 address now embeds it: identical across chains that share a wETH deployment, different elsewhere. The script takes
WETHfrom the environment and defaults to the OP-Stack address; the CREATE2 tests pin that derivation. - Tests run against
MockWETH, a WETH9 stand-in, and cover deposit, withdraw, the divisibility revert, backing invariants, round-trips and fuzzing. 40 tests pass,forge lintis clean.
NatSpec pass lands as a separate commit on this branch.
Sign in to comment.