What are the benefits of ERC721Holder.sol?

@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

1 Like

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?

1 Like

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.

1 Like