Hot answers tagged

34 votes
Accepted

How to find all ERC721 compliant NFTs owned by an address? (Web3 JS)

In order to get all NFTs of a user, you need to have an indexed database where you save this data. Then you index all Transfer events of ERC721 contracts and eventually calculate the balances for ...
Filip's user avatar
  • 931
15 votes
Accepted

Updating ERC-721 Token's Metadata after it was Minted

Is it possible to somehow update an existing ERC-721 Token's MetaData after it was already minted? Yes. This is not disallowed by the standard and so you are free to do this. The official ...
William Entriken's user avatar
12 votes

ERC721 Token Transfers and Approvals

To summarize : approve(address to, uint256 tokenId) : By calling this method, the sender authorizes the address to to transfer one of his tokens with the Id tokenId. setApprovalForAll(address to, ...
clement's user avatar
  • 4,302
12 votes

Get a list of all token types for ERC1155

So the question was an underlying question while trying to understand how all these platforms like OpenSeas are identifying all of the minted tokens for standard ERC721 and ERC1155 contracts. It was ...
Stevers's user avatar
  • 362
12 votes

How to find all ERC721 compliant NFTs owned by an address? (Web3 JS)

Assuming opensea is aware of the tokens you could use their api also: https://api.opensea.io/api/v1/assets?owner=${address}
pguardiario's user avatar
11 votes

ERC721 NFT minting to accept custom ERC20 token as payment

You can edit the mint function require the user to transfer certain ERC-20 tokens in your mint function. You can define a price for the ERC-721 tokens in terms of the ERC-20 token, and perform a ...
pbsh's user avatar
  • 2,411
9 votes
Accepted

Can we mint 5 gigabyte video NFTs?

I'll come at this from a slightly different direction... The current price of ETH is ~$1500. The Yellow Paper states that storing a 256-bit (32-byte) word costs 20,000 gas. Average gas price is ...
Richard Horrocks's user avatar
8 votes

How can I get a list of all owners of an ERC1155 NFT by using a web3 call?

UPDATE: Now you can use the Moralis API /nft/{token_address}/owners endpoint to get this directly. This is quite difficult, as Anupam pointed out you would have to go through all the transfer events ...
Filip's user avatar
  • 931
8 votes
Accepted

How to properly implement a ContractURI for on-chain NFTs

It seems like my setContractURI function had one encodepacket too much. it looks like it is working now on OpenSea. function setContractURI(string memory contractURI_) public onlyOwner() { ...
Martijn Vissers's user avatar
7 votes

How to find all ERC721 compliant NFTs owned by an address? (Web3 JS)

No, web3 doesn't know about all ERC721 token contracts, which would be required to call ownerOf() for each NFT. What could be done: take a list of popular ERC721 contracts (like this one from Bloxy) ...
pwagner's user avatar
  • 890
7 votes
Accepted

Why are all NFTs created from Null Address on Opensea?

Because the standard says so. https://eips.ethereum.org/EIPS/eip-721 /// @dev This emits when ownership of any NFT changes by any mechanism. /// This event emits when NFTs are created (`from` == 0) ...
William Entriken's user avatar
7 votes
Accepted

Is there any way to upload to IPFS or Swarm from inside a smart contract?

It would be very useful for a number of use cases if a function in a contract could directly upload to IPFS, Swarm, or similar and retrieve the hash. It would be useful, but what you are asking is ...
Mikko Ohtamaa's user avatar
7 votes

Metamask - "Params specify an EIP-1559 transaction but the current network does not support EIP-1559"

According to a post here, the solution is surprisingly simple. One can switch back and forth between the Ethereum main network and another network such as Polygon or Avalanche, and then the issue just ...
Maxareo's user avatar
  • 653
7 votes
Accepted

Is reentrancy guard needed in ERC 721 minting process and why so?

TL;DR: _safeMint is not that safe. So ensure your mint process is safe. Take a look at the mint method here contract code, require(_mintAmount <= maxMint, "Cant mint more then maxmint" ); ...
Jimson James's user avatar
7 votes
Accepted

What should I write in token decimal while importing NFT in Metamask

NFTs have a decimals value of 0. Conceptually you cannot split a simple non-fungible token in half (think of sending half a painting to a buyer). Only natural values. Technically, we can read in the ...
razgraf's user avatar
  • 780
6 votes

Ethereum implementation of a non-fungible but divisible token? (ERC721 seems not to work for that)

The problem of this standard is that it would not allow multiple owners of a token because each token is not divisible. Is there possibly confusion between the idea of divisibility and fractional ...
Rob Hitchens's user avatar
6 votes

Two ERC721 tokens that refer to the same metadata

The ERC721 Metadata standard does not enforce uniqueness of the returned tokenURI. It is allowable for two 721 tokens to return the same metadata. Whether this is appropriate is up to you to decide ...
cousinit's user avatar
  • 311
6 votes
Accepted

What is Lazy Minting in Ethereum?

According to https://blog.openzeppelin.com/workshop-recap-building-an-nft-merkle-drop/ Lazy minting uses cryptographic primitives, the artist can sign “minting authorizations” that later allow a user ...
AlphaColo's user avatar
6 votes

How to find all ERC721 compliant NFTs owned by an address? (Web3 JS)

One thing worth checking out is if the NFT is ERC721Enumerable. This allows you to call the tokenOfOwnerByIndex function, which gives you to index through all the NFTs from the contract that the ...
Becrazy's user avatar
  • 86
6 votes

approve + safeTransferFrom ERC721 from existing smart contract

It looks like one of your function calls needs to be changed -let's look at the approveAndTransfer function from your contract: function approveAndTransfer(IERC721 nft, uint256 _tokenId, address _from,...
Linum Labs's user avatar
  • 1,438
6 votes

How can I make an ERC721 NFT such that the token owner can edit an attribute in the metadata? Where can they edit the metadata?

To my knowledge, none of the marketplaces have this functionality of the owner being able to edit the metadata. But with that being said, there is nothing stopping you from including this ...
Filip's user avatar
  • 931
6 votes

Is there any way to upload to IPFS or Swarm from inside a smart contract?

The Ethereum blockchain is an entirely separate system from IPFS, it does not understand what IPFS is or what it does. In most DApps, what usually happens is that the file is uploaded to IPFS via the ...
Ahmed Ihsan Tawfeeq's user avatar
6 votes

Metamask - "Params specify an EIP-1559 transaction but the current network does not support EIP-1559"

I was also struggling with this previously. This error occurs with users using MetaMask with Ledger/Trezor. It appears that more recent versions of web3js is requiring MetaMask to strictly send txs as ...
John Doe's user avatar
  • 133
6 votes
Accepted

VoidSigner cannot sign transactions

In here the signer for any method called to the contract should be the signer object instead of its address. Your code: try { const creatorEtherBalanceBeforeClaim = await signer.getBalance() ...
liorcito's user avatar
5 votes

Updating ERC-721 Token's Metadata after it was Minted

I created an NFT, listed it on OpenSea testnet. TestNFT The NFT had a link to a json metadata file. After a few minutes, I edited the json metadata file, and then hit the refresh metadata button on ...
John Cochran's user avatar
5 votes

How to show erc721 NFT card images in compatible wallets?

Just create a JSON file following the "ERC721 Metadata JSON Schema" specified at https://eips.ethereum.org/EIPS/eip-721 Here is one simple example that meets the specification: { "...
William Entriken's user avatar
5 votes
Accepted

How to extract the URL of a crypto art as it appears within the NFT? and technical details like ERC-token type?

I can't find that particular piece in their contracts, but the below applies to the 2 of 10 edition. How can I view the URL link to the associated image file as it appears within the metadata/code of ...
Richard Horrocks's user avatar
5 votes

Get a list of all token types for ERC1155

The common way to know the number of token types (aka. tokenId) is to have a counter inside the ERC1155 contract, for instance: uint256 private _currentTokenID = 0; This way, whenever you need to ...
Sergi Juanati's user avatar
5 votes
Accepted

View all NFTs owned by specific Ethereum wallet

The smart contract ABI and code are public on Ethereum net. You could find the NFT contract that you want to retrieve info (https://etherscan.io/) and call the public functions on it... Hope it helps
JTCon's user avatar
  • 703
5 votes
Accepted

Is there ERC721 decimals?

According to several formal implementations, ERC721 is not supposed to a divisible token by itself. Although, you can deploy an ERC721 through an ERC20 and distribute its shares using the fungible ...
Anupam's user avatar
  • 572

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