Content
@
0 reply
0 recast
0 reaction
jp 🎩
@jpfraneto.eth
imagine you want to take a snapshot of all the holders of token X and their balance. how would you do it?
5 replies
4 recasts
13 reactions
Kevin
@typedarray.eth
@fucory could you use a custom view function for this?
1 reply
0 recast
1 reaction
Fucory
@fucory
Depends on storage layout. If all the contract gives you is a mapping(address account => uint256) private _balances; Unfortunately you cannot iterate over that as the evm storage doesn’t hold the array of Object.keys in memory/storage You could however use an event filter or other means to get a list of all potential holders and iterate over that with a custom view function
0 reply
0 recast
0 reaction