metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

[Bug]: The 'Max' amount option doesn't function as expected for Layer 2 networks

Open sleepytanya opened this issue 1 year ago • 2 comments
trafficstars

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

  1. Connect to L2 network
  2. Start a transaction
  3. Select 'Max' amount
  4. Proceed to confirm the transaction
  5. 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

sleepytanya avatar Jul 10 '24 00:07 sleepytanya

This ticket is dependency for #2771 so it should be closed first.

pedronfigueiredo avatar Jul 11 '24 14:07 pedronfigueiredo

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.

jpuri avatar Aug 28 '24 09:08 jpuri

Retested with 12.3.0 and can still reproduce. I was able to reproduce only with Optimism, not with Linea, zksync, Arbitrum or Avalanche

davibroc avatar Sep 17 '24 04:09 davibroc

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

jclancy93 avatar Sep 20 '24 16:09 jclancy93

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.

github-actions[bot] avatar Dec 19 '24 18:12 github-actions[bot]

This is still happening.

dylanbutler1 avatar Mar 14 '25 16:03 dylanbutler1

Can reproduce on Optimism with 12.18.0.

benjisclowder avatar May 14 '25 15:05 benjisclowder