LicenseRegistry.sol

Registry of License NFTs, which represent licenses granted by IP ID licensors to create derivative IPs.

name

string name

Name of the License NFT

symbol

string symbol

Symbol of the License NFT

LICENSING_MODULE

contract ILicensingModule LICENSING_MODULE

Returns the canonical protocol-wide LicensingModule

DISPUTE_MODULE

contract IDisputeModule DISPUTE_MODULE

Returns the canonical protocol-wide DisputeModule

onlyLicensingModule

modifier onlyLicensingModule()

We have to implement this modifier instead of inheriting LicensingModuleAware because LicensingModule
constructor requires the licenseRegistry address, which would create a circular dependency. Thus, we use the
function setLicensingModule to set the licensing module address after deploying the module.

constructor

constructor(address governance) public

setDisputeModule

function setDisputeModule(address newDisputeModule) external

Sets the DisputeModule address.
Enforced to be only callable by the protocol admin

Parameters

NameTypeDescription
newDisputeModuleaddressThe address of the DisputeModule

setLicensingModule

function setLicensingModule(address newLicensingModule) external

Sets the LicensingModule address.
Enforced to be only callable by the protocol admin

Parameters

NameTypeDescription
newLicensingModuleaddressThe address of the LicensingModule

mintLicense

function mintLicense(uint256 policyId, address licensorIpId_, bool transferable, uint256 amount, address receiver) external returns (uint256 licenseId)

Mints license NFTs representing a policy granted by a set of ipIds (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. If not, the license is fungible and an id will be reused.

Only callable by the licensing module.

Parameters

NameTypeDescription
policyIduint256The ID of the policy to be minted
licensorIpId_addressThe ID of the IP granting the license (ie. licensor)
transferableboolTrue if the license is transferable
amountuint256Number of licenses to mint. License NFT is fungible for same policy and same licensors
receiveraddressReceiver address of the minted license NFT(s).

Return Values

NameTypeDescription
licenseIduint256The ID of the minted license NFT(s).

burnLicenses

function burnLicenses(address holder, uint256[] licenseIds) external

Burns licenses

Parameters

NameTypeDescription
holderaddressThe address that holds the licenses
licenseIdsuint256[]The ids of the licenses to burn

mintedLicenses

function mintedLicenses() external view returns (uint256)

Returns the number of licenses registered in the protocol.

Token ID counter total count.

Return Values

NameTypeDescription
[0]uint256mintedLicenses The number of minted licenses

isLicensee

function isLicensee(uint256 licenseId, address holder) external view returns (bool)

Returns true if holder has positive balance for the given license ID.

Return Values

NameTypeDescription
[0]boolisLicensee True if holder is the licensee for the license (owner of the license NFT), or derivative IP owner if the license was added to the IP by linking (burning a license).

license

function license(uint256 licenseId) external view returns (struct Licensing.License)

Returns the license data for the given license ID

Parameters

NameTypeDescription
licenseIduint256The ID of the license

Return Values

NameTypeDescription
[0]struct Licensing.LicenselicenseData The license data

licensorIpId

function licensorIpId(uint256 licenseId) external view returns (address)

Returns the ID of the IP asset that is the licensor of the given license ID

Parameters

NameTypeDescription
licenseIduint256The ID of the license

Return Values

NameTypeDescription
[0]addresslicensorIpId The ID of the licensor

policyIdForLicense

function policyIdForLicense(uint256 licenseId) external view returns (uint256)

Returns the policy ID for the given license ID

Parameters

NameTypeDescription
licenseIduint256The ID of the license

Return Values

NameTypeDescription
[0]uint256policyId The ID of the policy

isLicenseRevoked

function isLicenseRevoked(uint256 licenseId) public view returns (bool)

Returns true if the license has been revoked (licensor tagged after a dispute in
the dispute module). If the tag is removed, the license is not revoked anymore.

Parameters

NameTypeDescription
licenseIduint256The id of the license to check

Return Values

NameTypeDescription
[0]boolisRevoked True if the license is revoked

uri

function uri(uint256 id) public view virtual returns (string)

ERC1155 OpenSea metadata JSON representation of the LNFT parameters

Expect PFM.policyToJson to return {'trait_type: 'value'},{'trait_type': 'value'},...,{...}
(last attribute must not have a comma at the end)

_update

function _update(address from, address to, uint256[] ids, uint256[] values) internal virtual

Pre-hook for ERC1155's _update() called on transfers.