update docs for erc20
69c46a2 parent: 4c8048e modified
.env.example +0 -3 | @@ -1,7 +1,4 @@ | ||
| 1 | 1 | # RPC endpoints |
| 2 | -MAINNET_RPC_URL= | |
| 3 | -SEPOLIA_RPC_URL= | |
| 4 | -BASE_RPC_URL=https://mainnet.base.org | |
| 5 | 2 | BASE_SEPOLIA_RPC_URL=https://sepolia.base.org |
| 6 | 3 | |
| 7 | 4 | # Block explorer verification |
| @@ -1,7 +1,4 @@ | |||
| 1 | # RPC endpoints | 1 | # RPC endpoints |
| 2 | -MAINNET_RPC_URL= | ||
| 3 | -SEPOLIA_RPC_URL= | ||
| 4 | -BASE_RPC_URL=https://mainnet.base.org | ||
| 5 | BASE_SEPOLIA_RPC_URL=https://sepolia.base.org | 2 | BASE_SEPOLIA_RPC_URL=https://sepolia.base.org |
| 6 | 3 | ||
| 7 | # Block explorer verification | 4 | # Block explorer verification |
modified
CHANGELOG.md +5 -3 | @@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | ||
| 10 | 10 | ### Added |
| 11 | 11 | |
| 12 | 12 | - Foundry project scaffolding (`forge-std`, CI workflow, `.gitignore`). |
| 13 | -- `Love` contract recording units of love sent between addresses. | |
| 14 | -- Unit, revert and fuzz tests for `Love`. | |
| 13 | +- `Love`, an ERC-20 token (`LOVE`, 18 decimals) on OpenZeppelin v5, with an | |
| 14 | + unrestricted public `mint(address,uint256)` — anyone can mint any amount. | |
| 15 | +- Metadata, mint, transfer, approve/`transferFrom`, revert and fuzz tests. | |
| 15 | 16 | - Deployment script `script/Love.s.sol`. |
| 16 | 17 | - `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant |
| 17 | - defaults, and RPC/Etherscan endpoints driven by env vars. | |
| 18 | + defaults, and Base Sepolia RPC/Etherscan endpoints driven by env vars. | |
| 19 | +- `remappings.txt` for `@openzeppelin/contracts/` and `forge-std/`. | |
| 18 | 20 | - `.env.example` documenting required environment variables. |
| @@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 10 | ### Added | 10 | ### Added |
| 11 | 11 | ||
| 12 | - Foundry project scaffolding (`forge-std`, CI workflow, `.gitignore`). | 12 | - Foundry project scaffolding (`forge-std`, CI workflow, `.gitignore`). |
| 13 | -- `Love` contract recording units of love sent between addresses. | 13 | +- `Love`, an ERC-20 token (`LOVE`, 18 decimals) on OpenZeppelin v5, with an |
| 14 | -- Unit, revert and fuzz tests for `Love`. | 14 | + unrestricted public `mint(address,uint256)` — anyone can mint any amount. |
| 15 | +- Metadata, mint, transfer, approve/`transferFrom`, revert and fuzz tests. | ||
| 15 | - Deployment script `script/Love.s.sol`. | 16 | - Deployment script `script/Love.s.sol`. |
| 16 | - `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant | 17 | - `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant |
| 17 | - defaults, and RPC/Etherscan endpoints driven by env vars. | 18 | + defaults, and Base Sepolia RPC/Etherscan endpoints driven by env vars. |
| 19 | +- `remappings.txt` for `@openzeppelin/contracts/` and `forge-std/`. | ||
| 18 | - `.env.example` documenting required environment variables. | 20 | - `.env.example` documenting required environment variables. |
modified
README.md +19 -2 | @@ -2,8 +2,17 @@ | ||
| 2 | 2 | |
| 3 | 3 | A [Foundry](https://getfoundry.sh) project. |
| 4 | 4 | |
| 5 | -`Love` is a minimal contract that records units of love sent from one address to | |
| 6 | -another — a placeholder to build on. | |
| 5 | +`Love` (`LOVE`, 18 decimals) is a basic ERC-20 built on | |
| 6 | +[OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts), with one | |
| 7 | +deliberate twist: `mint` has **no access control**. | |
| 8 | + | |
| 9 | +```solidity | |
| 10 | +function mint(address to, uint256 amount) external; | |
| 11 | +``` | |
| 12 | + | |
| 13 | +Anyone can mint any amount to any address. Supply starts at zero and is | |
| 14 | +unbounded, so the token carries no economic value — it is a faucet / demo token. | |
| 15 | +Do not deploy it to mainnet expecting otherwise. | |
| 7 | 16 | |
| 8 | 17 | ## Setup |
| 9 | 18 | |
| @@ -44,3 +53,11 @@ Drop `--broadcast` for a dry run. | ||
| 44 | 53 | | `test/` | Tests | |
| 45 | 54 | | `script/` | Deployment scripts | |
| 46 | 55 | | `lib/` | Dependencies | |
| 56 | + | |
| 57 | +## Mint | |
| 58 | + | |
| 59 | +```shell | |
| 60 | +cast send <LOVE_ADDRESS> "mint(address,uint256)" <RECIPIENT> 1000000000000000000 \ | |
| 61 | + --rpc-url base_sepolia \ | |
| 62 | + --account "$DEPLOYER_ACCOUNT" | |
| 63 | +``` | |
| @@ -2,8 +2,17 @@ | |||
| 2 | 2 | ||
| 3 | A [Foundry](https://getfoundry.sh) project. | 3 | A [Foundry](https://getfoundry.sh) project. |
| 4 | 4 | ||
| 5 | -`Love` is a minimal contract that records units of love sent from one address to | 5 | +`Love` (`LOVE`, 18 decimals) is a basic ERC-20 built on |
| 6 | -another — a placeholder to build on. | 6 | +[OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts), with one |
| 7 | +deliberate twist: `mint` has **no access control**. | ||
| 8 | + | ||
| 9 | +```solidity | ||
| 10 | +function mint(address to, uint256 amount) external; | ||
| 11 | +``` | ||
| 12 | + | ||
| 13 | +Anyone can mint any amount to any address. Supply starts at zero and is | ||
| 14 | +unbounded, so the token carries no economic value — it is a faucet / demo token. | ||
| 15 | +Do not deploy it to mainnet expecting otherwise. | ||
| 7 | 16 | ||
| 8 | ## Setup | 17 | ## Setup |
| 9 | 18 | ||
| @@ -44,3 +53,11 @@ Drop `--broadcast` for a dry run. | |||
| 44 | | `test/` | Tests | | 53 | | `test/` | Tests | |
| 45 | | `script/` | Deployment scripts | | 54 | | `script/` | Deployment scripts | |
| 46 | | `lib/` | Dependencies | | 55 | | `lib/` | Dependencies | |
| 56 | + | ||
| 57 | +## Mint | ||
| 58 | + | ||
| 59 | +```shell | ||
| 60 | +cast send <LOVE_ADDRESS> "mint(address,uint256)" <RECIPIENT> 1000000000000000000 \ | ||
| 61 | + --rpc-url base_sepolia \ | ||
| 62 | + --account "$DEPLOYER_ACCOUNT" | ||
| 63 | +``` | ||