0

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution reverted: ERC20: insufficient allowance { "originalError": { "code": 3, "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001d45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000", "message": "execution reverted: ERC20: insufficient allowance" } }

I found a repository on github that I am trying to experiment with at this link https://github.com/filipdujmusic/pontoon-contracts-poc . I compiled and deployed all three smart contracts there using remix IDE. I'm now trying to call the createBuyOrder function from the deployed OrderBook contract, but I'm getting the aforementioned error. Would highly appreciate if someone could assist with helping me see how I can fix this.

1 Answer 1

1

I think you need to increase the allowance. The smart contract is probably trying to use some of your tokens for some reasons and can't do that since you haven't allowed the smart contract to use some of your tokens.

So you should call the allowance function of the erc20 with, as parameters, the address of that smart contract and how many token you allow it to use.

What function are you trying to call when you are getting this error?

3
  • 1
    Yes, you need to increase the allowance. Oct 12, 2022 at 18:57
  • Thanks so much for the help! Increasing the allowance helped. I was trying to call one of the OrderBook functions - createBuyOrder, and it's now working after I called the allowance function on the erc20. Oct 12, 2022 at 22:10
  • Happy I could help! Mark my answer as correct so it can help others that face the same problem than you did! Oct 12, 2022 at 22:33

Your Answer

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

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