Ethereum Address List – How to Get All Addresses Holding My Token

erc-20ethereumjsoliditytokensweb3js

I want a list of all ethereum address which have my ERC20 token in their account. Anyone have an idea how to get list address. beause i want give divided to each account which have my ERC20 token.

Best Answer

Do it using your Transfer event in your contract.

    var myEvent = contract.Transfer({},{fromBlock: 0, toBlock: 'latest'});
    myEvent.get((error, result) => {
               console.log(result);
      });

use fromBlock param as 5933218 ,the block in which contract created

Related Topic