> ## 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.

# IPAssetRegistry

The IPAssetRegistry acts as the source of truth for all IP registered on Story. An IP is identified by its contract address, token id, and chain id, meaning any NFT may be conceptualized as an IP. Once an IP is registered into the protocol, a corresponding IP asset is generated, which references an IP resolver for metadata attribution and an IP account for protocol authorization.

## State Variables

### totalSupply

```solidity theme={null}
uint256 totalSupply
```

The total number of IP assets registered in the protocol.

### treasury

```solidity theme={null}
address treasury
```

The address of the treasury that receives registration fees.

### feeToken

```solidity theme={null}
address feeToken
```

The address of the token used to pay registration fees.

### feeAmount

```solidity theme={null}
uint96 feeAmount
```

The amount of the registration fee.

## Functions

### initialize

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

Initializes the IPAssetRegistry contract.

**Parameters:**

* `accessManager`: The address of the access manager.

### register

```solidity theme={null}
function register(
    uint256 chainid,
    address tokenContract,
    uint256 tokenId
) external whenNotPaused returns (address id)
```

Registers an NFT as an IP asset and creates an IP account for it. If the IP was already registered, returns the IP address.

**Parameters:**

* `chainid`: The chain identifier of where the IP NFT resides.
* `tokenContract`: The address of the NFT.
* `tokenId`: The token identifier of the NFT.

**Returns:**

* `id`: The address of the newly registered IP.

### setRegistrationFee

```solidity theme={null}
function setRegistrationFee(address treasury, address feeToken, uint96 feeAmount) external restricted
```

Sets the registration fee for IP assets.

**Parameters:**

* `treasury`: The address of the treasury that will receive the fee.
* `feeToken`: The address of the token used to pay the fee.
* `feeAmount`: The amount of the fee.

### upgradeIPAccountImpl

```solidity theme={null}
function upgradeIPAccountImpl(address newIpAccountImpl) external restricted
```

Upgrades the IP account implementation.

**Parameters:**

* `newIpAccountImpl`: The address of the new IP account implementation.

### ipId

```solidity theme={null}
function ipId(uint256 chainId, address tokenContract, uint256 tokenId) public view returns (address)
```

Gets the canonical IP identifier associated with an IP NFT. This is equivalent to the address of its bound IP account.

**Parameters:**

* `chainId`: The chain identifier of where the IP resides.
* `tokenContract`: The address of the IP.
* `tokenId`: The token identifier of the IP.

**Returns:**

* `ipId`: The IP's canonical address identifier.

### isRegistered

```solidity theme={null}
function isRegistered(address id) external view returns (bool)
```

Checks whether an IP was registered based on its ID.

**Parameters:**

* `id`: The canonical identifier for the IP.

**Returns:**

* `isRegistered`: Whether the IP was registered into the protocol.

### totalSupply

```solidity theme={null}
function totalSupply() external view returns (uint256)
```

Gets the total number of IP assets registered in the protocol.

**Returns:**

* `uint256`: The total number of IP assets registered.

### getTreasury

```solidity theme={null}
function getTreasury() external view returns (address)
```

Retrieves the treasury address for IP assets.

**Returns:**

* `treasury`: The address of the treasury.

### getFeeToken

```solidity theme={null}
function getFeeToken() external view returns (address)
```

Retrieves the registration fee token for IP assets.

**Returns:**

* `feeToken`: The address of the token used to pay the fee.

### getFeeAmount

```solidity theme={null}
function getFeeAmount() external view returns (uint96)
```

Retrieves the registration fee amount for IP assets.

**Returns:**

* `feeAmount`: The amount of the fee.
