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

Rationalize handling of token decimal precision #1932

Open
chuck-h opened this issue Sep 2, 2022 · 0 comments
Open

Rationalize handling of token decimal precision #1932

chuck-h opened this issue Sep 2, 2022 · 0 comments
Labels

Comments

@chuck-h
Copy link
Collaborator

chuck-h commented Sep 2, 2022

Is your feature request related to a problem? Please describe.
This FR was inspired by being unable to send a token that was displayed in LW. The failure was caused by an incorrect decimal precision (defaulted to 4) in the TokenModel. I suggest that when generating a blockchain transaction (e.g. the send transfer) the precision should always be based on the contract itself rather than metadata provided by the app.
Nonetheless the app should have control over the precision displayed at various screens in LW, and the preferred display precision may not equal the contract precision.
Finally, while looking thru the code it appears that a few different algorithms are used to set display precision in different screens. At some point there may be benefit to refactoring display precision in a coherent way.

Describe the solution you'd like

  1. Ensure that correct precision is used when generating blockchain transactions (e.g. send).
  2. (Lower priority) Document a display precision policy and implement it.

Additional context
A working fix to use contract precision for send transactions is at
71f064f
for receive QR generator at
6d4dbaa

@chuck-h chuck-h added the story label Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant