ethermint icon indicating copy to clipboard operation
ethermint copied to clipboard

Create token contract for ethermint coins

Open fedekunze opened this issue 5 years ago • 5 comments

Proposal: [Description of the feature]

Tokens in Metamask are represented as ETH because there's no token contract for each sdk.Coinin the account balances (for not only photon).

We could write a token contract for the photon and ara but ideally, we should have a generic contact for cosmos coin representation in Solidity. Alternatively, a tool for deploying the contract from the available supply of coins would be valuable.

I'm not super familiar with Ethereum so any help or input would be appreciated.

cc: @okwme

Screen Shot 2020-06-18 at 19 05 38

fedekunze avatar Jun 18 '20 17:06 fedekunze

you could maybe use a hash of the coin denom with a prefix for a reserved namespace that can be used as contract addresses and a reverse lookup table so that if someone does an eth_call with one of those contract addresses it directs the query to the bank module instead?

this would treat cosmos assets as ERC-20s which would need to be manually added to metamask still. Is that what you're asking about?

okwme avatar Jun 18 '20 17:06 okwme

yeah that was what I was asking about. I would want to return photon instead of ETH ideally

fedekunze avatar Jun 18 '20 17:06 fedekunze

Metamask will most likely not distinguish the fact that the ethermint gas token is called photon instead of ETH. Similarly Koven Ether (KETH) is still called ETH in metamask. You do have options with accessing other SDK Coins as ERC-20s which metamask can handle. But Metamask most likely won't keep track of them automatically. Adding them manually will be on the user unless some coordination of namespacing takes place with Metamask's ERC-20 data source.

In general tho, having a generic ERC-20 interface to wrap around SDK Coins would be a clever way to give MM users access.

okwme avatar Jun 18 '20 17:06 okwme

Might be worth checking in with the https://github.com/ChainAgnostic/CAIPs folks about asset types? Ethermint occupies a unique instance where an asset might be represented as a SDK Coin or an ERC-20 while located on the same chain.

okwme avatar Jun 18 '20 17:06 okwme

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 29 '20 00:07 github-actions[bot]