LicensingModule
The Licensing Module is the main entry point for the licensing system on Story. It is responsible for:
- Attaching license terms to IP assets
- Minting license tokens
- Registering derivatives
State Variables
name
Returns the name of the module.
ROYALTY_MODULE
Returns the canonical protocol-wide RoyaltyModule.
LICENSE_REGISTRY
Returns the canonical protocol-wide LicenseRegistry.
DISPUTE_MODULE
Returns the protocol-wide dispute module.
LICENSE_NFT
Returns the License NFT.
MODULE_REGISTRY
Returns the protocol-wide ModuleRegistry.
IP_GRAPH_ACL
Returns the protocol-wide IP Graph Access Control List.
Functions
initialize
Initializer for this implementation contract.
Parameters:
accessManager
: The address of the protocol admin roles contract.
attachDefaultLicenseTerms
Attaches the default license terms to an IP.
Parameters:
ipId
: The IP ID to attach default license terms to.
attachLicenseTerms
Attaches specific license terms to an IP. The function must be called by the IP owner or an authorized operator.
Parameters:
ipId
: The IP ID.licenseTemplate
: The address of the license template.licenseTermsId
: The ID of the license terms.
mintLicenseTokens
Mints license tokens for the license terms attached to an IP. The license tokens are minted to the receiver.
The license terms must be attached to the IP before calling this function, but it can mint license tokens of default license terms without explicitly attaching them, since they are attached to all IPs by default.
IP owners can mint license tokens for their IPs for arbitrary license terms without attaching the license terms to the IP.
It might require the caller to pay a minting fee, depending on the license terms or as configured by the IP owner. The minting fee is paid in the minting fee token specified in the license terms or configured by the IP owner.
Parameters:
licensorIpId
: The licensor IP ID.licenseTemplate
: The address of the license template.licenseTermsId
: The ID of the license terms within the license template.amount
: The amount of license tokens to mint.receiver
: The address of the receiver.royaltyContext
: The context of the royalty.maxMintingFee
: The maximum minting fee that the caller is willing to pay. If set to 0, then no limit.maxRevenueShare
: The maximum revenue share percentage allowed for minting the License Tokens.
Returns:
startLicenseTokenId
: The start ID of the minted license tokens.
registerDerivative
Registers a derivative directly with parent IP’s license terms, without needing license tokens, and attaches the license terms of the parent IPs to the derivative IP.
The license terms must be attached to the parent IP before calling this function. All IPs have default license terms attached by default.
The derivative IP owner must be the caller or an authorized operator.
Parameters:
childIpId
: The derivative IP ID.parentIpIds
: The parent IP IDs.licenseTermsIds
: The IDs of the license terms that the parent IP supports.licenseTemplate
: The address of the license template of the license terms IDs.royaltyContext
: The context of the royalty.maxMintingFee
: The maximum minting fee that the caller is willing to pay. If set to 0, then no limit.maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies.maxRevenueShare
: The maximum revenue share percentage allowed for minting the License Tokens.
registerDerivativeWithLicenseTokens
Registers a derivative with license tokens. The derivative IP is registered with license tokens minted from the parent IP’s license terms.
The license terms of the parent IPs issued with license tokens are attached to the derivative IP.
The caller must be the derivative IP owner or an authorized operator.
Parameters:
childIpId
: The derivative IP ID.licenseTokenIds
: The IDs of the license tokens.royaltyContext
: The context of the royalty.maxRts
: The maximum number of royalty tokens that can be distributed to the external royalty policies.
setLicensingConfig
Sets the licensing configuration for a specific license terms of an IP.
If both licenseTemplate and licenseTermsId are not specified, then the licensing config applies to all licenses of the given IP.
Parameters:
ipId
: The address of the IP for which the configuration is being set.licenseTemplate
: The address of the license template used. If not specified, the configuration applies to all licenses.licenseTermsId
: The ID of the license terms within the license template. If not specified, the configuration applies to all licenses.licensingConfig
: The licensing configuration for the license.
predictMintingLicenseFee
Pre-computes the minting license fee for the given IP and license terms.
This function can be used to calculate the minting license fee before minting license tokens.
Parameters:
licensorIpId
: The IP ID of the licensor.licenseTemplate
: The address of the license template.licenseTermsId
: The ID of the license terms.amount
: The amount of license tokens to mint.receiver
: The address of the receiver.royaltyContext
: The context of the royalty.
Returns:
currencyToken
: The address of the ERC20 token used for minting license fee.tokenAmount
: The amount of the currency token to be paid for minting license tokens.