Author: Hunter Chang Source code: https://github.com/scaffold-eth/scaffold-eth-examples/tree/simple-nft-example Intended audience: Beginners/Intermediate Topics: Scaffold-eth basics, NFTs, IPFS
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git simple-nft-example
git checkout simple-nft-example
in a second terminal window:
in a third terminal window:
✏️ Edit the mint script
packages/hardhat/scriptsand update the
toAddressto your frontend address (wallet address in the top right or localhost:3000).
in a terminal window run the mint script:
👀 You should see your collectibles show up if you minted to the correct address:
👛 Open an incognito window and navigate to http://localhost:3000 (You'll notice it has a new wallet address).
⛽️ Grab some gas for each account using the faucet:
🎟 Send an NFT to the incognito window address:
🕵🏻♂️ Inspect the
Debug Contractstab to figure out what address is the
💼 Edit your deployment script
🔏 Edit your smart contract
📝 Edit your frontend
🔑 Create wallet links to your app with
⬇️ Installing a new package to your frontend? You need to
cd packages/react-appand then
yarn add PACKAGE
🛰 Ready to deploy to a testnet?
🔐 Generate a deploy account with
👛 View your deployer address using
yarn account(You'll need to fund this account. Hint: use an instant wallet to fund your account via QR code)
👨🎤 Deploy your NFT smart contract:
✏️ Edit your frontend
packages/react-app/srcto change the
targetNetworkto wherever you deployed your contract:
You should see the correct network in the frontend:
🎫 Ready to mint a batch of NFTs for reals?
Make sure your target network is present in the hardhat networks config, then either update the default network in
hardhat.config.jsto your network of choice or run:
yarn deploy --network NETWORK_OF_CHOICE
Once verified, they will then be available to view on Tenderly!
Add your contract to OpenSea ( create -> submit NFTs -> "or add an existing contract" )
(It can take a while before they show up, but here is an example:)
yarn flatten > flat.txt(You will need to clean up extra junk at the top and bottom of flat.txt. Sorry, rookie stuff here.)
copy the contents of
flat.txtto the block explorer and select compiler
Optimization(200 runs if anyone asks)
⚙️ build and upload your frontend and share the url with your friends...
# build it:
# upload it:
Join the telegram [support chat 💬](https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA) to ask questions and find others building with 🏗 scaffold-eth!
===================================================== [⏫ back to the top ⏫](https://github.com/austintgriffith/scaffold-eth#-scaffold-eth)
👩❤️👨 Share your public url with a friend and ask them for their address to send them a collectible :)