@naszam asked:
Hi @naszam,
ERC721Holder is a convenience contract to inherit if you have a contract that allows receiving (and hence holding an ERC721) when safeTransferFrom
is being used
See the Rationale section of the EIP for further details: https://eips.ethereum.org/EIPS/eip-721
Thanks! In my case, the contract won’t hold any NFTs, cause they will be minted by external accounts. So I don’t need to include it right?
Hi @naszam,
You shouldn’t inherit from ERC721Holder
as you don’t want to hold ERC721 tokens in your contract.
If you wanted to, you could implement IERC721Receiver
to reject any ERC721 transfers to your contract when made with safeTransferFrom
. The opposite of ERC721Holder.
Hi @abcoathup !
Sorry I'm a little confused by your answer above:
If you wanted to, you could implement
IERC721Receiver
to reject any ERC721 transfers
What I don't understand is why should I? I mean, if I don't implement erc721receiver, safeTransferFrom will revert anyway, won't it? So why bother, what is the advantage in explicitly implementing this interface?
Thank you in advance
You're right, it's not necessary to manually implement IERC721Receiver in order to reject ERC721 safeTransfer.