Track 8 · Capstones · lesson 2
A token with a frontend
60 min
Your token, deployed, with a UI to mint and transfer it. This joins the two halves you already have: the ERC-20 from track 5 and the frontend from track 6.
Scaffolding tier: full. Starter repo and file-by-file TODOs again — but this one has a contract, a deployment, and a UI that reads and writes it. The last capstone with this much help.
The build
- An ERC-20 (use OpenZeppelin — you wrote one by hand already) with a capped
supply and an owner-only
mint. - Deployed to Sepolia and verified.
- A page that shows the connected wallet's balance, lets the owner mint, and lets anyone transfer.
Starter layout
my-token/
├── contracts/
│ ├── src/Token.sol // TODO: OZ ERC20 + ERC20Capped + Ownable
│ ├── test/Token.t.sol // TODO: tests (cap, mint auth, transfer)
│ └── script/Deploy.s.sol // TODO: deploy script
└── web/
├── src/Balance.tsx // TODO: read + display balance
├── src/MintForm.tsx // TODO: owner-only mint
└── src/TransferForm.tsx // TODO: transfer
Acceptance criteria
- The contract's tests pass under
forge test, including: minting past the cap reverts, and a non-owner minting reverts. - Deployed and verified on Sepolia.
- The UI shows the live balance and updates it after the receipt, not on broadcast.
- Mint is visible only to the owner; a non-owner sees it disabled or hidden.
Check
The UI should refresh the balance at which moment?
Worth remembering
- Capstone 2, full scaffolding: starter repo and TODOs across contract, tests, deploy and UI.
- A capped, owner-mintable ERC-20 with a read/write frontend.
- Tests must cover the cap and mint authorisation; deploy verified on Sepolia.
- Refresh balances on the receipt, and gate mint to the owner.