From b2f96e6262ace304d963f82c03a3745449240f71 Mon Sep 17 00:00:00 2001 From: Andrew Chung Date: Wed, 4 Jun 2025 09:46:04 -0700 Subject: [PATCH 1/5] Auto generated DerivativeWorkflows fns --- .../AccessController_client.py | 14 +- .../DerivativeWorkflows_client.py | 31 + .../abi/jsons/DerivativeWorkflows.json | 942 +++++++++--------- .../scripts/config.json | 9 +- 4 files changed, 533 insertions(+), 463 deletions(-) diff --git a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py index fdf2b8b..999c152 100644 --- a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py +++ b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py @@ -28,11 +28,17 @@ def setAllPermissions(self, ipAccount, signer, permission): def build_setAllPermissions_transaction(self, ipAccount, signer, permission, tx_params): return self.contract.functions.setAllPermissions(ipAccount, signer, permission).build_transaction(tx_params) - def setTransientBatchPermissions(self, permissions): - return self.contract.functions.setTransientBatchPermissions(permissions).transact() + def setBatchPermissions(self, permissions): + return self.contract.functions.setBatchPermissions(permissions).transact() - def build_setTransientBatchPermissions_transaction(self, permissions, tx_params): - return self.contract.functions.setTransientBatchPermissions(permissions).build_transaction(tx_params) + def build_setBatchPermissions_transaction(self, permissions, tx_params): + return self.contract.functions.setBatchPermissions(permissions).build_transaction(tx_params) + + def setPermission(self, ipAccount, signer, to, func, permission): + return self.contract.functions.setPermission(ipAccount, signer, to, func, permission).transact() + + def build_setPermission_transaction(self, ipAccount, signer, to, func, permission, tx_params): + return self.contract.functions.setPermission(ipAccount, signer, to, func, permission).build_transaction(tx_params) def setTransientPermission(self, ipAccount, signer, to, func, permission): return self.contract.functions.setTransientPermission(ipAccount, signer, to, func, permission).transact() diff --git a/src/story_protocol_python_sdk/abi/DerivativeWorkflows/DerivativeWorkflows_client.py b/src/story_protocol_python_sdk/abi/DerivativeWorkflows/DerivativeWorkflows_client.py index ababa9a..111b7b8 100644 --- a/src/story_protocol_python_sdk/abi/DerivativeWorkflows/DerivativeWorkflows_client.py +++ b/src/story_protocol_python_sdk/abi/DerivativeWorkflows/DerivativeWorkflows_client.py @@ -21,4 +21,35 @@ def __init__(self, web3: Web3): with open(abi_path, 'r') as abi_file: abi = json.load(abi_file) self.contract = self.web3.eth.contract(address=contract_address, abi=abi) + + def mintAndRegisterIpAndMakeDerivative(self, spgNftContract, derivData, ipMetadata, recipient, allowDuplicates): + return self.contract.functions.mintAndRegisterIpAndMakeDerivative(spgNftContract, derivData, ipMetadata, recipient, allowDuplicates).transact() + + def build_mintAndRegisterIpAndMakeDerivative_transaction(self, spgNftContract, derivData, ipMetadata, recipient, allowDuplicates, tx_params): + return self.contract.functions.mintAndRegisterIpAndMakeDerivative(spgNftContract, derivData, ipMetadata, recipient, allowDuplicates).build_transaction(tx_params) + + def mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(self, spgNftContract, licenseTokenIds, royaltyContext, maxRts, ipMetadata, recipient, allowDuplicates): + return self.contract.functions.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(spgNftContract, licenseTokenIds, royaltyContext, maxRts, ipMetadata, recipient, allowDuplicates).transact() + + def build_mintAndRegisterIpAndMakeDerivativeWithLicenseTokens_transaction(self, spgNftContract, licenseTokenIds, royaltyContext, maxRts, ipMetadata, recipient, allowDuplicates, tx_params): + return self.contract.functions.mintAndRegisterIpAndMakeDerivativeWithLicenseTokens(spgNftContract, licenseTokenIds, royaltyContext, maxRts, ipMetadata, recipient, allowDuplicates).build_transaction(tx_params) + + def multicall(self, data): + return self.contract.functions.multicall(data).transact() + + def build_multicall_transaction(self, data, tx_params): + return self.contract.functions.multicall(data).build_transaction(tx_params) + + def registerIpAndMakeDerivative(self, nftContract, tokenId, derivData, ipMetadata, sigMetadataAndRegister): + return self.contract.functions.registerIpAndMakeDerivative(nftContract, tokenId, derivData, ipMetadata, sigMetadataAndRegister).transact() + + def build_registerIpAndMakeDerivative_transaction(self, nftContract, tokenId, derivData, ipMetadata, sigMetadataAndRegister, tx_params): + return self.contract.functions.registerIpAndMakeDerivative(nftContract, tokenId, derivData, ipMetadata, sigMetadataAndRegister).build_transaction(tx_params) + + def registerIpAndMakeDerivativeWithLicenseTokens(self, nftContract, tokenId, licenseTokenIds, royaltyContext, maxRts, ipMetadata, sigMetadataAndRegister): + return self.contract.functions.registerIpAndMakeDerivativeWithLicenseTokens(nftContract, tokenId, licenseTokenIds, royaltyContext, maxRts, ipMetadata, sigMetadataAndRegister).transact() + + def build_registerIpAndMakeDerivativeWithLicenseTokens_transaction(self, nftContract, tokenId, licenseTokenIds, royaltyContext, maxRts, ipMetadata, sigMetadataAndRegister, tx_params): + return self.contract.functions.registerIpAndMakeDerivativeWithLicenseTokens(nftContract, tokenId, licenseTokenIds, royaltyContext, maxRts, ipMetadata, sigMetadataAndRegister).build_transaction(tx_params) + \ No newline at end of file diff --git a/src/story_protocol_python_sdk/abi/jsons/DerivativeWorkflows.json b/src/story_protocol_python_sdk/abi/jsons/DerivativeWorkflows.json index e820bf4..4e0ed13 100644 --- a/src/story_protocol_python_sdk/abi/jsons/DerivativeWorkflows.json +++ b/src/story_protocol_python_sdk/abi/jsons/DerivativeWorkflows.json @@ -1,865 +1,891 @@ [ { - "type": "constructor", "inputs": [ { + "internalType": "address", "name": "accessController", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "coreMetadataModule", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "ipAssetRegistry", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "licenseRegistry", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "licenseToken", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "licensingModule", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "pilTemplate", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "royaltyModule", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AccessManagedInvalidAuthority", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delay", + "type": "uint32" + } + ], + "name": "AccessManagedRequiredDelay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessManagedUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "actualTokenOwner", + "type": "address" + } + ], + "name": "DerivativeWorkflows__CallerAndNotTokenOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "DerivativeWorkflows__CallerNotSigner", + "type": "error" + }, + { + "inputs": [], + "name": "DerivativeWorkflows__EmptyLicenseTokens", + "type": "error" + }, + { + "inputs": [], + "name": "DerivativeWorkflows__ZeroAddressParam", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" }, { - "type": "function", - "name": "ACCESS_CONTROLLER", "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "LicensingHelper__ParentIpIdsAndLicenseTermsIdsMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "PermissionHelper__ModulesAndSelectorsMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "Workflow__CallerNotAuthorizedToMint", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "ACCESS_CONTROLLER", "outputs": [ { + "internalType": "contract IAccessController", "name": "", - "type": "address", - "internalType": "contract IAccessController" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "CORE_METADATA_MODULE", "inputs": [], + "name": "CORE_METADATA_MODULE", "outputs": [ { + "internalType": "contract ICoreMetadataModule", "name": "", - "type": "address", - "internalType": "contract ICoreMetadataModule" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "IP_ASSET_REGISTRY", "inputs": [], + "name": "IP_ASSET_REGISTRY", "outputs": [ { + "internalType": "contract IIPAssetRegistry", "name": "", - "type": "address", - "internalType": "contract IIPAssetRegistry" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "LICENSE_REGISTRY", "inputs": [], + "name": "LICENSE_REGISTRY", "outputs": [ { + "internalType": "contract ILicenseRegistry", "name": "", - "type": "address", - "internalType": "contract ILicenseRegistry" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "LICENSE_TOKEN", "inputs": [], + "name": "LICENSE_TOKEN", "outputs": [ { + "internalType": "contract ILicenseToken", "name": "", - "type": "address", - "internalType": "contract ILicenseToken" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "LICENSING_MODULE", "inputs": [], + "name": "LICENSING_MODULE", "outputs": [ { + "internalType": "contract ILicensingModule", "name": "", - "type": "address", - "internalType": "contract ILicensingModule" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "PIL_TEMPLATE", "inputs": [], + "name": "PIL_TEMPLATE", "outputs": [ { + "internalType": "contract IPILicenseTemplate", "name": "", - "type": "address", - "internalType": "contract IPILicenseTemplate" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "ROYALTY_MODULE", "inputs": [], + "name": "ROYALTY_MODULE", "outputs": [ { + "internalType": "contract IRoyaltyModule", "name": "", - "type": "address", - "internalType": "contract IRoyaltyModule" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "UPGRADE_INTERFACE_VERSION", "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", "outputs": [ { + "internalType": "string", "name": "", - "type": "string", - "internalType": "string" + "type": "string" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "authority", "inputs": [], + "name": "authority", "outputs": [ { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "initialize", "inputs": [ { + "internalType": "address", "name": "accessManager", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "initialize", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "isConsumingScheduledOp", "inputs": [], + "name": "isConsumingScheduledOp", "outputs": [ { + "internalType": "bytes4", "name": "", - "type": "bytes4", - "internalType": "bytes4" + "type": "bytes4" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "mintAndRegisterIpAndMakeDerivative", "inputs": [ { + "internalType": "address", "name": "spgNftContract", - "type": "address", - "internalType": "address" + "type": "address" }, { - "name": "derivData", - "type": "tuple", - "internalType": "struct WorkflowStructs.MakeDerivative", "components": [ { + "internalType": "address[]", "name": "parentIpIds", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "address", "name": "licenseTemplate", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256[]", "name": "licenseTermsIds", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "bytes", "name": "royaltyContext", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "maxMintingFee", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint32", "name": "maxRts", - "type": "uint32", - "internalType": "uint32" + "type": "uint32" }, { + "internalType": "uint32", "name": "maxRevenueShare", - "type": "uint32", - "internalType": "uint32" + "type": "uint32" } - ] + ], + "internalType": "struct WorkflowStructs.MakeDerivative", + "name": "derivData", + "type": "tuple" }, { - "name": "ipMetadata", - "type": "tuple", - "internalType": "struct WorkflowStructs.IPMetadata", "components": [ { + "internalType": "string", "name": "ipMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "ipMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "string", "name": "nftMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "nftMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } - ] + ], + "internalType": "struct WorkflowStructs.IPMetadata", + "name": "ipMetadata", + "type": "tuple" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bool", "name": "allowDuplicates", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], + "name": "mintAndRegisterIpAndMakeDerivative", "outputs": [ { + "internalType": "address", "name": "ipId", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "tokenId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens", "inputs": [ { + "internalType": "address", "name": "spgNftContract", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256[]", "name": "licenseTokenIds", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "bytes", "name": "royaltyContext", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint32", "name": "maxRts", - "type": "uint32", - "internalType": "uint32" + "type": "uint32" }, { - "name": "ipMetadata", - "type": "tuple", - "internalType": "struct WorkflowStructs.IPMetadata", "components": [ { + "internalType": "string", "name": "ipMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "ipMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "string", "name": "nftMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "nftMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } - ] + ], + "internalType": "struct WorkflowStructs.IPMetadata", + "name": "ipMetadata", + "type": "tuple" }, { + "internalType": "address", "name": "recipient", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bool", "name": "allowDuplicates", - "type": "bool", - "internalType": "bool" + "type": "bool" } ], + "name": "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens", "outputs": [ { + "internalType": "address", "name": "ipId", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "tokenId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "multicall", "inputs": [ { + "internalType": "bytes[]", "name": "data", - "type": "bytes[]", - "internalType": "bytes[]" + "type": "bytes[]" } ], + "name": "multicall", "outputs": [ { + "internalType": "bytes[]", "name": "results", - "type": "bytes[]", - "internalType": "bytes[]" + "type": "bytes[]" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "onERC721Received", "inputs": [ { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "address", "name": "", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } ], + "name": "onERC721Received", "outputs": [ { + "internalType": "bytes4", "name": "", - "type": "bytes4", - "internalType": "bytes4" + "type": "bytes4" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "proxiableUUID", "inputs": [], + "name": "proxiableUUID", "outputs": [ { + "internalType": "bytes32", "name": "", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } ], - "stateMutability": "view" + "stateMutability": "view", + "type": "function" }, { - "type": "function", - "name": "registerIpAndMakeDerivative", "inputs": [ { + "internalType": "address", "name": "nftContract", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "tokenId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { - "name": "derivData", - "type": "tuple", - "internalType": "struct WorkflowStructs.MakeDerivative", "components": [ { + "internalType": "address[]", "name": "parentIpIds", - "type": "address[]", - "internalType": "address[]" + "type": "address[]" }, { + "internalType": "address", "name": "licenseTemplate", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256[]", "name": "licenseTermsIds", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "bytes", "name": "royaltyContext", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint256", "name": "maxMintingFee", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint32", "name": "maxRts", - "type": "uint32", - "internalType": "uint32" + "type": "uint32" }, { + "internalType": "uint32", "name": "maxRevenueShare", - "type": "uint32", - "internalType": "uint32" + "type": "uint32" } - ] + ], + "internalType": "struct WorkflowStructs.MakeDerivative", + "name": "derivData", + "type": "tuple" }, { - "name": "ipMetadata", - "type": "tuple", - "internalType": "struct WorkflowStructs.IPMetadata", "components": [ { + "internalType": "string", "name": "ipMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "ipMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "string", "name": "nftMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "nftMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } - ] + ], + "internalType": "struct WorkflowStructs.IPMetadata", + "name": "ipMetadata", + "type": "tuple" }, { - "name": "sigMetadataAndRegister", - "type": "tuple", - "internalType": "struct WorkflowStructs.SignatureData", "components": [ { + "internalType": "address", "name": "signer", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "deadline", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "signature", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } - ] + ], + "internalType": "struct WorkflowStructs.SignatureData", + "name": "sigMetadataAndRegister", + "type": "tuple" } ], + "name": "registerIpAndMakeDerivative", "outputs": [ { + "internalType": "address", "name": "ipId", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "registerIpAndMakeDerivativeWithLicenseTokens", "inputs": [ { + "internalType": "address", "name": "nftContract", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "tokenId", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "uint256[]", "name": "licenseTokenIds", - "type": "uint256[]", - "internalType": "uint256[]" + "type": "uint256[]" }, { + "internalType": "bytes", "name": "royaltyContext", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" }, { + "internalType": "uint32", "name": "maxRts", - "type": "uint32", - "internalType": "uint32" + "type": "uint32" }, { - "name": "ipMetadata", - "type": "tuple", - "internalType": "struct WorkflowStructs.IPMetadata", "components": [ { + "internalType": "string", "name": "ipMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "ipMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" }, { + "internalType": "string", "name": "nftMetadataURI", - "type": "string", - "internalType": "string" + "type": "string" }, { + "internalType": "bytes32", "name": "nftMetadataHash", - "type": "bytes32", - "internalType": "bytes32" + "type": "bytes32" } - ] + ], + "internalType": "struct WorkflowStructs.IPMetadata", + "name": "ipMetadata", + "type": "tuple" }, { - "name": "sigMetadataAndRegister", - "type": "tuple", - "internalType": "struct WorkflowStructs.SignatureData", "components": [ { + "internalType": "address", "name": "signer", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "uint256", "name": "deadline", - "type": "uint256", - "internalType": "uint256" + "type": "uint256" }, { + "internalType": "bytes", "name": "signature", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } - ] + ], + "internalType": "struct WorkflowStructs.SignatureData", + "name": "sigMetadataAndRegister", + "type": "tuple" } ], + "name": "registerIpAndMakeDerivativeWithLicenseTokens", "outputs": [ { + "internalType": "address", "name": "ipId", - "type": "address", - "internalType": "address" + "type": "address" } ], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "setAuthority", "inputs": [ { + "internalType": "address", "name": "newAuthority", - "type": "address", - "internalType": "address" + "type": "address" } ], + "name": "setAuthority", "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "nonpayable", + "type": "function" }, { - "type": "function", - "name": "upgradeToAndCall", "inputs": [ { + "internalType": "address", "name": "newImplementation", - "type": "address", - "internalType": "address" + "type": "address" }, { + "internalType": "bytes", "name": "data", - "type": "bytes", - "internalType": "bytes" + "type": "bytes" } ], + "name": "upgradeToAndCall", "outputs": [], - "stateMutability": "payable" - }, - { - "type": "event", - "name": "AuthorityUpdated", - "inputs": [ - { - "name": "authority", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Initialized", - "inputs": [ - { - "name": "version", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Upgraded", - "inputs": [ - { - "name": "implementation", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "AccessManagedInvalidAuthority", - "inputs": [ - { - "name": "authority", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AccessManagedRequiredDelay", - "inputs": [ - { - "name": "caller", - "type": "address", - "internalType": "address" - }, - { - "name": "delay", - "type": "uint32", - "internalType": "uint32" - } - ] - }, - { - "type": "error", - "name": "AccessManagedUnauthorized", - "inputs": [ - { - "name": "caller", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AddressEmptyCode", - "inputs": [ - { - "name": "target", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "DerivativeWorkflows__CallerAndNotTokenOwner", - "inputs": [ - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "caller", - "type": "address", - "internalType": "address" - }, - { - "name": "actualTokenOwner", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "DerivativeWorkflows__EmptyLicenseTokens", - "inputs": [] - }, - { - "type": "error", - "name": "DerivativeWorkflows__ZeroAddressParam", - "inputs": [] - }, - { - "type": "error", - "name": "ERC1967InvalidImplementation", - "inputs": [ - { - "name": "implementation", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ERC1967NonPayable", - "inputs": [] - }, - { - "type": "error", - "name": "FailedCall", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidInitialization", - "inputs": [] - }, - { - "type": "error", - "name": "NotInitializing", - "inputs": [] - }, - { - "type": "error", - "name": "SafeERC20FailedOperation", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "UUPSUnauthorizedCallContext", - "inputs": [] - }, - { - "type": "error", - "name": "UUPSUnsupportedProxiableUUID", - "inputs": [ - { - "name": "slot", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "Workflow__CallerNotAuthorizedToMint", - "inputs": [] + "stateMutability": "payable", + "type": "function" } -] +] \ No newline at end of file diff --git a/src/story_protocol_python_sdk/scripts/config.json b/src/story_protocol_python_sdk/scripts/config.json index df8ee59..34c8872 100644 --- a/src/story_protocol_python_sdk/scripts/config.json +++ b/src/story_protocol_python_sdk/scripts/config.json @@ -252,7 +252,14 @@ { "contract_name": "DerivativeWorkflows", "contract_address": "0x9e2d496f72C547C2C535B167e06ED8729B374a4f", - "functions": [] + "functions": [ + "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens", + "registerIpAndMakeDerivative", + "mintAndRegisterIpAndMakeDerivative", + "registerIpAndMakeDerivativeWithLicenseTokens", + "mintAndRegisterIpAndMakeDerivativeWithLicenseTokens", + "multicall" + ] } ] } From d04210498a5a2205fdfbcae39a6e4c4ea17a1c5a Mon Sep 17 00:00:00 2001 From: Andrew Chung Date: Wed, 4 Jun 2025 09:46:34 -0700 Subject: [PATCH 2/5] Added register_derivative_ip() spg fn --- .../resources/IPAsset.py | 270 +++++++++--------- .../integration/test_integration_ip_asset.py | 70 +++-- 2 files changed, 174 insertions(+), 166 deletions(-) diff --git a/src/story_protocol_python_sdk/resources/IPAsset.py b/src/story_protocol_python_sdk/resources/IPAsset.py index a86e7c9..59e9c0b 100644 --- a/src/story_protocol_python_sdk/resources/IPAsset.py +++ b/src/story_protocol_python_sdk/resources/IPAsset.py @@ -485,7 +485,15 @@ def mint_and_register_ip( except Exception as e: raise ValueError(f"Failed to mint and register IP: {str(e)}") - def register_ip_and_attach_pil_terms(self, nft_contract: str, token_id: int, license_terms_data: dict, ip_metadata: dict = None, deadline: int = None, tx_options: dict = None) -> dict: + def register_ip_and_attach_pil_terms( + self, + nft_contract: str, + token_id: int, + license_terms_data: dict, + ip_metadata: dict = None, + deadline: int = None, + tx_options: dict = None + ) -> dict: """ Register a given NFT as an IP and attach Programmable IP License Terms. @@ -656,143 +664,147 @@ def register_ip_and_attach_pil_terms(self, nft_contract: str, token_id: int, lic except Exception as e: raise e - # def register_derivative_ip( - # self, - # nft_contract: str, - # token_id: int, - # deriv_data: dict, - # metadata: dict = None, - # deadline: int = None, - # tx_options: dict = None - # ) -> dict: - # """ - # Register the given NFT as a derivative IP with metadata without using - # license tokens. - - # :param nft_contract str: The address of the NFT collection. - # :param token_id int: The ID of the NFT. - # :param deriv_data dict: The derivative data for registerDerivative. - # :param parentIpIds list: The parent IP IDs. - # :param licenseTemplate str: License template address to be used. - # :param licenseTermsIds list: The license terms IDs. - # :param metadata dict: [Optional] Desired IP metadata. - # :param metadataURI str: [Optional] Metadata URI for the IP. - # :param metadataHash str: [Optional] Metadata hash for the IP. - # :param nftMetadataHash str: [Optional] NFT metadata hash. - # :param deadline int: [Optional] Signature deadline in milliseconds. - # :param tx_options dict: [Optional] Transaction options. - # :return dict: Dictionary with the tx hash and IP ID. - # """ - # try: - # ip_id = self._get_ip_id(nft_contract, token_id) - # if self._is_registered(ip_id): - # raise ValueError( - # f"The NFT with id {token_id} is already registered as IP." - # ) - - # if len(deriv_data['parentIpIds']) != len(deriv_data['licenseTermsIds']): - # raise ValueError( - # "Parent IP IDs and license terms IDs must match in quantity." - # ) - # if len(deriv_data['parentIpIds']) not in [1, 2]: - # raise ValueError("There can only be 1 or 2 parent IP IDs.") - - # for parent_ip_id, license_terms_id in zip( - # deriv_data['parentIpIds'], - # deriv_data['licenseTermsIds'] - # ): - # if not self.license_registry_client.hasIpAttachedLicenseTerms( - # parent_ip_id, - # self.pi_license_template_client.contract.address, - # license_terms_id - # ): - # raise ValueError( - # f"License terms id {license_terms_id} must be attached to " - # f"the parent ipId {parent_ip_id} before registering " - # f"derivative." - # ) + def register_derivative_ip( + self, + nft_contract: str, + token_id: int, + deriv_data: dict, + metadata: dict = None, + deadline: int = None, + tx_options: dict = None + ) -> dict: + """ + Register the given NFT as a derivative IP with metadata without using + license tokens. - # calculated_deadline = self._get_deadline(deadline=deadline) - # sig_register_signature = self._get_signature( - # ip_id, - # self.licensing_module_client.contract.address, - # calculated_deadline, - # "registerDerivative(address,address[],uint256[],address,bytes)", - # 2 - # ) + :param nft_contract str: The address of the NFT collection. + :param token_id int: The ID of the NFT. + :param deriv_data dict: The derivative data for registerDerivative. + :param parent_ip_ids list: The parent IP IDs. + :param license_template str: License template address to be used. + :param license_terms_ids list: The license terms IDs. + :param max_minting_fee int: [Optional] Maximum minting fee. + :param max_rts int: [Optional] Maximum royalty tokens. + :param max_revenue_share int: [Optional] Maximum revenue share. + :param metadata dict: [Optional] Desired IP metadata. + :param ip_metadata_uri str: [Optional] Metadata URI for the IP. + :param ip_metadata_hash str: [Optional] Metadata hash for the IP. + :param nft_metadata_uri str: [Optional] NFT metadata URI. + :param nft_metadata_hash str: [Optional] NFT metadata hash. + :param deadline int: [Optional] Signature deadline in milliseconds. + :param tx_options dict: [Optional] Transaction options. + :return dict: Dictionary with the tx hash and IP ID. + """ + try: + ip_id = self._get_ip_id(nft_contract, token_id) + if self._is_registered(ip_id): + raise ValueError( + f"The NFT with id {token_id} is already registered as IP." + ) - # req_object = { - # 'nftContract': nft_contract, - # 'tokenId': token_id, - # 'derivData': { - # 'parentIpIds': [ - # self.web3.to_checksum_address(id) - # for id in deriv_data['parentIpIds'] - # ], - # 'licenseTermsIds': deriv_data['licenseTermsIds'], - # 'licenseTemplate': self.pi_license_template_client.contract.address, - # 'royaltyContext': ZERO_ADDRESS, - # }, - # 'sigRegister': { - # 'signer': self.web3.to_checksum_address(self.account.address), - # 'deadline': calculated_deadline, - # 'signature': sig_register_signature, - # }, - # 'metadata': { - # 'metadataURI': "", - # 'metadataHash': ZERO_HASH, - # 'nftMetadataHash': ZERO_HASH, - # }, - # 'sigMetadata': { - # 'signer': ZERO_ADDRESS, - # 'deadline': 0, - # 'signature': ZERO_HASH, - # }, - # } + if len(deriv_data['parent_ip_ids']) != len(deriv_data['license_terms_ids']): + raise ValueError( + "Parent IP IDs and license terms IDs must match in quantity." + ) - # if metadata: - # req_object['metadata'].update({ - # 'metadataURI': metadata.get('metadataURI', ""), - # 'metadataHash': metadata.get('metadataHash', ZERO_HASH), - # 'nftMetadataHash': metadata.get('nftMetadataHash', ZERO_HASH), - # }) + for parent_ip_id, license_terms_id in zip( + deriv_data['parent_ip_ids'], + deriv_data['license_terms_ids'] + ): + if not self.license_registry_client.hasIpAttachedLicenseTerms( + parent_ip_id, + self.pi_license_template_client.contract.address, + license_terms_id + ): + raise ValueError( + f"License terms id {license_terms_id} must be attached to " + f"the parent ipId {parent_ip_id} before registering " + f"derivative." + ) - # signature = self._get_signature( - # ip_id, - # self.core_metadata_module_client.contract.address, - # calculated_deadline, - # "setAll(address,string,bytes32,bytes32)", - # 1 - # ) + calculated_deadline = self.sign_util.get_deadline(deadline=deadline) + + # Get combined permission signature for both metadata and registration + signature_response = self.sign_util.get_permission_signature( + ip_id=ip_id, + deadline=calculated_deadline, + state=self.web3.to_bytes(hexstr=ZERO_HASH), + permissions=[ + { + 'ipId': ip_id, + 'signer': self.derivative_workflows_client.contract.address, + 'to': self.core_metadata_module_client.contract.address, + 'func': "setAll(address,string,bytes32,bytes32)", + 'permission': 1 + }, + { + 'ipId': ip_id, + 'signer': self.derivative_workflows_client.contract.address, + 'to': self.licensing_module_client.contract.address, + 'func': "registerDerivative(address,address[],uint256[],address,bytes,uint256,uint32,uint32)", + 'permission': 1 + } + ] + ) + + # Use single signature object + sig_metadata_and_register = { + 'signer': self.web3.to_checksum_address(self.account.address), + 'deadline': calculated_deadline, + 'signature': self.web3.to_bytes(hexstr=signature_response['signature']) + } + + deriv_data_transformed = { + 'parentIpIds': [self.web3.to_checksum_address(id) for id in deriv_data['parent_ip_ids']], + 'licenseTermsIds': deriv_data['license_terms_ids'], + 'licenseTemplate': deriv_data.get('license_template', self.pi_license_template_client.contract.address), + 'royaltyContext': ZERO_ADDRESS, # Internal field + 'maxMintingFee': deriv_data.get('max_minting_fee', 0), + 'maxRts': deriv_data.get('max_rts', 100_000_000), # 100,000,000 + 'maxRevenueShare': deriv_data.get('max_revenue_share', 100) # 100 + } + + req_object = { + 'nftContract': nft_contract, + 'tokenId': token_id, + 'derivData': deriv_data_transformed, + 'metadata': { + 'ipMetadataURI': "", + 'ipMetadataHash': ZERO_HASH, + 'nftMetadataURI': "", + 'nftMetadataHash': ZERO_HASH, + }, + } - # req_object['sigMetadata'] = { - # 'signer': self.web3.to_checksum_address(self.account.address), - # 'deadline': calculated_deadline, - # 'signature': signature, - # } + if metadata: + req_object['metadata'].update({ + 'ipMetadataURI': metadata.get('ip_metadata_uri', ""), + 'ipMetadataHash': metadata.get('ip_metadata_hash', ZERO_HASH), + 'nftMetadataURI': metadata.get('nft_metadata_uri', ""), + 'nftMetadataHash': metadata.get('nft_metadata_hash', ZERO_HASH), + }) - # response = build_and_send_transaction( - # self.web3, - # self.account, - # self.derivative_workflows_client.build_registerIpAndMakeDerivative_transaction, # noqa: E501 - # req_object['nftContract'], - # req_object['tokenId'], - # req_object['derivData'], - # req_object['metadata'], - # req_object['sigMetadata'], - # req_object['sigRegister'], - # tx_options=tx_options - # ) + response = build_and_send_transaction( + self.web3, + self.account, + self.derivative_workflows_client.build_registerIpAndMakeDerivative_transaction, + req_object['nftContract'], + req_object['tokenId'], + req_object['derivData'], + req_object['metadata'], + sig_metadata_and_register, # Single combined signature + tx_options=tx_options + ) - # ip_registered = self._parse_tx_ip_registered_event(response['tx_receipt']) + ip_registered = self._parse_tx_ip_registered_event(response['tx_receipt']) - # return { - # 'tx_hash': response['tx_hash'], - # 'ip_id': ip_registered['ip_id'] - # } + return { + 'tx_hash': response['tx_hash'], + 'ip_id': ip_registered['ip_id'] + } - # except Exception as e: - # raise e + except Exception as e: + raise e def _validate_max_rts(self, max_rts: int): """ diff --git a/tests/integration/test_integration_ip_asset.py b/tests/integration/test_integration_ip_asset.py index 01b791b..f6fda0f 100644 --- a/tests/integration/test_integration_ip_asset.py +++ b/tests/integration/test_integration_ip_asset.py @@ -278,50 +278,46 @@ def parent_ip_and_license_terms(self, story_client, nft_collection): 'expect_minimum_group_reward_share': 0, 'expect_group_reward_pool': ZERO_ADDRESS } - }] + }], + allow_duplicates=True ) return { 'parent_ip_id': response['ip_id'], 'license_terms_id': response['license_terms_ids'][0] } - # def test_register_ip_asset_with_metadata(self, story_client, nft_collection): - # token_id = mint_by_spg(nft_collection, story_client.web3, story_client.account, "test-metadata") - - # response = story_client.IPAsset.register( - # nft_contract=nft_collection, - # token_id=token_id, - # ip_metadata={ - # 'ip_metadata_uri': "test-uri", - # 'ip_metadata_hash': web3.to_hex(web3.keccak(text="test-metadata-hash")), - # 'nft_metadata_hash': web3.to_hex(web3.keccak(text="test-nft-metadata-hash")) - # }, - # deadline=1000 - # ) - - # assert 'ip_id' in response - # assert isinstance(response['ip_id'], str) - # assert response['ip_id'] != '' - - # def test_register_derivative_ip(self, story_client, parent_ip_id, license_terms_id): - # token_child_id = mint_by_spg(MockERC721, story_client.web3, story_client.account) - # result = story_client.IPAsset.register_derivative_ip( - # nft_contract=MockERC721, - # token_id=token_child_id, - # deriv_data={ - # 'parentIpIds': [parent_ip_id], - # 'licenseTermsIds': [license_terms_id], - # 'maxMintingFee': 0, - # 'maxRts': 5 * 10**6, - # 'maxRevenueShare': 0 - # }, - # deadline=1000, - # tx_options={'waitForTransaction': True} - # ) - - # assert isinstance(result['tx_hash'], str) and result['tx_hash'] - # assert isinstance(result['ip_id'], str) and result['ip_id'] + def test_register_ip_asset_with_metadata(self, story_client, nft_collection): + token_id = mint_by_spg(nft_collection, story_client.web3, story_client.account, "test-metadata") + + response = story_client.IPAsset.register( + nft_contract=nft_collection, + token_id=token_id, + deadline=1000 + ) + + assert 'ip_id' in response + assert isinstance(response['ip_id'], str) + assert response['ip_id'] != '' + + def test_register_derivative_ip(self, story_client, nft_collection, parent_ip_and_license_terms): + token_child_id = mint_by_spg(nft_collection, story_client.web3, story_client.account) + + result = story_client.IPAsset.register_derivative_ip( + nft_contract=nft_collection, + token_id=token_child_id, + deriv_data={ + 'parent_ip_ids': [parent_ip_and_license_terms['parent_ip_id']], + 'license_terms_ids': [parent_ip_and_license_terms['license_terms_id']], + 'max_minting_fee': 0, + 'max_rts': 5 * 10**6, + 'max_revenue_share': 0 + }, + deadline=1000 + ) + + assert isinstance(result['tx_hash'], str) and result['tx_hash'] + assert isinstance(result['ip_id'], str) and result['ip_id'] def test_register_ip_and_attach_pil_terms(self, story_client, nft_collection, parent_ip_and_license_terms): token_id = mint_by_spg(nft_collection, story_client.web3, story_client.account) From 82efad51dd5ca427ed244bf5e0e4375df93c5572 Mon Sep 17 00:00:00 2001 From: Andrew Chung Date: Wed, 4 Jun 2025 09:49:58 -0700 Subject: [PATCH 3/5] Removed unused set permissions fns from auto generated client --- .../abi/AccessController/AccessController_client.py | 12 ------------ src/story_protocol_python_sdk/scripts/config.json | 2 -- 2 files changed, 14 deletions(-) diff --git a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py index 999c152..78bb5c2 100644 --- a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py +++ b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py @@ -28,18 +28,6 @@ def setAllPermissions(self, ipAccount, signer, permission): def build_setAllPermissions_transaction(self, ipAccount, signer, permission, tx_params): return self.contract.functions.setAllPermissions(ipAccount, signer, permission).build_transaction(tx_params) - def setBatchPermissions(self, permissions): - return self.contract.functions.setBatchPermissions(permissions).transact() - - def build_setBatchPermissions_transaction(self, permissions, tx_params): - return self.contract.functions.setBatchPermissions(permissions).build_transaction(tx_params) - - def setPermission(self, ipAccount, signer, to, func, permission): - return self.contract.functions.setPermission(ipAccount, signer, to, func, permission).transact() - - def build_setPermission_transaction(self, ipAccount, signer, to, func, permission, tx_params): - return self.contract.functions.setPermission(ipAccount, signer, to, func, permission).build_transaction(tx_params) - def setTransientPermission(self, ipAccount, signer, to, func, permission): return self.contract.functions.setTransientPermission(ipAccount, signer, to, func, permission).transact() diff --git a/src/story_protocol_python_sdk/scripts/config.json b/src/story_protocol_python_sdk/scripts/config.json index 34c8872..b2f2f96 100644 --- a/src/story_protocol_python_sdk/scripts/config.json +++ b/src/story_protocol_python_sdk/scripts/config.json @@ -5,9 +5,7 @@ "contract_address": "0xcCF37d0a503Ee1D4C11208672e622ed3DFB2275a", "functions": [ "PermissionSet", - "setPermission", "setAllPermissions", - "setBatchPermissions", "setTransientPermission", "setTransientBatchPermissions" ] From 1523ede52d8dfbc3c181fce71d72de814b3ca95d Mon Sep 17 00:00:00 2001 From: Andrew Chung Date: Wed, 4 Jun 2025 09:52:06 -0700 Subject: [PATCH 4/5] Added back setTransientBatchPermissions() --- .../abi/AccessController/AccessController_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py index 78bb5c2..fdf2b8b 100644 --- a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py +++ b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py @@ -28,6 +28,12 @@ def setAllPermissions(self, ipAccount, signer, permission): def build_setAllPermissions_transaction(self, ipAccount, signer, permission, tx_params): return self.contract.functions.setAllPermissions(ipAccount, signer, permission).build_transaction(tx_params) + def setTransientBatchPermissions(self, permissions): + return self.contract.functions.setTransientBatchPermissions(permissions).transact() + + def build_setTransientBatchPermissions_transaction(self, permissions, tx_params): + return self.contract.functions.setTransientBatchPermissions(permissions).build_transaction(tx_params) + def setTransientPermission(self, ipAccount, signer, to, func, permission): return self.contract.functions.setTransientPermission(ipAccount, signer, to, func, permission).transact() From f6681f12ef7bfe4907d119f391701a544ee874fb Mon Sep 17 00:00:00 2001 From: Andrew Chung Date: Wed, 4 Jun 2025 11:44:41 -0700 Subject: [PATCH 5/5] Fixed access controller to use setBatchTransientPermissions() --- .../abi/AccessController/AccessController_client.py | 8 ++++---- src/story_protocol_python_sdk/scripts/config.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py index fdf2b8b..5f62161 100644 --- a/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py +++ b/src/story_protocol_python_sdk/abi/AccessController/AccessController_client.py @@ -28,11 +28,11 @@ def setAllPermissions(self, ipAccount, signer, permission): def build_setAllPermissions_transaction(self, ipAccount, signer, permission, tx_params): return self.contract.functions.setAllPermissions(ipAccount, signer, permission).build_transaction(tx_params) - def setTransientBatchPermissions(self, permissions): - return self.contract.functions.setTransientBatchPermissions(permissions).transact() + def setBatchTransientPermissions(self, permissions): + return self.contract.functions.setBatchTransientPermissions(permissions).transact() - def build_setTransientBatchPermissions_transaction(self, permissions, tx_params): - return self.contract.functions.setTransientBatchPermissions(permissions).build_transaction(tx_params) + def build_setBatchTransientPermissions_transaction(self, permissions, tx_params): + return self.contract.functions.setBatchTransientPermissions(permissions).build_transaction(tx_params) def setTransientPermission(self, ipAccount, signer, to, func, permission): return self.contract.functions.setTransientPermission(ipAccount, signer, to, func, permission).transact() diff --git a/src/story_protocol_python_sdk/scripts/config.json b/src/story_protocol_python_sdk/scripts/config.json index b2f2f96..3a13f1a 100644 --- a/src/story_protocol_python_sdk/scripts/config.json +++ b/src/story_protocol_python_sdk/scripts/config.json @@ -7,7 +7,7 @@ "PermissionSet", "setAllPermissions", "setTransientPermission", - "setTransientBatchPermissions" + "setBatchTransientPermissions" ] }, {