A production-ready ERC-20 token + React dApp for Mitch from Transylvania's gothic street food empire π§
Get MitchCoin deployed and running in 10 minutes! See QUICKSTART.md for the fastest path.
# 1. Install dependencies
pnpm install
# 2. Configure (add your keys to .env and web/.env.local)
pnpm check
# 3. Deploy
pnpm deploy:amoy
# 4. Launch dApp
pnpm web:devMitchCoin is a complete loyalty and payment token system featuring:
- πͺ ERC-20 Token - Standard, secure, OpenZeppelin-based
- π¨ Web Dashboard - Beautiful gothic-themed UI
- πΈ Transfer System - Send tokens to anyone
- π Mint System - Owner can create rewards
- π± Wallet Connect - MetaMask, WalletConnect, etc.
- π Block Explorer - View on Polygonscan
Perfect for:
- Loyalty rewards programs
- Customer retention
- In-store payments
- Community building
- Promotional campaigns
- β ERC-20 compliant token
- β Owner-controlled minting for rewards
- β Burn function for supply management
- β OpenZeppelin v5.0 security
- β Fully tested (4/4 tests passing)
- β Polygon Amoy testnet ready
- β Gas optimized
- β Real-time balance display
- β Total supply tracking
- β Transfer tokens to any address
- β Mint tokens (owner only)
- β Transaction history links
- β Responsive design
- β Gothic dark theme
- β Auto-refresh balances
Before you begin, you need:
- Node.js 18+ - Download
- pnpm -
npm install -g pnpm - Test Wallet - Create a MetaMask wallet for testing
- Testnet MATIC - Get free tokens
- Alchemy Account - Sign up free
cd Mitch_coin
pnpm installBackend (.env):
PRIVATE_KEY=0xYOUR_TEST_WALLET_PRIVATE_KEY
ALCHEMY_API_KEY=your_alchemy_api_key
POLYGONSCAN_API_KEY=your_polygonscan_key # Optional
INITIAL_SUPPLY=1000000Frontend (web/.env.local):
NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_api_key
NEXT_PUBLIC_CHAIN_ID=80002
NEXT_PUBLIC_TOKEN_ADDRESS= # Fill after deploymentpnpm compile
pnpm testpnpm checkShould show: β Configuration looks good!
pnpm deploy:amoyCopy the contract address and add it to web/.env.local
pnpm web:devOpen http://localhost:5173 π
- QUICKSTART.md - Deploy in 10 minutes
- SETUP.md - Detailed setup guide
- DEPLOYMENT_CHECKLIST.md - Step-by-step checklist
- PROJECT_SUMMARY.md - Complete project overview
pnpm compile # Compile Solidity contracts
pnpm test # Run test suite
pnpm check # Validate configuration
pnpm deploy:amoy # Deploy to Polygon Amoy testnet
pnpm deploy:sepolia # Deploy to Sepolia testnet
pnpm verify # Verify contract on Polygonscan
pnpm airdrop # Bulk send tokens
pnpm node # Start local Hardhat nodepnpm web:dev # Start dev server (localhost:5173)
pnpm web:build # Build for production
pnpm web:start # Start production serverMitch_coin/
βββ contracts/ # Solidity smart contracts
β βββ MitchCoin.sol # Main ERC-20 token
βββ scripts/ # Deployment & utility scripts
β βββ deploy.ts # Deploy to networks
β βββ verify.ts # Verify on Polygonscan
β βββ check-config.ts # Config validation
β βββ airdrop.ts # Bulk token distribution
βββ test/ # Smart contract tests
β βββ MitchCoin.test.ts
βββ web/ # Next.js web application
β βββ app/ # Next.js App Router
β βββ components/ # React components
β βββ lib/ # Configuration & utilities
βββ docs/ # Documentation
- β Polygon Amoy (ChainID: 80002) - Primary testnet
- β Sepolia (ChainID: 11155111) - Ethereum testnet
- π§ Polygon Mainnet (ChainID: 137)
- π§ Ethereum Mainnet (ChainID: 1)
- π§ Base (ChainID: 8453)
- π§ Arbitrum (ChainID: 42161)
- Loyalty Rewards - Award MTC for purchases
- Promotions - Airdrop tokens for marketing
- Payments - Accept MTC as payment
- Community - Build engaged customer base
- Events - Special token-gated experiences
- Earn - Get MTC with every purchase
- Save - Accumulate tokens over time
- Spend - Use MTC for discounts
- Trade - Send to friends
- Collect - Hold for VIP access
- β OpenZeppelin audited contracts
- β Owner-controlled minting (prevents unauthorized creation)
- β Standard ERC-20 implementation
- β Comprehensive test coverage
- β Testnet deployment first
- Professional smart contract audit
- Multi-signature wallet for owner
- Rate limiting on mints
- Transaction monitoring
- Emergency pause mechanism
- Time-locks for critical actions
All tests passing β
MitchCoin
β mints initial supply to deployer
β owner can mint
β has correct name and symbol
β owner can burn tokens
4 passing (383ms)Contributions welcome! This is an open-source starter template.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open Pull Request
"Insufficient funds" error
- Get testnet MATIC from https://faucet.polygon.technology/
"Invalid API key" error
- Check
.envhas correct Alchemy key - Ensure you selected "Polygon Amoy" network in Alchemy
Web dApp won't connect
- Clear browser cache
- Check MetaMask is on correct network
- Restart dev server
Tests failing
- Run
pnpm installagain - Delete
node_modulesand reinstall - Check Node.js version (18+)
See SETUP.md for detailed troubleshooting.
- Smart Contract Deployment: ~$5-20 (testnet: free)
- Domain: $10-30/year
- Contract Audit: $5,000-$15,000 (optional, for mainnet)
- Alchemy Free Tier: $0 (300M compute units)
- Hosting: $0-30 (Vercel free tier available)
- Maintenance: Variable
- Users pay their own gas fees on Polygon
- Polygon fees are very low (~$0.001-0.01 per tx)
- ERC-20 smart contract
- Deployment scripts
- Web dashboard
- Transfer & mint UI
- Testnet deployment
- Staking/rewards system
- NFT loyalty passes
- Mobile app (React Native)
- QR code payments
- Analytics dashboard
- Smart contract audit
- Mainnet deployment
- Exchange integration
- Marketing campaign
- Partnership program
- DAO governance
- Cross-chain bridge
- Liquidity pools
- Third-party API
- Enterprise features
MIT License - see LICENSE file for details.
Free to use, modify, and distribute.
Built with:
- OpenZeppelin - Security-audited contracts
- Hardhat - Development framework
- Next.js - React framework
- RainbowKit - Wallet connection
- wagmi - React hooks for Ethereum
- Polygon - Scaling solution
- Documentation: Check
/docsfolder - Issues: GitHub Issues
- Community: [Discord/Telegram link]
- Email: support@mitchcoin.example
If this starter helped you, please give it a star! β
Ready to deploy? β Start with QUICKSTART.md
Need help? β Read SETUP.md
Going to production? β Follow DEPLOYMENT_CHECKLIST.md
Made with π§ for Mitch from Transylvania