function registerPolicyFrameworkManager(address manager) external
Registers a policy framework manager into the contract, so it can add policy data for licenses.
Parameters
Name
Type
Description
manager
address
the address of the manager. Will be ERC165 checked for IPolicyFrameworkManager
registerPolicy
function registerPolicy(struct Licensing.Policy pol) external returns (uint256 policyId)
Registers a policy into the contract. MUST be called by a registered framework or it will revert.
The policy data and its integrity must be verified by the policy framework manager.
Parameters
Name
Type
Description
pol
struct Licensing.Policy
The Licensing policy data. MUST have same policy framework as the caller address
Return Values
Name
Type
Description
policyId
uint256
The id of the newly registered policy
addPolicyToIp
function addPolicyToIp(address ipId, uint256 polId) external returns (uint256 indexOnIpId)
Adds a policy to the set of policies of an IP. Reverts if policy is undefined in LicenseRegistry.
Mints a license to create derivative IP. License NFTs represent a policy granted by IPs (licensors).
Reverts if caller is not authorized by any of the licensors.
This NFT needs to be burned in order to link a derivative IP with its parents. If this is the first
combination of policy and licensors, a new licenseId will be created (by incrementing prev totalLicenses).
If not, the license is fungible and an id will be reused. The licensing terms that regulate creating new
licenses will be verified to allow minting.
Parameters
Name
Type
Description
policyId
uint256
The id of the policy with the licensing parameters
licensorIpId
address
The id of the licensor IP
amount
uint256
The amount of licenses to mint
receiver
address
The address that will receive the license
royaltyContext
bytes
The context for the royalty module to process
Return Values
Name
Type
Description
licenseId
uint256
The ID of the license NFT(s)
linkIpToParents
function linkIpToParents(uint256[] licenseIds, address childIpId, bytes royaltyContext) external
Links an IP to the licensors listed in the license NFTs, if their policies allow it. Burns the license
NFTs in the proccess. The caller must be the owner of the IP asset and license NFTs.
Parameters
Name
Type
Description
licenseIds
uint256[]
The id of the licenses to burn
childIpId
address
The id of the child IP to be linked
royaltyContext
bytes
The context for the royalty module to process
isFrameworkRegistered
function isFrameworkRegistered(address policyFramework) external view returns (bool)
Returns if the framework address is registered in the LicensingModule.
Parameters
Name
Type
Description
policyFramework
address
The address of the policy framework manager
Return Values
Name
Type
Description
[0]
bool
isRegistered True if the framework is registered
totalPolicies
function totalPolicies() external view returns (uint256)
Returns amount of distinct licensing policies in the LicensingModule.
Return Values
Name
Type
Description
[0]
uint256
totalPolicies The amount of policies
policy
function policy(uint256 policyId) public view returns (struct Licensing.Policy pol)
Returns the policy data for policyId, reverts if not found.
Parameters
Name
Type
Description
policyId
uint256
The id of the policy
Return Values
Name
Type
Description
pol
struct Licensing.Policy
The policy data
getPolicyId
function getPolicyId(struct Licensing.Policy pol) external view returns (uint256 policyId)
Returns the policy id for the given policy data, or 0 if not found.
Parameters
Name
Type
Description
pol
struct Licensing.Policy
The policy data in Policy struct
Return Values
Name
Type
Description
policyId
uint256
The id of the policy
policyAggregatorData
function policyAggregatorData(address framework, address ipId) external view returns (bytes)
Returns the policy aggregator data for the given IP ID in the framework.
Parameters
Name
Type
Description
framework
address
The address of the policy framework manager
ipId
address
The id of the IP asset
Return Values
Name
Type
Description
[0]
bytes
data The encoded policy aggregator data to be decoded by the framework manager
isPolicyDefined
function isPolicyDefined(uint256 policyId) public view returns (bool)
Returns if policyId exists in the LicensingModule
Parameters
Name
Type
Description
policyId
uint256
The id of the policy
Return Values
Name
Type
Description
[0]
bool
isDefined True if the policy is defined
policyIdsForIp
function policyIdsForIp(bool isInherited, address ipId) external view returns (uint256[] policyIds)
Returns the policy ids attached to an IP
Potentially gas-intensive operation, use with care.
Parameters
Name
Type
Description
isInherited
bool
True if the policy is inherited from a parent IP
ipId
address
The id of the IP asset
Return Values
Name
Type
Description
policyIds
uint256[]
The ids of policy ids for the IP
totalPoliciesForIp
function totalPoliciesForIp(bool isInherited, address ipId) public view returns (uint256)
Returns the total number of policies attached to an IP
Parameters
Name
Type
Description
isInherited
bool
True if the policy is inherited from a parent IP
ipId
address
The id of the IP asset
Return Values
Name
Type
Description
[0]
uint256
totalPolicies The total number of policies for the IP