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

feat: map ics20 denoms to erc20 #23

Merged
merged 10 commits into from
Sep 25, 2023
Merged

feat: map ics20 denoms to erc20 #23

merged 10 commits into from
Sep 25, 2023

Conversation

blckngm
Copy link
Contributor

@blckngm blckngm commented Sep 14, 2023

No description provided.

@Flouse Flouse requested a review from a team September 14, 2023 07:46
@blckngm blckngm marked this pull request as ready for review September 18, 2023 02:50
// Deploy an ERC20 contract for each (sink zone) denom seen.
if (address(denomTokenContract[denom]) == address(0)) {
string memory name = string.concat("IBC/", hexEncode(abi.encodePacked(sha256(bytes(denom)))));
denomTokenContract[denom] = new ERC20PresetMinterPauser(name, "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to associate this non-human-readable token name with a human-readable token name, like ETC, BTC, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a concern for UI/explorer etc. Cosmos uses https://github.com/cosmos/chain-registry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or the allowlist version allows setting custom token name, symbol and decimal.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do not set symbol for the ERC20?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should the symbol be?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no sure if we can use denom as the symbol, but use an empty string is strange

Copy link
Contributor

@ashuralyk ashuralyk Sep 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no sure if we can use denom as the symbol, but use an empty string is strange

it's not an empty string, but just an encoded string which isn't recognized for human-beings and differs from symbol of ERC20, like BTC, ETH, and so on

Copy link
Collaborator

@jjyr jjyr Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the first arg.

            denomTokenContract[denom] = new ERC20PresetMinterPauser(name, "");

I am discussing the second one here

// Deploy an ERC20 contract for each (sink zone) denom seen.
if (address(denomTokenContract[denom]) == address(0)) {
string memory name = string.concat("IBC/", hexEncode(abi.encodePacked(sha256(bytes(denom)))));
denomTokenContract[denom] = new ERC20PresetMinterPauser(name, "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do not set symbol for the ERC20?

@Flouse Flouse merged commit f407f44 into master Sep 25, 2023
3 checks passed
@Flouse Flouse deleted the ics20-erc20 branch September 25, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants