Build, mint, and send around your own ERC721!
Required: Node plus Yarn and Git
git clone https://github.com/austintgriffith/scaffold-eth.git simple-nft-example
cd simple-nft-example
git checkout simple-nft-example
yarn install
yarn start
in a second terminal window, start your π± frontend:
cd simple-nft-example
yarn chain
in a third terminal window, π° deploy your contract:
cd simple-nft-example
yarn deploy --network NETWORK_OF_CHOICE (localhost, kovan, rinkeby, mainnet)
π± Open http://localhost:3000 to see the app
βοΈ Edit the mint script mint.js in packages/hardhat/scripts and update the toAddress to your frontend address (wallet address in the top right or localhost:3000).
βοΈ Edit both
packages/hardhat/scripts/mint.jsandpackages/react-app/src/App.jsxwith your Infura project id and project secrets
in a terminal window run the mint script:
yarn mint
π 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 Contracts tab to figure out what address is the owner of YourCollectible?
πΌ Edit your deployment script deploy.js in packages/hardhat/scripts
π Edit your smart contract YourCollectible.sol in packages/hardhat/contracts
π Edit your frontend App.jsx in packages/react-app/src
π Create wallet links to your app with yarn wallet and yarn fundedwallet
β¬οΈ Installing a new package to your frontend? You need to cd packages/react-app and then yarn add PACKAGE
π° Ready to deploy to a testnet?
Change the
defaultNetworkinpackages/hardhat/hardhat.config.js
π Generate a deploy account with yarn generate
π 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:
Make sure your target network is present in the hardhat networks config, then either update the default network in hardhat.config.js to your network of choice or run:
yarn deploy --network NETWORK_OF_CHOICE
βοΈ Edit your frontend
App.jsxinpackages/react-app/srcto change thetargetNetworkto wherever you deployed your contract:
You should see the correct network in the frontend:
π« Ready to mint a batch of NFTs for reals?
yarn mint
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:) https://testnets.opensea.io/assets/0xc2839329166d3d004aaedb94dde4173651babccf/1
run 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.txt to the block explorer and select compiler v0.6.7 and Yes to Optimization (200 runs if anyone asks)
You will need to get a key from infura.io and paste it into constants.js in packages/react-app/src:
βοΈ build and upload your frontend and share the url with your friends...
# build it:
yarn build
# upload it:
yarn surge
yarn s3
yarn ipfs
π©ββ€οΈβπ¨ Share your public url with a friend and ask them for their address to send them a collectible :)
π Read the docs: https://docs.soliditylang.org
π Go through each topic from solidity by example editing YourContract.sol in π scaffold-eth
π§ Learn the Solidity globals and units
Check out all the active branches, open issues, and join/fund the π° BuidlGuidl!
-
π« Extend the NFT example to make a "buyer mints" marketplace
-
βοΈ Learn how ecrecover works
-
π©βπ©βπ§βπ§ Build a multi-sig that uses off-chain signatures
-
βοΈ Learn how a simple DEX works
-
π¦ Ape into learning!
Join the telegram support chat π¬ to ask questions and find others building with π scaffold-eth!
π Please check out our Gitcoin grant too!















