I would like my token to have the maximum possible amount of tokens issued as a novelty. I would like to use 18 decimals standard ERC20 token, what value can I put in to get the maximum amount of tokens possible?
1 Answer
The maximum number of tokens, compatible with ERC20, is the maximum amount a uint256
variable can store: (2**256) - 1
with 0
decimals. If you use 18
decimals, the maximum amount of tokens is (2^256-1)/10^18 = 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457
-
It should be
(2**256-1)/10**18 = 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457
– Ismael ♦Commented Aug 27, 2017 at 9:53 -
-
Thanks corrected it. I just wanted to make clear that he most likely isn't hitting the cap Commented Aug 27, 2017 at 18:58
-
@danielmetlitski uint256 has 256 bits of storage so the maximum number being
(2**256) - 1
. If you have one decimal you can represent at most[(2**256) - 1] / 10
the last digit will be your decimal, repeating that reasoning you get formula in the answer.– Ismael ♦Commented Aug 27, 2017 at 19:04