diff --git a/packages/dvilela/contracts/agent_registry.json b/packages/dvilela/contracts/agent_registry.json new file mode 100644 index 0000000..6d3e917 --- /dev/null +++ b/packages/dvilela/contracts/agent_registry.json @@ -0,0 +1,1256 @@ +[ + { + "inputs":[ + { + "internalType":"string", + "name":"_name", + "type":"string" + }, + { + "internalType":"string", + "name":"_symbol", + "type":"string" + }, + { + "internalType":"string", + "name":"_baseURI", + "type":"string" + }, + { + "internalType":"address", + "name":"_componentRegistry", + "type":"address" + } + ], + "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":"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":false, + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + }, + { + "indexed":false, + "internalType":"enum UnitRegistry.UnitType", + "name":"uType", + "type":"uint8" + }, + { + "indexed":false, + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "name":"CreateUnit", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"manager", + "type":"address" + } + ], + "name":"ManagerUpdated", + "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":"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":false, + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + }, + { + "indexed":false, + "internalType":"enum UnitRegistry.UnitType", + "name":"uType", + "type":"uint8" + }, + { + "indexed":false, + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "name":"UpdateUnitHash", + "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":"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":"uint32[]", + "name":"unitIds", + "type":"uint32[]" + } + ], + "name":"calculateSubComponents", + "outputs":[ + { + "internalType":"uint32[]", + "name":"subComponentIds", + "type":"uint32[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"newManager", + "type":"address" + } + ], + "name":"changeManager", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"newOwner", + "type":"address" + } + ], + "name":"changeOwner", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + + ], + "name":"componentRegistry", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"unitOwner", + "type":"address" + }, + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + }, + { + "internalType":"uint32[]", + "name":"dependencies", + "type":"uint32[]" + } + ], + "name":"create", + "outputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "stateMutability":"nonpayable", + "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":"", + "type":"uint256" + } + ], + "name":"getApproved", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getDependencies", + "outputs":[ + { + "internalType":"uint256", + "name":"numDependencies", + "type":"uint256" + }, + { + "internalType":"uint32[]", + "name":"dependencies", + "type":"uint32[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getLocalSubComponents", + "outputs":[ + { + "internalType":"uint32[]", + "name":"subComponentIds", + "type":"uint32[]" + }, + { + "internalType":"uint256", + "name":"numSubComponents", + "type":"uint256" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getUnit", + "outputs":[ + { + "components":[ + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + }, + { + "internalType":"uint32[]", + "name":"dependencies", + "type":"uint32[]" + } + ], + "internalType":"struct UnitRegistry.Unit", + "name":"unit", + "type":"tuple" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getUpdatedHashes", + "outputs":[ + { + "internalType":"uint256", + "name":"numHashes", + "type":"uint256" + }, + { + "internalType":"bytes32[]", + "name":"unitHashes", + "type":"bytes32[]" + } + ], + "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":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapSubComponents", + "outputs":[ + { + "internalType":"uint32", + "name":"", + "type":"uint32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapUnitIdHashes", + "outputs":[ + { + "internalType":"bytes32", + "name":"", + "type":"bytes32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapUnits", + "outputs":[ + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "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":"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":"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":"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":[ + + ], + "name":"unitType", + "outputs":[ + { + "internalType":"enum UnitRegistry.UnitType", + "name":"", + "type":"uint8" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"unitOwner", + "type":"address" + }, + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + }, + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "name":"updateHash", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"nonpayable", + "type":"function" + } +] \ No newline at end of file diff --git a/packages/dvilela/contracts/component_registry.json b/packages/dvilela/contracts/component_registry.json new file mode 100644 index 0000000..943555e --- /dev/null +++ b/packages/dvilela/contracts/component_registry.json @@ -0,0 +1,1217 @@ +[ + { + "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":"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":false, + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + }, + { + "indexed":false, + "internalType":"enum UnitRegistry.UnitType", + "name":"uType", + "type":"uint8" + }, + { + "indexed":false, + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "name":"CreateUnit", + "type":"event" + }, + { + "anonymous":false, + "inputs":[ + { + "indexed":true, + "internalType":"address", + "name":"manager", + "type":"address" + } + ], + "name":"ManagerUpdated", + "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":"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":false, + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + }, + { + "indexed":false, + "internalType":"enum UnitRegistry.UnitType", + "name":"uType", + "type":"uint8" + }, + { + "indexed":false, + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "name":"UpdateUnitHash", + "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":"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":"newManager", + "type":"address" + } + ], + "name":"changeManager", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"newOwner", + "type":"address" + } + ], + "name":"changeOwner", + "outputs":[ + + ], + "stateMutability":"nonpayable", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"unitOwner", + "type":"address" + }, + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + }, + { + "internalType":"uint32[]", + "name":"dependencies", + "type":"uint32[]" + } + ], + "name":"create", + "outputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "stateMutability":"nonpayable", + "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":"", + "type":"uint256" + } + ], + "name":"getApproved", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getDependencies", + "outputs":[ + { + "internalType":"uint256", + "name":"numDependencies", + "type":"uint256" + }, + { + "internalType":"uint32[]", + "name":"dependencies", + "type":"uint32[]" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getLocalSubComponents", + "outputs":[ + { + "internalType":"uint32[]", + "name":"subComponentIds", + "type":"uint32[]" + }, + { + "internalType":"uint256", + "name":"numSubComponents", + "type":"uint256" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getUnit", + "outputs":[ + { + "components":[ + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + }, + { + "internalType":"uint32[]", + "name":"dependencies", + "type":"uint32[]" + } + ], + "internalType":"struct UnitRegistry.Unit", + "name":"unit", + "type":"tuple" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + } + ], + "name":"getUpdatedHashes", + "outputs":[ + { + "internalType":"uint256", + "name":"numHashes", + "type":"uint256" + }, + { + "internalType":"bytes32[]", + "name":"unitHashes", + "type":"bytes32[]" + } + ], + "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":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapSubComponents", + "outputs":[ + { + "internalType":"uint32", + "name":"", + "type":"uint32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapUnitIdHashes", + "outputs":[ + { + "internalType":"bytes32", + "name":"", + "type":"bytes32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapUnits", + "outputs":[ + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "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":"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":"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":"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":[ + + ], + "name":"unitType", + "outputs":[ + { + "internalType":"enum UnitRegistry.UnitType", + "name":"", + "type":"uint8" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"address", + "name":"unitOwner", + "type":"address" + }, + { + "internalType":"uint256", + "name":"unitId", + "type":"uint256" + }, + { + "internalType":"bytes32", + "name":"unitHash", + "type":"bytes32" + } + ], + "name":"updateHash", + "outputs":[ + { + "internalType":"bool", + "name":"success", + "type":"bool" + } + ], + "stateMutability":"nonpayable", + "type":"function" + } +] \ No newline at end of file diff --git a/packages/dvilela/contracts/service_registry.json b/packages/dvilela/contracts/service_registry.json new file mode 100644 index 0000000..cde7ef7 --- /dev/null +++ b/packages/dvilela/contracts/service_registry.json @@ -0,0 +1,2031 @@ +[ + { + "inputs":[ + { + "internalType":"string", + "name":"_name", + "type":"string" + }, + { + "internalType":"string", + "name":"_symbol", + "type":"string" + }, + { + "internalType":"string", + "name":"_baseURI", + "type":"string" + }, + { + "internalType":"address", + "name":"_agentRegistry", + "type":"address" + } + ], + "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" + } + ], + "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":[ + + ], + "name":"agentRegistry", + "outputs":[ + { + "internalType":"address", + "name":"", + "type":"address" + } + ], + "stateMutability":"view", + "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 ServiceRegistry.ServiceState", + "name":"state", + "type":"uint8" + }, + { + "internalType":"uint32[]", + "name":"agentIds", + "type":"uint32[]" + } + ], + "internalType":"struct ServiceRegistry.Service", + "name":"service", + "type":"tuple" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"enum IRegistry.UnitType", + "name":"unitType", + "type":"uint8" + }, + { + "internalType":"uint256", + "name":"serviceId", + "type":"uint256" + } + ], + "name":"getUnitIdsOfService", + "outputs":[ + { + "internalType":"uint256", + "name":"numUnitIds", + "type":"uint256" + }, + { + "internalType":"uint32[]", + "name":"unitIds", + "type":"uint32[]" + } + ], + "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" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapServiceIdSetAgentIds", + "outputs":[ + { + "internalType":"uint32", + "name":"", + "type":"uint32" + } + ], + "stateMutability":"view", + "type":"function" + }, + { + "inputs":[ + { + "internalType":"uint256", + "name":"", + "type":"uint256" + }, + { + "internalType":"uint256", + "name":"", + "type":"uint256" + } + ], + "name":"mapServiceIdSetComponentIds", + "outputs":[ + { + "internalType":"uint32", + "name":"", + "type":"uint32" + } + ], + "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 ServiceRegistry.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 diff --git a/packages/dvilela/skills/tsunami_abci/behaviours.py b/packages/dvilela/skills/tsunami_abci/behaviours.py index f1ecac5..030962d 100644 --- a/packages/dvilela/skills/tsunami_abci/behaviours.py +++ b/packages/dvilela/skills/tsunami_abci/behaviours.py @@ -50,6 +50,7 @@ TwitterDialogue, TwitterDialogues, ) +from packages.dvilela.skills.tsunami_abci.prompts import SYSTEM_PROMPTS, USER_PROMPT_TEMPLATES class TsunamiBaseBehaviour(BaseBehaviour, ABC): @@ -108,11 +109,11 @@ def async_act(self) -> Generator: # Publish tweets for tweet in tweets: - if not tweet["twitter"]: - tweet["twitter"] = yield from self.publish_tweet(tweet["text"]) + if self.params.publish_twitter and not tweet["twitter_published"]: + tweet["twitter_published"] = yield from self.publish_tweet(tweet["text"])["success"] - if not tweet["farcaster"]: - tweet["farcaster"] = yield from self.publish_cast(tweet["text"]) + if self.params.publish_farcaster and not tweet["farcaster_published"]: + tweet["farcaster_published"] = yield from self.publish_cast(tweet["text"])["success"] # Remove published tweets tweets = [t for t in tweets if t["twitter"] and t["farcaster"]] diff --git a/packages/dvilela/skills/tsunami_abci/events.py b/packages/dvilela/skills/tsunami_abci/events.py new file mode 100644 index 0000000..e6cb95b --- /dev/null +++ b/packages/dvilela/skills/tsunami_abci/events.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2024 David Vilela Freire +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the tracked contract events.""" +from enum import Enum + + +class Chain(Enum): + """Chain""" + ETHEREUM = "ETHEREUM" + GNOSIS = "GNOSIS" + + +class ContractEvent(Enum): + """ContractEvent""" + + +"service_registry": { + "CreateService", + "OperatorSlashed" +}, +"agent_registry": { + "CreateUnit" +}, +"component_registry": { + "CreateUnit" +} \ No newline at end of file diff --git a/packages/dvilela/skills/tsunami_abci/models.py b/packages/dvilela/skills/tsunami_abci/models.py index cd07985..b467997 100644 --- a/packages/dvilela/skills/tsunami_abci/models.py +++ b/packages/dvilela/skills/tsunami_abci/models.py @@ -19,6 +19,8 @@ """This module contains the shared state for the abci skill of TsunamiAbciApp.""" +from typing import Any + from packages.dvilela.skills.tsunami_abci.rounds import TsunamiAbciApp from packages.valory.skills.abstract_round_abci.models import BaseParams from packages.valory.skills.abstract_round_abci.models import ( @@ -36,6 +38,15 @@ class SharedState(BaseSharedState): abci_app_cls = TsunamiAbciApp -Params = BaseParams Requests = BaseRequests BenchmarkTool = BaseBenchmarkTool + + +class Params(BaseParams): + """Parameters.""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + """Initialize the parameters object.""" + self.publish_twitter = self._ensure("publish_twitter", kwargs, bool) + self.publish_farcaster = self._ensure("publish_farcaster", kwargs, bool) + super().__init__(*args, **kwargs) \ No newline at end of file diff --git a/packages/dvilela/skills/tsunami_abci/prompts.py b/packages/dvilela/skills/tsunami_abci/prompts.py new file mode 100644 index 0000000..bb4dac5 --- /dev/null +++ b/packages/dvilela/skills/tsunami_abci/prompts.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2024 David Vilela Freire +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ +"""Prompts""" + +SYSTEM_PROMPT_PIRATE = """ +You are an old Twitter influencer who used to be a drunk pirate. + +You announce new events in the blockchain space using your pirate language and words +related to the sea, fish and rum. + +Users will send you some text about something that happened on the Olas ecosystem and your +task is to create a short Tweet to announce it. +Keep it short, under 250 characters. +""" + +SYSTEM_PROMPT_OLAD = """ +You are an Olad, a sophisticated, elegant, intellectual Twitter influencer from the 18th +century who uses a monocle, top hat and expensive silk three-piece suits. + +You announce new events in the Olas blockchain ecosystem using well-mannered Victorian language, +sometimes referencing the way you dress and Olads, your colleagues. + +Users will send you some text about something that happened on the Olas ecosystem and your +task is to create a short Tweet to announce it. +Keep it short, under 250 characters. +""" + +SYSTEM_PROMPT_TECHIE = """ +You are a sassy, grumpy techie Twitter influencer who writes about web3 protocols. + +You announce new events in the blockchain space and you are really hyped up about it, +usually making sci-fi movie analogies like Star Trek, Dune or Star Wars. + +Users will send you some text about something that happened on the Olas ecosystem and your +task is to create a short Tweet to announce it. +Keep it short, under 250 characters. +""" + +USER_PROMPT_SERVICE = "A new service with id {service_id} has been minted on the Olas protocol" +USER_PROMPT_AGENT = "A new agent with id {agent_id} has been minted on the Olas protocol" +USER_PROMPT_COMPONENT = "A new component with id {component_id} has been minted on the Olas protocol" + +SYSTEM_PROMPTS = [SYSTEM_PROMPT_PIRATE, SYSTEM_PROMPT_OLAD, SYSTEM_PROMPT_TECHIE] +USER_PROMPT_TEMPLATES = [USER_PROMPT_SERVICE, USER_PROMPT_AGENT, USER_PROMPT_COMPONENT] diff --git a/packages/dvilela/skills/tsunami_abci/skill.yaml b/packages/dvilela/skills/tsunami_abci/skill.yaml index 08f53ba..80a8efb 100644 --- a/packages/dvilela/skills/tsunami_abci/skill.yaml +++ b/packages/dvilela/skills/tsunami_abci/skill.yaml @@ -126,6 +126,8 @@ models: tendermint_url: http://localhost:26657 tx_timeout: 10.0 validate_timeout: 1205 + publish_twitter: true + publish_farcaster: true class_name: Params requests: args: {}