5

Over the last few days, I have been looking up the best and clear explanation of the differences between Approve() and increaseAllowance() of the ERC20 contract. Still, I couldn't come up with a proper conclusion for myself.

I still don't know what the difference is between them. And what are their separate use cases?

Thanks in advance to anyone who can manifest this for me

1 Answer 1

4

The simple difference is that approve updates the approval to a specific (given) amount, while increaseAllowance increases the current allowance by the given amount. The former is part of the ERC20 standard, while the latter is not. So some ERC20 tokens include the latter and some don't.

The reason the latter was introduced is a minor frontrunning issue with allowances. The main idea is that using the basic approve function allows someone to sort of double-use allowances. You can read more about the issue for example here: https://blog.smartdec.net/erc20-approve-issue-in-simple-words-a41aaf47bca6

So, if the token contract has the increaseAllowance function, it should be used when increasing the allowance. But the approve is always there, so it can be used if the other function isn't there.

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.