The License Registry stores all license-related states within the protocol, including managing global state like registering new License Templates like the Programmable IP License (PIL💊), attaching licenses to individual IP Assets, registering derivatives, and the like:
LicenseRegistry.sol
Copy
Ask AI
/// @dev Storage of the LicenseRegistry/// @param defaultLicenseTemplate The default license template address/// @param defaultLicenseTermsId The default license terms ID/// @param registeredLicenseTemplates Registered license templates/// @param registeredRoyaltyPolicies Registered royalty policies/// @param registeredCurrencyTokens Registered currency tokens/// @param parentIps Mapping of parent IPs to derivative IPs/// @param parentLicenseTerms Mapping of parent IPs to license terms used to link to derivative IPs/// @param childIps Mapping of derivative IPs to parent IPs/// @param attachedLicenseTerms Mapping of attached license terms to IP IDs/// @param licenseTemplates Mapping of license templates to IP IDs/// @param expireTimes Mapping of IP IDs to expire times/// @param licensingConfigs Mapping of minting license configs to a licenseTerms of an IP/// @dev Storage structure for the LicenseRegistry/// @custom:storage-location erc7201:story-protocol.LicenseRegistrystruct LicenseRegistryStorage { address defaultLicenseTemplate; uint256 defaultLicenseTermsId; mapping(address licenseTemplate => bool isRegistered) registeredLicenseTemplates; mapping(address childIpId => EnumerableSet.AddressSet parentIpIds) parentIps; mapping(address childIpId => mapping(address parentIpId => uint256 licenseTermsId)) parentLicenseTerms; mapping(address parentIpId => EnumerableSet.AddressSet childIpIds) childIps; mapping(address ipId => EnumerableSet.UintSet licenseTermsIds) attachedLicenseTerms; mapping(address ipId => address licenseTemplate) licenseTemplates; mapping(bytes32 ipLicenseHash => Licensing.LicensingConfig licensingConfig) licensingConfigs;}
This function allows you to register an IP Asset as a derivative of another IP Asset, unlocking things like claimable royalty flows from the 💸 Royalty Module.