简体   繁体   English

如何获取某个地址的某些 ERC721 代币的 tokenid? 使用 Web3py

[英]How to get the tokenids of certain ERC721 tokens for a adress? using Web3py

A known way:一种已知的方式:

  1. call balanceOf to get the number of tokens owned by the address call调用balanceOf获取地址调用所拥有的代币数量
  2. Call tokenOfOwnerByIndex in a loop to get each owned token ID.在循环中调用tokenOfOwnerByIndex以获取每个拥有的令牌 ID。

But what I'm very confused about is what to do when the ERC721 contract has not included tokenOfOwnerByIndex function但是我很困惑的是,当ERC721合约没有包含tokenOfOwnerByIndex function时该怎么办

tokenOfOwnerByIndex is what most token will provide for you to enumerate in, but you could use Transfer event on that contract to do that also tokenOfOwnerByIndex 是大多数代币将提供给您枚举的内容,但您也可以使用该合约上的 Transfer 事件来执行此操作

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

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