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
The total number of IP assets registered in the protocol.
treasury
The address of the treasury that receives registration fees.
feeToken
The address of the token used to pay registration fees.
feeAmount
The amount of the registration fee.
Functions
initialize
Initializes the IPAssetRegistry contract.
Parameters:
accessManager
: The address of the access manager.
register
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
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
Upgrades the IP account implementation.
Parameters:
newIpAccountImpl
: The address of the new IP account implementation.
ipId
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
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
Gets the total number of IP assets registered in the protocol.
Returns:
uint256
: The total number of IP assets registered.
getTreasury
Retrieves the treasury address for IP assets.
Returns:
treasury
: The address of the treasury.
getFeeToken
Retrieves the registration fee token for IP assets.
Returns:
feeToken
: The address of the token used to pay the fee.
getFeeAmount
Retrieves the registration fee amount for IP assets.
Returns:
feeAmount
: The amount of the fee.