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

Need to add a limit for the minimum transferable AIN value #1208

Closed
platfowner opened this issue Sep 26, 2023 · 3 comments
Closed

Need to add a limit for the minimum transferable AIN value #1208

platfowner opened this issue Sep 26, 2023 · 3 comments
Assignees
Labels
new feature request new feature

Comments

@platfowner
Copy link
Member

Currently we are not applying any limit on the minimum transferable AIN value.
When we transfer 1e-39 AIN for example, the balance changes 50.0948888888891 -> 149.90438888888912 for example, which means except the tx fee 0.1905 AIN, 0.00000000000002 (2e-14) AIN is subtracted from the sender's balance, and it's not the same as the transferred value 1e-39 AIN.

This happens because of the 52 bits limit of the mantissa:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number

So, we need to apply a limit to the minimum transferable AIN value.
As 2^52 ~= 4.5 x 10^{15}, some value around 10^{-14} would be safe.

@platfowner platfowner added the new feature request new feature label Sep 26, 2023
@platfowner platfowner self-assigned this Sep 26, 2023
@platfowner
Copy link
Member Author

Updates:
As the total supply is 0.7 billion (700,000,000) AIN, the integer parts consumes 9 digits. So only 6 (= 15 - 9) digits are available for non-integer values. So 10^{-6} would be safe.

@platfowner
Copy link
Member Author

Resolved with release.

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

No branches or pull requests

1 participant