LicenseToken
The LicenseToken contract, also known as LNFT (License NFT), is an ERC721 token that represents a license agreement for IP assets within the Story ecosystem. It enables the creation, transfer, and management of programmable IP licenses.
State Variables
LICENSE_REGISTRY
The address of the protocol-wide License Registry.
LICENSING_MODULE
The address of the protocol-wide Licensing Module.
DISPUTE_MODULE
The address of the protocol-wide Dispute Module.
MAX_COMMERCIAL_REVENUE_SHARE
The maximum royalty percentage is 100_000_000, which represents 100%.
LicenseTokenMetadata
Metadata structure for license tokens:
licensorIpId
: The IP asset that is the licensorlicenseTemplate
: The license template contract addresslicenseTermsId
: The ID of the license termstransferable
: Whether the license token can be transferredcommercialRevShare
: The commercial revenue share percentage
Functions
initialize
Initializes the LicenseToken contract.
Parameters:
accessManager
: The address of the access manager.imageUrl
: The URL of the default image for license tokens.
setLicensingImageUrl
Sets the licensing image URL for all license tokens.
Parameters:
url
: The URL of the licensing image.
mintLicenseTokens
Mints a specified amount of License Tokens (LNFTs).
Parameters:
licensorIpId
: The ID of the licensor IP for which the License Tokens are minted.licenseTemplate
: The address of the License Template.licenseTermsId
: The ID of the License Terms.amount
: The amount of License Tokens to mint.minter
: The address of the minter.receiver
: The address of the receiver of the minted License Tokens.maxRevenueShare
: The maximum revenue share percentage allowed for minting the License Tokens.
Returns:
startLicenseTokenId
: The start ID of the minted License Tokens.
burnLicenseTokens
Burns the License Tokens (LTs) for the given token IDs.
Parameters:
holder
: The address of the holder of the License Tokens.tokenIds
: An array of IDs of the License Tokens to be burned.
validateLicenseTokensForDerivative
Validates License Tokens for registering a derivative IP.
Parameters:
caller
: The address of the caller who register derivative with the given tokens.childIpId
: The ID of the derivative IP.tokenIds
: An array of IDs of the License Tokens to validate.
Returns:
licenseTemplate
: The address of the License Template associated with the License Tokens.licensorIpIds
: An array of licensor IPs associated with each License Token.licenseTermsIds
: An array of License Terms associated with each validated License Token.commercialRevShares
: An array of commercial revenue share percentages associated with each License Token.
totalMintedTokens
Returns the total number of minted License Tokens since beginning. The number won’t decrease when license tokens are burned.
Returns:
uint256
: The total number of minted License Tokens.
getLicenseTokenMetadata
Returns the license data for the given license ID.
Parameters:
tokenId
: The ID of the license token.
Returns:
LicenseTokenMetadata
: The metadata of the license token.
getLicensorIpId
Returns the ID of the IP asset that is the licensor of the given license ID.
Parameters:
tokenId
: The ID of the license token.
Returns:
address
: The ID of the licensor IP.
getLicenseTermsId
Returns the ID of the license terms that are used for the given license ID.
Parameters:
tokenId
: The ID of the license token.
Returns:
uint256
: The ID of the license terms.
getLicenseTemplate
Returns the address of the license template that is used for the given license ID.
Parameters:
tokenId
: The ID of the license token.
Returns:
address
: The address of the license template.
getTotalTokensByLicensor
Retrieves the total number of License Tokens minted for a given licensor IP.
Parameters:
licensorIpId
: The ID of the licensor IP.
Returns:
uint256
: The total number of License Tokens minted for the licensor IP.
isLicenseTokenRevoked
Returns true if the license has been revoked (licensor IP tagged after a dispute in the dispute module). If the tag is removed, the license is not revoked anymore.
Parameters:
tokenId
: The ID of the license token.
Returns:
bool
: True if the license is revoked.
tokenURI
ERC721 OpenSea metadata JSON representation of the LNFT parameters.
Parameters:
id
: The ID of the license token.
Returns:
string
: The metadata URI of the license token.