use-token icon indicating copy to clipboard operation
use-token copied to clipboard

Token decimals

Open bpierre opened this issue 5 years ago • 3 comments

It could be nice to provide the token decimals as well.

bpierre avatar Jul 23 '20 12:07 bpierre

@bpierre I think this information already exists from ethereum-lists. I saw that we had the URL in the code, but weren't using it 😅.

Nevertheless, and perhaps this can be a different issue, we should still add support for a fallback read provider to get token information for arbitrary tokens that may not be in one of these verified lists (e.g. any one of our fake DAI tokens). This would go nicely with #8.

sohkai avatar Jul 24 '20 09:07 sohkai

@bpierre I think this information already exists from ethereum-lists. I saw that we had the URL in the code, but weren't using it sweat_smile.

Yes! The idea was to only add things as we need them, to keep it minimal (and easy to move to a TCR + IPFS).

Nevertheless, and perhaps this can be a different issue, we should still add support for a fallback read provider to get token information for arbitrary tokens that may not be in one of these verified lists (e.g. any one of our fake DAI tokens). This would go nicely with #8.

That could definitely be an option yes. We could also provide a way to identify the source of the information, or just a flag to indicate that the token exists on the trusted list (ethereum-lists now, a TCR in the future).

bpierre avatar Jul 24 '20 11:07 bpierre

just a flag to indicate that the token exists on the trusted list

Yes, that's what I was thinking. The best source of truth is reading the contract anyway, especially for decimals and symbol.

We could even warn if there's a mismatch (e.g. in the case of the list being changed maliciously), but to be honest, I'm not sure it'd lead to any security benefit for an end user.

sohkai avatar Jul 24 '20 12:07 sohkai