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

Decimal Support: 9 or 18 #16

Closed
ashen1dev opened this issue Nov 28, 2018 · 3 comments
Closed

Decimal Support: 9 or 18 #16

ashen1dev opened this issue Nov 28, 2018 · 3 comments
Labels
Milestone

Comments

@ashen1dev
Copy link
Contributor

ashen1dev commented Nov 28, 2018

'AERGO' is main coin of Aergo Network. One advantage of cryptocurrency is that it can be divided smaller than the base unit.(Better Liquidity) and we want to define the minimum unit called AER. Aergo's smart contracts, SDK and AergoCLI will use AER as a basic unit. The problem is how much AER is smaller than AERGO. In initial discussion, we noticed that most Ether wallets actually use the GWei unit as a fee unit.

So we tried to define AER to be 10 ^ -9 of AERGO (until Release 0.8.1). But soon, we found the compatibility problem. In case of the ERC20 token transfer from the Ethereum to AERGO main network(via the Asset Bridge), token value will be truncated from 18 decimals to 9 decimals.

We will define AER as 10 ^ -18. However, in this case, we need to implement a separate big number data structure instead of using unsigned int 64 bits.

In addition, it is also better to be compatible with Ethereum by supporting up to 10 ^ -18 in terms of 'Forward Compatibility'.

@graup
Copy link
Member

graup commented Nov 28, 2018

For compatibility reasons, I think it makes sense to stick with 18 digits. There are even some proposals to make that compulsory for all ERC20 tokens (ethereum/EIPs#724), but anyway it is the de-facto standard.

We'll need to refactor all code regarding balances and transaction amounts in the server and all clients.

@graup
Copy link
Member

graup commented Dec 6, 2018

[x] Herajs merged support for 18 decimals in aergoio/herajs@7435563

@ashen1dev
Copy link
Contributor Author

We decided to go on 18 decimals.

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

2 participants