Skip to content

chenzhi1985/solidity-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solidity Starter Kit — ERC-20 & ERC-721

Production-grade smart contract templates with comprehensive test coverage.

📦 Contracts

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

🛠 Quick Start

# 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

🧪 Test Coverage

  • 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

📁 Structure

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)

🔐 Audit Readiness

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors