diff --git a/packages/dvilela/contracts/service_registry/build/ServiceRegistryL2.json b/packages/dvilela/contracts/service_registry/build/ServiceRegistryL2.json index 48f59a3..9c6b370 100644 --- a/packages/dvilela/contracts/service_registry/build/ServiceRegistryL2.json +++ b/packages/dvilela/contracts/service_registry/build/ServiceRegistryL2.json @@ -1,1940 +1,1943 @@ -[ - { - "inputs":[ - { - "internalType":"string", - "name":"_name", - "type":"string" - }, - { - "internalType":"string", - "name":"_symbol", - "type":"string" - }, - { - "internalType":"string", - "name":"_baseURI", - "type":"string" - } - ], - "stateMutability":"nonpayable", - "type":"constructor" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"operator", - "type":"address" - } - ], - "name":"AgentInstanceRegistered", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"AgentInstancesSlotsFilled", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"agentId", - "type":"uint256" - } - ], - "name":"AgentNotFound", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"agentId", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"AgentNotInService", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"componentId", - "type":"uint256" - } - ], - "name":"ComponentNotFound", - "type":"error" - }, - { - "inputs":[ - - ], - "name":"HashExists", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"sent", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"expected", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"IncorrectAgentBondingValue", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"sent", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"expected", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"IncorrectRegistrationDepositValue", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"manager", - "type":"address" - } - ], - "name":"ManagerOnly", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"provided", - "type":"address" - }, - { - "internalType":"address", - "name":"expected", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"OnlyOwnServiceMultisig", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"OperatorHasNoInstances", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"provided", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"max", - "type":"uint256" - } - ], - "name":"Overflow", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"OwnerOnly", - "type":"error" - }, - { - "inputs":[ - - ], - "name":"Paused", - "type":"error" - }, - { - "inputs":[ - - ], - "name":"ReentrancyGuard", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"ServiceMustBeInactive", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"token", - "type":"address" - }, - { - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "internalType":"uint256", - "name":"value", - "type":"uint256" - } - ], - "name":"TransferFailed", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"multisig", - "type":"address" - } - ], - "name":"UnauthorizedMultisig", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"agentId", - "type":"uint256" - } - ], - "name":"WrongAgentId", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"numValues1", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"numValues2", - "type":"uint256" - } - ], - "name":"WrongArrayLength", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"WrongOperator", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"state", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"WrongServiceState", - "type":"error" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"currentThreshold", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"minThreshold", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"maxThreshold", - "type":"uint256" - } - ], - "name":"WrongThreshold", - "type":"error" - }, - { - "inputs":[ - - ], - "name":"ZeroAddress", - "type":"error" - }, - { - "inputs":[ - - ], - "name":"ZeroValue", - "type":"error" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"ActivateRegistration", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "indexed":true, - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"Approval", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"owner", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "indexed":false, - "internalType":"bool", - "name":"approved", - "type":"bool" - } - ], - "name":"ApprovalForAll", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"string", - "name":"baseURI", - "type":"string" - } - ], - "name":"BaseURIChanged", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "indexed":true, - "internalType":"address", - "name":"multisig", - "type":"address" - } - ], - "name":"CreateMultisigWithAgents", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"bytes32", - "name":"configHash", - "type":"bytes32" - } - ], - "name":"CreateService", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"DeployService", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"sender", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"Deposit", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"drainer", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"Drain", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"drainer", - "type":"address" - } - ], - "name":"DrainerUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"manager", - "type":"address" - } - ], - "name":"ManagerUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":false, - "internalType":"uint256", - "name":"amount", - "type":"uint256" - }, - { - "indexed":true, - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"OperatorSlashed", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"OperatorUnbond", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"OwnerUpdated", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"receiver", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "name":"Refund", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "indexed":true, - "internalType":"address", - "name":"agentInstance", - "type":"address" - }, - { - "indexed":false, - "internalType":"uint256", - "name":"agentId", - "type":"uint256" - } - ], - "name":"RegisterInstance", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"TerminateService", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "indexed":true, - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "indexed":true, - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"Transfer", - "type":"event" - }, - { - "anonymous":false, - "inputs":[ - { - "indexed":true, - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "indexed":false, - "internalType":"bytes32", - "name":"configHash", - "type":"bytes32" - } - ], - "name":"UpdateService", - "type":"event" - }, - { - "inputs":[ - - ], - "name":"CID_PREFIX", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"VERSION", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"serviceOwner", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"activateRegistration", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - } - ], - "stateMutability":"payable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"spender", - "type":"address" - }, - { - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"approve", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "name":"balanceOf", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"baseURI", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"newDrainer", - "type":"address" - } - ], - "name":"changeDrainer", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"newManager", - "type":"address" - } - ], - "name":"changeManager", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"multisig", - "type":"address" - }, - { - "internalType":"bool", - "name":"permission", - "type":"bool" - } - ], - "name":"changeMultisigPermission", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"newOwner", - "type":"address" - } - ], - "name":"changeOwner", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"serviceOwner", - "type":"address" - }, - { - "internalType":"bytes32", - "name":"configHash", - "type":"bytes32" - }, - { - "internalType":"uint32[]", - "name":"agentIds", - "type":"uint32[]" - }, - { - "components":[ - { - "internalType":"uint32", - "name":"slots", - "type":"uint32" - }, - { - "internalType":"uint96", - "name":"bond", - "type":"uint96" - } - ], - "internalType":"struct AgentParams[]", - "name":"agentParams", - "type":"tuple[]" - }, - { - "internalType":"uint32", - "name":"threshold", - "type":"uint32" - } - ], - "name":"create", - "outputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"serviceOwner", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "internalType":"address", - "name":"multisigImplementation", - "type":"address" - }, - { - "internalType":"bytes", - "name":"data", - "type":"bytes" - } - ], - "name":"deploy", - "outputs":[ - { - "internalType":"address", - "name":"multisig", - "type":"address" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"drain", - "outputs":[ - { - "internalType":"uint256", - "name":"amount", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"drainer", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"unitId", - "type":"uint256" - } - ], - "name":"exists", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"getAgentInstances", - "outputs":[ - { - "internalType":"uint256", - "name":"numAgentInstances", - "type":"uint256" - }, - { - "internalType":"address[]", - "name":"agentInstances", - "type":"address[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"getAgentParams", - "outputs":[ - { - "internalType":"uint256", - "name":"numAgentIds", - "type":"uint256" - }, - { - "components":[ - { - "internalType":"uint32", - "name":"slots", - "type":"uint32" - }, - { - "internalType":"uint96", - "name":"bond", - "type":"uint96" - } - ], - "internalType":"struct AgentParams[]", - "name":"agentParams", - "type":"tuple[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"getApproved", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"agentId", - "type":"uint256" - } - ], - "name":"getInstancesForAgentId", - "outputs":[ - { - "internalType":"uint256", - "name":"numAgentInstances", - "type":"uint256" - }, - { - "internalType":"address[]", - "name":"agentInstances", - "type":"address[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"getOperatorBalance", - "outputs":[ - { - "internalType":"uint256", - "name":"balance", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"getPreviousHashes", - "outputs":[ - { - "internalType":"uint256", - "name":"numHashes", - "type":"uint256" - }, - { - "internalType":"bytes32[]", - "name":"configHashes", - "type":"bytes32[]" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"getService", - "outputs":[ - { - "components":[ - { - "internalType":"uint96", - "name":"securityDeposit", - "type":"uint96" - }, - { - "internalType":"address", - "name":"multisig", - "type":"address" - }, - { - "internalType":"bytes32", - "name":"configHash", - "type":"bytes32" - }, - { - "internalType":"uint32", - "name":"threshold", - "type":"uint32" - }, - { - "internalType":"uint32", - "name":"maxNumAgentInstances", - "type":"uint32" - }, - { - "internalType":"uint32", - "name":"numAgentInstances", - "type":"uint32" - }, - { - "internalType":"enum ServiceRegistryL2.ServiceState", - "name":"state", - "type":"uint8" - }, - { - "internalType":"uint32[]", - "name":"agentIds", - "type":"uint32[]" - } - ], - "internalType":"struct ServiceRegistryL2.Service", - "name":"service", - "type":"tuple" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - }, - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"isApprovedForAll", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"manager", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"mapAgentInstanceOperators", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"mapConfigHashes", - "outputs":[ - { - "internalType":"bytes32", - "name":"", - "type":"bytes32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "name":"mapMultisigs", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"mapOperatorAndServiceIdAgentInstances", - "outputs":[ - { - "internalType":"address", - "name":"instance", - "type":"address" - }, - { - "internalType":"uint32", - "name":"agentId", - "type":"uint32" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"mapOperatorAndServiceIdOperatorBalances", - "outputs":[ - { - "internalType":"uint96", - "name":"", - "type":"uint96" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - }, - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"mapServiceAndAgentIdAgentInstances", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"mapServiceAndAgentIdAgentParams", - "outputs":[ - { - "internalType":"uint32", - "name":"slots", - "type":"uint32" - }, - { - "internalType":"uint96", - "name":"bond", - "type":"uint96" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "name":"mapServices", - "outputs":[ - { - "internalType":"uint96", - "name":"securityDeposit", - "type":"uint96" - }, - { - "internalType":"address", - "name":"multisig", - "type":"address" - }, - { - "internalType":"bytes32", - "name":"configHash", - "type":"bytes32" - }, - { - "internalType":"uint32", - "name":"threshold", - "type":"uint32" - }, - { - "internalType":"uint32", - "name":"maxNumAgentInstances", - "type":"uint32" - }, - { - "internalType":"uint32", - "name":"numAgentInstances", - "type":"uint32" - }, - { - "internalType":"enum ServiceRegistryL2.ServiceState", - "name":"state", - "type":"uint8" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"name", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"owner", - "outputs":[ - { - "internalType":"address", - "name":"", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"ownerOf", - "outputs":[ - { - "internalType":"address", - "name":"owner", - "type":"address" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - }, - { - "internalType":"address[]", - "name":"agentInstances", - "type":"address[]" - }, - { - "internalType":"uint32[]", - "name":"agentIds", - "type":"uint32[]" - } - ], - "name":"registerAgents", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - } - ], - "stateMutability":"payable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"safeTransferFrom", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "internalType":"uint256", - "name":"id", - "type":"uint256" - }, - { - "internalType":"bytes", - "name":"data", - "type":"bytes" - } - ], - "name":"safeTransferFrom", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "internalType":"bool", - "name":"approved", - "type":"bool" - } - ], - "name":"setApprovalForAll", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"string", - "name":"bURI", - "type":"string" - } - ], - "name":"setBaseURI", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address[]", - "name":"agentInstances", - "type":"address[]" - }, - { - "internalType":"uint96[]", - "name":"amounts", - "type":"uint96[]" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"slash", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"slashedFunds", - "outputs":[ - { - "internalType":"uint96", - "name":"", - "type":"uint96" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"bytes4", - "name":"interfaceId", - "type":"bytes4" - } - ], - "name":"supportsInterface", - "outputs":[ - { - "internalType":"bool", - "name":"", - "type":"bool" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"symbol", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"serviceOwner", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"terminate", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - }, - { - "internalType":"uint256", - "name":"refund", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"tokenByIndex", - "outputs":[ - { - "internalType":"uint256", - "name":"unitId", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"uint256", - "name":"unitId", - "type":"uint256" - } - ], - "name":"tokenURI", - "outputs":[ - { - "internalType":"string", - "name":"", - "type":"string" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - - ], - "name":"totalSupply", - "outputs":[ - { - "internalType":"uint256", - "name":"", - "type":"uint256" - } - ], - "stateMutability":"view", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"from", - "type":"address" - }, - { - "internalType":"address", - "name":"to", - "type":"address" - }, - { - "internalType":"uint256", - "name":"id", - "type":"uint256" - } - ], - "name":"transferFrom", - "outputs":[ - - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"operator", - "type":"address" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"unbond", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - }, - { - "internalType":"uint256", - "name":"refund", - "type":"uint256" - } - ], - "stateMutability":"nonpayable", - "type":"function" - }, - { - "inputs":[ - { - "internalType":"address", - "name":"serviceOwner", - "type":"address" - }, - { - "internalType":"bytes32", - "name":"configHash", - "type":"bytes32" - }, - { - "internalType":"uint32[]", - "name":"agentIds", - "type":"uint32[]" - }, - { - "components":[ - { - "internalType":"uint32", - "name":"slots", - "type":"uint32" - }, - { - "internalType":"uint96", - "name":"bond", - "type":"uint96" - } - ], - "internalType":"struct AgentParams[]", - "name":"agentParams", - "type":"tuple[]" - }, - { - "internalType":"uint32", - "name":"threshold", - "type":"uint32" - }, - { - "internalType":"uint256", - "name":"serviceId", - "type":"uint256" - } - ], - "name":"update", - "outputs":[ - { - "internalType":"bool", - "name":"success", - "type":"bool" - } - ], - "stateMutability":"nonpayable", - "type":"function" - } -] \ No newline at end of file +{ + "abi": [ + { + "inputs":[ + { + "internalType":"string", + "name":"_name", + "type":"string" + }, + { + "internalType":"string", + "name":"_symbol", + "type":"string" + }, + { + "internalType":"string", + "name":"_baseURI", + "type":"string" + } + ], + "stateMutability":"nonpayable", + "type":"constructor" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"operator", + "type":"address" + } + ], + "name":"AgentInstanceRegistered", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"AgentInstancesSlotsFilled", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"agentId", + "type":"uint256" + } + ], + "name":"AgentNotFound", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"agentId", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"AgentNotInService", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"componentId", + "type":"uint256" + } + ], + "name":"ComponentNotFound", + "type":"error" + }, + { + "inputs":[ + + ], + "name":"HashExists", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"sent", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"expected", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"IncorrectAgentBondingValue", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"sent", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"expected", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"IncorrectRegistrationDepositValue", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"sender", + "type":"address" + }, + { + "internalType":"address", + "name":"manager", + "type":"address" + } + ], + "name":"ManagerOnly", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"provided", + "type":"address" + }, + { + "internalType":"address", + "name":"expected", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"OnlyOwnServiceMultisig", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"OperatorHasNoInstances", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"provided", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"max", + "type":"uint256" + } + ], + "name":"Overflow", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"sender", + "type":"address" + }, + { + "internalType":"address", + "name":"owner", + "type":"address" + } + ], + "name":"OwnerOnly", + "type":"error" + }, + { + "inputs":[ + + ], + "name":"Paused", + "type":"error" + }, + { + "inputs":[ + + ], + "name":"ReentrancyGuard", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"ServiceMustBeInactive", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"token", + "type":"address" + }, + { + "internalType":"address", + "name":"from", + "type":"address" + }, + { + "internalType":"address", + "name":"to", + "type":"address" + }, + { + "internalType":"uint256", + "name":"value", + "type":"uint256" + } + ], + "name":"TransferFailed", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"multisig", + "type":"address" + } + ], + "name":"UnauthorizedMultisig", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"agentId", + "type":"uint256" + } + ], + "name":"WrongAgentId", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"numValues1", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"numValues2", + "type":"uint256" + } + ], + "name":"WrongArrayLength", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"WrongOperator", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"state", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"WrongServiceState", + "type":"error" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"currentThreshold", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"minThreshold", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"maxThreshold", + "type":"uint256" + } + ], + "name":"WrongThreshold", + "type":"error" + }, + { + "inputs":[ + + ], + "name":"ZeroAddress", + "type":"error" + }, + { + "inputs":[ + + ], + "name":"ZeroValue", + "type":"error" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"ActivateRegistration", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"owner", + "type":"address" + }, + { + "indexed":true, + "internalType":"address", + "name":"spender", + "type":"address" + }, + { + "indexed":true, + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"Approval", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"owner", + "type":"address" + }, + { + "indexed":true, + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "indexed":false, + "internalType":"bool", + "name":"approved", + "type":"bool" + } + ], + "name":"ApprovalForAll", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":false, + "internalType":"string", + "name":"baseURI", + "type":"string" + } + ], + "name":"BaseURIChanged", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "indexed":true, + "internalType":"address", + "name":"multisig", + "type":"address" + } + ], + "name":"CreateMultisigWithAgents", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "indexed":false, + "internalType":"bytes32", + "name":"configHash", + "type":"bytes32" + } + ], + "name":"CreateService", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"DeployService", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"sender", + "type":"address" + }, + { + "indexed":false, + "internalType":"uint256", + "name":"amount", + "type":"uint256" + } + ], + "name":"Deposit", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"drainer", + "type":"address" + }, + { + "indexed":false, + "internalType":"uint256", + "name":"amount", + "type":"uint256" + } + ], + "name":"Drain", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"drainer", + "type":"address" + } + ], + "name":"DrainerUpdated", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"manager", + "type":"address" + } + ], + "name":"ManagerUpdated", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":false, + "internalType":"uint256", + "name":"amount", + "type":"uint256" + }, + { + "indexed":true, + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"OperatorSlashed", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"OperatorUnbond", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"owner", + "type":"address" + } + ], + "name":"OwnerUpdated", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"receiver", + "type":"address" + }, + { + "indexed":false, + "internalType":"uint256", + "name":"amount", + "type":"uint256" + } + ], + "name":"Refund", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "indexed":true, + "internalType":"address", + "name":"agentInstance", + "type":"address" + }, + { + "indexed":false, + "internalType":"uint256", + "name":"agentId", + "type":"uint256" + } + ], + "name":"RegisterInstance", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"TerminateService", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"from", + "type":"address" + }, + { + "indexed":true, + "internalType":"address", + "name":"to", + "type":"address" + }, + { + "indexed":true, + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"Transfer", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "indexed":false, + "internalType":"bytes32", + "name":"configHash", + "type":"bytes32" + } + ], + "name":"UpdateService", + "type":"event" + }, + { + "inputs":[ + + ], + "name":"CID_PREFIX", + "outputs":[ + { + "internalType":"string", + "name":"", + "type":"string" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"VERSION", + "outputs":[ + { + "internalType":"string", + "name":"", + "type":"string" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"serviceOwner", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"activateRegistration", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"payable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"spender", + "type":"address" + }, + { + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"approve", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"owner", + "type":"address" + } + ], + "name":"balanceOf", + "outputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"baseURI", + "outputs":[ + { + "internalType":"string", + "name":"", + "type":"string" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"newDrainer", + "type":"address" + } + ], + "name":"changeDrainer", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"newManager", + "type":"address" + } + ], + "name":"changeManager", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"multisig", + "type":"address" + }, + { + "internalType":"bool", + "name":"permission", + "type":"bool" + } + ], + "name":"changeMultisigPermission", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"newOwner", + "type":"address" + } + ], + "name":"changeOwner", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"serviceOwner", + "type":"address" + }, + { + "internalType":"bytes32", + "name":"configHash", + "type":"bytes32" + }, + { + "internalType":"uint32[]", + "name":"agentIds", + "type":"uint32[]" + }, + { + "components":[ + { + "internalType":"uint32", + "name":"slots", + "type":"uint32" + }, + { + "internalType":"uint96", + "name":"bond", + "type":"uint96" + } + ], + "internalType":"struct AgentParams[]", + "name":"agentParams", + "type":"tuple[]" + }, + { + "internalType":"uint32", + "name":"threshold", + "type":"uint32" + } + ], + "name":"create", + "outputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"serviceOwner", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "internalType":"address", + "name":"multisigImplementation", + "type":"address" + }, + { + "internalType":"bytes", + "name":"data", + "type":"bytes" + } + ], + "name":"deploy", + "outputs":[ + { + "internalType":"address", + "name":"multisig", + "type":"address" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"drain", + "outputs":[ + { + "internalType":"uint256", + "name":"amount", + "type":"uint256" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"drainer", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"exists", + "outputs":[ + { + "internalType":"bool", + "name":"", + "type":"bool" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"getAgentInstances", + "outputs":[ + { + "internalType":"uint256", + "name":"numAgentInstances", + "type":"uint256" + }, + { + "internalType":"address[]", + "name":"agentInstances", + "type":"address[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"getAgentParams", + "outputs":[ + { + "internalType":"uint256", + "name":"numAgentIds", + "type":"uint256" + }, + { + "components":[ + { + "internalType":"uint32", + "name":"slots", + "type":"uint32" + }, + { + "internalType":"uint96", + "name":"bond", + "type":"uint96" + } + ], + "internalType":"struct AgentParams[]", + "name":"agentParams", + "type":"tuple[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"getApproved", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"agentId", + "type":"uint256" + } + ], + "name":"getInstancesForAgentId", + "outputs":[ + { + "internalType":"uint256", + "name":"numAgentInstances", + "type":"uint256" + }, + { + "internalType":"address[]", + "name":"agentInstances", + "type":"address[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"getOperatorBalance", + "outputs":[ + { + "internalType":"uint256", + "name":"balance", + "type":"uint256" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"getPreviousHashes", + "outputs":[ + { + "internalType":"uint256", + "name":"numHashes", + "type":"uint256" + }, + { + "internalType":"bytes32[]", + "name":"configHashes", + "type":"bytes32[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"getService", + "outputs":[ + { + "components":[ + { + "internalType":"uint96", + "name":"securityDeposit", + "type":"uint96" + }, + { + "internalType":"address", + "name":"multisig", + "type":"address" + }, + { + "internalType":"bytes32", + "name":"configHash", + "type":"bytes32" + }, + { + "internalType":"uint32", + "name":"threshold", + "type":"uint32" + }, + { + "internalType":"uint32", + "name":"maxNumAgentInstances", + "type":"uint32" + }, + { + "internalType":"uint32", + "name":"numAgentInstances", + "type":"uint32" + }, + { + "internalType":"enum ServiceRegistryL2.ServiceState", + "name":"state", + "type":"uint8" + }, + { + "internalType":"uint32[]", + "name":"agentIds", + "type":"uint32[]" + } + ], + "internalType":"struct ServiceRegistryL2.Service", + "name":"service", + "type":"tuple" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + }, + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "name":"isApprovedForAll", + "outputs":[ + { + "internalType":"bool", + "name":"", + "type":"bool" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"manager", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "name":"mapAgentInstanceOperators", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapConfigHashes", + "outputs":[ + { + "internalType":"bytes32", + "name":"", + "type":"bytes32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "name":"mapMultisigs", + "outputs":[ + { + "internalType":"bool", + "name":"", + "type":"bool" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapOperatorAndServiceIdAgentInstances", + "outputs":[ + { + "internalType":"address", + "name":"instance", + "type":"address" + }, + { + "internalType":"uint32", + "name":"agentId", + "type":"uint32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapOperatorAndServiceIdOperatorBalances", + "outputs":[ + { + "internalType":"uint96", + "name":"", + "type":"uint96" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapServiceAndAgentIdAgentInstances", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapServiceAndAgentIdAgentParams", + "outputs":[ + { + "internalType":"uint32", + "name":"slots", + "type":"uint32" + }, + { + "internalType":"uint96", + "name":"bond", + "type":"uint96" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapServices", + "outputs":[ + { + "internalType":"uint96", + "name":"securityDeposit", + "type":"uint96" + }, + { + "internalType":"address", + "name":"multisig", + "type":"address" + }, + { + "internalType":"bytes32", + "name":"configHash", + "type":"bytes32" + }, + { + "internalType":"uint32", + "name":"threshold", + "type":"uint32" + }, + { + "internalType":"uint32", + "name":"maxNumAgentInstances", + "type":"uint32" + }, + { + "internalType":"uint32", + "name":"numAgentInstances", + "type":"uint32" + }, + { + "internalType":"enum ServiceRegistryL2.ServiceState", + "name":"state", + "type":"uint8" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"name", + "outputs":[ + { + "internalType":"string", + "name":"", + "type":"string" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"owner", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"ownerOf", + "outputs":[ + { + "internalType":"address", + "name":"owner", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + }, + { + "internalType":"address[]", + "name":"agentInstances", + "type":"address[]" + }, + { + "internalType":"uint32[]", + "name":"agentIds", + "type":"uint32[]" + } + ], + "name":"registerAgents", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"payable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"from", + "type":"address" + }, + { + "internalType":"address", + "name":"to", + "type":"address" + }, + { + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"safeTransferFrom", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"from", + "type":"address" + }, + { + "internalType":"address", + "name":"to", + "type":"address" + }, + { + "internalType":"uint256", + "name":"id", + "type":"uint256" + }, + { + "internalType":"bytes", + "name":"data", + "type":"bytes" + } + ], + "name":"safeTransferFrom", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "internalType":"bool", + "name":"approved", + "type":"bool" + } + ], + "name":"setApprovalForAll", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"string", + "name":"bURI", + "type":"string" + } + ], + "name":"setBaseURI", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address[]", + "name":"agentInstances", + "type":"address[]" + }, + { + "internalType":"uint96[]", + "name":"amounts", + "type":"uint96[]" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"slash", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"slashedFunds", + "outputs":[ + { + "internalType":"uint96", + "name":"", + "type":"uint96" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"bytes4", + "name":"interfaceId", + "type":"bytes4" + } + ], + "name":"supportsInterface", + "outputs":[ + { + "internalType":"bool", + "name":"", + "type":"bool" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"symbol", + "outputs":[ + { + "internalType":"string", + "name":"", + "type":"string" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"serviceOwner", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"terminate", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + }, + { + "internalType":"uint256", + "name":"refund", + "type":"uint256" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"tokenByIndex", + "outputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"tokenURI", + "outputs":[ + { + "internalType":"string", + "name":"", + "type":"string" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"totalSupply", + "outputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"from", + "type":"address" + }, + { + "internalType":"address", + "name":"to", + "type":"address" + }, + { + "internalType":"uint256", + "name":"id", + "type":"uint256" + } + ], + "name":"transferFrom", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"operator", + "type":"address" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"unbond", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + }, + { + "internalType":"uint256", + "name":"refund", + "type":"uint256" + } + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"serviceOwner", + "type":"address" + }, + { + "internalType":"bytes32", + "name":"configHash", + "type":"bytes32" + }, + { + "internalType":"uint32[]", + "name":"agentIds", + "type":"uint32[]" + }, + { + "components":[ + { + "internalType":"uint32", + "name":"slots", + "type":"uint32" + }, + { + "internalType":"uint96", + "name":"bond", + "type":"uint96" + } + ], + "internalType":"struct AgentParams[]", + "name":"agentParams", + "type":"tuple[]" + }, + { + "internalType":"uint32", + "name":"threshold", + "type":"uint32" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"update", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"nonpayable", + "type":"function" + } + ], + "bytecode": "" +} \ No newline at end of file diff --git a/packages/dvilela/contracts/service_registry/contract.py b/packages/dvilela/contracts/service_registry/contract.py index 3ba6e18..210547c 100644 --- a/packages/dvilela/contracts/service_registry/contract.py +++ b/packages/dvilela/contracts/service_registry/contract.py @@ -49,10 +49,12 @@ def get_services_data( contract_instance = cls.get_instance(ledger_api, contract_address) # Get the number of registered services - n_services = contract_instance.functions.mapServices().call() + n_services = contract_instance.functions.totalSupply().call() + _logger.info(f"Got {n_services} services") services_data = [] for i in range(1, n_services + 1): + _logger.info(f"Reading service {i}") service_data = contract_instance.functions.mapServices(i).call() services_data.append( { diff --git a/packages/dvilela/skills/memeooorr_abci/behaviour_classes/base.py b/packages/dvilela/skills/memeooorr_abci/behaviour_classes/base.py index 1d73cf9..796c295 100644 --- a/packages/dvilela/skills/memeooorr_abci/behaviour_classes/base.py +++ b/packages/dvilela/skills/memeooorr_abci/behaviour_classes/base.py @@ -58,7 +58,7 @@ CELO_CHAIN_ID = "celo" HTTP_OK = 200 AVAILABLE_ACTIONS = ["heart", "unleash", "collect", "purge", "burn"] -MEMEOOORR_DESCRIPTION_PATTERN = r"^Memeooorr (@\w+)$" +MEMEOOORR_DESCRIPTION_PATTERN = r"^Memeooorr @(\w+)$" IPFS_ENDPOINT = "https://gateway.autonolas.tech/ipfs/{ipfs_hash}" @@ -359,7 +359,7 @@ def get_memeooorr_handles_from_subgraph(self) -> Generator[None, None, List[str] handle = match.group(1) # Exclude my own username - if handle != self.params.twitter_username: + if handle == self.params.twitter_username: continue handles.append(handle) @@ -415,11 +415,13 @@ def get_memeooorr_handles_from_chain(self) -> Generator[None, None, List[str]]: handle = match.group(1) # Exclude my own username - if handle != self.params.twitter_username: + if handle == self.params.twitter_username: continue handles.append(handle) + self.context.logger.info(f"Got Twitter handles: {handles}") + return handles def get_meme_coins_from_chain(self) -> Generator[None, None, Optional[List]]: diff --git a/packages/dvilela/skills/memeooorr_abci/behaviour_classes/twitter.py b/packages/dvilela/skills/memeooorr_abci/behaviour_classes/twitter.py index d6968c7..fffedcd 100644 --- a/packages/dvilela/skills/memeooorr_abci/behaviour_classes/twitter.py +++ b/packages/dvilela/skills/memeooorr_abci/behaviour_classes/twitter.py @@ -349,12 +349,13 @@ def get_event(self) -> Generator[None, None, str]: # Get their latest tweet tweet_id_to_response = {} for agent_handle in agent_handles: - # By defaul only 1 tweet is retrieved (the latest one) + # By default only 1 tweet is retrieved (the latest one) latest_tweets = yield from self._call_twikit( method="get_user_tweets", twitter_handle=agent_handle, ) if not latest_tweets: + self.context.logger.info("Couldn't get any tweets") continue tweet_id = latest_tweets[0]["id"] tweet_time = datetime.strptime( @@ -363,6 +364,7 @@ def get_event(self) -> Generator[None, None, str]: # Only respond to new tweets (last hour) if (datetime.now(timezone.utc) - tweet_time).total_seconds() >= 3600: + self.context.logger.info("Tweet is not recent") continue tweet_id_to_response[tweet_id] = latest_tweets[0]["text"]