-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix UFix64 <-> UInt256 conversion #56
Comments
6 tasks
Reopening as new bugs were uncovered |
6 tasks
Reopening after uncovering another issue. @bluesign shared a fix - would you be able to submit a PR or would you mind if I do on your behalf? |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Current behavior simply truncates decimal which is poor user experience, particularly for dust values. In the edge where the total supply of a token is 1 (prior art here in memecoins), users wouldn't be able to bridge any value and worse, if attempted the request would succeed in escrowing the value only to return none on the receiving end.
Acceptance Criteria
Conversions are appropriate for the given amount. E.g.
0.001234
converts to12340000000000
for decimals == 18. Any implementation should also cover the case where an ERC20's decimal value is less precise than Cadence's UFix64 decimal value of 8, rounding down to prevent overage in either direction.The text was updated successfully, but these errors were encountered: