DEV Community

Discussion on: Writing an NFT Collectible Smart Contract

Collapse
 
devmonster profile image
Monster Universe

Thanks a lot for such enjoyable a series of tutorials! All things go smoothly except that the following piece of code in run.js emits an error when deploying the contract:

    // Mint 3 NFTs by sending 0.03 ether
    txn = await contract.mintNFTs(3, { value: utils.parseEther('0.03') });
    await txn.wait()
Enter fullscreen mode Exit fullscreen mode

The contract has been successfully deployed to the rinkeby chain, but the three NFTs failed to be minted with the error as follows:

Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"name":"ProviderError","code":3,"_isProviderError":true,"data":"0x .......  
Enter fullscreen mode Exit fullscreen mode

What should I read to understand this and fix it?