4

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 1

5

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

4
  • 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
  • @Ismael is that the same as (2**(256) - 1) ? Commented Aug 27, 2017 at 11:38
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.