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

uint256 totalSupply

The total number of IP assets registered in the protocol.

treasury

address treasury

The address of the treasury that receives registration fees.

feeToken

address feeToken

The address of the token used to pay registration fees.

feeAmount

uint96 feeAmount

The amount of the registration fee.

Functions

initialize

function initialize(address accessManager) public initializer

Initializes the IPAssetRegistry contract.

Parameters:

  • accessManager: The address of the access manager.

register

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

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

function upgradeIPAccountImpl(address newIpAccountImpl) external restricted

Upgrades the IP account implementation.

Parameters:

  • newIpAccountImpl: The address of the new IP account implementation.

ipId

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

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

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

function getTreasury() external view returns (address)

Retrieves the treasury address for IP assets.

Returns:

  • treasury: The address of the treasury.

getFeeToken

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

function getFeeAmount() external view returns (uint96)

Retrieves the registration fee amount for IP assets.

Returns:

  • feeAmount: The amount of the fee.