question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor fetching token information: symbol, decimals, etc

See original GitHub issue

Current logic for fetching token information is overcomplicated and not working properly (https://github.com/gnosis/safe-react/issues/1068).

So, the problem: Currently token information is fetched for a transaction inside fetchTransactions (https://github.com/gnosis/safe-react/issues/1070). This shouldn’t be a thing, imagine the following example:

  • we get a transaction with an unknown token, we fail to fetch info and now showing UNKNOWN
  • later we get this token info from the backend
  • UNKNOWN will still be shown because the token info is tied to the transaction

Possible solution: Implement a react component for displaying token symbols with a usage like this: <TokenSymbol address={} It should get the symbol from state, if there’s no info in state, fetch it This function should work as a good base: https://github.com/gnosis/safe-react/blob/a5b45850494097e7b288e84dc25e0b8a8a017564/src/logic/tokens/store/actions/fetchTokens.ts#L60

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Agupanecommented, Jul 24, 2020

Ahhh got it, now it makes sense, thanks for the clarification! @Uxio0

0reactions
katspaughcommented, Jun 16, 2021

This has been refactored since, so I think we can close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Covert ERC-20 tokens with different decimals to amount to Wei
The token contract should have a function to get how many decimals it uses. If you know that the token contract uses 3...
Read more >
How do I get a token's name, symbol, decimals, etc.?
Update: Make this call directly from the RPC. You can query the RPC directly as follows: curl --location --request POST 'https://archival-rpc.
Read more >
How to manage your Design Tokens with Style Dictionary
Recently I have come across a tool, called Style Dictionary, developed by Danny Banks at Amazon, that allows you to manage design tokens...
Read more >
ERC: Token Registries · Issue #22 · ethereum/EIPs - GitHub
Sets or returns the base unit of a token. Although most tokens are displayed to the final user as containing decimal points, token...
Read more >
How to Fetch and Update Data From Ethereum With React ...
Here's how to configure your dapp's frontend so token balances and fund transfers update in your users' Ethereum wallets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found