-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC-681 implementation bug: Wrong value on ERC-20 token transactions #1549
Comments
As reported here: ethereum/EIPs#681 |
Any update on this? |
We can't reproduce this @dwjorgeb Can you try it with the latest version 0.2.18 and let us know if this is still an issue? |
hello @omnat Can confirm this still happens with 0.2.18. What values did you put on the payment URI? |
@dwjorgeb I put 1.5 USDT. The link that was generated also showed it correctly. |
exactly, but that's not what it's in the ERC-681 spec. as per the spec text:
Doesn't even make sense to send a float ( |
hey @dwjorgeb thank you very much for reporting this, pushed a PR to fix it |
Great :) I'm glad to help. @estebanmino |
The bug
When parsing ERC-681 encoded URIs or QR Codes for ERC-20 token transactions, the
uint256
parameter is parsed wrong.MetaMask seems to assume the
uint256
value is on main token unit, instead of atomic unit.Example:
ethereum:0xdAC17F958D2ee523a2206206994597C13D831ec7/transfer?address=0x8e23ee67d1332ad560396262c48ffbb01f93d052&uint256=1500000
should be parsed to 1.5 USDT, but instead is parsed as 1.5 million USDT
In order to parse 1.5 USDT the URI needs to be constructed like:
ethereum:0xdAC17F958D2ee523a2206206994597C13D831ec7/transfer?address=0x8e23ee67d1332ad560396262c48ffbb01f93d052&uint256=1.5
Which not only doesn't match what's on the spec (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-681.md)
but also makes no sense, since it's supposed to be a unsigned integer, not a decimal value.
To Reproduce
Expected behavior
Token value parsed in atomic units
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: