I would like to read contract information(especially name, symbol, decimal, owner) from token contracts like shown here: https://moonbeam.moonscan.io/token/0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b#readContract

How do I read that from on-chain? Also, how do I figure out if a contract is a token contract?

context: this is for an indexer project.

  • I think once you've decoded the scale, then you have to decode it on the eth side. I'm guessing that github.com/rust-ethereum/ethabi should be able to do it though have not tried this out yet.
    – Squirrel
    May 16, 2022 at 9:58


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.