-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion to remove increaseAllowance
and decreaseAllowance
from ERC20
#4583
Comments
would like to add that there is an open bounty of 1500+ dai (collectable from these people) for demonstrating the allowance frontrun has ever happened in the wild. |
I can't understand the question, but I've observed something noteworthy. https://bscscan.com/tx/0x0b57d3847581c983e870a5237edc368e524c82cd8eb1037d98266613951fb7f8 In fact, I've noticed a lot of this activity on BSC, likely due to outdated and poorly implemented code. https://bscscan.com/tx/0x0b57d3847581c983e870a5237edc368e524c82cd8eb1037d98266613951fb7f8#eventlog I suspect this all started with a phishing allowance. It's evident right here. However, this person seems to be benefiting significantly from this feature. https://bscscan.com/tx/0x6b9f84fd535b234d461582d1adbdfec24f4f8f4a161523be34e91960e7dad9c0 I'm not sure if this is the answer or relates to a bug bounty qualification, but this feature is problematic. Unfortunately, many malicious actors are using it daily in conjunction with phishing strategies. |
However, it seems nothing really happens without a phishing attack... all the transactions fail. |
An additional argument for removing the functions is the following. Some smart wallets (Argent in particulat) enforce some restriction on token movement, in the form of daily spending limits. This is likelly to be more widespread with AA adoption. AFAIK, this is done (or used to be done) by a module that filters the data of outgoing calls, to "detect" calls to This would have been affected if Permit had supported ERC-1271, because the wallets would have had a hard time detecting weither they are verifying a permit message or not. This is one of the reason we did not include ERC-1271 support in ERC-2612 permit! Non standard functions, such as |
@pcaversaccio Hi Pascal, I don't see what you mean by Now, let me explain my point of view about increaseAllowance. If Bob currently has 100 tokens approved and Alice calls The same goes with decreaseAllowance. If bob has 100 tokens approved and Alice calls
In either way, Bob couldn't get his hands on more than 100 tokens. Would appreciate the explanation how this |
@novaknole I stated in the original issue description in brackets: "and
The reason why I mentioned it is that many people state that |
There's one interesting thing. In your 4th bullet point, you correctly say that transaction from Question 1: Don't you agree with what I just said ? Question 2: Well, in my opinion, front-running with increaseAllowance/decreaseAllowance doesn't result in a tragedy, while in approve way, it does. Thoughts ? |
Regarding
|
@pcaversaccio I completely agree with that. I just wanted to learn more and that's why I keep asking you the same question, but let me ask again. assume that I am experienced. even if I am experienced, if I use approve method way, I can be hacked, but if I use increaseAllowance/decreaseAllowance, I won't be hacked, because it's clear that with those methods, the same hack doesn't happen because of the reasons stated in #4583 (comment). What is it that you don't agree here ? Can you give an example of an attack of increaseAllowance ? |
This attack is completely hypothetical, it never happens in practice. We even offered a bounty here #4583 (comment) for people showing the frontrun attack in the wild. Thus, this guardrail prevents nothing and just adds technical cruft. Example attack via a phishing site:
Many people are aware that they should be careful with |
I think I understand your point. What I was saying was that |
Let me specify: I agree that these functions solve the hypothetical frontrunning issue. Apart from the arguments mentioned above, I also don't like these custom functions since they are not part of the EIP-20 specs or any other EIP. So they should not be part of any |
Thanks for the help so much. One last question I have remaining is about phishing attack you mentioned. so, malicious actor creates a dapp and users go there and dapp asks them to "sign" a increaseAllowance, but there's not a function like |
I don't get how they ask a signature for Is this attack described somewhere ? I couldn't find anything on the internet. |
The user makes an on-chain transaction with |
haha. I thought attack was more complicated than that and I was going furious. How is this attack any different than if hacker's dapp asks a user to send a transaction that transfers 1 eth from him to hacker's address ? I guess, a user can spot that he is losing 1 eth and will easily reject it while increaseAllowance is just a function that he has no idea of what it does. correct right ? I guess, I am looking at the situation from my point of view since I am a developer and have a hard time imagining myself instead of un-experienced user. |
@pcaversaccio what would be the best practice then for ERC20 contract to be integrated with dapp ? should we use approve(0), approve(amount) practice(that also doesn't solve the problem fully) or just integrate it normally as we did in the pass ? just simply call approve(amount) from dapp and leave it to the chance of what will happen ? |
I wanted to quickly get your opinion on whether it would make sense to remove the functions
increaseAllowance
anddecreaseAllowance
from theERC20
contract and move it to an extension contract instead. My arguments are the following:approve
orpermit
ones; see e.g. just 12 hours ago someone lost $24m since he got tricked into signing a maliciousincreaseAllowance
payload https://etherscan.io/tx/0xcbe7b32e62c7d931a28f747bba3a0afa7da95169fcf380ac2f7d54f3a2f77913).increaseAllowance
anddecreaseAllowance
are not critical nor high in the wild (anddecreaseAllowance
can be frontrunned also) and thus I think the responsibility can be delegated to the devs to decide whether to include it or not.5.0.0
would be suitable.The text was updated successfully, but these errors were encountered: