I'm trying to index the names and decimals of tokens in moonbeam, I think I should listen for a contract instantiation event to get that data. Which event and module should I listen for? Or is there any other straight forward way to get the data that i'm looking for?
-
"names and decimals of tokens in moonbeam" - do you mean total issuance or do you mean you want to understand volume of what tokens are being transacted? (You can see the events related to moonbeam here: polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwss.api.moonbeam.network#/… )– SquirrelApr 25, 2022 at 15:06
-
@Squirrel I'm trying to get token name, decimals, such as shown here: moonbeam.moonscan.io/token/…– user2395Apr 26, 2022 at 10:31
1 Answer
You should probably listen to Evm.ContractDeployed
events to track all contracts ever deployed. However, you'd then need to filter ERC20-like contracts among those, which is a non-trivial task to do (but one can try looking at the methods implemented by the contract to "duck-guess").