metamask-extension
metamask-extension copied to clipboard
[Bug]: The 'Max' amount option doesn't function as expected for Layer 2 networks
Describe the bug
The 'Max' option doesn't seem to function as expected for L2 networks. Although the option allows a user to select the maximum amount, any transaction attempted with this setting invariably fails with 'Internal JSON-RPC error'. It appears that for the transaction to succeed, one must manually adjust the amount to account for gas fees.
Expected behavior
Screenshots/Recordings
https://github.com/MetaMask/metamask-extension/assets/104780023/e7ea73aa-dbad-4efe-a1fa-600ce8a13b02
No response
Steps to reproduce
- Connect to L2 network
- Start a transaction
- Select 'Max' amount
- Proceed to confirm the transaction
- See the transaction fails with the 'Internal JSON-RPC error'
Error messages or log output
No response
Version
v11.16.14, v12.0.0, v12.0.1
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
Severity
No response
This ticket is dependency for #2771 so it should be closed first.
This seems to be issue on send page, max should set value for transfer to user balance - gas. It seems that amount currently being set is not correct for Layer 2 transactions.
Retested with 12.3.0 and can still reproduce. I was able to reproduce only with Optimism, not with Linea, zksync, Arbitrum or Avalanche
I spent a good few hours looking into this this morning. It looks like the max button functions correctly on the send page, but the gas limit then gets re-estimated on the confirmations page which forces the value of the tx + gas to be more than the user's max balance. I will still need more time to debug further and may have to work with the confirmations team as well
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.
This is still happening.
Can reproduce on Optimism with 12.18.0.