I was trying to mint 70 NFTs at once and I set a limit of 8,700,000 but ran out of gas (wasted $300). What is the max limit we should set?

1 Answer 1


First, you should test minting those 70NFTs on one of the testnets such as Ropsten, Rinkeby, or Kovan. They simulate the real Ethereum network (Mainnet), but the Ether is not real so you won't lose any actual money.

Alternately, you can use some development tools (Hardhat, Truffle, Brownie, etc). Those can give you the exact gas cost of your minting() function.

Minting 70NFTs can be really expensive in terms of gas, (depending on the amount of data in those NFTs). It might even hit a blockGasLimit.

So yeah, first step is to test your deployment on a testNet. Then you should try to do actually deployment.

  • Testing on testnets makes no difference cos the projected costs on testnets are different than mainnet due to different validators and traffic intensity.
    – ratib90486
    Jul 4, 2023 at 22:33
  • @ratib90486 gasPrice will oscilate, but gasCost (the amount of gas spent by transaction) will not. Those two are two very different values. The amount of ETH you spend on transaction equals gasPrice X gasCost of the transaction. gasLimit on the other hand is the max amount of gas you are willing to spend on a transaction.
    – Sky
    Jul 5, 2023 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.