Hot answers tagged

3 votes

How do smart contracts keep track of what eth address controls an NFT

From what I catch in your question, you would like to get the list of owners of an NFT contract. Trying to query this information manually is challenging and takes a lot of resources and time. I ...
3 votes

How to find total value in ETH of all NFTs owned by a user

If you like to get the user's NFT portfolio value, then you can use Moralis to provide you with such data. Simply sign up to Moralis to get the API key and install the SDK: npm install moralis Then, ...
2 votes

what this error and how to solve it with metamask wallet?

There seems to be an error with the smart contract. Please post your code so that we can have a closer look, the error is not very explicit.
2 votes
Accepted

When someone sends me a erc721, does my wallet actually receiving it?

Yes, the same happens with the ERC721, you simply become the owner of that NFT in the contract. As you can see in the contract below from OpenZeppelin, the transferFrom() function calls _transfer(). ...
1 vote
Accepted

How to solve this error?

The sender for this function in the NFT contract will be the contract through which you are calling the function. Is your contract owner of the tokens, if not then please share the contract. If no ...
1 vote
Accepted

Is it possible to track marketplace sales for an ERC721?

Here is an example code on how you can track NFT transfer events on a smart contract using Moralis streams API. import Moralis from "moralis"; const addStream = async () => { if (!...
1 vote

What is an NFT collection?

NFTs are smart contracts that follow the ERC721 standard. NFT smart contracts are fully on chain, however they may or may not point to an off-chain URI. The URI is the variable that points to the NFT ...
1 vote

How to get basic NFT transaction details?

Moralis API might help you in your case. It has an API endpoint to get the NFT contract transfers which can provide you with the transfers happened on a smart contract and also an endpoint to get the ...
1 vote

How to make NFT data fetching tools on EVM blockchain like the Moralis?

Developer advocate from Chainstack here. TL, DR: You need to index the data by yourself, which requires re-executing many historical transactions. Essentially all NFT ownership data and Metadata are ...
1 vote

ERC1155 and ERC1155UriStorage Question

If you want to use ERC1155URIStorage, it is already inheriting from ERC1155, so you do not need to inherit both in your contract. Just inherit from ERC1155URIStorage and you get what you need. Your ...
  • 328
1 vote
Accepted

Fetching chain data to to website

for simplicity, use web3js to track these data. It is difficult to ensure data from database will be up to date. For advance use case, create a program to monitor the block head and when detect token ...
  • 26
1 vote
Accepted

How do i prevent users from selling NFTs they earned from my platform to any external marketplaces like openSea

I see 3 possible options depending what fits best current and future use cases for your contract: contract XXX is ERC721, Ownable {} 1- You can override the _safeTransferFrom function to include an ...
  • 26
1 vote

How do i prevent users from selling NFTs they earned from my platform to any external marketplaces like openSea

Yeah just disable the transfer functions. If you are using the openzeppelin then you can do something like this Just add this code and transfer functions will always revert. Even if you are not using ...
1 vote
Accepted

Does Moralis "Get NFTs by Wallet" API support ERC-1155?

Yes, it does support ERC1155 NFT, so all ERC1155 and ERC721, including non-standard NFT (e.g. Cryptopunk) will be fetched and indexed with this API. Hope this helps~

Only top scored, non community-wiki answers of a minimum length are eligible