julien/lovepublic Fork 0
3-peg-love-to-weth
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.

add weth peg tests and docs 5376202 · on 3-peg-love-to-weth · julienbrg · 3h ago
CHANGELOG.md · 35 lines · 1.9 KBmarkdown
Blame HistoryOpen raw

Changelog

All notable changes to this project are documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[Unreleased]

Added

  • Foundry project scaffolding (forge-std, CI workflow, .gitignore).
  • Love, an ERC-20 token (LOVE, 18 decimals) on OpenZeppelin v5, pegged to
    wETH at 100000 LOVE per wETH. No mint function and no owner: supply moves
    only through the permissionless deposit(uint256) and withdraw(uint256),
    so circulating LOVE is always backed by wETH held by the contract.
    withdraw reverts with AmountNotDivisibleByRate unless the amount is a
    multiple of the rate, keeping the peg free of rounding dust.
  • MockWETH, a test-only WETH9 stand-in, and tests covering deposit, withdraw,
    the divisibility revert, backing invariants, round-trips, transfers,
    approve/transferFrom, reverts and fuzzing.
  • Deployment script script/Love.s.sol, deploying with CREATE2 through the
    canonical deterministic deployer; salt defaults to keccak256("LOVE") and is
    overridable via SALT, wETH defaults to the OP-Stack address and is
    overridable via WETH. The address embeds the wETH argument, so it is
    identical across chains that share one wETH deployment.
  • predict() entrypoint printing the deployment address without broadcasting,
    and CREATE2 tests pinning address determinism across chain IDs and its
    dependence on the wETH argument.
  • foundry.toml with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant
    defaults, and Base Sepolia RPC/Etherscan endpoints driven by env vars.
  • script/multichain-check.sh, deploying Love on two local anvil nodes with
    different chain IDs and failing if the two addresses don't match.
  • remappings.txt for @openzeppelin/contracts/ and forge-std/.
  • .env.example documenting required environment variables, including WETH.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Foundry project scaffolding (`forge-std`, CI workflow, `.gitignore`).
- `Love`, an ERC-20 token (`LOVE`, 18 decimals) on OpenZeppelin v5, pegged to
  wETH at 100000 LOVE per wETH. No mint function and no owner: supply moves
  only through the permissionless `deposit(uint256)` and `withdraw(uint256)`,
  so circulating LOVE is always backed by wETH held by the contract.
  `withdraw` reverts with `AmountNotDivisibleByRate` unless the amount is a
  multiple of the rate, keeping the peg free of rounding dust.
- `MockWETH`, a test-only WETH9 stand-in, and tests covering deposit, withdraw,
  the divisibility revert, backing invariants, round-trips, transfers,
  approve/`transferFrom`, reverts and fuzzing.
- Deployment script `script/Love.s.sol`, deploying with CREATE2 through the
  canonical deterministic deployer; salt defaults to `keccak256("LOVE")` and is
  overridable via `SALT`, wETH defaults to the OP-Stack address and is
  overridable via `WETH`. The address embeds the wETH argument, so it is
  identical across chains that share one wETH deployment.
- `predict()` entrypoint printing the deployment address without broadcasting,
  and CREATE2 tests pinning address determinism across chain IDs and its
  dependence on the wETH argument.
- `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant
  defaults, and Base Sepolia RPC/Etherscan endpoints driven by env vars.
- `script/multichain-check.sh`, deploying `Love` on two local anvil nodes with
  different chain IDs and failing if the two addresses don't match.
- `remappings.txt` for `@openzeppelin/contracts/` and `forge-std/`.
- `.env.example` documenting required environment variables, including `WETH`.