Is there a way to programmatically fetch a list of all erc20 tokens including contract addresses and decimals? Im using web3 but if there is any rest service I dont know Im happy to get to know about it.

  • Could you please provide more details about what are you trying to accomplish? – balajipachai May 11 at 18:17
  • I think what I am trying to accomplish is literally my question. Get a list of all erc20 tokens (name, decimals and so on) best case from some sort of open api – Chris S May 11 at 20:43

Currently, there is no way to easily list ERC-20 token contracts on Ethereum blockchain. This is because contracts do not report any event when they are created.

One way to identify ERC-20 tokens would be

  1. Listen for Transfer event for any contract

  2. For any unidenfitied contract address

  3. a) Check the address of the contract if it has name and symbol and decimals accessor function

  4. b) Assume the contract implements ERC-20 if this is the case

  • 1
    Yes thank you, that would be the approach I was going for but I was hoping I could save me from doing that. Especially as I only have 1.000.000 requests with my teams plan on infura and I need these already for gathering all transactions of my app. – Chris S May 11 at 20:42
  • Host your own node. It it cheaper plus it is much faster. twitter.com/moo9000/status/1370323189486784513 – Mikko Ohtamaa May 12 at 7:25
  • Even with Infura or an own node which would require me a month to sync, I still dont know any way of getting what I need tho. – Chris S May 12 at 7:54
  • My tweet literally says it took less than 24h to sync, that's why I linked it. You are now pulling facts out from some Bitcoin maxi misinformation forum. – Mikko Ohtamaa May 12 at 8:48
  • last time I ran a full node on a vps it took more than 3 weeks to have it completly synced. I cant imagine that you can load the whole eth chain in a few minutes. If that is true, it would be an option but I doubt it is. – Chris S May 12 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.