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.
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
Transferevent for any contract
For any unidenfitied contract address
a) Check the address of the contract if it has
b) Assume the contract implements ERC-20 if this is the case