diff --git a/contracts/StoryProtocol.sol b/contracts/StoryProtocol.sol index e7f28ea7..f1906201 100644 --- a/contracts/StoryProtocol.sol +++ b/contracts/StoryProtocol.sol @@ -84,7 +84,6 @@ contract StoryProtocol { // Licensing // //////////////////////////////////////////////////////////////////////////// - function configureIpOrgLicensing( address ipOrg_, Licensing.FrameworkConfig calldata framework_ diff --git a/contracts/lib/modules/ProtocolRelationships.sol b/contracts/lib/modules/ProtocolRelationships.sol index 9daabc58..3e5f086a 100644 --- a/contracts/lib/modules/ProtocolRelationships.sol +++ b/contracts/lib/modules/ProtocolRelationships.sol @@ -14,8 +14,8 @@ library ProtocolRelationships { relType: IPA_LICENSE, ipOrg: LibRelationship.PROTOCOL_LEVEL_RELATIONSHIP, allowedElements: LibRelationship.RelatedElements({ - src: LibRelationship.Relatables.IPA, - dst: LibRelationship.Relatables.LICENSE + src: LibRelationship.Relatables.LICENSE, + dst: LibRelationship.Relatables.IPA }), allowedSrcs: new uint8[](0), allowedDsts: new uint8[](0) diff --git a/contracts/modules/licensing/LicenseCreatorModule.sol b/contracts/modules/licensing/LicenseCreatorModule.sol index 6115cf4e..661363c1 100644 --- a/contracts/modules/licensing/LicenseCreatorModule.sol +++ b/contracts/modules/licensing/LicenseCreatorModule.sol @@ -76,7 +76,6 @@ contract LicenseCreatorModule is BaseModule, TermsRepository, ProtocolTermsHelpe } } - function _hookRegistryAdmin() internal view @@ -109,10 +108,10 @@ contract LicenseCreatorModule is BaseModule, TermsRepository, ProtocolTermsHelpe // TODO: Check if parent license is active } - if (_comIpOrgTermIds[address(ipOrg_)].length() == 0) { + // At least non commercial terms must be set + if (_nonComIpOrgTermData[address(ipOrg_)].length == 0) { revert Errors.LicensingModule_IpOrgNotConfigured(); } - if (!ipOrgAllowsCommercial(address(ipOrg_)) && lParams.isCommercial) { revert Errors.LicensingModule_CommercialLicenseNotAllowed(); } @@ -134,20 +133,63 @@ contract LicenseCreatorModule is BaseModule, TermsRepository, ProtocolTermsHelpe params_, (Licensing.LicenseCreationParams) ); + // TODO: How do we distinguish which terms apply? + // Share alike and Remix IPA, posting the remixed IPA => copy parent license terms? + // License to make an remixed IPA in the future => ???? + // License to commercialize IPA => ??? + // Commerial license to use IPA in IPA => ??? IPAsset.IPA memory ipa = IPA_REGISTRY.getIpAsset(lParams.ipaId); - - // Licensing.License memory license = Licensing.License({ - // isCommercial: lParams.isCommercial, - // licensor: _getLicensor( - // ipOrg_.owner(), - // ipa.owner, - // LICENSE_REGISTRY.getLicenseOwner(lParams.parentLicenseId) - // ), - // revoker: _getRevoker(ipOrg_), - // termsConfig: - // }); - // return LICENSE_REGISTRY.createLicense(license); - return ""; + (ShortString[] memory termIds, bytes[] memory termsData) = getIpOrgTerms( + lParams.isCommercial, + address(ipOrg_) + ); + Licensing.License memory license = Licensing.License({ + isCommercial: lParams.isCommercial, + licensor: _getLicensor( + ipOrg_.owner(), + ipa.owner, + LICENSE_REGISTRY.getLicenseOwner(lParams.parentLicenseId) + ), + revoker: _getRevoker(ipOrg_), + termIds: termIds, + termsData: termsData + }); + uint256 licenseId = LICENSE_REGISTRY.addLicense(license); + if (lParams.ipaId != 0) { + _relateToIpa(lParams.ipaId, licenseId); + } + if (lParams.parentLicenseId != 0) { + _relateToParentLicense(lParams.parentLicenseId, licenseId); + } + return abi.encode(licenseId); + } + + function _relateToIpa(uint256 ipaId, uint256 licenseId) private returns (uint256) { + return _createRelationship( + LibRelationship.CreateRelationshipParams({ + relType: ProtocolRelationships.IPA_LICENSE, + srcAddress: address(LICENSE_REGISTRY), + srcId: licenseId, + srcType: 0, + dstAddress: address(IPA_REGISTRY), + dstId: ipaId, + dstType: 0 + }) + ); + } + + function _relateToParentLicense(uint256 parentLicenseId, uint256 licenseId) private returns (uint256) { + return _createRelationship( + LibRelationship.CreateRelationshipParams({ + relType: ProtocolRelationships.SUBLICENSE_OF, + srcAddress: address(LICENSE_REGISTRY), + srcId: licenseId, + srcType: 0, + dstAddress: address(LICENSE_REGISTRY), + dstId: parentLicenseId, + dstType: 0 + }) + ); } function _getLicensor( @@ -168,54 +210,6 @@ contract LicenseCreatorModule is BaseModule, TermsRepository, ProtocolTermsHelpe return ipOrg.owner(); } - /* - ( - uint256 parentLicenseId, - bytes[] memory additionalTerms, - uint256 newIpaId - ) = abi.decode(params_, (uint256, bytes[], uint256)); - - uint256 licenseId = LICENSE_REGISTRY.createLicenseFrom(parentLicenseId); - // If we have commercial terms (this is a commercial sublicense or remix) - if (additionalTerms.length > 0) { - LICENSE_REGISTRY.addTerms(licenseId, additionalTerms); - } - - uint256 sublicenseRelId = _createRelationship( - LibRelationship.CreateRelationshipParams({ - relType: ProtocolRelationships.SUBLICENSE_OF, - srcAddress: address(LICENSE_REGISTRY), - srcId: parentLicenseId, - srcType: 0, - dstAddress: address(LICENSE_REGISTRY), - dstId: licenseId, - dstType: 0 - }) - ); - - if (newIpaId > 0) { - uint256 ipaI = _createRelationship( - LibRelationship.CreateRelationshipParams({ - relType: ProtocolRelationships.IPA_LICENSE, - srcAddress: address(ipOrg_), - srcId: parentLicenseId, - srcType: 0, - dstAddress: address(LICENSE_REGISTRY), - dstId: licenseId, - dstType: 0 - }) - ); - } else { - LICENSE_REGISTRY.makeTradeable(licenseId); - } - - // If sublicense is to create work, we mint an IPA and relate it to the original IPA? - (LibRelationship.CreateRelationshipParams memory addRel) = abi.decode( - params_, - (LibRelationship.CreateRelationshipParams) - ); - */ - //////////////////////////////////////////////////////////////////////////// // Config // //////////////////////////////////////////////////////////////////////////// diff --git a/contracts/modules/licensing/LicenseRegistry.sol b/contracts/modules/licensing/LicenseRegistry.sol index 081f0086..a4a34c79 100644 --- a/contracts/modules/licensing/LicenseRegistry.sol +++ b/contracts/modules/licensing/LicenseRegistry.sol @@ -9,7 +9,7 @@ contract LicenseRegistry { uint256 private _licenseCount = 0; - function addLicense(Licensing.License calldata license_) external returns (uint256) { + function addLicense(Licensing.License memory license_) external returns (uint256) { // TOOD: Add authorization _licenseCount++; _licenses[_licenseCount] = license_; @@ -21,7 +21,7 @@ contract LicenseRegistry { } function getLicenseOwner(uint256 id_) external view returns (address) { - return address(123); + return address(0); } function addTerms(uint256 licenseId, bytes[] memory terms) external { diff --git a/test/foundry/modules/licensing/BaseLicensingTest.sol b/test/foundry/modules/licensing/BaseLicensingTest.sol index 393d148c..5d09dfbf 100644 --- a/test/foundry/modules/licensing/BaseLicensingTest.sol +++ b/test/foundry/modules/licensing/BaseLicensingTest.sol @@ -15,6 +15,32 @@ contract BaseLicensingTest is BaseTest { ShortString public nonCommTextTermId = "non_comm_text_term_id".toShortString(); ShortString public commTextTermId = "comm_text_term_id".toShortString(); + modifier withNonCommFramework() { + vm.prank(ipOrg.owner()); + spg.configureIpOrgLicensing( + address(ipOrg), + getNonCommFramework( + nonCommTextTermId, + bytes("") + ) + ); + _; + } + + modifier withCommFramework() { + vm.prank(ipOrg.owner()); + spg.configureIpOrgLicensing( + address(ipOrg), + getCommFramework( + commTextTermId, + bytes(""), + nonCommTextTermId, + bytes("") + ) + ); + _; + } + function setUp() virtual override public { super.setUp(); licensingModule.addTermCategory("test_category"); @@ -53,7 +79,7 @@ contract BaseLicensingTest is BaseTest { )); } - function getEmptyLicensingFramework() public pure returns (Licensing.FrameworkConfig memory) { + function getEmptyFramework() public pure returns (Licensing.FrameworkConfig memory) { return Licensing.FrameworkConfig({ comTermsConfig: Licensing.TermsConfig({ @@ -67,7 +93,7 @@ contract BaseLicensingTest is BaseTest { }); } - function getNonCommLicensingFramework( + function getNonCommFramework( ShortString termId, bytes memory data ) public pure returns (Licensing.FrameworkConfig memory) { @@ -88,24 +114,56 @@ contract BaseLicensingTest is BaseTest { }); } - function getCommLicensingFramework( - ShortString termId, - bytes memory data + function getCommFramework( + ShortString cId, + bytes memory cData, + ShortString ncId, + bytes memory ncData ) public pure returns (Licensing.FrameworkConfig memory) { - ShortString[] memory termIds = new ShortString[](1); - termIds[0] = termId; - bytes[] memory termData = new bytes[](1); - termData[0] = data; + ShortString[] memory comTermsId = new ShortString[](1); + comTermsId[0] = cId; + bytes[] memory comTermsData = new bytes[](1); + comTermsData[0] = cData; + ShortString[] memory nonComTermsId = new ShortString[](1); + nonComTermsId[0] = ncId; + bytes[] memory nonComTermsData = new bytes[](1); + nonComTermsData[0] = ncData; return Licensing.FrameworkConfig({ comTermsConfig: Licensing.TermsConfig({ - termIds: termIds, - termData: termData + termIds: comTermsId, + termData: comTermsData }), nonComTermsConfig: Licensing.TermsConfig({ - termIds: termIds, - termData: termData + termIds: nonComTermsId, + termData: nonComTermsData }) }); } + + + function assertTerms(Licensing.License memory license) public { + (ShortString[] memory ipOrgTermsId, bytes[] memory ipOrgTermsData) = licensingModule.getIpOrgTerms( + license.isCommercial, address(ipOrg) + ); + assertEq(license.termIds.length, ipOrgTermsId.length); + assertEq(license.termsData.length, ipOrgTermsData.length); + for (uint256 i = 0; i < license.termIds.length; i++) { + assertTrue(ShortStringOps._equal(license.termIds[i], ipOrgTermsId[i])); + assertTrue(keccak256(license.termsData[i]) == keccak256(ipOrgTermsData[i])); + Licensing.LicensingTerm memory term = licensingModule.getTerm(ipOrgTermsId[i]); + if (license.isCommercial) { + assertTrue( + term.comStatus == Licensing.CommercialStatus.Commercial || + term.comStatus == Licensing.CommercialStatus.Both + ); + } else { + assertTrue( + term.comStatus == Licensing.CommercialStatus.NonCommercial || + term.comStatus == Licensing.CommercialStatus.Both + ); + } + } + } + } diff --git a/test/foundry/modules/licensing/LicenseCreatorModule.Terms.sol b/test/foundry/modules/licensing/LicenseCreatorModule.Terms.sol index 2d8a27d4..610a42aa 100644 --- a/test/foundry/modules/licensing/LicenseCreatorModule.Terms.sol +++ b/test/foundry/modules/licensing/LicenseCreatorModule.Terms.sol @@ -19,14 +19,6 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { function setUp() override public { super.setUp(); - vm.prank(ipOrg.owner()); - spg.configureIpOrgLicensing( - address(ipOrg), - getCommLicensingFramework( - textTermId, - bytes("") - ) - ); registry.register(IPAsset.RegisterIpAssetParams({ name: "test", ipAssetType: 2, @@ -53,37 +45,11 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { function test_LicensingModule_licensing_createsNonCommercialLicense() public { } - function test_LicensingModule_licensing_createRootLicense() public { - vm.prank(ipOrg.owner()); - uint256 lId = spg.createLicense( - address(ipOrg), - Licensing.LicenseCreationParams({ - parentLicenseId: 0, - isCommercial: false, - ipaId: 1 - }), - new bytes[](0), - new bytes[](0) - ); - // Non Commercial - Licensing.License memory license = licenseRegistry.getLicense(lId); - assertFalse(license.isCommercial); - assertEq(license.revoker, ipOrg.owner()); - assertEq(license.licensor, ipOrg.owner()); - - assertTrue( - relationshipModule.relationshipExists( - LibRelationship.Relationship({ - relType: ProtocolRelationships.IPA_LICENSE, - srcAddress: address(registry), - dstAddress: address(licenseRegistry), - srcId: 1, - dstId: 1 - }) - ) - ); - //Licensing.License memory license = licenseReg - // Commercial + function test_LicensingModule_licensing_createsCommerciaSublLicense() public { + + } + + function test_LicensingModule_licensing_createsNonCommercialSubLicense() public { } diff --git a/test/foundry/modules/licensing/LicensingCreatorModule.Config.t.sol b/test/foundry/modules/licensing/LicensingCreatorModule.Config.t.sol index 742f2343..b7ed3194 100644 --- a/test/foundry/modules/licensing/LicensingCreatorModule.Config.t.sol +++ b/test/foundry/modules/licensing/LicensingCreatorModule.Config.t.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.13; import "forge-std/Test.sol"; -import 'contracts/modules/relationships/RelationshipModule.sol'; -import 'contracts/lib/modules/LibRelationship.sol'; +import "contracts/modules/relationships/RelationshipModule.sol"; +import "contracts/lib/modules/LibRelationship.sol"; import { AccessControl } from "contracts/lib/AccessControl.sol"; import { Licensing, TermCategories, TermIds } from "contracts/lib/modules/Licensing.sol"; import { OffChain } from "contracts/lib/OffChain.sol"; @@ -13,8 +13,7 @@ import { ShortStringOps } from "contracts/utils/ShortStringOps.sol"; import { ShortString } from "@openzeppelin/contracts/utils/ShortStrings.sol"; contract LicensingCreatorModuleConfigTest is BaseLicensingTest { - - function setUp() override public { + function setUp() public override { super.setUp(); } @@ -22,60 +21,67 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { vm.expectRevert(Errors.LicensingModule_CallerNotIpOrgOwner.selector); spg.configureIpOrgLicensing( address(ipOrg), - getNonCommLicensingFramework( - textTermId, - bytes("") - ) + getNonCommFramework(textTermId, bytes("")) ); } - function test_LicensingModule_configIpOrg_ipOrgWithNoCommercialTermsIsNonCommercial() public { - vm.prank(ipOrg.owner()); - spg.configureIpOrgLicensing( - address(ipOrg), - getNonCommLicensingFramework( - textTermId, - bytes("") - ) - ); + + function test_LicensingModule_configIpOrg_ipOrgWithNoCommercialTermsIsNonCommercial() + public + withNonCommFramework + { assertFalse(licensingModule.ipOrgAllowsCommercial(address(ipOrg))); - (ShortString[] memory nonComTermIds, bytes[] memory nonComTermData) = licensingModule.getIpOrgTerms(false, address(ipOrg)); - assertTrue(ShortStringOps._equal(nonComTermIds[0], textTermId)); - (ShortString[] memory termIds, bytes[] memory termsData) = licensingModule.getIpOrgTerms(true, address(ipOrg)); + ( + ShortString[] memory nonComTermIds, + bytes[] memory nonComTermData + ) = licensingModule.getIpOrgTerms(false, address(ipOrg)); + assertTrue(ShortStringOps._equal(nonComTermIds[0], nonCommTextTermId)); + ( + ShortString[] memory termIds, + bytes[] memory termsData + ) = licensingModule.getIpOrgTerms(true, address(ipOrg)); assertTrue(termIds.length == 0); } - function test_LicensingModule_configIpOrg_ipOrgWithCommercialTermsIsCommercial() public { - vm.prank(ipOrg.owner()); - spg.configureIpOrgLicensing( - address(ipOrg), - getCommLicensingFramework( - textTermId, - bytes("") - ) - ); + function test_LicensingModule_configIpOrg_ipOrgWithCommercialTermsIsCommercial() + public + withCommFramework + { assertTrue(licensingModule.ipOrgAllowsCommercial(address(ipOrg))); - (ShortString[] memory nonComTermIds, bytes[] memory nonComTermData) = licensingModule.getIpOrgTerms(false, address(ipOrg)); - assertTrue(ShortStringOps._equal(nonComTermIds[0], textTermId)); - (ShortString[] memory termIds, bytes[] memory termsData) = licensingModule.getIpOrgTerms(true, address(ipOrg)); - assertTrue(ShortStringOps._equal(termIds[0], textTermId)); + ( + ShortString[] memory nonComTermIds, + bytes[] memory nonComTermData + ) = licensingModule.getIpOrgTerms(false, address(ipOrg)); + assertTrue(ShortStringOps._equal(nonComTermIds[0], nonCommTextTermId)); + ( + ShortString[] memory termIds, + bytes[] memory termsData + ) = licensingModule.getIpOrgTerms(true, address(ipOrg)); + assertTrue(ShortStringOps._equal(termIds[0], commTextTermId)); } - function test_LicensingModule_configIpOrg_revert_noEmptyNonCommercialTerms() public { + function test_LicensingModule_configIpOrg_revert_noEmptyNonCommercialTerms() + public + { vm.startPrank(ipOrg.owner()); - vm.expectRevert(Errors.LicensingModule_NonCommercialTermsRequired.selector); - spg.configureIpOrgLicensing( - address(ipOrg), - getEmptyLicensingFramework() + vm.expectRevert( + Errors.LicensingModule_NonCommercialTermsRequired.selector ); + spg.configureIpOrgLicensing(address(ipOrg), getEmptyFramework()); vm.stopPrank(); } - function test_LicensingModule_configIpOrg_revertIfWrongTermCommercialStatus() public { + function test_LicensingModule_configIpOrg_revert_IfWrongTermCommercialStatus() + public + { vm.startPrank(ipOrg.owner()); - vm.expectRevert(Errors.LicensingModule_InvalidTermCommercialStatus.selector); + vm.expectRevert( + Errors.LicensingModule_InvalidTermCommercialStatus.selector + ); spg.configureIpOrgLicensing( address(ipOrg), - getCommLicensingFramework( + getCommFramework( + nonCommTextTermId, + bytes(""), nonCommTextTermId, bytes("") ) @@ -83,35 +89,33 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { vm.stopPrank(); } - function test_LicensingModule_configIpOrg_revertIfIpOrgAlreadyConfigured() public { + function test_LicensingModule_configIpOrg_revertIfIpOrgAlreadyConfigured() + public + { // Todo } - - function test_LicensingModule_configIpOrg_setsHooksForCreatingCommercialLicenses() public { + function test_LicensingModule_configIpOrg_setsHooksForCreatingCommercialLicenses() + public + { // Todo } - - function test_LicensingModule_configIpOrg_setsHooksForCreatingNonCommercialLicenses() public { + + function test_LicensingModule_configIpOrg_setsHooksForCreatingNonCommercialLicenses() + public + { // Todo } - function test_LicensingModule_configIpOrg_commercialLicenseActivationHooksCanBeSet() public { + function test_LicensingModule_configIpOrg_commercialLicenseActivationHooksCanBeSet() + public + { // TODO } - function test_LicensingModule_configIpOrg_nonCommercialLicenseActivationHooksCanBeSet() public { + function test_LicensingModule_configIpOrg_nonCommercialLicenseActivationHooksCanBeSet() + public + { // TODO } - - - function test_LicensingModule_licensing_createsCommercialLicense() public { - - } - - - function test_LicensingModule_licensing_createsNonCommercialLicense() public { - - } } - diff --git a/test/foundry/modules/licensing/LicensingCreatorModule.Licensing.sol b/test/foundry/modules/licensing/LicensingCreatorModule.Licensing.sol index 9f23c428..366823ee 100644 --- a/test/foundry/modules/licensing/LicensingCreatorModule.Licensing.sol +++ b/test/foundry/modules/licensing/LicensingCreatorModule.Licensing.sol @@ -12,22 +12,13 @@ import { IHook } from "contracts/interfaces/hooks/base/IHook.sol"; import { IPAsset } from "contracts/lib/IPAsset.sol"; import { BaseLicensingTest } from "./BaseLicensingTest.sol"; -contract LicensingCreatorModuleConfigTest is BaseLicensingTest { +contract LicensingCreatorLicensingTest is BaseLicensingTest { using ShortStrings for *; address ipaOwner = address(0x13333); function setUp() override public { super.setUp(); - - vm.prank(ipOrg.owner()); - spg.configureIpOrgLicensing( - address(ipOrg), - getCommLicensingFramework( - textTermId, - bytes("") - ) - ); registry.register(IPAsset.RegisterIpAssetParams({ name: "test", ipAssetType: 2, @@ -37,10 +28,8 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { url: "https://example.com", data: "" })); - } - function test_LicensingModule_configIpOrg_commercialLicenseActivationHooksCanBeSet() public { // TODO } @@ -49,14 +38,7 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { // TODO } - - function test_LicensingModule_licensing_createsCommercialLicense() public { - } - - function test_LicensingModule_licensing_createsNonCommercialLicense() public { - } - - function test_LicensingModule_licensing_createRootLicense() public { + function test_LicensingModule_licensing_createNonCommercialRootLicense() withNonCommFramework public { vm.prank(ipOrg.owner()); uint256 lId = spg.createLicense( address(ipOrg), @@ -72,23 +54,29 @@ contract LicensingCreatorModuleConfigTest is BaseLicensingTest { Licensing.License memory license = licenseRegistry.getLicense(lId); assertFalse(license.isCommercial); assertEq(license.revoker, ipOrg.owner()); - assertEq(license.licensor, ipOrg.owner()); + assertEq(license.licensor, ipaOwner, "licensor"); + assertTerms(license); assertTrue( relationshipModule.relationshipExists( LibRelationship.Relationship({ relType: ProtocolRelationships.IPA_LICENSE, - srcAddress: address(registry), - dstAddress: address(licenseRegistry), + srcAddress: address(licenseRegistry), srcId: 1, + dstAddress: address(registry), dstId: 1 }) ) ); - //Licensing.License memory license = licenseReg - // Commercial - } + function test_LicensingModule_licensing_createsCommercialSubLicense() withCommFramework public { + } + + function test_LicensingModule_licensing_createsNonCommercialSubLicense() withNonCommFramework public { + } + + + } diff --git a/test/foundry/utils/BaseTest.sol b/test/foundry/utils/BaseTest.sol index 50b80ff1..773d9cb3 100644 --- a/test/foundry/utils/BaseTest.sol +++ b/test/foundry/utils/BaseTest.sol @@ -21,6 +21,7 @@ import { ShortString, ShortStrings } from "@openzeppelin/contracts/utils/ShortSt import { ShortStringOps } from "contracts/utils/ShortStringOps.sol"; import { AccessControl } from "contracts/lib/AccessControl.sol"; import { ModuleRegistryKeys } from "contracts/lib/modules/ModuleRegistryKeys.sol"; +import { ProtocolRelationships } from "contracts/lib/modules/ProtocolRelationships.sol"; // On active refactor @@ -47,11 +48,7 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper { address constant upgrader = address(6969); address constant ipAssetOrgOwner = address(456); - address constant revoker = address(789); - // string constant NON_COMMERCIAL_LICENSE_URI = "https://noncommercial.license"; - // string constant COMMERCIAL_LICENSE_URI = "https://commercial.license"; - - constructor() {} + address constant relManager = address(9999); function setUp() virtual override(BaseTestUtils) public { super.setUp(); @@ -104,17 +101,12 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper { ); moduleRegistry.registerProtocolModule(ModuleRegistryKeys.RELATIONSHIP_MODULE, relationshipModule); - // Create Licensing Module - // address licensingImplementation = address(new LicensingModule(address(ipAssetOrgFactory))); - // licensingModule = LicensingModule( - // _deployUUPSProxy( - // licensingImplementation, - // abi.encodeWithSelector( - // bytes4(keccak256(bytes("initialize(address,string)"))), - // address(accessControl), NON_COMMERCIAL_LICENSE_URI - // ) - // ) - // ); + // Set Protocol Relationships + _grantRole(vm, AccessControl.RELATIONSHIP_MANAGER_ROLE, relManager); + vm.startPrank(relManager); + spg.addRelationshipType(ProtocolRelationships._getIpLicenseAddRelPArams()); + spg.addRelationshipType(ProtocolRelationships._getSublicenseAddRelParams()); + vm.stopPrank(); defaultCollectNftImpl = _deployCollectNFTImpl(); collectModule = ICollectModule(_deployCollectModule(defaultCollectNftImpl));