By cloning this repository, you can instantly create a mint application of ERC721 minting.
$ git clone https://github.com/lastrust/erc721-minting-boilerplate.git
$ cd erc721-minting-boilerplate
Please access to Bunzz.
For this application, you need to deploy "NFT (IPFS Mitable)" smart contract at a minimum.
- Create NFT Storage
NFT Storage is free storage for NFT. Please access to this page and login.
You can get your API key from API Keys page.
Let's add REACT_APP_NFT_STORAGE_KEY
to .env
file.
REACT_APP_NFT_STORAGE_KEY=YOUR_NFT_STORAGE_KEY
- Add INFURA_KEY
Let's add REACT_APP_INFURA_KEY
to .env
file.
REACT_APP_INFURA_KEY=YOUR_INFURA_KEY
You can refer this guide: How to get infura key
- Add Network name
Let's add REACT_APP_NETWORK
If you deployed the contract on goerli network, add this.
REACT_APP_NETWORK=goerli
*** Don't share the private keys on github ***
Open utils/constant.js
file.
Add this in NETWORK_LIST
goerli: {
chainName: "Goerli Testnet",
chainIdHex: "0x5",
chainId: 5,
RPC: "https://goerli.infura.io/v3/" + process.env.REACT_APP_INFURA_KEY,
contracts: {
ERC721URIStorage: ""
}
}
Set ERC721URIStorage with the contract address you deployed.
*** Need to share deployed smart contract address with users on github. ***
$ yarn install
$ yarn start
This is the screen for minting the NFT.
Now let's mint the NFT. Enter the "Token Name", "description" and "image" in Step 1.
When you are done, press the "mint" button.
Minting creates an NFT on the blockchain. This application stores NFT metadata in IPFS.
Then let's fetch the NFT you created. Below the mint button, you can see the ID. Please enter this ID to form in Step2 and press the "get" button.