简体   繁体   English

Solidity - 是否有 function 可以查看持有者地址列表以及它拥有的每个地址附加令牌

[英]Solidity - Is there function to view list of holders addresses and each address attached tokens that it owns

Is there function to view list of holders addresses and each address attached tokens that it owns something like this是否有 function 可以查看持有者地址列表以及每个地址附加的令牌,它拥有类似这样的东西

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

First, balanceOf(owner) to get the nft balance from owner.首先, balanceOf(owner)从所有者那里获取 nft 余额。 Second, tokenOfOwnerByIndex(owner, index) to retrieve the tokenId by index.二、 tokenOfOwnerByIndex(owner, index)按索引检索tokenId。 Note that the range of index is bigger equal to 0 and less than nft balance.注意 index 的范围大于等于 0 小于 nft balance。 Ref: https://docs.openzeppelin.com/contracts/3.x/api/token/erc721参考: https://docs.openzeppelin.com/contracts/3.x/api/token/erc721

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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