A custom ERC-20 token built with Solidity and Hardhat. This project demonstrates full token functionality with a comprehensive test suite, making it ideal for both learning and showcasing smart contract development skills.
- Name: Sakura
- Symbol: SKR
- Decimals: 18
- Total Supply: 1,000,000 SKR
sakura-token/ ├── contracts/ │ └── Token.sol # Sakura token smart contract ├── test/ │ └── Token.test.js # Full test suite (deployment, transfers, approvals) ├── scripts/ │ └── deploy.js # Deployment script for local/testnet ├── .gitignore ├── hardhat.config.js ├── package.json ├── README.md └── LICENSE
npm installnpx hardhat testStart local node:
npx hardhat nodeIn a new terminal, deploy the token:
npx hardhat run scripts/deploy.js --network localhost🔐 Environment Setup (for Testnet)
Create a .env file in the root(if deploying to Sepolia or Goerli):
PRIVATE_KEY=your_private_key
ALCHEMY_URL=https://eth-sepolia.g.alchemy.com/v2/your_keyYour hardhat.config.js:
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`,
accounts: process.env.PRIVATE_KEYS.split(",")
}Deploy with:
npx hardhat run scripts/deploy.js --network sepolia✅ Features
-
ERC-20 Transfers — transfer, approve, transferFrom
-
Allowance Logic — secure delegation and controlled spending
-
Edge Case Handling — reverts for invalid recipient or overspend
-
Events Emitted — Transfer and Approval for transparency
-
Full Test Suite — includes success and failure conditions
📝 License This project is licensed under the MIT License — open source and free to use with attribution.
🧠 Author Eugene McGrath Blockchain Developer | Smart Contract Engineer 🔗 GitHub: @CryptoMachineGene
Want to connect or collaborate? 📬 Let’s connect on LinkedIn