简体   繁体   中英

Get ETH Wallet address list by smart contract address

I would like to fetch the list of all ETH wallet addresses by an API(?), given a smart contract address. Similar feature that we see on etherscan.io under the erc20 Holder list. Any docs/resource would be appreciated. Thanks

If you want to get the addresses of all accounts from which transactions were sent to a specific smart contract, then the only general way is to scan all blocks using the eth_getBlockByNumber method (or its equivalent) and "manually" select all transactions with the desired recipient address.

At the same time, you also most likely need to weed out transactions coming from other smart contracts. In order to determine whether an address belongs to an account or a smart contract, you can, for example, use the eth_getCode method - if it returns an empty value, then this is an account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM