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.

Peg LOVE to wETH with deposit and withdraw #3

Merged@julien wants to merge 3-peg-love-to-weth into main
Merged as ce13509fab5b.
  • @julien opened this merge request · 4h ago

    closes #3

    Removes the unrestricted mint and turns LOVE into a wETH wrapper at a fixed rate of 100000 LOVE per wETH.

    • deposit(uint256 wethAmount) pulls wETH with SafeERC20.safeTransferFrom and mints wethAmount * RATE.
    • withdraw(uint256 loveAmount) burns first, then releases loveAmount / RATE wETH, and reverts with AmountNotDivisibleByRate unless 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 WETH from 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 lint is clean.

    NatSpec pass lands as a separate commit on this branch.

Sign in to comment.