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] Use the ERC20 metadata to set the Name and display for a Bank Coin #2073

Closed
Unique-Divine opened this issue Oct 10, 2024 · 0 comments · Fixed by #2074
Closed

[evm] Use the ERC20 metadata to set the Name and display for a Bank Coin #2073

Unique-Divine opened this issue Oct 10, 2024 · 0 comments · Fixed by #2074
Labels
x: evm Relates to Nibiru EVM or the EVM Module

Comments

@Unique-Divine
Copy link
Member

Unique-Divine commented Oct 10, 2024

In the context of FunToken mapping creation:

I'm wondering why the retrieved erc20 metadata is not used here to set Name to the erc20 token's name?

Context:

Description:

In createFunTokenFromERC20(), the bank metadata for the new funtoken coin is created with a single DenomUnit, with Denom set to "erc20/{erc20}" and Exponent set to 0.

This can be improved in the following way by using two DenomUnits:

  1. The smallest possible unit with Exponent = 0, universally called wei (i.e. Denom = "wei") for all such ERC-20 funtokens
  2. The regular unit which uses the ERC-20 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.

Additionally, the metadata Name could be set to the retrieved ERC-20 metadata info.Name.

Recommendation:

Consider using two DenomUnits for the new funtoken coin metadata and setting the Name to the ERC-20 token's name. This would bring parity between EVM wallets, such as MetaMask, and Cosmos wallets, such as Keplr/Leap when displaying the coins/tokens.

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

@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
@github-project-automation github-project-automation bot moved this from ⚡ Building 🧱 to ✅ Completed in ⚛️ Nibiru (Hougyoku) Oct 11, 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 Unique-Divine added the x: evm Relates to Nibiru EVM or the EVM Module label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x: evm Relates to Nibiru EVM or the EVM Module
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant