added .env.example +12 -0
| new file mode 100644 |
| @@ -0,0 +1,12 @@ |
| 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 |
| 6 | + |
| 7 | +# Block explorer verification |
| 8 | +ETHERSCAN_API_KEY= |
| 9 | + |
| 10 | +# Deployer — prefer `cast wallet` keystore over a raw key |
| 11 | +# cast wallet import deployer --interactive |
| 12 | +DEPLOYER_ACCOUNT=deployer |
| new file mode 100644 |
| @@ -0,0 +1,12 @@ |
| | 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 |
| | 6 | + |
| | 7 | +# Block explorer verification |
| | 8 | +ETHERSCAN_API_KEY= |
| | 9 | + |
| | 10 | +# Deployer — prefer `cast wallet` keystore over a raw key |
| | 11 | +# cast wallet import deployer --interactive |
| | 12 | +DEPLOYER_ACCOUNT=deployer |
added CHANGELOG.md +18 -0
| new file mode 100644 |
| @@ -0,0 +1,18 @@ |
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project are documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [Unreleased] |
| 9 | + |
| 10 | +### Added |
| 11 | + |
| 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`. |
| 15 | +- Deployment script `script/Love.s.sol`. |
| 16 | +- `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant |
| 17 | + defaults, and RPC/Etherscan endpoints driven by env vars. |
| 18 | +- `.env.example` documenting required environment variables. |
| new file mode 100644 |
| @@ -0,0 +1,18 @@ |
| | 1 | +# Changelog |
| | 2 | + |
| | 3 | +All notable changes to this project are documented in this file. |
| | 4 | + |
| | 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
| | 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| | 7 | + |
| | 8 | +## [Unreleased] |
| | 9 | + |
| | 10 | +### Added |
| | 11 | + |
| | 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`. |
| | 15 | +- Deployment script `script/Love.s.sol`. |
| | 16 | +- `foundry.toml` with pinned solc 0.8.30, optimizer, fmt rules, fuzz/invariant |
| | 17 | + defaults, and RPC/Etherscan endpoints driven by env vars. |
| | 18 | +- `.env.example` documenting required environment variables. |
added README.md +46 -0
| new file mode 100644 |
| @@ -0,0 +1,46 @@ |
| 1 | +# love |
| 2 | + |
| 3 | +A [Foundry](https://getfoundry.sh) project. |
| 4 | + |
| 5 | +`Love` is a minimal contract that records units of love sent from one address to |
| 6 | +another — a placeholder to build on. |
| 7 | + |
| 8 | +## Setup |
| 9 | + |
| 10 | +```shell |
| 11 | +forge install |
| 12 | +cp .env.example .env |
| 13 | +``` |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +```shell |
| 18 | +forge build # compile |
| 19 | +forge test # run tests |
| 20 | +forge test -vvv # with traces |
| 21 | +forge fmt # format |
| 22 | +forge coverage # coverage report |
| 23 | +forge snapshot # gas snapshot |
| 24 | +anvil # local node |
| 25 | +``` |
| 26 | + |
| 27 | +## Deploy |
| 28 | + |
| 29 | +```shell |
| 30 | +forge script script/Love.s.sol:LoveScript \ |
| 31 | + --rpc-url base_sepolia \ |
| 32 | + --account "$DEPLOYER_ACCOUNT" \ |
| 33 | + --broadcast \ |
| 34 | + --verify |
| 35 | +``` |
| 36 | + |
| 37 | +Drop `--broadcast` for a dry run. |
| 38 | + |
| 39 | +## Layout |
| 40 | + |
| 41 | +| Path | Contents | |
| 42 | +| --------- | ------------------- | |
| 43 | +| `src/` | Contracts | |
| 44 | +| `test/` | Tests | |
| 45 | +| `script/` | Deployment scripts | |
| 46 | +| `lib/` | Dependencies | |
| new file mode 100644 |
| @@ -0,0 +1,46 @@ |
| | 1 | +# love |
| | 2 | + |
| | 3 | +A [Foundry](https://getfoundry.sh) project. |
| | 4 | + |
| | 5 | +`Love` is a minimal contract that records units of love sent from one address to |
| | 6 | +another — a placeholder to build on. |
| | 7 | + |
| | 8 | +## Setup |
| | 9 | + |
| | 10 | +```shell |
| | 11 | +forge install |
| | 12 | +cp .env.example .env |
| | 13 | +``` |
| | 14 | + |
| | 15 | +## Usage |
| | 16 | + |
| | 17 | +```shell |
| | 18 | +forge build # compile |
| | 19 | +forge test # run tests |
| | 20 | +forge test -vvv # with traces |
| | 21 | +forge fmt # format |
| | 22 | +forge coverage # coverage report |
| | 23 | +forge snapshot # gas snapshot |
| | 24 | +anvil # local node |
| | 25 | +``` |
| | 26 | + |
| | 27 | +## Deploy |
| | 28 | + |
| | 29 | +```shell |
| | 30 | +forge script script/Love.s.sol:LoveScript \ |
| | 31 | + --rpc-url base_sepolia \ |
| | 32 | + --account "$DEPLOYER_ACCOUNT" \ |
| | 33 | + --broadcast \ |
| | 34 | + --verify |
| | 35 | +``` |
| | 36 | + |
| | 37 | +Drop `--broadcast` for a dry run. |
| | 38 | + |
| | 39 | +## Layout |
| | 40 | + |
| | 41 | +| Path | Contents | |
| | 42 | +| --------- | ------------------- | |
| | 43 | +| `src/` | Contracts | |
| | 44 | +| `test/` | Tests | |
| | 45 | +| `script/` | Deployment scripts | |
| | 46 | +| `lib/` | Dependencies | |