Questions tagged [onerc721received]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 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
151 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
318 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
178 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
  • 551