dfinity / ICRC-1

A fungible token standard developed by the Ledger & Tokenization working group for the IC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

decimals should be nat8

timohanke opened this issue · comments

decimals: () -> (nat32) query;

balanceOf returns a nat64. The number 2^64 has only 20 decimal places, so any value for decimals beyond 20 means that nobody can ever hold an entire token. Therefore a nat8 should be more than enough for decimals.

It also provides less risk to break frontends, even though one can argue that a frontend should just drop tokens that have an unreasonable decimals value (even if the type is nat8).