LicenseRegistry
The LicenseRegistry manages the registration and tracking of License NFTs (LNFTs), which represent licenses granted by IP ID licensors to create derivative IPs. It provides functionality for managing license templates, license terms, and the relationships between parent and derivative IP assets.
State Variables
MAX_PARENTS
The maximum number of parent IPs a derivative IP can have.
MAX_ANCESTORS
The maximum number of ancestor IPs a derivative IP can have.
IP_GRAPH
The address of the IP Graph contract that tracks relationships between IPs.
GROUP_IP_ASSET_REGISTRY
The address of the Group IP Asset Registry contract.
LICENSING_MODULE
The address of the Licensing Module contract.
DISPUTE_MODULE
The address of the Dispute Module contract.
IP_GRAPH_ACL
The address of the IP Graph Access Control List contract.
EXPIRATION_TIME
The key used to store expiration time in IP Account storage.
Functions
initialize
Initializes the LicenseRegistry contract.
Parameters:
accessManager
: The address of the protocol admin roles contract.
setDefaultLicenseTerms
Sets the default license terms that are attached to all IPs by default.
Parameters:
newLicenseTemplate
: The address of the new default license template.newLicenseTermsId
: The ID of the new default license terms.
registerLicenseTemplate
Registers a new license template on Story.
Parameters:
licenseTemplate
: The address of the license template to register.
setLicensingConfigForLicense
Sets the minting license configuration for a specific license attached to a specific IP.
Parameters:
ipId
: The address of the IP for which the configuration is being set.licenseTemplate
: The address of the license template used.licenseTermsId
: The ID of the license terms within the license template.licensingConfig
: The configuration for minting the license.
attachLicenseTermsToIp
Attaches license terms to an IP.
Parameters:
ipId
: The address of the IP to which the license terms are attached.licenseTemplate
: The address of the license template.licenseTermsId
: The ID of the license terms.
registerDerivativeIp
Registers a derivative IP and its relationship to parent IPs.
Parameters:
childIpId
: The address of the derivative IP.parentIpIds
: An array of addresses of the parent IPs.licenseTemplate
: The address of the license template used.licenseTermsIds
: An array of IDs of the license terms.isUsingLicenseToken
: Whether the derivative IP is registered with license tokens.
initializeLicenseTemplate
Sets license template for an IP, if the IP has no license template set.
Parameters:
ipId
: The address of the IP to which the license template is attached.licenseTemplate
: The address of the license template.
verifyMintLicenseToken
Verifies the minting of a license token.
Parameters:
licensorIpId
: The address of the licensor IP.licenseTemplate
: The address of the license template where the license terms are defined.licenseTermsId
: The ID of the license terms will mint the license token.isMintedByIpOwner
: Whether the license token is minted by the IP owner.
Returns:
Licensing.LicensingConfig
: The configuration for minting the license.
verifyGroupAddIp
Verifies the group can add given IP.
Parameters:
groupId
: The address of the group.groupRewardPool
: The address of the reward pool of the group.ipId
: The address of the IP to be added to the group.groupLicenseTemplate
: The address of the license template attached to the group.groupLicenseTermsId
: The ID of the license terms attached to the group.
Returns:
ipLicensingConfig
: The configuration for license attached to the IP.
isRegisteredLicenseTemplate
Checks if a license template is registered.
Parameters:
licenseTemplate
: The address of the license template to check.
Returns:
bool
: Whether the license template is registered.
isDerivativeIp
Checks if an IP is a derivative IP.
Parameters:
childIpId
: The address of the IP to check.
Returns:
bool
: Whether the IP is a derivative IP.
hasDerivativeIps
Checks if an IP has derivative IPs.
Parameters:
parentIpId
: The address of the IP to check.
Returns:
bool
: Whether the IP has derivative IPs.
exists
Checks if license terms exist.
Parameters:
licenseTemplate
: The address of the license template where the license terms are defined.licenseTermsId
: The ID of the license terms.
Returns:
bool
: Whether the license terms exist.
hasIpAttachedLicenseTerms
Checks if an IP has attached any license terms.
Parameters:
ipId
: The address of the IP to check.licenseTemplate
: The address of the license template where the license terms are defined.licenseTermsId
: The ID of the license terms.
Returns:
bool
: Whether the IP has attached any license terms.
getAttachedLicenseTerms
Gets the attached license terms of an IP by its index.
Parameters:
ipId
: The address of the IP.index
: The index of the attached license terms within the array of all attached license terms of the IP.
Returns:
licenseTemplate
: The address of the license template where the license terms are defined.licenseTermsId
: The ID of the license terms.
getAttachedLicenseTermsCount
Gets the count of attached license terms of an IP.
Parameters:
ipId
: The address of the IP.
Returns:
uint256
: The count of attached license terms.
getDerivativeIp
Gets the derivative IP of an IP by its index.
Parameters:
parentIpId
: The address of the IP.index
: The index of the derivative IP within the array of all derivative IPs of the IP.
Returns:
childIpId
: The address of the derivative IP.
getDerivativeIpCount
Gets the count of derivative IPs of an IP.
Parameters:
parentIpId
: The address of the IP.
Returns:
uint256
: The count of derivative IPs.
getParentIp
Gets the parent IP of an IP by its index.
Parameters:
childIpId
: The address of the IP.index
: The index of the parent IP within the array of all parent IPs of the IP.
Returns:
parentIpId
: The address of the parent IP.
isParentIp
Checks if an IP is a parent of another IP.
Parameters:
parentIpId
: The address of the potential parent IP.childIpId
: The address of the potential child IP.
Returns:
bool
: Whether the IP is a parent of the other IP.
getParentIpCount
Gets the count of parent IPs.
Parameters:
childIpId
: The address of the child IP.
Returns:
uint256
: The count of parent IPs.
getAncestorsCount
Gets the count of ancestors IPs.
Parameters:
ipId
: The ID of IP asset.
Returns:
uint256
: The count of ancestor IPs.
getLicensingConfig
Retrieves the minting license configuration for a given license terms of the IP.
Parameters:
ipId
: The address of the IP.licenseTemplate
: The address of the license template where the license terms are defined.licenseTermsId
: The ID of the license terms.
Returns:
Licensing.LicensingConfig
: The configuration for minting the license.
getExpireTime
Gets the expiration time for an IP.
Parameters:
ipId
: The address of the IP.
Returns:
uint256
: The expiration time, 0 means never expired.
isExpiredNow
Checks if an IP is expired.
Parameters:
ipId
: The address of the IP.
Returns:
bool
: Whether the IP is expired.
getDefaultLicenseTerms
Returns the default license terms.
Returns:
licenseTemplate
: The address of the default license template.licenseTermsId
: The ID of the default license terms.
isDefaultLicense
Checks if the license terms are the default license terms.
Parameters:
licenseTemplate
: The address of the license template.licenseTermsId
: The ID of the license terms.
Returns:
bool
: Whether the license terms are the default license terms.
getParentLicenseTerms
Returns the license terms through which a child IP links to a parent IP.
Parameters:
childIpId
: The address of the child IP.parentIpId
: The address of the parent IP.
Returns:
licenseTemplate
: The address of the license template.licenseTermsId
: The ID of the license terms.
getRoyaltyPercent
Return the Royalty percentage of the license terms of the IP.
Parameters:
ipId
: The address of the IP.licenseTemplate
: The address of the license template where the license terms are defined.licenseTermsId
: The ID of the license terms.
Returns:
royaltyPercent
: The Royalty percentage 100% is 100_000_000.