A full-stack decentralized application for managing the Small Cap Token (SCT), an ERC20 token with enhanced features including minting, burning, and pausability controls.
This project consists of:
- Frontend: React application for interacting with the smart contract
- Smart Contracts: Solidity contracts deployed on Ethereum
- Development Environment: Hardhat for testing, deployment, and local development
The SmallCapToken contract implements:
- ERC20 Standard: Full compliance with ERC20 token standard
- Initial Supply: 21,000,000 SCT tokens
- Minting: Owner can mint additional tokens
- Burning: Token holders can burn their tokens
- Pausable: Owner can pause/unpause all token transfers
- Ownable: Access control for administrative functions
- Name: Small Cap Token
- Symbol: SCT
- Decimals: 18
- Initial Supply: 21,000,000 SCT
- Node.js (v14 or higher)
- npm or yarn
- MetaMask wallet
- Git
-
Clone the repository
git clone <repository-url> cd small-cap-token-dapp
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Fill in your environment variables:
INFURA_PROJECT_ID=your_infura_project_id PRIVATE_KEY=your_private_key_without_0x ETHERSCAN_API_KEY=your_etherscan_api_key
-
Start the React development server
npm start
The app will open at http://localhost:3000
-
Build for production
npm run build
-
Run tests
npm test
-
Compile contracts
npx hardhat compile
-
Run tests
npx hardhat test -
Deploy to local network
npx hardhat node # In another terminal: npx hardhat run scripts/deploy.js --network localhost -
Deploy to Sepolia testnet
npx hardhat run scripts/deploy.js --network sepolia
├── contracts/ # Solidity smart contracts
│ └── SmallCapToken.sol # Main ERC20 token contract
├── test/ # Smart contract tests
│ └── Lock.js # Test files
├── scripts/ # Deployment scripts
├── src/ # React frontend source
├── public/ # Static assets
├── artifacts/ # Compiled contract artifacts
├── hardhat.config.js # Hardhat configuration
├── package.json # Project dependencies
└── README.md # This file
mint(address to, uint256 amount)- Owner only: Mint new tokensburn(uint256 value)- Burn your own tokensburnFrom(address account, uint256 value)- Burn tokens from allowancepause()- Owner only: Pause all transfersunpause()- Owner only: Resume all transferstransfer(address to, uint256 amount)- Standard ERC20 transferapprove(address spender, uint256 amount)- Standard ERC20 approval
totalSupply()- Get total token supplybalanceOf(address account)- Get account balanceallowance(address owner, address spender)- Get allowance amountpaused()- Check if contract is pausedowner()- Get contract owner address
The React application provides:
- Wallet Connection: Connect/disconnect MetaMask wallet
- Token Information: Display token details and your balance
- Transfer Tokens: Send SCT tokens to other addresses
- Approve Allowances: Set spending allowances for other addresses
- Owner Functions: If you're the owner, access minting and pause controls
- Transaction History: View your recent transactions
The project includes comprehensive tests for the smart contract:
# Run all tests
npm test
# Run smart contract tests
npx hardhat test
# Run tests with gas reporting
REPORT_GAS=true npx hardhat test- Ensure you have Sepolia ETH for gas fees
- Update your
.envfile with the required API keys - Run the deployment script:
npx hardhat run scripts/deploy.js --network sepolia
- Update hardhat.config.js with mainnet configuration
- Ensure you have sufficient ETH for gas fees
- Run deployment with mainnet network
- The contract uses OpenZeppelin's audited contracts
- Owner functions are protected by access controls
- Pausable functionality allows emergency stops
- All functions include proper error handling
Create a .env file with:
INFURA_PROJECT_ID=your_infura_project_id
PRIVATE_KEY=your_private_key_without_0x_prefix
ETHERSCAN_API_KEY=your_etherscan_api_key- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License.
For questions or support, please:
- Check the documentation
- Review existing issues
- Create a new issue if needed
- Add staking functionality
- Implement governance features
- Multi-signature wallet support
- Advanced token metrics dashboard
- Mobile app development
Disclaimer: This project is for educational/development purposes. Always conduct thorough testing and security audits before deploying to mainnet.