1

Im trying to deploy my NFT contract and works fine but only if i mint less then 1000 nfts. When i tried to raise up to 2000, 5000, 8000 and even 10000 i got the gas exceeds allowance error. Can some one help me out pls enter image description hereenter image description here

6
  • Why is your gas limit so high? Shouldn't need 30 million. You have 0.47 of the native coin, how many units of gas are needed to mint 1, and what are you paying per unit of gas?
    – Maka
    Sep 6, 2023 at 19:57
  • its 30 million cause i change to see if it works, but i get the same error with the normal 3 million. to mint 1 nft its too low, i pay less than 0.001 matic
    – kauan
    Sep 6, 2023 at 20:20
  • I think one of the reasons can be the stack limit solidity has with for loops. You cannot run a loop with high limits, since the stack limits reach in that case. That's why it could run for less than 1000 runs but not more. Sep 7, 2023 at 5:06
  • @ShubhamSharma i know how i can raise the limit?
    – kauan
    Sep 8, 2023 at 19:04
  • Why did you change your question to a bunch of letters?
    – Rohan Nero
    Sep 11, 2023 at 21:56

2 Answers 2

1

This error can occur when interacting with a contract, and means that MyCrypto could not estimate the gas limit for your transaction.

This error can be caused by a few reasons, including:

The gas limit required for your transaction is higher than the block gas limit. refer: https://support.mycrypto.com/troubleshooting/sending/gas-required-exceeds-allowance-or-always-failing-transaction/#:~:text=This%20error%20can%20occur%20when,than%20the%20block%20gas%20limit.

try to use less loop in the contract(100 is more than fine, and it will work..), don't use larger number. If you want to mint that much you can go for binance which doest have block limit . I have tried 4500 mint in a loop it worked and I am sure it can handle more than that..

0

In order for a transaction to be confirmed, its gas consumption needs to be less than the gas limit of a block in the blockchain, so you cannot increase your transaction from a higher ceiling, even if you raise the gas limit.Because blockchain has limits for each block and does not allow you to have a large transaction volume from one limit, that is why you have to categorize your mint into several transactions.

In fact, this issue is not only related to writing in the blockchain, there is also a limit for reading from the blockchain, and pagination is required to read large data.

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.