julien/lovepublic Fork
⑂ 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.

Download ZIP

Add LoveEnvelope secret/bearer-code contract #5

Merged@julien wants to merge 6-add-love-envelope into main
Merged as 13964fbd8e7f.
  • @julien opened this merge request · Sep 18, 2026

    closes #6

    Adds the on-chain mechanism assumed by docs/notes/add-privacy-to-love.md, folded into Love.sol:

    • deposit(bytes32 secretHash, uint256 wethAmount) — overload of the existing deposit, pulls wETH and mints LOVE the same way, but locks it into a secret-locked envelope (auto-incrementing depositId, decrementing remaining) instead of crediting the caller. Keeps the peg invariant (totalSupply() == WETH.balanceOf(this) * RATE) exactly.
    • claim(uint256 depositId, bytes32 secret, uint256 loveAmount) — new function, bearer-note semantics: whoever proves the secret is paid, reusable across partial claims.
    • withdraw is untouched — a claimed balance redeems for wETH the normal way.

    Tests in test/LoveEnvelope.t.sol cover deposit/claim accounting, independent envelopes, wrong-secret/unknown-deposit/insufficient-remaining reverts, and fuzzing.

Sign in to comment.