-
Notifications
You must be signed in to change notification settings - Fork 39
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
Modeling assets with non-natural numbers in ERTP #65
Comments
Currencies should always be represented in code in natural numbers (i.e. in cents for US dollars). In UI, those natural numbers are converted to the usual representation (i.e. dollars) by moving the decimal point. If you look at Ethereum's ERC20 tokens, they all have a field called In ERTP, the extents are the smallest denomination of digital asset such that it is always a natural number. We don't currently have a place to put information about how it should be represented to the user, like |
In Satoshis for bitcoins, then. There are 2100000000000000 ( |
Yes, we should switch to BigInt soon and stop worrying about exceeding the SAFE_INTEGER range of floats. |
Discussion about something that should be done in ERTP. Not relevant to Documentation until it's implemented in ERTP and we'll be told of that via other means than this issue. |
I think that all examples i have seen of ERTP either use natural numbers (1, 10, 1000, 32) or use objects to represent rights
Euros, dollars, bitcoins all use non-natural numbers in their usual representation
But JavaScript is notoriously inadequate for non-natural numbers (
0.1 + 0.2 !== 0.3
)What is the approach recommanded by Agoric to model non-natural number assets?
(Attn @erights)
The text was updated successfully, but these errors were encountered: