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?
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
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.