Skip to main content

setMetadataOf

Contract: JBProjects

Interface: IJBProjects

Allows a project owner to set the project's metadata content for a particular domain namespace.

Only a project's owner or operator can set its metadata.

Applications can use the domain namespace as they wish.

Definition​

function setMetadataOf(uint256 _projectId, JBProjectMetadata calldata _metadata)
external
override
requirePermission(ownerOf(_projectId), _projectId, JBOperations.SET_METADATA) { ... }
  • Arguments:
    • _projectId is the ID of the project who's metadata is being changed.
    • _metadata is the struct containing metadata content, and domain within which the metadata applies.
  • Through the requirePermission modifier, the function is only accessible by the project's owner, or from an operator that has been given the JBOperations.SET_METADATA permission by the project owner for the provided _projectId.
  • The function overrides a function definition from the IJBProjects interface.
  • The function doesn't return anything.

Body​

  1. Store the project's new metadata content within the specified domain.

    // Set the project's new metadata content within the specified domain.
    metadataContentOf[_projectId][_metadata.domain] = _metadata.content;

    Internal references:

  2. Emit a SetMetadataCid event with the relevant parameters.

    emit SetMetadata(_projectId, _metadata, msg.sender);

    Event references: