Skip to content

Repository files navigation

MitchCoin (MTC) - Gothic Street Food Loyalty Token

A production-ready ERC-20 token + React dApp for Mitch from Transylvania's gothic street food empire πŸ§›

Polygon Solidity Next.js License

⚑ Quick Start (10 Minutes)

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:dev

🎯 What Is MitchCoin?

MitchCoin 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

πŸ—οΈ Features

Smart Contract (Solidity)

  • βœ… 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

Web Application (Next.js)

  • βœ… 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

πŸ“‹ Prerequisites

Before you begin, you need:

  1. Node.js 18+ - Download
  2. pnpm - npm install -g pnpm
  3. Test Wallet - Create a MetaMask wallet for testing
  4. Testnet MATIC - Get free tokens
  5. Alchemy Account - Sign up free

πŸš€ Installation

1. Clone & Install

cd Mitch_coin
pnpm install

2. Configure Environment

Backend (.env):

PRIVATE_KEY=0xYOUR_TEST_WALLET_PRIVATE_KEY
ALCHEMY_API_KEY=your_alchemy_api_key
POLYGONSCAN_API_KEY=your_polygonscan_key  # Optional
INITIAL_SUPPLY=1000000

Frontend (web/.env.local):

NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_api_key
NEXT_PUBLIC_CHAIN_ID=80002
NEXT_PUBLIC_TOKEN_ADDRESS=  # Fill after deployment

3. Compile & Test

pnpm compile
pnpm test

4. Check Configuration

pnpm check

Should show: βœ… Configuration looks good!

5. Deploy

pnpm deploy:amoy

Copy the contract address and add it to web/.env.local

6. Start Web App

pnpm web:dev

Open http://localhost:5173 πŸŽ‰

πŸ“š Documentation

πŸ› οΈ Available Commands

Smart Contracts

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 node

Web Application

pnpm web:dev       # Start dev server (localhost:5173)
pnpm web:build     # Build for production
pnpm web:start     # Start production server

🎨 Project Structure

Mitch_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

🌐 Supported Networks

Testnets (Configured)

  • βœ… Polygon Amoy (ChainID: 80002) - Primary testnet
  • βœ… Sepolia (ChainID: 11155111) - Ethereum testnet

Production (Easy to Add)

  • πŸ”§ Polygon Mainnet (ChainID: 137)
  • πŸ”§ Ethereum Mainnet (ChainID: 1)
  • πŸ”§ Base (ChainID: 8453)
  • πŸ”§ Arbitrum (ChainID: 42161)

πŸ’‘ Use Cases

For Business (Mitch's Gothic Street Food)

  • 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

For Customers

  • 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

πŸ”’ Security

  • βœ… OpenZeppelin audited contracts
  • βœ… Owner-controlled minting (prevents unauthorized creation)
  • βœ… Standard ERC-20 implementation
  • βœ… Comprehensive test coverage
  • βœ… Testnet deployment first

Production Security Checklist

  • Professional smart contract audit
  • Multi-signature wallet for owner
  • Rate limiting on mints
  • Transaction monitoring
  • Emergency pause mechanism
  • Time-locks for critical actions

πŸ§ͺ Testing

All tests passing βœ…

  MitchCoin
    βœ“ mints initial supply to deployer
    βœ“ owner can mint
    βœ“ has correct name and symbol
    βœ“ owner can burn tokens

  4 passing (383ms)

🀝 Contributing

Contributions welcome! This is an open-source starter template.

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open Pull Request

πŸ“– Learn More

Web3 & Blockchain

Tools & Frameworks

Polygon

πŸ†˜ Troubleshooting

Common Issues

"Insufficient funds" error

"Invalid API key" error

  • Check .env has 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 install again
  • Delete node_modules and reinstall
  • Check Node.js version (18+)

See SETUP.md for detailed troubleshooting.

πŸ’° Cost Estimates

Development (One-Time)

  • Smart Contract Deployment: ~$5-20 (testnet: free)
  • Domain: $10-30/year
  • Contract Audit: $5,000-$15,000 (optional, for mainnet)

Operations (Monthly)

  • Alchemy Free Tier: $0 (300M compute units)
  • Hosting: $0-30 (Vercel free tier available)
  • Maintenance: Variable

Transaction Costs

  • Users pay their own gas fees on Polygon
  • Polygon fees are very low (~$0.001-0.01 per tx)

πŸ—ΊοΈ Roadmap

Phase 1: Foundation βœ… (DONE)

  • ERC-20 smart contract
  • Deployment scripts
  • Web dashboard
  • Transfer & mint UI
  • Testnet deployment

Phase 2: Enhanced Features

  • Staking/rewards system
  • NFT loyalty passes
  • Mobile app (React Native)
  • QR code payments
  • Analytics dashboard

Phase 3: Production

  • Smart contract audit
  • Mainnet deployment
  • Exchange integration
  • Marketing campaign
  • Partnership program

Phase 4: Advanced

  • DAO governance
  • Cross-chain bridge
  • Liquidity pools
  • Third-party API
  • Enterprise features

πŸ“œ License

MIT License - see LICENSE file for details.

Free to use, modify, and distribute.

πŸ™ Acknowledgments

Built with:

πŸ“ž Support

⭐ Star This Repo!

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

About

MitchCoin Starter Repo (Solidity + Hardhat + React + WalletConnect)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages