Skip to content

Commit

Permalink
redeploy for with active license PR#176
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster-will committed Nov 18, 2023
1 parent 2dc47d3 commit c59e731
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 24 deletions.
27 changes: 14 additions & 13 deletions deployment-11155111.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"main": {
"AccessControlSingleton-Impl": "0x7a076554EACc026e10DE5aB73E9E5D487898BAB6",
"AccessControlSingleton-Proxy": "0xedA59921817A60614fA2De04DCd2cc5684cAa117",
"IPAssetRegistry": "0x39B1efd4Edb0188347980A2570EF3c025b90998f",
"IPOrgController-Impl": "0x201EEF5a058d5AA68C064bA231636477388469Ef",
"IPOrgController-Proxy": "0x581857409579161Dabd2C4994f78b2F1B3671bc2",
"LicenseCreatorModule": "0xF753165075537f11F9Cc0a8F31A9cdbDF95D617B",
"LicenseRegistry": "0xE41DD87832c2418529e46Ef847B3c73EFa051b91",
"MockERC721": "0x663B05E7ED1A0E1059E31E6dd00b10585510A7C2",
"ModuleRegistry": "0x6D99Bf3f058c29B45A6B3f63784a95d584E419e1",
"RegistrationModule": "0x6DF05Ef53B1a9D98d48859f08D568cf042d05C9e",
"RelationshipModule": "0xcBA2fE1aeCBE27356bF6A8AF52641ADC4aD69F02",
"StoryProtocol": "0x998741CFE6dDb4114ae27EE3857BD3d2295aECcc",
"TokenGatedHook": "0xfe36fbAdF98f7CB97BE2F87b0b0FFBBEf8810A21"
"AccessControlSingleton-Impl": "0x9d78608605409d997f452b7E47410F6317b5312A",
"AccessControlSingleton-Proxy": "0xF3A6064ba0DBd98AdBb794136f534A53A2aC1aE5",
"IPAssetRegistry": "0x177175a4b26f6EA050676F8c9a14D395F896492C",
"IPOrgController-Impl": "0x01CCa0268c92b55FBC5360c76b3d39125DD39c9E",
"IPOrgController-Proxy": "0x73fCB515cEE99e4991465ef586CfE2B072EbB512",
"LicenseRegistry": "0x14b3b2b1700C9A1d5A5217dB92F0Ab54C7900563",
"LicensingModule": "0xa906E2589A7F8385A376BABBb70a39dad551603b",
"MockERC721": "0xe37983Ad02c0BEB88b334727d5A5a0dA6801F964",
"ModuleRegistry": "0x8DFd8d6673c5EDf13ACD0992a0Cd21dFB198F969",
"RegistrationModule": "0x091e5F55135155bb8Cb5868aDb39e5C34eB32CFd",
"RelationshipModule": "0x49477130a70a37E0D6e22b674ef9E923E6D0202c",
"StoryProtocol": "0x79448112dB0F3EaC69124e4bAd728ab74e1575Ea",
"TermsRepository": "0xCD5d06cFf106131A0845E2a18f8429D8115b3fD8",
"TokenGatedHook": "0xC0F6E387aC0B324Ec18EAcf22EE7271207dCE3d5"
}
}
7 changes: 4 additions & 3 deletions deployment-31337.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"IPAssetRegistry": "0x446ce25bff9fe7049Aaf3339124F51F301e9c220",
"IPOrgController-Impl": "0xa1833d78f09e2198774E612ca3d9879597ACc859",
"IPOrgController-Proxy": "0xd8562c2C2f7497D96C7Cf2f9E15392fe4c31c84f",
"LicenseCreatorModule": "0x0e0C15Fe242628fce34A123A0317C97f1D3256c8",
"LicenseRegistry": "0x687E4e5a4471c259a8f56F1f06b0E5c5FEa808c8",
"MockERC721": "0xdCc500f52a509F65023696FE7B717c81F8a432d5",
"LicensingModule": "0xb9162E7d63aDAC660f987755D45f55710EB5542a",
"MockERC721": "0x29715b74703b258D045fed347A8B3909aBdE5179",
"ModuleRegistry": "0xC06CBc0B7A136bda48865BE24228396Dea4094Ec",
"RegistrationModule": "0x869b721BbF176D0130d87E3aD2eEA02CEBB883eE",
"RelationshipModule": "0x812d70D430362c56E56F7Cfc73464FE2F1670ec9",
"StoryProtocol": "0xB61c296B51f542EeD7B76022c736488A571ac05b",
"TokenGatedHook": "0xb9162E7d63aDAC660f987755D45f55710EB5542a"
"TermsRepository": "0x0e0C15Fe242628fce34A123A0317C97f1D3256c8",
"TokenGatedHook": "0xdCc500f52a509F65023696FE7B717c81F8a432d5"
},
"relationship-processors": {
"DstOwnerRelationshipProcessor": "0x6E447CeC286dbaBe885fDbD9723DD63Cc2DE0Bd2",
Expand Down
61 changes: 53 additions & 8 deletions script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ import "contracts/modules/base/BaseModule.sol";
import "contracts/modules/licensing/LicenseRegistry.sol";
import "contracts/modules/relationships/RelationshipModule.sol";
import "contracts/lib/modules/ModuleRegistryKeys.sol";
import "contracts/modules/licensing/LicenseCreatorModule.sol";
import "contracts/modules/licensing/LicensingModule.sol";
import "contracts/hooks/TokenGatedHook.sol";
import "contracts/modules/base/HookRegistry.sol";
import "contracts/interfaces/hooks/base/IHook.sol";
import { TokenGated } from "contracts/lib/hooks/TokenGated.sol";
import "test/foundry/mocks/MockERC721.sol";
import "contracts/modules/licensing/TermsRepository.sol";
import { Licensing } from "contracts/lib/modules/Licensing.sol";
import { TermCategories, TermIds } from "contracts/lib/modules/ProtocolLicensingTerms.sol";

contract Main is Script, BroadcastManager, JsonDeploymentHandler, ProxyHelper {

Expand All @@ -45,9 +48,10 @@ import "test/foundry/mocks/MockERC721.sol";
address licenseRegistry;
address registrationModule;
address relationshipModule;
address licenseCreatorModule;
address licensingModule;
address tokenGatedHook;
address mockNFT;
address termsRepository;

string constant NON_COMMERCIAL_LICENSE_URI = "https://noncommercial.license";
string constant COMMERCIAL_LICENSE_URI = "https://commercial.license";
Expand Down Expand Up @@ -180,21 +184,30 @@ import "test/foundry/mocks/MockERC721.sol";

relationshipModule = newAddress;

/// TERMS_REPOSITORY
contractKey = "TermsRepository";

console.log(string.concat("Deploying ", contractKey, "..."));
newAddress = address(new TermsRepository(accessControl));
_writeAddress(contractKey, newAddress);
console.log(string.concat(contractKey, " deployed to:"), newAddress);

termsRepository = newAddress;

/// LICENSE_MODULE
contractKey = "LicenseCreatorModule";
contractKey = "LicensingModule";

console.log(string.concat("Deploying ", contractKey, "..."));
newAddress = address(new LicenseCreatorModule(BaseModule.ModuleConstruction({
newAddress = address(new LicensingModule(BaseModule.ModuleConstruction({
ipaRegistry: IPAssetRegistry(ipAssetRegistry),
moduleRegistry: ModuleRegistry(moduleRegistry),
licenseRegistry: LicenseRegistry(licenseRegistry),
ipOrgController: IPOrgController(ipOrgController)
})));
}), termsRepository) );
_writeAddress(contractKey, newAddress);
console.log(string.concat(contractKey, " deployed to:"), newAddress);

licenseCreatorModule = newAddress;
licensingModule = newAddress;


/// TOKEN_GATED_HOOK
Expand Down Expand Up @@ -227,6 +240,7 @@ import "test/foundry/mocks/MockERC721.sol";
accessControlSingleton.grantRole(AccessControl.UPGRADER_ROLE, admin);
accessControlSingleton.grantRole(AccessControl.RELATIONSHIP_MANAGER_ROLE, admin);
accessControlSingleton.grantRole(AccessControl.LICENSING_MANAGER_ROLE, admin);
accessControlSingleton.grantRole(AccessControl.TERMS_SETTER_ROLE, admin);
accessControlSingleton.grantRole(AccessControl.IPORG_CREATOR_ROLE, admin);
accessControlSingleton.grantRole(AccessControl.MODULE_REGISTRAR_ROLE, admin);
accessControlSingleton.grantRole(AccessControl.MODULE_EXECUTOR_ROLE, spg);
Expand All @@ -237,7 +251,7 @@ import "test/foundry/mocks/MockERC721.sol";
ModuleRegistry(moduleRegistry).registerProtocolModule(
ModuleRegistryKeys.RELATIONSHIP_MODULE, BaseModule(relationshipModule));
ModuleRegistry(moduleRegistry).registerProtocolModule(
ModuleRegistryKeys.LICENSING_MODULE, BaseModule(licenseCreatorModule));
ModuleRegistryKeys.LICENSING_MODULE, BaseModule(licensingModule));
string[] memory ipAssetTypes = new string[](2);
ipAssetTypes[0] = "STORY";
ipAssetTypes[1] = "CHARACTER";
Expand All @@ -254,8 +268,39 @@ import "test/foundry/mocks/MockERC721.sol";
hooksConfig[0] = abi.encode(tokenGatedConfig);
RegistrationModule(registrationModule).registerHooks(HookRegistry.HookType.PreAction, IIPOrg(ipOrg), hooks, hooksConfig);

// CONFIG LICENSING MODULE
Licensing.CommercialStatus comStatus = Licensing.CommercialStatus.Both;
TermsRepository(termsRepository).addCategory(TermCategories.SHARE_ALIKE);
Licensing.LicensingTerm memory term = _getTerm(TermIds.NFT_SHARE_ALIKE, comStatus);
TermsRepository(termsRepository).addTerm(TermCategories.SHARE_ALIKE, TermIds.NFT_SHARE_ALIKE, term);

TermsRepository(termsRepository).addCategory(TermCategories.LICENSOR);
term = _getTerm(TermIds.LICENSOR_APPROVAL, comStatus);
TermsRepository(termsRepository).addTerm(TermCategories.LICENSOR, TermIds.LICENSOR_APPROVAL, term);

TermsRepository(termsRepository).addCategory(TermCategories.CATEGORIZATION);
term = _getTerm(TermIds.FORMAT_CATEGORY, comStatus);
TermsRepository(termsRepository).addTerm(TermCategories.CATEGORIZATION, TermIds.FORMAT_CATEGORY, term);

TermsRepository(termsRepository).addCategory(TermCategories.ACTIVATION);
term = _getTerm(TermIds.LICENSOR_IPORG_OR_PARENT, comStatus);
TermsRepository(termsRepository).addTerm(TermCategories.ACTIVATION, TermIds.LICENSOR_IPORG_OR_PARENT, term);


_writeDeployment();
_endBroadcast();
}


function _getTerm(
string memory termId,
Licensing.CommercialStatus comStatus_
) internal pure returns (Licensing.LicensingTerm memory) {
return Licensing.LicensingTerm({
comStatus: comStatus_,
url: string(abi.encodePacked("https://", termId,".com")),
hash: "qwertyu",
algorithm: "sha256",
hook: IHook(address(0))
});
}
}

0 comments on commit c59e731

Please sign in to comment.