简体   繁体   中英

Proving ownership of a NFT collection minted on Opensea

I am trying to develop a token-gated website, users will need to connect their wallet and proof their ownership of a NFT collection.

Usually, this is fairly straightforward for a NFT collection with a contract address. We can simply do:

const contract = await new ethers.Contract(contractAddress, abi, provider);  
const balance = await contract.balanceOf(walletAddress);

However, in my case, the NFT collection is minted on Opensea, and the address is 0x495f947276749Ce646f68AC8c248420045cb7b5e . There will be whole lot of the other collection under this address. So, I am not sure it is possible to prove a user's ownership of a NFT collection minted on Opensea. I have read through Opensea API and also Opensea SDK , but found nothing.

It is possible by tracking the collection you want to, down to the "mint". Having said that and given that Opensea uses lazy minting (ie, the token is not minted until it's actually sold for the first time), it is indeed challenging.

A solution would be to track all the NFT history down to the first transaction and identify the address that actually transfers the NFT.

Here is an example:

https://etherscan.io/tx/0xc4d8ec0d8a841ec68ee1b83dbca127a6b5fcb42fffc2d478d8863733ce28e310

This is the first transaction of this particular NFT. The address that transfers the NFT (0x55c8423f6247be9a523effa5423f680c2777206e) is actually the creator/owner of the collection.

You can also see the full history here:

https://openstory.io/nfts/0x495f947276749ce646f68ac8c248420045cb7b5e/0x55c8423f6247be9a523effa5423f680c2777206e000000000000390000000001

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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