New answers tagged

0 votes

How to create and send Flashbot bsc?

As of writing (May 2022), geth-fb miners and the Flashbot rpc endpoint are only available on Ethereum mainnet and Goerli testnet (https://docs.flashbots.net/flashbots-auction/searchers/quick-start)
user avatar
0 votes

Get an NFT's last sale price

Sales are not part of ERC721, you may tap on OpenSea's transaction events and read auction bids along with transfers. Look at here, OpenSea's contract events.
user avatar
  • 1,166
0 votes

How to mint nft with ERC721A using tokenuri or uri (string) as in URI-Storage?

Unfortunately, ERC721A only allows you to batch mint NFT IDs to a single recipient address. If you have multiple recipients, then you will have to use a for loop and call _safeMint to each and every ...
user avatar
0 votes

ERC1155 Deficiencies

The gas savings with 1155 come from not keeping track of an additional variable which in 721 is accessible through 'balanceOf'. If you were trying to adapt 1155 to make it non-fungible, like 721 (if ...
user avatar
  • 849
0 votes

Tracking token ownership off chain?

That's easy, you're the owner, you're the custodian. If you would like to track the beneficial owner, you can use Excel, PHP, or any other technology you would like to record who you think should own ...
user avatar
0 votes

Function that returns address if is passed or msg.sender

if user don't passed any address while calling your solidity function, web3/ether js/py will give Error: invalid address. there is no optional parameters in solidity. means user have to pass it.
user avatar
0 votes

Why do I keep receiving this error? "revert ERC721: transfer caller is not owner nor approved"

If you are reselling an nft, you should satisfy those conditiions: // if the owner of the token is the sender of the transaction require(ERC721.ownerOf(tokenId)==msg.sender,"You are not the owner ...
user avatar
  • 475
-1 votes

How to create and send Flashbot bsc?

You could try to do this: const PRIVATE_KEY_EXECUTOR = process.env.PRIVATE_KEY_EXECUTOR || "XXXXXX" const PRIVATE_KEY_SPONSOR = process.env.PRIVATE_KEY_SPONSOR || "XXXXXX" const ...
user avatar
  • 1
0 votes

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

It depends on the contract implementation. How the developer keep track of the owner: This is one way you can implement mapping(address=>mapping(uint=>uint)) private _ownedTokens; this mapping ...
user avatar
  • 475
0 votes

What does ERC721URIStorage actually mean?

Usually, metadata is not stored directly on chain. There has to be a link (tokenURI) in your contract pointing to that external metadata. ERC721URIStorage extension provides storage for token URIs ...
user avatar
  • 475
1 vote

How ERC721URIStorage is abstract even though all the functions are implemented?

From the v0.8.13 Solidity Docs on Abstract Contracts (emphasis added): Contracts need to be marked as abstract when at least one of their functions is not implemented. Contracts may be marked as ...
user avatar
1 vote
Accepted

useContractCall in a loop from React

Looks I solved the issue by myself by using the useCalls function from useDapp instead of useContractCall. First I get the number of ERC721 tokens the user has in his balance : const [userBalance]:...
user avatar
  • 11
1 vote

in OpenZeppelin's ERC721 why are tokenapprovals more restrictive that operatorApprovals

_tokenapprovals is related to the function approve andapprove is an approval specific to a tokenID but _operatorApprovals is related to the function setApprovalForAll and setApprovalForAll is for all ...
user avatar
4 votes

if I add a parameter in a ERC721's mint function, is it still ERC721?

Minting functions are (contrary to popular belief) not part of the ERC-721 standard. See this specific text in the specification - Creation of NFTs (“minting”) and destruction of NFTs (“burning”) is ...
user avatar
  • 192
0 votes

How to mint when using the ERC721A contract (address, tokenid)?

No, from their docs: "Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..)." See https://github.com/chiru-labs/ERC721A/blob/main/contracts/...
user avatar
0 votes

"TypeError: Cannot read property 'sendTransaction' of null" error when deploying to Ropsten testnet using hardhat

I had this issue because I was using multiple signers: const [deployer, account, ...] = await ethers.getSigners(); for testing on localhost, but I only added 1 private key when deploying to the ...
user avatar
  • 15
0 votes

NFT Sent to Smart Contract

I don't think that you can. But that would have reverted if you would have used the safeTransferFrom function as this contract doesn't appear to implement the IERC721Receiver. Did you used ...
user avatar
  • 124
0 votes

ERC-721 collection image

I'm not sure you want to ask about the entire collection's images, or each nft's image. So I will try to answer both. For entire collection's image, when you listing your token on a marketplace, the ...
user avatar
0 votes

How to create a dynamic NFT?

usually, ERC721 contract does not keep track the most token's properties on-chain! Update data on chain is expensive! The token's metadata in fact is usually stored in a separate hosting server (or ...
user avatar
0 votes

How can I deploy my smart contract with someone else's wallet?

Have the developer teach you how to deploy. If they developer deploys using their wallet then now or later, that developer will be able to claim they are the "owner" of the contract and ...
user avatar
0 votes

Non transferrable ERC721 token?

Update the _beforeTokenTransfer function to include a modifier. internal whenNotPaused onlyRole(MINTER_ROLE) override { super._beforeTokenTransfer(from, to, ...
user avatar
1 vote

Merging two NFTs together

Yes. Nobody stops you from implementing that.
user avatar
1 vote

How to buy NFTs from my smart contract with custom ERC20 token?

You must change the mint function. If it is callable by the end user, why would you want it to take as a parameter _tokenamount? You only need to know the amount of NFT tokens the user would like to ...
user avatar
0 votes

How to use ERC721URIStorage and ERC721Royalty together (requires override)

pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/...
user avatar
0 votes

Token id 0 minted error

You must to put the expression _tokenIdCounter.increment() into your smart contract constructor and when you'll call _mintLoop() function for the first time, the counter will start from 1. You can see ...
user avatar
  • 1,165
2 votes

Why ERC721 does not have direct transfer function?

We did not include a transfer function because it may be ambiguous whether you mean to transfer something that you are the owner of versus something you are authorize to get. The current owner must ...
user avatar
1 vote
Accepted

Is it possible to view the source code of dependencies of a contract in Etherscan?

If you scroll down the page about etherscan, you can see the code about all file that include this smart contract. ERC721A.sol IMerkle.sol IClaimMerkle.sol
user avatar
  • 1,165
0 votes

Contract A delegatecall function in contract B which calls function in contract c. msg.sender for function in contract c?

The msg.sender according to the test scenario below is Contract A The Change to state happens in Contract A and Contract C For me it make sense because contract B has nothing to do with the ...
user avatar
  • 2,248
0 votes

ERC721 is being minted to null address

I think your problem is here, the firstMinter is still haven't own the NFT yet before deployed tokenID 1, so the firstOwner is null. assert.equal(firstMinter, firstOwner, "Error: First Minter ...
user avatar
0 votes

Should I use totalSupply() or a custom counter for ERC-721 token id?

The difference between the higher and lower gas fee contracts was the use of OpenZeppelin’s ERC721Enumerable. This contract is an extension of the ERC721 standard, with a handful of additional ...
user avatar

Top 50 recent answers are included