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

MAX button removes decimal separator when sending USDT

Open rdymac opened this issue 6 years ago • 3 comments

Describe the bug MAX button removes decimal point/separator when trying to send USDT

To Reproduce (REQUIRED) Needs test to reproduce

  1. Go to USDT (balance 58.500)
  2. Click on MAX
  3. Amount to be sent automatically shows 58,500,000.000 USDT

Screenshots

max_USDT

Reported on Twitter: https://twitter.com/davecraige/status/1287282730917560321

rdymac avatar Jul 26 '20 13:07 rdymac

I could not reproduce it. However I see balance as 58.5 instead of 58.500. Are you still experiencing this issue?

PatrykLucka avatar Aug 26 '20 12:08 PatrykLucka

I did an initial investigation into this issue, though was unable to reproduce. this looked alarmingly as though it could have been caused as a side effect of https://github.com/MetaMask/eth-token-tracker/commit/2896f88a7f8411f9e46b893c2fc31321478634fe but after careful investigation, I do not believe this to be a potential cause.

The input field on this form is the 'token-input' component rendered in the 'send.component' file. This Send component's container sets up a token contract object when a token is selected from the dropdown list of assets. The balance is pulled via eth_call and requesting the current address' token balance for the specified token. Once we get the balance in hex format from eth_call we have to convert it ourselves. I believe that, if there is a reproducible bug here,it would be in the conversion mechanism

brad-decker avatar Jan 13 '21 21:01 brad-decker

After a few failed attempts to reproduce, and a year since the question "Are you still experiencing this issue?" was last asked, I think we can close this.

danjm avatar Oct 04 '21 10:10 danjm