1

I've seen most tokens use 18 decimals and USDC use 6 decimals. Is it possible for a token to have over 18?

5

The maximum amount of token that a ERC-20 contract can mind (according to the specification) is the max of uint256, which is (2 ** 256)-1 ≈ 10 ** 77. And the decimal variable merely mentions the number of decimal places to be used while displaying the amount on a UI. Theoretically, you could use any decimal. As long as the decimal is less than 77, you'll have a whole number part (mantissa). For example, if you have 18 decimals, the max value you can have is (2 ** 256-1)/10 ** 18 ≈ 10 ** 59. Most ERC-20 tokens use 18 so as to stay comparable to other tokens in terms of supply.

1
  • Thank you. I'm working on alternative EVM blockchain and I noticed some tokens had 24 decimals. It was breaking my contracts so I'm updating them for >18 decimal support.
    – caker
    Jan 14 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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