PatrickAlphaC / hardhat-nft-fcc

102 stars 140 forks source link

Update 04-mint.js fix console error "ERC721 invalid token ID" #76

Closed kiraliwhite closed 1 year ago

kiraliwhite commented 1 year ago

Greetings!

After we deployed the three contracts to the testnet and set the VRF consumer settings, an error will occur when executing "yarn hardhat deploy --network goerli --tags mint".

I think this is because there is no any NFT on the new contract. When we call the requestNft function, we will start to request the VRF to get the random number. After the random number is obtained, the NFT will be produced, but before that, we called tokenURI(0) first, so an error will occur.

So I think console.log should be placed inside contract.once.

yarn hardhat deploy

ERC721-invalid-tokenId