iotex-analytics
iotex-analytics copied to clipboard
Add NFT Indexing
Given NFT contract addresses, indexing the owners of all tokens by tracking
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
If from
is 0x0, this is a new mint token.
Example contract on testnet: io1kep76e8z6xlcn6hr97wa7ykjnhfvz5uc3nlt5g
Example action with new mint token on testnet: https://testnet.iotexscan.io/action/ea0e5018a744aabd7c902500f845ccaef4bf486e2e93884e60143d9420394e20
"topics": [
"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0000000000000000000000000000000000000000000000000000000000000000",
"00000000000000000000000091414195231b0df10eb3807a8f2b52d6ddfed0a3",
"0000000000000000000000000000000000000000000000000000000000000001"
],
ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
is the "Transfer" topic, 0000000000000000000000000000000000000000000000000000000000000000
is "from", 00000000000000000000000091414195231b0df10eb3807a8f2b52d6ddfed0a3
is "to", and 0000000000000000000000000000000000000000000000000000000000000001
is token id.
@lzxm160 @Madongming Either one of you who have time, please claim this issue and work on it.
@lzxm160 @Madongming Either one of you who have time, please claim this issue and work on it.
sure
I checked code,I think this NFT is already supported,instead of NFT,we use XRC721,we check four func to make sure if it's XRC721,https://github.com/iotexproject/iotex-analytics/blob/master/indexprotocol/actions/xrc20.go#L321-L339 we record all the holders in the table xrc721_holders,tokenHolderAddresses api could get those holders from frontend
It's going to add api to insert contract address that is not xrc721 directly to table xrc721_holders,so that can record other kinds of token holder's info
#263 I tested the new XRC721 API, but couldn't get the data.
#263 I tested the new XRC721 API, but couldn't get the data.
I think there's no XRC721's data in mysql
Here's an XRC721 contract with some actions.
https://iotexscan.io/address/io1xpvzahnl4h46f9ea6u03ec2hkusrzu020th8xx
Here's an XRC721 contract with some actions. https://iotexscan.io/address/io1xpvzahnl4h46f9ea6u03ec2hkusrzu020th8xx
Analytics will check the following func to make sure it's xrc721: totalSupply,balanceOf,approve,ownerOf can you check the contract source code to make sure it's xrc721?
Here's an XRC721 contract with some actions. https://iotexscan.io/address/io1xpvzahnl4h46f9ea6u03ec2hkusrzu020th8xx
Analytics will check the following func to make sure it's xrc721: totalSupply,balanceOf,approve,ownerOf can you check the contract source code to make sure it's xrc721?
I checked the ABI for the contract, and all four func above are included.