Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[evm] What about having 2 DenomUnits for UX? #2072

Closed
Unique-Divine opened this issue Oct 10, 2024 · 1 comment
Closed

[evm] What about having 2 DenomUnits for UX? #2072

Unique-Divine opened this issue Oct 10, 2024 · 1 comment

Comments

@Unique-Divine
Copy link
Member

Summary

Code4rena:

What about having 2 DenomUnits:

  1. The smallest possible unit with Exponent = 0, universally called wei (i.e. Denom = "wei") for all such erc20 funtokens
  2. The regular unit which uses the erc20 token's decimals, i.e. { Denom: bankDenom, Exponent: info.Decimals }

This first wei unit will be used as the coin's Base and the second unit as Display.

Originally posted by @berndartmueller in https://github.com/code-423n4/2024-10-nibiru-zenith/pull/21#discussion_r1794865216

@Unique-Divine

Yeah, I think that would improve the UX. That would bring about parity between MetaMask and Keplr/Leap.

The 0 exponent one's required and technically correct, but putting a second denom unit like you've described would make the behavior similar to NIBI's bank metadata:

    {
      "description": "The native staking token of the Nibiru network.",
      "denom_units": [
        {
          "denom": "unibi",
          "exponent": 0,
          "aliases": [
            "micronibi"
          ]
        },
        {
          "denom": "NIBI",
          "exponent": 6,
          "aliases": []
        }
      ],
      "base": "unibi",
      "display": "NIBI",
      "name": "NIBI",
      "symbol": "NIBI",
      "uri": "",
      "uri_hash": ""
    }

Integrating a change shortly.

@github-project-automation github-project-automation bot moved this to ⚡ Building 🧱 in ⚛️ Nibiru (Hougyoku) Oct 10, 2024
@github-actions github-actions bot added the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Oct 10, 2024
@Unique-Divine Unique-Divine removed the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Oct 11, 2024
@Unique-Divine
Copy link
Member Author

Closed by #2074

@github-project-automation github-project-automation bot moved this from ⚡ Building 🧱 to ✅ Completed in ⚛️ Nibiru (Hougyoku) Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant