I'm trying to design this: user clicks the button and the button calls approve for ERC20 and call contract function that requires those ERC20s. But what happens it's that approve function succeeds, but the other contract function call errors that the user hasn't approved the tokens. Is there something I can do?

  • Did you try waiting for the approve function to succeed and the issuing the second function?
    – Ismael
    Nov 17, 2021 at 3:21

1 Answer 1


I don't think it's possible, because with first call you are asking a ERC20 contract to allow your contract to spend funds and only after successful transaction you can call TransferFrom from your contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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