Search code examples
blockchainethereumgo-ethereumerc20ethereumclassic

Can we get Smart Contract address by Token Name


I want to get smart contract information by token name as Etherscan does but with my private network.

According to web3 doc, If I need to get any information related to Smart Contract, I first need to have a smart contract address and ABI. But when writing Smart Contract I don't have the command to store it in my database.

My main goal is I need to create an exact copy of explorer as Etherscan and bscscan.com


Solution

  • Because it is your private network, you have private tokens. I assume you have an ERC-20 token smart contract you are going to deploy.

    Just modify your token smart contract to emit an event in a constructor, like TokenCreated(string name, string symbol). Then you can fetch this event list from your JSON-RPC node.

    My main goal is I need to create an exact copy of explorer as Etherscan and bscscan.com

    EtherScan was built by an expert team over a period of six years. If you want feature parity with EtherScan, you are unlikely to accomplish it working solo.