How to add public setURI on ERC1155?

Hi @Eibriel,

Welcome to the community :wave:

The OpenZeppelin Contracts ERC1155 implementation uses a single URI for the entire contract. See the following example: Create an ERC1155.

According to the EIP (see: https://eips.ethereum.org/EIPS/eip-1155#metadata):

  • Changes to the URI MUST emit the URI event if the change can be expressed with an event (i.e. it isn’t dynamic/programmatic).
  • An implementation MAY emit the URI event during a mint operation but it is NOT mandatory. An observer MAY fetch the metadata uri at mint time from the uri function if it was not emitted.
  • The uri function SHOULD be used to retrieve values if no event was emitted.
  • The uri function MUST return the same value as the latest event for an _id if it was emitted.

I interpret this as changing the uri for the contract would require emitting the event for each token ID. Though I recommend reading the EIP on this detail.

event URI(string _value, uint256 indexed _id);

Do you want to use a different uri per token ID?
Under what circumstances would you want to change the uri?