0

Is there function to view list of holders addresses and each address attached tokens that it owns something like this

 - HOLDERADDRESS:   Tokens Id:
 - ADRESS1           1 , 24 , 
 - ADDRES2           9 , 6 , 
 - ADDRES3           1 , 24 , 

1 Answers1

0

First,balanceOf(owner) to get the nft balance from owner. Second,tokenOfOwnerByIndex(owner, index) to retrieve the tokenId by index. Note that the range of index is bigger equal to 0 and less than nft balance. Ref:https://docs.openzeppelin.com/contracts/3.x/api/token/erc721