A cleaned-up Hardhat starter project for deploying and testing a simple ERC20-like token on EVM testnets.
- Standardize project structure and scripts
- Add working Hardhat config and reusable network settings.
- Add npm scripts for compile, test, deploy, clean, and accounts.
- Improve smart contract baseline quality
- Keep the token simple, but add
transferFromand internal transfer logic. - Add missing events/validations expected from ERC20-like behavior.
- Keep the token simple, but add
- Make deployment repeatable
- Add a deploy script that prints deployed address and metadata.
- Add automated tests
- Cover deployment, transfer, approve, transferFrom, and negative cases.
- Reduce repo noise
- Add
.gitignoreand remove generated cache artifacts. - Keep
BasicContractStructureas reference, but clearly mark it as legacy.
- Add
npm install
cp .env.example .env
npx hardhat compile
npx hardhat testnpm run compile
npm run test
npm run accounts
npm run deploy:local
npm run deploy:sepolia
npm run deploy:amoy
npm run cleanSee .env.example.
At minimum for testnet deploys:
PRIVATE_KEYSEPOLIA_RPC_URLorAMOY_RPC_URL
Optional verification:
ETHERSCAN_API_KEYPOLYGONSCAN_API_KEY