# What are the benefits of ERC721Holder.sol?

**URL:** <https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792>\
**Category:** Contracts\
**Created:** [May 5, 2020, 4:38am UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792 "2020-05-05T04:38:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [May 5, 2020, 4:38am UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/1 "2020-05-05T04:38:18Z")

</div>

@naszam asked:

> [@ERC721PresetMinterPauserAutoId mint() function and tokenId](https://forum.openzeppelin.com/t/erc721presetminterpauserautoid-mint-function-and-tokenid/2780/3):
>
> Thanks! I’ve asked because I was testing on Truffle. Anyway, now I’ve opted for the basic ERC721.sol with an autogenerated tokenId to keep track of. Also, what about ERC721Holder.sol? Benefits? Applications? (Should I open a new topic?) Thanks!

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [May 5, 2020, 7:03am UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/2 "2020-05-05T07:03:47Z")

</div>

Hi @naszam,

[ERC721Holder](https://docs.openzeppelin.com/contracts/3.x/api/token/erc721#ERC721Holder) is a convenience contract to inherit if you have a contract that allows receiving (and hence holding an ERC721) when [`safeTransferFrom`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.1/contracts/token/ERC721/IERC721.sol#L51) is being used

See the Rationale section of the EIP for further details: [https://eips.ethereum.org/EIPS/eip-721](https://eips.ethereum.org/EIPS/eip-721)

---

<div class="post-metadata">

**Author:** ![naszam](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/naszam/32/19397_2.png) [@naszam](https://forum.openzeppelin.com/u/naszam)\
**Post date:** [May 5, 2020, 10:54am UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/3 "2020-05-05T10:54:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [May 6, 2020, 4:50am UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/4 "2020-05-06T04:50:26Z")

</div>

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`](https://docs.openzeppelin.com/contracts/3.x/api/token/erc721#IERC721Receiver) to reject any ERC721 transfers to your contract when made with `safeTransferFrom`. The opposite of ERC721Holder.

---

<div class="post-metadata">

**Author:** ![Cosimo\_de\_Medici\_di](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cosimo_de_medici_di/32/10185_2.png) [@Cosimo\_de\_Medici\_di](https://forum.openzeppelin.com/u/Cosimo_de_Medici_di)\
**Post date:** [December 26, 2021, 11:42am UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/5 "2021-12-26T11:42:06Z")

</div>

Hi @abcoathup !

Sorry I'm a little confused by your answer above:

> If you wanted to, you could implement [`IERC721Receiver`](https://docs.openzeppelin.com/contracts/3.x/api/token/erc721#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

---

<div class="post-metadata">

**Author:** ![Cosimo\_de\_Medici\_di](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cosimo_de_medici_di/32/10185_2.png) [@Cosimo\_de\_Medici\_di](https://forum.openzeppelin.com/u/Cosimo_de_Medici_di)\
**Post date:** [January 5, 2022, 5:20pm UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/6 "2022-01-05T17:20:23Z")

</div>

@frangio help please 🙏 🙏

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [January 5, 2022, 7:54pm UTC](https://forum.openzeppelin.com/t/what-are-the-benefits-of-erc721holder-sol/2792/7 "2022-01-05T19:54:42Z")

</div>

> [@Cosimo\_de\_Medici\_di](#):
>
> if I don't implement erc721receiver, safeTransferFrom will revert anyway, won't it?

You're right, it's not necessary to manually implement IERC721Receiver in order to reject ERC721 safeTransfer.
