How can I find out what addresses my token has and how much is solid? I thought of creating an array with the addresses like this would go through, but this array can grow to infinity and cost me a big gas. My idea would be to get all the wallets that have my token with the amount of it.
One approach could be through events:
- You can emit an event whenever there is a transfer from/to your token smart contract from/to an external account.
- Afterwards, you can retrieve all the related events off-chain without any cost
Any other alternative on-chain might have significant gas fees.