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

[Bug]: Sending MAX amount while having low balance results in error.

Open sleepytanya opened this issue 10 months ago • 1 comments

Describe the bug

For accounts with a lower balance, the calculation of the 'MAX' amount may not be accurately reflecting the available balance and estimated gas fees. This discrepancy can lead to an amount being suggested that exceeds the actual balance, clicking 'Continue' seems to do nothing, error appear in the background console.

Expected behavior

The Max amount on confirmation screen accurately reflects account balance, taking into account the gas estimation.

Screenshots/Recordings

https://github.com/MetaMask/metamask-extension/assets/104780023/8ec17a67-e1a8-4cde-b030-93c38a31d270

Steps to reproduce

  1. Have an account with low balance (e.i. 0.000001 ETH)
  2. Try to send MAX amount
  3. See the amount to be sent exceeds the actual account balance
  4. Click 'Continue'
  5. See the error in the background console

Error messages or log output

No response

Version

dev build <mb843/data-flows>

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

sleepytanya avatar Apr 04 '24 04:04 sleepytanya

Still present on the latest build:

https://github.com/MetaMask/metamask-extension/assets/104780023/252c65de-9013-4ac8-8d99-6c9d24f8b9c0

sleepytanya avatar Apr 12 '24 19:04 sleepytanya

@micaelae @BZahory @ejwessel Correct behavior for sending Max amount with insufficient funds, production 11.15.5- 'Max' and 'Confirm' disabled:

https://github.com/MetaMask/metamask-extension/assets/104780023/f9eff0b7-3107-48f4-ba02-7aebf45b988f

Current 14.4.4 behavior:

https://github.com/MetaMask/metamask-extension/assets/104780023/643a700c-1a8f-428e-8669-e9a2680beadd

sleepytanya avatar May 18 '24 22:05 sleepytanya

https://github.com/MetaMask/metamask-extension/assets/44588480/9da8bb18-4337-48a8-82e0-75fe3a3750ce

Resolve the Max button issue in c091dd28193e9d628df69a3ad03c44ed2f76594b

BZahory avatar May 20 '24 05:05 BZahory