greymass / unicove

Unicove - Antelope Web Wallet 🦄
https://unicove.com
Other
20 stars 10 forks source link

Token metadata (logo etc) #119

Open chuck-h opened 2 years ago

chuck-h commented 2 years ago

We need a well-defined way to introduce new tokens to the wallet so that their names and logos can appear in the UI. Ref: https://forums.eoscommunity.org/t/custom-tokens-in-unicove/5504/4 . This issue statement does not define a specific approach, but mentions some possibilities.

A "classic" way to do this is with a public repository e.g. https://github.com/eoscafe/eos-airdrops . Alternatively, the token index can be maintained by a contract on-chain, e.g. https://github.com/telosnetwork/tokenmanager/blob/master/contracts/tokenmanager/include/tokenmanager.hpp , or a similar one I have written https://github.com/chuck-h/seeds-smart-contracts/blob/feature/master_token_list/include/seeds.tokensmaster.hpp .

As mentioned in that code, there are reasons to include a vetting process to exclude erroneous or malicious "scam" coin metadata.

For the long term we could encourage token designers to self-document with entries in a "well-known" table name in the token contract. It could be as simple as a table containing a JSON string. For example the TABLE currency_display, populated by a setdisplay action in https://github.com/chuck-h/seeds-smart-contracts/blob/feature/rainbows/include/seeds.rainbows.hpp .

@aaroncox

chuck-h commented 2 years ago

See also https://github.com/Uniswap/token-lists

ismyhc commented 2 years ago

We did something similar at proton. Theres a contract that allows the token contract creator to "register" their token with all the needed information. Url, iconurl, etc.

https://github.com/ProtonProtocol/proton.contracts/tree/master/contracts/token.proton

You can see it in action here: https://www.protonscan.io/account/token.proton?loadContract=true&tab=Tables&table=tokens&account=token.proton&scope=token.proton&limit=100