> ## Documentation Index
> Fetch the complete documentation index at: https://docs.story.foundation/llms.txt
> Use this file to discover all available pages before exploring further.

# CoreMetadataModule

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

```solidity theme={null}
string public constant override name = CORE_METADATA_MODULE_KEY
```

Returns the name of the module.

## Functions

### initialize

```solidity theme={null}
function initialize(address accessManager) public initializer
```

Initializes the CoreMetadataModule contract.

**Parameters:**

* `accessManager`: The address of the protocol admin roles contract.

### name

```solidity theme={null}
function name() external pure override returns (string memory)
```

Returns the name of the module.

**Returns:**

* `string`: The name of the module.

### updateNftTokenURI

```solidity theme={null}
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

```solidity theme={null}
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

```solidity theme={null}
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

```solidity theme={null}
function freezeMetadata(address ipId) external verifyPermission(ipId)
```

Makes all metadata of the IP Asset immutable.

**Parameters:**

* `ipId`: The address of the IP asset.

### isMetadataFrozen

```solidity theme={null}
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

```solidity theme={null}
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.
