Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

scaffold-eth/scaffold-eth

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ— Scaffold-ETH - 🎟 Simple NFT Example

Build, mint, and send around your own ERC721!

πŸƒβ€β™€οΈ Quick Start

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).

nft1

✏️ Edit both packages/hardhat/scripts/mint.js and packages/react-app/src/App.jsx with your Infura project id and project secrets

image

in a terminal window run the mint script:

yarn mint

nft2

πŸ‘€ You should see your collectibles show up if you minted to the correct address:

nft3

πŸ‘› 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:

nft4

🎟 Send an NFT to the incognito window address:

nft5

πŸ•΅πŸ»β€β™‚οΈ 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

πŸ“‘ Deploy NFT smart contract!

πŸ›° Ready to deploy to a testnet?

Change the defaultNetwork in packages/hardhat/hardhat.config.js

nft6

πŸ” Generate a deploy account with yarn generate

nft7

πŸ‘› 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)

nft8

πŸ‘¨β€πŸŽ€ 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.jsx in packages/react-app/src to change the targetNetwork to wherever you deployed your contract:

nft9

You should see the correct network in the frontend:

nft10

🎫 Ready to mint a batch of NFTs for reals?

yarn mint

Once verified, they will then be available to view on Tenderly!

nft11

βš”οΈ Side Quests

🐟 Open Sea

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

πŸ” Etherscan Contract Verification

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)

nft12

πŸ”Ά Infura

You will need to get a key from infura.io and paste it into constants.js in packages/react-app/src:

nft13

πŸ›³ Ship the app!

βš™οΈ build and upload your frontend and share the url with your friends...

# build it:

yarn build

# upload it:

yarn surge

yarn s3

yarn ipfs

nft14

πŸ‘©β€β€οΈβ€πŸ‘¨ Share your public url with a friend and ask them for their address to send them a collectible :)

nft15


πŸ”­ Learning Solidity

πŸ“• 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

πŸ›  Buidl

Check out all the active branches, open issues, and join/fund the 🏰 BuidlGuidl!

πŸ’¬ Support Chat

Join the telegram support chat πŸ’¬ to ask questions and find others building with πŸ— scaffold-eth!


πŸ™ Please check out our Gitcoin grant too!