Skip to content

Can not change the decimal of native token of custom network #15168

@jongrun

Description

@jongrun

Describe the bug

When adding a custom network, the metamask will divide the native token amount by 10^18 to get its user representation. This is proper for Ethereum and some other blockchains.

But for some reason, the number of decimals may not always 18 for some custom network. For example, when the blockchain implement uses int64 as a type for balance, the max value is 2^63-1(+9,223,372,036,854,775,807), about 9*10^18. In this case, using 18 as the number of decimals is obviously inappropriate. Or, the native token is just designed with a smaller number of decimals, like 8.

Therefore, is it possible to support specifying decimals when adding a custom network. If not, what is the reason. Thanks for reading and looking forward to your reply.

Steps to reproduce

  1. Adding a custom network.
  2. The metamask divides the native token amount by 10^18 to get its user representation.

Error messages or log output

No response

Version

10.16.2

Build type

No response

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

Related issues: Changing the metamask display decimal of native token
Related doc: MetaMask does not yet support chains with native currencies that do not have 18 decimals, but may do so in the future.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions