julien/lovepublic Fork 0
69c46a271e8ad618afdd4b84a226b8fc3525f827
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.

update docs for erc20 69c46a2 · on 69c46a271e8ad618afdd4b84a226b8fc3525f827 · julienbrg · 7h ago
README.md · 63 lines · 1.4 KBmarkdown
Blame HistoryOpen raw

love

A Foundry project.

Love (LOVE, 18 decimals) is a basic ERC-20 built on
OpenZeppelin, with one
deliberate twist: mint has no access control.

function mint(address to, uint256 amount) external;

Anyone can mint any amount to any address. Supply starts at zero and is
unbounded, so the token carries no economic value — it is a faucet / demo token.
Do not deploy it to mainnet expecting otherwise.

Setup

forge install
cp .env.example .env

Usage

forge build            # compile
forge test             # run tests
forge test -vvv        # with traces
forge fmt              # format
forge coverage         # coverage report
forge snapshot         # gas snapshot
anvil                  # local node

Deploy

forge script script/Love.s.sol:LoveScript \
  --rpc-url base_sepolia \
  --account "$DEPLOYER_ACCOUNT" \
  --broadcast \
  --verify

Drop --broadcast for a dry run.

Layout

Path Contents
src/ Contracts
test/ Tests
script/ Deployment scripts
lib/ Dependencies

Mint

cast send <LOVE_ADDRESS> "mint(address,uint256)" <RECIPIENT> 1000000000000000000 \
  --rpc-url base_sepolia \
  --account "$DEPLOYER_ACCOUNT"
 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# love

A [Foundry](https://getfoundry.sh) project.

`Love` (`LOVE`, 18 decimals) is a basic ERC-20 built on
[OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts), with one
deliberate twist: `mint` has **no access control**.

```solidity
function mint(address to, uint256 amount) external;
```

Anyone can mint any amount to any address. Supply starts at zero and is
unbounded, so the token carries no economic value — it is a faucet / demo token.
Do not deploy it to mainnet expecting otherwise.

## Setup

```shell
forge install
cp .env.example .env
```

## Usage

```shell
forge build            # compile
forge test             # run tests
forge test -vvv        # with traces
forge fmt              # format
forge coverage         # coverage report
forge snapshot         # gas snapshot
anvil                  # local node
```

## Deploy

```shell
forge script script/Love.s.sol:LoveScript \
  --rpc-url base_sepolia \
  --account "$DEPLOYER_ACCOUNT" \
  --broadcast \
  --verify
```

Drop `--broadcast` for a dry run.

## Layout

| Path      | Contents            |
| --------- | ------------------- |
| `src/`    | Contracts           |
| `test/`   | Tests               |
| `script/` | Deployment scripts  |
| `lib/`    | Dependencies        |

## Mint

```shell
cast send <LOVE_ADDRESS> "mint(address,uint256)" <RECIPIENT> 1000000000000000000 \
  --rpc-url base_sepolia \
  --account "$DEPLOYER_ACCOUNT"
```