I'm creating a web3.0 project where I need to know if the user has a specific token in their wallet to provide access to content.
The collection was created in opensea, was lazy minted, and the contract is ERC-1155 provided by opensea.
My question is, based on Opensea is the owner of the contract, how can I determine if the asset hold for the customer is the one in the collection?
Ask the customer to verify their wallet using Sign in with Ethereum
After you have verified the address of the customer wallet, you can use this address to query NFTs under it using web3.js and NFT ABIs
ERC-1155 ABIs are available in several Github repositories
You need an Ethreum node you can trust to give you a correct answer for proof of ownership queries
You can determine if a wallet holds an NFT or not using Moralis NFT API.
Here is an example step-by-step: https://docs.moralis.io/web3-data-api/evm/how-to-get-all-nfts-owned-by-an-address .
Also here is a guide on how to build a protected webpage that only an owner of an NFT can access: https://docs.moralis.io/example-dapps/evm/token-gating-website-nextjs .
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.