setMetadataOf
Contract: JBProjects
Interface: IJBProjects
- Step by step
 - Code
 - Events
 - Bug bounty
 
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:
_projectIdis the ID of the project who's metadata is being changed._metadatais the struct containing metadata content, and domain within which the metadata applies.
 - Through the 
requirePermissionmodifier, the function is only accessible by the project's owner, or from an operator that has been given theJBOperations.SET_METADATApermission by the project owner for the provided_projectId. - The function overrides a function definition from the 
IJBProjectsinterface. - The function doesn't return anything.
 
Bodyβ
- 
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:
 - 
Emit a
SetMetadataCidevent with the relevant parameters.emit SetMetadata(_projectId, _metadata, msg.sender);Event references:
 
/**
  @notice
  Allows a project owner to set the project's metadata content for a particular domain namespace.
  @dev
  Only a project's owner or operator can set its metadata.
  @dev
  Applications can use the domain namespace as they wish.
  @param _projectId The ID of the project who's metadata is being changed.
  @param _metadata A struct containing metadata content, and domain within which the metadata applies.
*/
function setMetadataOf(uint256 _projectId, JBProjectMetadata calldata _metadata)
  external
  override
  requirePermission(ownerOf(_projectId), _projectId, JBOperations.SET_METADATA)
{
  // Set the project's new metadata content within the specified domain.
  metadataContentOf[_projectId][_metadata.domain] = _metadata.content;
  emit SetMetadata(_projectId, _metadata, msg.sender);
}
| Name | Data | 
|---|---|
SetMetadata | 
  | 
| Category | Description | Reward | 
|---|---|---|
| Optimization | Help make this operation more efficient. | 0.5ETH | 
| Low severity | Identify a vulnerability in this operation that could lead to an inconvenience for a user of the protocol or for a protocol developer. | 1ETH | 
| High severity | Identify a vulnerability in this operation that could lead to data corruption or loss of funds. | 5+ETH |