Skip to main content

Questions tagged [onerc721received]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
64 views

ERC721 safeTransferFrom reverts with no message

I'm trying to build a NFT marketplace to learn solidty but i don't understand why my code doesn't work. Here's the relevant parts: // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0....
xx_VxR_xx's user avatar
0 votes
1 answer
133 views

How can I fix execution reverted: ERC721: approval to current owner?

My contract is returning me this error: execution reverted: ERC721: approval to current owner How can I fix this? //SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "hardhat/...
Mohamed Dhaanish's user avatar
0 votes
2 answers
234 views

Can "onERC721Received" be safely relied upon to reject unwanted ERC721 tokens?

I have a master contract (Contract A) which interacts with another contract (Contract B). Contract A has functions that use 'safeTransferFrom' to move tokens into Contract B, and there are some ...
dosdel's user avatar
  • 101
1 vote
1 answer
373 views

How does safeTransferFrom use the receive function on an ERC721 contract?

I have 2 contracts, contractA (an ERC721 contract) and contractB (a contract that inherits from IERC721Receiver). I am trying to transfer an nft(contractA) from the owner to contractB. Originally ...
Lance's user avatar
  • 111
0 votes
1 answer
307 views

reverting direct transfer with onERC721Received

Working on a NFT marketplace I want to disallow direct transfers, to only allow transfering through this contract's custom function createSale() Here is the way I came about: function ...
Torof's user avatar
  • 790