The CoreMetadataModule manages the core metadata for IP assets within Story. It allows setting and updating metadata attributes for IP assets, with the ability to freeze metadata to prevent further changes.

State Variables

name

string public constant override name = CORE_METADATA_MODULE_KEY

Returns the name of the module.

Functions

initialize

function initialize(address accessManager) public initializer

Initializes the CoreMetadataModule contract.

Parameters:

  • accessManager: The address of the protocol admin roles contract.

name

function name() external pure override returns (string memory)

Returns the name of the module.

Returns:

  • string: The name of the module.

updateNftTokenURI

function updateNftTokenURI(address ipId, bytes32 nftMetadataHash) external verifyPermission(ipId)

Update the nftTokenURI for an IP asset by retrieving the latest TokenURI from the IP NFT to which the IP Asset is bound.

Parameters:

  • ipId: The address of the IP asset.
  • nftMetadataHash: A bytes32 hash representing the metadata of the NFT. This metadata is associated with the IP Asset and is accessible via the NFT’s TokenURI. Use bytes32(0) to indicate that the metadata is not available.

setMetadataURI

function setMetadataURI(
    address ipId,
    string memory metadataURI,
    bytes32 metadataHash
) external verifyPermission(ipId)

Sets the metadataURI for an IP asset.

Parameters:

  • ipId: The address of the IP asset.
  • metadataURI: The metadataURI to set for the IP asset.
  • metadataHash: The hash of metadata at metadataURI. Use bytes32(0) to indicate that the metadata is not available.

setAll

function setAll(
    address ipId,
    string memory metadataURI,
    bytes32 metadataHash,
    bytes32 nftMetadataHash
) external verifyPermission(ipId)

Sets all core metadata for an IP asset.

Parameters:

  • ipId: The address of the IP asset.
  • metadataURI: The metadataURI to set for the IP asset.
  • metadataHash: The hash of metadata at metadataURI. Use bytes32(0) to indicate that the metadata is not available.
  • nftMetadataHash: A bytes32 hash representing the metadata of the NFT. This metadata is associated with the IP Asset and is accessible via the NFT’s TokenURI. Use bytes32(0) to indicate that the metadata is not available.

freezeMetadata

function freezeMetadata(address ipId) external verifyPermission(ipId)

Makes all metadata of the IP Asset immutable.

Parameters:

  • ipId: The address of the IP asset.

isMetadataFrozen

function isMetadataFrozen(address ipId) external view returns (bool)

Checks if the metadata of the IP Asset is immutable.

Parameters:

  • ipId: The address of the IP asset.

Returns:

  • bool: True if the metadata is frozen, false otherwise.

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual override(BaseModule, IERC165) returns (bool)

Implements the IERC165 interface.

Parameters:

  • interfaceId: The interface identifier.

Returns:

  • bool: True if the contract supports the interface, false otherwise.