(Almost all) ERC-20 token contracts do not maintain a list of iterable token holders, but you need to build a database offchain yourself. mapping in EVM is not iterable, you can only check for a known key value.
I have created a standalone tool which collects ERC-20 token holders and transactions to SQLite database and using [login to view URL] library.
Take a token contract address
Iterate over all Transfer events for token using eth_getLogs JSON-RPC API
Build a local database of these events
Allow you to use SQL to query any account balance on any point of time (block num)
You can find the command line application execution example how to build the token holder database here
The core Python logic is here.
There are some quirks here and there: for example detecting mint / creation event for some tokens is not straightforward. Thus, you will may negative balance on the account receiving initial total supply if you rely on Transfer event only.
11 фрилансеров(-а) готовы выполнить эту работу в среднем за $545
Hello, I have rich experien cien in [login to view URL] and smart contract . I am familiear with bsc, eth, polygon. Please discuss more ind etail. SO I can help you enough. THansk in advance.