For anyone who has worked with Open Zepp's ERC1155 and ERC155UriStorage. Both of them have a _setURI function and a uri function (returns the token uri). 2 questions when using both of these contracts together...

1.)When using both is it..... contract NFTContract is ERC1155URIStorage, ERC1155 {} In other words do you list both like this?

2.)How do I ensure the _setURI and uri functions are being called on the ERC1155URIstorage contract and not the ERC1155? Just make the one i want to override (ERC155) virtual and label the the contract I want to use for these functions (ERC155URIStrorage) with override? Do I also have to reference the ERC1155URIStorage in this _setURI function when doing so or is the "override" enough?

Or do i have it all wrong? This is very possible too.

1 Answer 1


If you want to use ERC1155URIStorage, it is already inheriting from ERC1155, so you do not need to inherit both in your contract. Just inherit from ERC1155URIStorage and you get what you need. Your inheritance chain would look like NFTContract -> ERC1155URIStorage -> ERC1155, therefore, you are indirectly inheriting from ERC1155.

For Your function calls, they go up the chain and access the first function signature that exists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.