use-token
use-token copied to clipboard
Token decimals
It could be nice to provide the token decimals as well.
@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.
@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).
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.