Creating and deploying an ERC-721 smart contract on the Goerli test network.
-
Clone the repository, moving into the folder with
cd
, install dependenciesnpm install
-
Create an app on Alchemy and generate API key
-
Add ether from a faucet : Goerli Faucet or here or others..
-
Configure the metadata for your nft using IPFS with Pinata or use the ready ones in the project
- Upload your image to Pinata and copy CID
- Add to
nft-metadata.json
and change other data. - Once you’re done editing the JSON file, save it and upload it to Pinata.
- Copy CID and change
mintNFT("ipfs://your CID")"
inmint-nft.js
-
Create
.env
like this :API_URL = "alchemy api https url" PRIVATE_KEY = "metamask private key" PUBLIC_KEY = "metamask public key"
-
Compile the smart contract
npx hardhat compile
-
Deploy the smart contract
npx hardhat --network goerli run scripts/deploy.js
- Go to the Goerli etherscan for check.
- Copy contract adress from Goerli etherscan or console.
- Change
const contractAddress = "your contract adress"
inmint-nft.js
-
Mint the NFT
node scripts/mint-nft.js
and check Goerli etherscan
-
For view your NFT in your wallet:
- Get metamask mobile app
- Select Goerli Test Network as your network.
- Import your NFT: Address:
contract adress
and ID:1
(collectible ID)