cosmos / ethermint

Ethermint is a scalable and interoperable Ethereum, built on Proof-of-Stake with fast-finality using the Cosmos SDK.
https://ethermint.dev/
Apache License 2.0
413 stars 161 forks source link

Create token contract for ethermint coins #336

Open fedekunze opened 4 years ago

fedekunze commented 4 years ago

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
okwme commented 4 years ago

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?

fedekunze commented 4 years ago

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

okwme commented 4 years ago

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 commented 4 years ago

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.

github-actions[bot] commented 4 years ago

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.