Production-grade smart contract templates with comprehensive test coverage.
| Contract | Features |
|---|---|
| ERC20Token | Transfer, Approve, Mint, Burn, EIP-2612 Permit, Batch Transfer, Ownership |
| ERC721NFT | Mint (Public/Whitelist/Admin), Reveal, EIP-2981 Royalty, Merkle Proof, Ownership |
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash && foundryup
# Build
forge build
# Run tests
forge test -vvv
# Deploy ERC-20 (Sepolia example)
forge script script/Deploy.s.sol:DeployERC20Script \
--rpc-url $SEPOLIA_RPC_URL \
--broadcast \
--verify
# Deploy ERC-721
forge script script/Deploy.s.sol:DeployERC721Script \
--rpc-url $SEPOLIA_RPC_URL \
--broadcast- 38 tests + 3000+ fuzz runs
- Transfers, approvals, batch operations
- EIP-2612 permit (gasless approvals)
- Mint / Burn lifecycle
- Ownership management
- Edge cases (zero address, insufficient balance, overflows)
- Invariant: totalSupply = sum of all balances
src/
├── ERC20Token.sol # Full ERC-20 with Permit & Batch
├── ERC721NFT.sol # Full NFT with Whitelist & Royalty
└── lib/
└── Ownable.sol # Minimal ownership
test/
└── ERC20Token.t.sol # 38 comprehensive tests
script/
└── Deploy.s.sol # Deployment scripts (ERC20 + ERC721)
- Custom errors (gas efficient)
- Checks-Effects-Interactions pattern
- No external calls in critical paths
- Solidity 0.8.20 (built-in overflow protection)
- Foundry fuzz testing (1000 runs per fuzz test)
Built with Foundry | For freelance portfolio use