metamask-extension
metamask-extension copied to clipboard
[Bug]: Unable to send ERC-20 Approval transaction in gas-free case
Describe the bug
While sending the gasless ERC-20 Approval transaction, the user with 0 ETH in his wallet gets "Insufficient funds for gas" error, even if he doesn't need to pay anything.
Expected behavior
We are expecting it not to throw the error "Insufficient funds for gas", because we do not charge gas for such interaction with the Aurora ERC-20 contract. And you can see clearly, that the fee is 0 ETH there.
Screenshots/Recordings
Here is the video demonstration of what is happening: https://www.youtube.com/watch?v=aNnGhvDTJmc
Here is the popup with the error:
And here is the second one without it:
Steps to reproduce
- Go to https://aurora.plus/
- Connect Metamask wallet and switch to AuroraMainnet [important, you need to have 0 ETH there on Aurora network].
- Click on "Stake" and then on "Approve my AURORA" button.
- Get an approval popup, click "Next"
- Get an error about insufficient funds.
Error messages or log output
No response
Version
11.7.5
Build type
None
Browser
Chrome, Brave
Operating system
MacOS
Hardware wallet
No response
Additional context
You can now do the next steps to trick the Metamask and do the transaction:
- Click outside the popup.
- Click on Metamask icon.
- See the same popup, but now it is not native one! The first popup with an error was a native one, with the window controls (like hide, and close buttons) and I could move it freely over the screen. This one I can't.
- Notice, it has no errors. And we can just Send the transaction.
Severity
- It is visible to all of the users who use Aurora+ and has 0 ETH in their wallet, and I think this apply to any other gasless ERC-20 contracts on other networks.
- Probably mid severity.
Hi @Karkunow, thank you for reporting this bug.
I'm having trouble following the steps you provided to reproduce this bug. The "Stake" button is disabled for me:
To be clear, I have no AURORA tokens and no ETH on Aurora.
Could you advise me on what additional steps I need to follow to reproduce the bug?
Thank you!
@dbrans hi! yes, sorry, forgot to say that you need to have some AURORA - I can send some to your wallet, just let me know
@dbrans hi! yes, sorry, forgot to say that you need to have some AURORA - I can send some to your wallet, just let me know
@Karkunow, could you send the AURORA to 0x2990079bcdEe240329a520d2444386FC119da21a? Thank you.
@Karkunow, could you send the AURORA to 0x2990079bcdEe240329a520d2444386FC119da21a? Thank you.
Done. Sent 0.1 AURORA to you. Should be enough to test.
Hi @Karkunow, I'm trying to reproduce on 11.9.5 but I don't get an "Insufficient Funds for Gas" error. It seems to work fine (see images). I wonder if the issue has been resolved by a more recent version of MetaMask. Could you verify?
@dbrans Just tested it and it is still reproducible. Make sure you get the native OS window first. And not the one from the extension.
Here is what I get in native window on 11.9.5:
And later, in the extension window, if I click outside of the first one and reenter:
No errors in it + Approve button is enabled.
Hi @Karkunow, I confirmed on my end that I get the native OS window as you mentioned. However, I don't encounter the "insufficient funds" message that you're running into. I've attached a screen recording below for you to take a look. Could I be missing a step somewhere? Let me know!
https://github.com/MetaMask/metamask-extension/assets/507015/69956976-a058-443c-86ac-a322c8c18904
@dbrans I've rechecked - still have the error there.
Metamask version 11.10.0.
Do you have 0 ETH on your wallet?
@Karkunow I just realized I missed that crucial detail after switching to a new testing account, and I'm really sorry for the mix-up and the back-and-forth over the last couple weeks. Thanks for your patience.
Good news, though—I can now consistently reproduce the issue, which means we're on the right track to sorting it out.
Thanks for bearing with me, and I'll make sure we get this fixed as soon as possible. In the meantime, I'll post regular updates.
Translation.. ميتا ماسك لم يحمينى من الهجمات داخل التليفون وداخل المحفظه . المعامله صعبه وجدا وتليفونى متكتف منذ يومين . حاول تساعدونى .. انا بيحصل فى تليفونى حاجات غريبه جدا
Help me please 🥺
Translation.. ميتا ماسك لم يحمينى من الهجمات داخل التليفون وداخل المحفظه . المعامله صعبه وجدا وتليفونى متكتف منذ يومين . حاول تساعدونى .. انا بيحصل فى تليفونى حاجات غريبه جدا
@Ramyromel, please go to support.MetaMask.io select “Start a conversation” and our User Safety team will assist you.
After some investigation:
When this bug is triggered, I see an inconsistency where the "Fee details" shown on the confirmation screen don't match the "Transaction fee" displayed above. The expected fee (and fee details) is zero. This is likely causing the "insufficient funds for gas" message on that screen when the user has zero ETH in their account.
Below is an image highlighting this issue:
@Karkunow, I'm going to triage this bug to the right team based on these findings.
@dbrans glad you've managed to reproduce this! looking forward to triage.
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.