# ERC1155MetadataExtension imports IERC1155

**URL:** <https://forum.openzeppelin.com/t/erc1155metadataextension-imports-ierc1155/34564>\
**Category:** Contracts\
**Tags:** erc1155\
**Created:** [February 5, 2023, 7:19pm UTC](https://forum.openzeppelin.com/t/erc1155metadataextension-imports-ierc1155/34564 "2023-02-05T19:19:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssolson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ssolson/32/15452_2.png) [@ssolson](https://forum.openzeppelin.com/u/ssolson)\
**Post date:** [February 5, 2023, 7:19pm UTC](https://forum.openzeppelin.com/t/erc1155metadataextension-imports-ierc1155/34564/1 "2023-02-05T19:19:04Z")

</div>

The [ERC1155 contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol) imports two interfaces:  
IERC1155, IERC1155MetadataURI.

However, [IERC1155MetadataURI](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol) also inherits IERC1155.

This seems redundant and unnecessary. It caused me a bit of trouble trying to figure out where IERC1155 was being pulled in from @openzepplin/contracts in a modified ERC1155 I was making.

Is there a reason this design choice was made that I am missing?

---

<div class="post-metadata">

**Author:** ![Amxx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/amxx/32/668_2.png) [@Amxx](https://forum.openzeppelin.com/u/Amxx)\
**Post date:** [February 7, 2023, 2:50pm UTC](https://forum.openzeppelin.com/t/erc1155metadataextension-imports-ierc1155/34564/2 "2023-02-07T14:50:12Z")

</div>

Hello @ssolson

We make `IERC1155MetadataURI` inherit `IERC1155` because we believe it doesn't make sens for a contract to implement the metadata without also implementing the base ERC. This also means that if you write a contract `A` that know another contract `B` and that call function from both interfaces on `B`, you don't need to cast `B`

```plaintext
contract A {
    IERC1155MetadataURI public B;

    function someFunction() external {
        // here you can call b.uri(...) but also b.balanceOf(...);
    }
}

```

Then there is the question of "why does ERC1155 inherit both?". It definitely doesn't need to. Inheriting `IERC1155MetadataURI` would be enough. Yet we find it clearer to explicitly specific the inheritance. We don't expect it to cause any issue.

---

<div class="post-metadata">

**Author:** ![ssolson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ssolson/32/15452_2.png) [@ssolson](https://forum.openzeppelin.com/u/ssolson)\
**Post date:** [February 8, 2023, 6:46pm UTC](https://forum.openzeppelin.com/t/erc1155metadataextension-imports-ierc1155/34564/3 "2023-02-08T18:46:26Z")

</div>

Thanks Amxx for explaining the design thought to me.

I am probably an edge case but for my purpose, it caused a bit of an issue and was very unclear.

I did not expect that the ERC1155 interface was inherited twice and it took me quite a long time to figure out where IERC1155 was coming from.

If you are interested I needed to modify the location of the events to work with Alejandro Santander's static router design.

[![](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/3X/1/1/119251305556b1e024832fb7fae333dc696505e6.jpeg "Alice in Proxyland") ](https://www.youtube.com/watch?v=URxPvAaT7vE)
