Track 8 · Capstones · lesson 3
NFT minting dApp
90 min
An NFT collection people can mint from your site. The help steps down now: you get the shape and the signatures, and you write the bodies.
Scaffolding tier: signatures. An architecture sketch and the function signatures — no starter repo, no TODOs inside the functions. You decide the implementation.
The build
An ERC-721 with a public mint (paid or free, your call), on-chain or IPFS metadata, and a page that mints and shows what the connected wallet owns.
Architecture
contracts/
NFT.sol // ERC721 + Ownable, a mint function, a tokenURI
test/
web/
Mint.tsx // mint button + supply counter
Gallery.tsx // the connected wallet's tokens, from Transfer events
The signatures — you fill the bodies
function mint() external payable; // enforce price + max supply
function tokenURI(uint256 id)
external view returns (string memory); // metadata per token
function totalMinted() external view returns (uint256);
Decisions the signatures leave to you:
- Metadata: fully on-chain SVG (track 5), or an IPFS base URI. Either is valid; know why you chose it.
- Supply and price: enforce a maximum, and refund or reject overpayment.
- The gallery: read the wallet's tokens from
Transferevents (track 6), since ERC-721 has no built-in enumeration.
Acceptance criteria
- Minting past the max supply reverts.
tokenURIreturns valid metadata for a minted id and reverts for an unminted one.- The gallery shows exactly the connected wallet's tokens and updates after a mint.
Check
Why must the gallery read Transfer events rather than ask the contract for a wallet's tokens?
Worth remembering
- Capstone 3, signatures scaffolding: architecture and function signatures, bodies are yours.
- An ERC-721 with public mint, metadata, and a mint + gallery frontend.
- You choose on-chain vs IPFS metadata and must justify it.
- The gallery reconstructs ownership from Transfer events, since core ERC-721 has no enumeration.