Skip to content
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

Offline send token amount value order messed up #4386

Open
Trinketer22 opened this issue Nov 27, 2022 · 1 comment
Open

Offline send token amount value order messed up #4386

Trinketer22 opened this issue Nov 27, 2022 · 1 comment

Comments

@Trinketer22
Copy link

Trinketer22 commented Nov 27, 2022

Info
Steps to reproduce
  • Navigate to send offline
  • Pick any ERC-20 token
  • Let's pick a value 1000 for simplicity
  • File gas field accordingly
  • Hit "Generate transaction"
  • Look what we get in transaction data input

00000000000000000000000000000000000000000000000000000000000003e8
This is what we get in the transaction input data value field.
I'm pretty sure it expects value of different order (I assume * "mwei", but you know better).
More so if we enter decimal like "1000.12345" we would get 0 in the data value field.
Highly likely because of this:https://github.com/MyEtherWallet/MyEtherWallet/blob/main/src/modules/send-offline/ModuleSendOffline.vue#L355
BN can't take fractional AND value has to be put in some wei order first.
Like so for example:web3.utils.toWei(this.amount, "mwei")

@Trinketer22
Copy link
Author

Trinketer22 commented Nov 27, 2022

Perhaps it's not that simple and we have to store decimals for some of the tokens:https://eips.ethereum.org/EIPS/eip-20 method decimals.
Pretty sure it used to work fine with decimals and everything in way earlier releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant