简体   繁体   English

证明在 Opensea 上铸造的 NFT 集合的所有权

[英]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.我正在尝试开发一个代币门控网站,用户需要连接他们的钱包并证明他们对 NFT 集合的所有权。

Usually, this is fairly straightforward for a NFT collection with a contract address.通常,对于具有合约地址的 NFT 集合来说,这相当简单。 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 .但是,在我的例子中,NFT 集合是在 Opensea 上铸造的,地址是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.因此,我不确定是否可以证明用户对 Opensea 上铸造的 NFT 集合的所有权。 I have read through Opensea API and also Opensea SDK , but found nothing.我已通读Opensea APIOpensea SDK ,但一无所获。

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.话虽如此,并且鉴于 Opensea 使用惰性铸造(即代币在第一次实际出售之前不会铸造),这确实具有挑战性。

A solution would be to track all the NFT history down to the first transaction and identify the address that actually transfers the NFT.一个解决方案是跟踪所有 NFT 历史直到第一笔交易,并确定实际转移 NFT 的地址。

Here is an example:这是一个例子:

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

This is the first transaction of this particular NFT.这是该特定 NFT 的第一笔交易。 The address that transfers the NFT (0x55c8423f6247be9a523effa5423f680c2777206e) is actually the creator/owner of the collection.转移 NFT 的地址(0x55c8423f6247be9a523effa5423f680c2777206e)实际上是集合的创建者/所有者。

You can also see the full history here:您还可以在此处查看完整的历史记录:

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

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

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