diff --git a/README.md b/README.md index b1674d1..8e5f279 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,13 @@ Run the tests: npx hardhat test ``` +## Deployment and redeployment +The deployment of contracts to the test- and main-net is split into step-by-step series of scripts for more control and checkpoint convenience. +The description of deployment procedure can be found here: [deployment](https://github.com/valory-xyz/ai-registry-mech/blob/main/scripts/deployment). + +The finalized contract ABIs for deployment and their number of optimization passes are located here: [ABIs](https://github.com/valory-xyz/ai-registry-mech/blob/main/abis). +Each folder there contains contracts compiled with the solidity version before their deployment. + ## Acknowledgements The registries contracts were inspired and based on the following sources: - [Rari-Capital Solmate](https://github.com/Rari-Capital/solmate). diff --git a/abis/0.8.21/AgentFactory.json b/abis/0.8.21/AgentFactory.json new file mode 100644 index 0000000..f89821d --- /dev/null +++ b/abis/0.8.21/AgentFactory.json @@ -0,0 +1,534 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "AgentFactory", + "sourceName": "contracts/AgentFactory.sol", + "abi": [ + { + "inputs": [ + { + "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": "address", + "name": "mech", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "CreateMech", + "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": "owner", + "type": "address" + } + ], + "name": "Pause", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "Unpause", + "type": "event" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "agentRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "changeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "agentOwner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "agentHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "mech", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60a060405234801561000f575f80fd5b50604051612b50380380612b5083398101604081905261002e91610050565b6001600160a01b03166080525f80546001600160a01b0319163317905561007d565b5f60208284031215610060575f80fd5b81516001600160a01b0381168114610076575f80fd5b9392505050565b608051612aae6100a25f395f8181609a0152818161043e01526104f40152612aae5ff3fe608060405234801562000010575f80fd5b506004361062000090575f3560e01c80638da5cb5b116200005f5780638da5cb5b14620001325780638f9ade5e1462000152578063a6f9dae11462000194578063ffa1ad7414620001ab575f80fd5b80630d1cfcae14620000945780633f4ba83a14620000e65780635c975abb14620000f25780638456cb591462000128575b5f80fd5b620000bc7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b620000f0620001f7565b005b5f54620001179074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001620000dd565b620000f0620002bf565b5f54620000bc9073ffffffffffffffffffffffffffffffffffffffff1681565b620001696200016336600462000720565b6200039a565b6040805192835273ffffffffffffffffffffffffffffffffffffffff909116602083015201620000dd565b620000f0620001a536600462000753565b620005bc565b620001e86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b604051620000dd919062000776565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146200026e575f546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b5f80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16815560405133917faeb196d352664784d1900b0e7414a8face7d29f4dae8c4b0cf68ed477423bbf491a2565b5f5473ffffffffffffffffffffffffffffffffffffffff16331462000332575f546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440162000265565b5f80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017815560405133917f5ee71a369c8672edded508e624ffc9257fa1ae6886ef32905c18e60196bca39991a2565b5f8054819074010000000000000000000000000000000000000000900460ff1615620003f2576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fa3def92300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063a3def923906044016020604051808303815f875af115801562000485573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620004ab9190620007e1565b6040805173ffffffffffffffffffffffffffffffffffffffff881660208201529081018290529092505f90606001604051602081830303815290604052805190602001209050807f000000000000000000000000000000000000000000000000000000000000000084866040516200052390620006e9565b73ffffffffffffffffffffffffffffffffffffffff9093168352602083019190915260408201526060018190604051809103905ff59050801580156200056b573d5f803e3d5ffd5b50915083838373ffffffffffffffffffffffffffffffffffffffff167f67a2e45041c70013518c5b9b849a6944a6c17ff44d66be1c707020460ecbd1db60405160405180910390a450935093915050565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146200062f575f546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440162000265565b73ffffffffffffffffffffffffffffffffffffffff81166200067d576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b91a250565b61227f80620007fa83390190565b803573ffffffffffffffffffffffffffffffffffffffff811681146200071b575f80fd5b919050565b5f805f6060848603121562000733575f80fd5b6200073e84620006f7565b95602085013595506040909401359392505050565b5f6020828403121562000764575f80fd5b6200076f82620006f7565b9392505050565b5f6020808352835180828501525f5b81811015620007a35785810183015185820160400152820162000785565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b5f60208284031215620007f2575f80fd5b505191905056fe60806040525f805534801562000013575f80fd5b506040516200227f3803806200227f833981016040819052620000369162000391565b604080516001600160a01b03851660208201528082018490528151808203830181526060909101909152839083906200006f8162000145565b5050506001600160a01b0383166200009a5760405163d92e233d60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390525f906001600160a01b03851690636352211e90602401602060405180830381865afa158015620000e0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001069190620003c6565b90506001600160a01b0381166200013857604051630ede975960e01b8152600481018490526024015b60405180910390fd5b50600155506200049a9050565b6200014f620001ad565b51156200019f5760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016200012f565b620001aa8162000218565b50565b6060620002136200020d604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b620002e1565b905090565b5f620002248262000339565b90505f8151602083015ff090506200028b604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b6001600160a01b0316816001600160a01b031614620002dc5760405162461bcd60e51b815260206004820152600c60248201526b15dc9a5d194819985a5b195960a21b60448201526064016200012f565b505050565b6060813b600181116200030357505060408051602081019091525f8152919050565b806200030f81620003fd565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016200034b919062000415565b826040516020016200035f92919062000431565b6040516020818303038152906040529050919050565b80516001600160a01b03811681146200038c575f80fd5b919050565b5f805f60608486031215620003a4575f80fd5b620003af8462000375565b925060208401519150604084015190509250925092565b5f60208284031215620003d7575f80fd5b620003e28262000375565b9392505050565b634e487b7160e01b5f52601160045260245ffd5b5f816200040e576200040e620003e9565b505f190190565b808201808211156200042b576200042b620003e9565b92915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b60058201525f600e82018190528251815b8181101562000489576020818601810151600f8684010152016200046a565b505f9201600f019182525092915050565b611dd780620004a85f395ff3fe608060405260043610610159575f3560e01c8063a035b1fe116100bb578063bc197c8111610071578063e00b911811610057578063e00b911814610451578063f23a6e6114610470578063fc0c546a146104b5575f80fd5b8063bc197c81146103de578063c7dec3fc14610425575f80fd5b8063affed0e0116100a1578063affed0e014610371578063b0d691fe14610384578063b94207d3146103cb575f80fd5b8063a035b1fe1461033d578063a4f9edbf14610352575f80fd5b80633a871cdd116101105780636d70f7ae116100f65780636d70f7ae146102ae5780637af73473146102dd57806391b7f5ed1461031e575f80fd5b80633a871cdd146102645780635fee608514610283575f80fd5b8063157305fe11610140578063157305fe146102045780631626ba7e1461022357806317d70f7c14610242575f80fd5b806223de2914610164578063150b7a021461018a575f80fd5b3661016057005b5f80fd5b34801561016f575f80fd5b5061018861017e366004611586565b5050505050505050565b005b348015610195575f80fd5b506101ce6101a4366004611630565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b34801561020f575f80fd5b5061018861021e366004611772565b6104c9565b34801561022e575f80fd5b506101ce61023d366004611772565b6105be565b34801561024d575f80fd5b50610256610761565b6040519081526020016101fb565b34801561026f575f80fd5b5061025661027e3660046117b6565b610785565b34801561028e575f80fd5b5061025661029d366004611805565b60026020525f908152604090205481565b3480156102b9575f80fd5b506102cd6102c8366004611805565b6107c1565b60405190151581526020016101fb565b3480156102e8575f80fd5b506102566102f7366004611805565b73ffffffffffffffffffffffffffffffffffffffff165f9081526002602052604090205490565b348015610329575f80fd5b50610188610338366004611820565b610893565b348015610348575f80fd5b5061025660015481565b34801561035d575f80fd5b5061018861036c366004611837565b610981565b34801561037c575f80fd5b505f54610256565b34801561038f575f80fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fb565b6102566103d9366004611837565b6109fd565b3480156103e9575f80fd5b506101ce6103f83660046118b2565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b348015610430575f80fd5b5061044461043f366004611948565b610ac8565b6040516101fb9190611a25565b34801561045c575f80fd5b5061025661046b366004611a37565b610bb2565b34801561047b575f80fd5b506101ce61048a366004611a6e565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b3480156104c0575f80fd5b506103a6610c03565b6104d2336107c1565b806104f0575033730576a174d229e3cfa37253523e645a78a0c91b57145b610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b7f3ec84da2cdc1ce60c063642b69ff2e65f3b69787a2b90443457ba274e51e7c7282826040516105b2929190611ae5565b60405180910390a15050565b5f805f806105de85602081015160408201516060909201515f1a92909190565b9094509250905060ff81165f036106f457828583016020016105ff826107c1565b158015610622575073ffffffffffffffffffffffffffffffffffffffff82163014155b1561065557507fffffffff00000000000000000000000000000000000000000000000000000000945061075b9350505050565b6040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631626ba7e906106a9908b908590600401611ae5565b602060405180830381865afa1580156106c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e89190611afd565b9550505050505061075b565b6107036102c887838686610c20565b1561073457507f1626ba7e00000000000000000000000000000000000000000000000000000000925061075b915050565b507fffffffff00000000000000000000000000000000000000000000000000000000925050505b92915050565b5f8061076b610c3c565b80602001905181019061077e9190611b3c565b9392505050565b5f61078e610d10565b6107988484610d8f565b90506107a76040850185611b68565b90505f036107b8576107b884610e8f565b61077e82610f0d565b5f805f6107cc610c3c565b8060200190518101906107df9190611b3c565b915091508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161083591815260200190565b602060405180830381865afa158015610850573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108749190611bc9565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b61089c336107c1565b806108ba575033730576a174d229e3cfa37253523e645a78a0c91b57145b610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b610989610c3c565b51156109f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610578565b6109fa81610f81565b50565b5f600154341015610a47576001546040517fb48978280000000000000000000000000000000000000000000000000000000081523460048201526024810191909152604401610578565b610a513383610bb2565b335f908152600260205260408120805492935090610a6e83611c11565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc8284604051610abb929190611ae5565b60405180910390a2919050565b6060610ad3336107c1565b80610af1575033730576a174d229e3cfa37253523e645a78a0c91b57145b610b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b5f610b97878787878715610b9157876110f6565b5a6110f6565b9250905080610ba857815160208301fd5b5095945050505050565b5f8282604051602001610bc6929190611c48565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b5f80610c0d610c3c565b80602001905181019061075b9190611bc9565b5f805f610c2f878787876111f9565b91509150610ba8816112e1565b6060610d0b610d066040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b611493565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b5714610d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610578565b565b5f80610de7836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b90507f1626ba7e00000000000000000000000000000000000000000000000000000000610e5582610e1c610140880188611b68565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506105be92505050565b7fffffffff000000000000000000000000000000000000000000000000000000001614610e8657600191505061075b565b505f9392505050565b5f805460208301359180610ea283611c11565b91905055146109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610578565b80156109fa576040515f9033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d805f8114610f75576040519150601f19603f3d011682016040523d82523d5f602084013e610f7a565b606091505b5050505050565b5f610f8b826114e8565b90505f8151602083015ff0905061105d6040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5772697465206661696c656400000000000000000000000000000000000000006044820152606401610578565b505050565b5f6060600184600181111561110d5761110d611c76565b03611181578673ffffffffffffffffffffffffffffffffffffffff1683866040516111389190611ca3565b5f604051808303818686f4925050503d805f8114611171576040519150601f19603f3d011682016040523d82523d5f602084013e611176565b606091505b5090925090506111ef565b8673ffffffffffffffffffffffffffffffffffffffff168387876040516111a89190611ca3565b5f60405180830381858888f193505050503d805f81146111e3576040519150601f19603f3d011682016040523d82523d5f602084013e6111e8565b606091505b5090925090505b9550959350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561122e57505f905060036112d8565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561127f573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166112d2575f600192509250506112d8565b91505f90505b94509492505050565b5f8160048111156112f4576112f4611c76565b036112fc5750565b600181600481111561131057611310611c76565b03611377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610578565b600281600481111561138b5761138b611c76565b036113f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610578565b600381600481111561140657611406611c76565b036109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610578565b6060813b600181116114b457505060408051602081019091525f8152919050565b806114be81611cbe565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016114f89190611cf2565b8260405160200161150a929190611d05565b6040516020818303038152906040529050919050565b73ffffffffffffffffffffffffffffffffffffffff811681146109fa575f80fd5b5f8083601f840112611551575f80fd5b50813567ffffffffffffffff811115611568575f80fd5b60208301915083602082850101111561157f575f80fd5b9250929050565b5f805f805f805f8060c0898b03121561159d575f80fd5b88356115a881611520565b975060208901356115b881611520565b965060408901356115c881611520565b955060608901359450608089013567ffffffffffffffff808211156115eb575f80fd5b6115f78c838d01611541565b909650945060a08b013591508082111561160f575f80fd5b5061161c8b828c01611541565b999c989b5096995094979396929594505050565b5f805f805f60808688031215611644575f80fd5b853561164f81611520565b9450602086013561165f81611520565b935060408601359250606086013567ffffffffffffffff811115611681575f80fd5b61168d88828901611541565b969995985093965092949392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f8301126116da575f80fd5b813567ffffffffffffffff808211156116f5576116f561169e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561173b5761173b61169e565b81604052838152866020858801011115611753575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f8060408385031215611783575f80fd5b82359150602083013567ffffffffffffffff8111156117a0575f80fd5b6117ac858286016116cb565b9150509250929050565b5f805f606084860312156117c8575f80fd5b833567ffffffffffffffff8111156117de575f80fd5b840161016081870312156117f0575f80fd5b95602085013595506040909401359392505050565b5f60208284031215611815575f80fd5b813561077e81611520565b5f60208284031215611830575f80fd5b5035919050565b5f60208284031215611847575f80fd5b813567ffffffffffffffff81111561185d575f80fd5b611869848285016116cb565b949350505050565b5f8083601f840112611881575f80fd5b50813567ffffffffffffffff811115611898575f80fd5b6020830191508360208260051b850101111561157f575f80fd5b5f805f805f805f8060a0898b0312156118c9575f80fd5b88356118d481611520565b975060208901356118e481611520565b9650604089013567ffffffffffffffff80821115611900575f80fd5b61190c8c838d01611871565b909850965060608b0135915080821115611924575f80fd5b6119308c838d01611871565b909650945060808b013591508082111561160f575f80fd5b5f805f805f60a0868803121561195c575f80fd5b853561196781611520565b945060208601359350604086013567ffffffffffffffff811115611989575f80fd5b611995888289016116cb565b9350506060860135600281106119a9575f80fd5b949793965091946080013592915050565b5f5b838110156119d45781810151838201526020016119bc565b50505f910152565b5f81518084526119f38160208601602086016119ba565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f61077e60208301846119dc565b5f8060408385031215611a48575f80fd5b8235611a5381611520565b9150602083013567ffffffffffffffff8111156117a0575f80fd5b5f805f805f8060a08789031215611a83575f80fd5b8635611a8e81611520565b95506020870135611a9e81611520565b94506040870135935060608701359250608087013567ffffffffffffffff811115611ac7575f80fd5b611ad389828a01611541565b979a9699509497509295939492505050565b828152604060208201525f61186960408301846119dc565b5f60208284031215611b0d575f80fd5b81517fffffffff000000000000000000000000000000000000000000000000000000008116811461077e575f80fd5b5f8060408385031215611b4d575f80fd5b8251611b5881611520565b6020939093015192949293505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611b9b575f80fd5b83018035915067ffffffffffffffff821115611bb5575f80fd5b60200191503681900382131561157f575f80fd5b5f60208284031215611bd9575f80fd5b815161077e81611520565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c4157611c41611be4565b5060010190565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f61186960408301846119dc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f8251611cb48184602087016119ba565b9190910192915050565b5f81611ccc57611ccc611be4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b8082018082111561075b5761075b611be4565b7f630000000000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000008360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201525f600e8201525f8251611d9381600f8501602087016119ba565b91909101600f01939250505056fea2646970667358221220073f5be44e81b6be82780af4f2aa9c121509069750d75443ddf750e5f1dd745064736f6c63430008150033a2646970667358221220f7124325c38c84caf59a3ced5c39dfca96d040169bcbc36988bdfd3e4f2bee9864736f6c63430008150033", + "deployedBytecode": "0x608060405234801562000010575f80fd5b506004361062000090575f3560e01c80638da5cb5b116200005f5780638da5cb5b14620001325780638f9ade5e1462000152578063a6f9dae11462000194578063ffa1ad7414620001ab575f80fd5b80630d1cfcae14620000945780633f4ba83a14620000e65780635c975abb14620000f25780638456cb591462000128575b5f80fd5b620000bc7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b620000f0620001f7565b005b5f54620001179074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001620000dd565b620000f0620002bf565b5f54620000bc9073ffffffffffffffffffffffffffffffffffffffff1681565b620001696200016336600462000720565b6200039a565b6040805192835273ffffffffffffffffffffffffffffffffffffffff909116602083015201620000dd565b620000f0620001a536600462000753565b620005bc565b620001e86040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b604051620000dd919062000776565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146200026e575f546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b5f80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16815560405133917faeb196d352664784d1900b0e7414a8face7d29f4dae8c4b0cf68ed477423bbf491a2565b5f5473ffffffffffffffffffffffffffffffffffffffff16331462000332575f546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440162000265565b5f80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017815560405133917f5ee71a369c8672edded508e624ffc9257fa1ae6886ef32905c18e60196bca39991a2565b5f8054819074010000000000000000000000000000000000000000900460ff1615620003f2576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fa3def92300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063a3def923906044016020604051808303815f875af115801562000485573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620004ab9190620007e1565b6040805173ffffffffffffffffffffffffffffffffffffffff881660208201529081018290529092505f90606001604051602081830303815290604052805190602001209050807f000000000000000000000000000000000000000000000000000000000000000084866040516200052390620006e9565b73ffffffffffffffffffffffffffffffffffffffff9093168352602083019190915260408201526060018190604051809103905ff59050801580156200056b573d5f803e3d5ffd5b50915083838373ffffffffffffffffffffffffffffffffffffffff167f67a2e45041c70013518c5b9b849a6944a6c17ff44d66be1c707020460ecbd1db60405160405180910390a450935093915050565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146200062f575f546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff909116602482015260440162000265565b73ffffffffffffffffffffffffffffffffffffffff81166200067d576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b91a250565b61227f80620007fa83390190565b803573ffffffffffffffffffffffffffffffffffffffff811681146200071b575f80fd5b919050565b5f805f6060848603121562000733575f80fd5b6200073e84620006f7565b95602085013595506040909401359392505050565b5f6020828403121562000764575f80fd5b6200076f82620006f7565b9392505050565b5f6020808352835180828501525f5b81811015620007a35785810183015185820160400152820162000785565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b5f60208284031215620007f2575f80fd5b505191905056fe60806040525f805534801562000013575f80fd5b506040516200227f3803806200227f833981016040819052620000369162000391565b604080516001600160a01b03851660208201528082018490528151808203830181526060909101909152839083906200006f8162000145565b5050506001600160a01b0383166200009a5760405163d92e233d60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390525f906001600160a01b03851690636352211e90602401602060405180830381865afa158015620000e0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001069190620003c6565b90506001600160a01b0381166200013857604051630ede975960e01b8152600481018490526024015b60405180910390fd5b50600155506200049a9050565b6200014f620001ad565b51156200019f5760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016200012f565b620001aa8162000218565b50565b6060620002136200020d604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b620002e1565b905090565b5f620002248262000339565b90505f8151602083015ff090506200028b604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b6001600160a01b0316816001600160a01b031614620002dc5760405162461bcd60e51b815260206004820152600c60248201526b15dc9a5d194819985a5b195960a21b60448201526064016200012f565b505050565b6060813b600181116200030357505060408051602081019091525f8152919050565b806200030f81620003fd565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016200034b919062000415565b826040516020016200035f92919062000431565b6040516020818303038152906040529050919050565b80516001600160a01b03811681146200038c575f80fd5b919050565b5f805f60608486031215620003a4575f80fd5b620003af8462000375565b925060208401519150604084015190509250925092565b5f60208284031215620003d7575f80fd5b620003e28262000375565b9392505050565b634e487b7160e01b5f52601160045260245ffd5b5f816200040e576200040e620003e9565b505f190190565b808201808211156200042b576200042b620003e9565b92915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b60058201525f600e82018190528251815b8181101562000489576020818601810151600f8684010152016200046a565b505f9201600f019182525092915050565b611dd780620004a85f395ff3fe608060405260043610610159575f3560e01c8063a035b1fe116100bb578063bc197c8111610071578063e00b911811610057578063e00b911814610451578063f23a6e6114610470578063fc0c546a146104b5575f80fd5b8063bc197c81146103de578063c7dec3fc14610425575f80fd5b8063affed0e0116100a1578063affed0e014610371578063b0d691fe14610384578063b94207d3146103cb575f80fd5b8063a035b1fe1461033d578063a4f9edbf14610352575f80fd5b80633a871cdd116101105780636d70f7ae116100f65780636d70f7ae146102ae5780637af73473146102dd57806391b7f5ed1461031e575f80fd5b80633a871cdd146102645780635fee608514610283575f80fd5b8063157305fe11610140578063157305fe146102045780631626ba7e1461022357806317d70f7c14610242575f80fd5b806223de2914610164578063150b7a021461018a575f80fd5b3661016057005b5f80fd5b34801561016f575f80fd5b5061018861017e366004611586565b5050505050505050565b005b348015610195575f80fd5b506101ce6101a4366004611630565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b34801561020f575f80fd5b5061018861021e366004611772565b6104c9565b34801561022e575f80fd5b506101ce61023d366004611772565b6105be565b34801561024d575f80fd5b50610256610761565b6040519081526020016101fb565b34801561026f575f80fd5b5061025661027e3660046117b6565b610785565b34801561028e575f80fd5b5061025661029d366004611805565b60026020525f908152604090205481565b3480156102b9575f80fd5b506102cd6102c8366004611805565b6107c1565b60405190151581526020016101fb565b3480156102e8575f80fd5b506102566102f7366004611805565b73ffffffffffffffffffffffffffffffffffffffff165f9081526002602052604090205490565b348015610329575f80fd5b50610188610338366004611820565b610893565b348015610348575f80fd5b5061025660015481565b34801561035d575f80fd5b5061018861036c366004611837565b610981565b34801561037c575f80fd5b505f54610256565b34801561038f575f80fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fb565b6102566103d9366004611837565b6109fd565b3480156103e9575f80fd5b506101ce6103f83660046118b2565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b348015610430575f80fd5b5061044461043f366004611948565b610ac8565b6040516101fb9190611a25565b34801561045c575f80fd5b5061025661046b366004611a37565b610bb2565b34801561047b575f80fd5b506101ce61048a366004611a6e565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b3480156104c0575f80fd5b506103a6610c03565b6104d2336107c1565b806104f0575033730576a174d229e3cfa37253523e645a78a0c91b57145b610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b7f3ec84da2cdc1ce60c063642b69ff2e65f3b69787a2b90443457ba274e51e7c7282826040516105b2929190611ae5565b60405180910390a15050565b5f805f806105de85602081015160408201516060909201515f1a92909190565b9094509250905060ff81165f036106f457828583016020016105ff826107c1565b158015610622575073ffffffffffffffffffffffffffffffffffffffff82163014155b1561065557507fffffffff00000000000000000000000000000000000000000000000000000000945061075b9350505050565b6040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631626ba7e906106a9908b908590600401611ae5565b602060405180830381865afa1580156106c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e89190611afd565b9550505050505061075b565b6107036102c887838686610c20565b1561073457507f1626ba7e00000000000000000000000000000000000000000000000000000000925061075b915050565b507fffffffff00000000000000000000000000000000000000000000000000000000925050505b92915050565b5f8061076b610c3c565b80602001905181019061077e9190611b3c565b9392505050565b5f61078e610d10565b6107988484610d8f565b90506107a76040850185611b68565b90505f036107b8576107b884610e8f565b61077e82610f0d565b5f805f6107cc610c3c565b8060200190518101906107df9190611b3c565b915091508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161083591815260200190565b602060405180830381865afa158015610850573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108749190611bc9565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b61089c336107c1565b806108ba575033730576a174d229e3cfa37253523e645a78a0c91b57145b610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b610989610c3c565b51156109f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610578565b6109fa81610f81565b50565b5f600154341015610a47576001546040517fb48978280000000000000000000000000000000000000000000000000000000081523460048201526024810191909152604401610578565b610a513383610bb2565b335f908152600260205260408120805492935090610a6e83611c11565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc8284604051610abb929190611ae5565b60405180910390a2919050565b6060610ad3336107c1565b80610af1575033730576a174d229e3cfa37253523e645a78a0c91b57145b610b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b5f610b97878787878715610b9157876110f6565b5a6110f6565b9250905080610ba857815160208301fd5b5095945050505050565b5f8282604051602001610bc6929190611c48565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b5f80610c0d610c3c565b80602001905181019061075b9190611bc9565b5f805f610c2f878787876111f9565b91509150610ba8816112e1565b6060610d0b610d066040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b611493565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b5714610d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610578565b565b5f80610de7836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b90507f1626ba7e00000000000000000000000000000000000000000000000000000000610e5582610e1c610140880188611b68565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506105be92505050565b7fffffffff000000000000000000000000000000000000000000000000000000001614610e8657600191505061075b565b505f9392505050565b5f805460208301359180610ea283611c11565b91905055146109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610578565b80156109fa576040515f9033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d805f8114610f75576040519150601f19603f3d011682016040523d82523d5f602084013e610f7a565b606091505b5050505050565b5f610f8b826114e8565b90505f8151602083015ff0905061105d6040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5772697465206661696c656400000000000000000000000000000000000000006044820152606401610578565b505050565b5f6060600184600181111561110d5761110d611c76565b03611181578673ffffffffffffffffffffffffffffffffffffffff1683866040516111389190611ca3565b5f604051808303818686f4925050503d805f8114611171576040519150601f19603f3d011682016040523d82523d5f602084013e611176565b606091505b5090925090506111ef565b8673ffffffffffffffffffffffffffffffffffffffff168387876040516111a89190611ca3565b5f60405180830381858888f193505050503d805f81146111e3576040519150601f19603f3d011682016040523d82523d5f602084013e6111e8565b606091505b5090925090505b9550959350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561122e57505f905060036112d8565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561127f573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166112d2575f600192509250506112d8565b91505f90505b94509492505050565b5f8160048111156112f4576112f4611c76565b036112fc5750565b600181600481111561131057611310611c76565b03611377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610578565b600281600481111561138b5761138b611c76565b036113f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610578565b600381600481111561140657611406611c76565b036109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610578565b6060813b600181116114b457505060408051602081019091525f8152919050565b806114be81611cbe565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016114f89190611cf2565b8260405160200161150a929190611d05565b6040516020818303038152906040529050919050565b73ffffffffffffffffffffffffffffffffffffffff811681146109fa575f80fd5b5f8083601f840112611551575f80fd5b50813567ffffffffffffffff811115611568575f80fd5b60208301915083602082850101111561157f575f80fd5b9250929050565b5f805f805f805f8060c0898b03121561159d575f80fd5b88356115a881611520565b975060208901356115b881611520565b965060408901356115c881611520565b955060608901359450608089013567ffffffffffffffff808211156115eb575f80fd5b6115f78c838d01611541565b909650945060a08b013591508082111561160f575f80fd5b5061161c8b828c01611541565b999c989b5096995094979396929594505050565b5f805f805f60808688031215611644575f80fd5b853561164f81611520565b9450602086013561165f81611520565b935060408601359250606086013567ffffffffffffffff811115611681575f80fd5b61168d88828901611541565b969995985093965092949392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f8301126116da575f80fd5b813567ffffffffffffffff808211156116f5576116f561169e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561173b5761173b61169e565b81604052838152866020858801011115611753575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f8060408385031215611783575f80fd5b82359150602083013567ffffffffffffffff8111156117a0575f80fd5b6117ac858286016116cb565b9150509250929050565b5f805f606084860312156117c8575f80fd5b833567ffffffffffffffff8111156117de575f80fd5b840161016081870312156117f0575f80fd5b95602085013595506040909401359392505050565b5f60208284031215611815575f80fd5b813561077e81611520565b5f60208284031215611830575f80fd5b5035919050565b5f60208284031215611847575f80fd5b813567ffffffffffffffff81111561185d575f80fd5b611869848285016116cb565b949350505050565b5f8083601f840112611881575f80fd5b50813567ffffffffffffffff811115611898575f80fd5b6020830191508360208260051b850101111561157f575f80fd5b5f805f805f805f8060a0898b0312156118c9575f80fd5b88356118d481611520565b975060208901356118e481611520565b9650604089013567ffffffffffffffff80821115611900575f80fd5b61190c8c838d01611871565b909850965060608b0135915080821115611924575f80fd5b6119308c838d01611871565b909650945060808b013591508082111561160f575f80fd5b5f805f805f60a0868803121561195c575f80fd5b853561196781611520565b945060208601359350604086013567ffffffffffffffff811115611989575f80fd5b611995888289016116cb565b9350506060860135600281106119a9575f80fd5b949793965091946080013592915050565b5f5b838110156119d45781810151838201526020016119bc565b50505f910152565b5f81518084526119f38160208601602086016119ba565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f61077e60208301846119dc565b5f8060408385031215611a48575f80fd5b8235611a5381611520565b9150602083013567ffffffffffffffff8111156117a0575f80fd5b5f805f805f8060a08789031215611a83575f80fd5b8635611a8e81611520565b95506020870135611a9e81611520565b94506040870135935060608701359250608087013567ffffffffffffffff811115611ac7575f80fd5b611ad389828a01611541565b979a9699509497509295939492505050565b828152604060208201525f61186960408301846119dc565b5f60208284031215611b0d575f80fd5b81517fffffffff000000000000000000000000000000000000000000000000000000008116811461077e575f80fd5b5f8060408385031215611b4d575f80fd5b8251611b5881611520565b6020939093015192949293505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611b9b575f80fd5b83018035915067ffffffffffffffff821115611bb5575f80fd5b60200191503681900382131561157f575f80fd5b5f60208284031215611bd9575f80fd5b815161077e81611520565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c4157611c41611be4565b5060010190565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f61186960408301846119dc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f8251611cb48184602087016119ba565b9190910192915050565b5f81611ccc57611ccc611be4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b8082018082111561075b5761075b611be4565b7f630000000000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000008360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201525f600e8201525f8251611d9381600f8501602087016119ba565b91909101600f01939250505056fea2646970667358221220073f5be44e81b6be82780af4f2aa9c121509069750d75443ddf750e5f1dd745064736f6c63430008150033a2646970667358221220f7124325c38c84caf59a3ced5c39dfca96d040169bcbc36988bdfd3e4f2bee9864736f6c63430008150033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/0.8.21/AgentMech.json b/abis/0.8.21/AgentMech.json new file mode 100644 index 0000000..097a0e7 --- /dev/null +++ b/abis/0.8.21/AgentMech.json @@ -0,0 +1,652 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "AgentMech", + "sourceName": "contracts/AgentMech.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_price", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + } + ], + "name": "AgentNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + } + ], + "name": "NotEnoughPaid", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "Deliver", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "taskHash", + "type": "bytes32" + } + ], + "name": "Perform", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "PriceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "Request", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "deliver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "entryPoint", + "outputs": [ + { + "internalType": "contract IEntryPoint", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "txGas", + "type": "uint256" + } + ], + "name": "exec", + "outputs": [ + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "getRequestId", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRequestsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "requestsCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "isOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "magicValue", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mapRequestsCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "price", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "request", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newPrice", + "type": "uint256" + } + ], + "name": "setPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC721", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "tokensReceived", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initCode", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "callGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "verificationGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "preVerificationGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeePerGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPriorityFeePerGas", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "paymasterAndData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct UserOperation", + "name": "userOp", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "userOpHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "missingAccountFunds", + "type": "uint256" + } + ], + "name": "validateUserOp", + "outputs": [ + { + "internalType": "uint256", + "name": "validationData", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x60806040525f805534801562000013575f80fd5b506040516200227f3803806200227f833981016040819052620000369162000391565b604080516001600160a01b03851660208201528082018490528151808203830181526060909101909152839083906200006f8162000145565b5050506001600160a01b0383166200009a5760405163d92e233d60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390525f906001600160a01b03851690636352211e90602401602060405180830381865afa158015620000e0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001069190620003c6565b90506001600160a01b0381166200013857604051630ede975960e01b8152600481018490526024015b60405180910390fd5b50600155506200049a9050565b6200014f620001ad565b51156200019f5760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016200012f565b620001aa8162000218565b50565b6060620002136200020d604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b620002e1565b905090565b5f620002248262000339565b90505f8151602083015ff090506200028b604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b6001600160a01b0316816001600160a01b031614620002dc5760405162461bcd60e51b815260206004820152600c60248201526b15dc9a5d194819985a5b195960a21b60448201526064016200012f565b505050565b6060813b600181116200030357505060408051602081019091525f8152919050565b806200030f81620003fd565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016200034b919062000415565b826040516020016200035f92919062000431565b6040516020818303038152906040529050919050565b80516001600160a01b03811681146200038c575f80fd5b919050565b5f805f60608486031215620003a4575f80fd5b620003af8462000375565b925060208401519150604084015190509250925092565b5f60208284031215620003d7575f80fd5b620003e28262000375565b9392505050565b634e487b7160e01b5f52601160045260245ffd5b5f816200040e576200040e620003e9565b505f190190565b808201808211156200042b576200042b620003e9565b92915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b60058201525f600e82018190528251815b8181101562000489576020818601810151600f8684010152016200046a565b505f9201600f019182525092915050565b611dd780620004a85f395ff3fe608060405260043610610159575f3560e01c8063a035b1fe116100bb578063bc197c8111610071578063e00b911811610057578063e00b911814610451578063f23a6e6114610470578063fc0c546a146104b5575f80fd5b8063bc197c81146103de578063c7dec3fc14610425575f80fd5b8063affed0e0116100a1578063affed0e014610371578063b0d691fe14610384578063b94207d3146103cb575f80fd5b8063a035b1fe1461033d578063a4f9edbf14610352575f80fd5b80633a871cdd116101105780636d70f7ae116100f65780636d70f7ae146102ae5780637af73473146102dd57806391b7f5ed1461031e575f80fd5b80633a871cdd146102645780635fee608514610283575f80fd5b8063157305fe11610140578063157305fe146102045780631626ba7e1461022357806317d70f7c14610242575f80fd5b806223de2914610164578063150b7a021461018a575f80fd5b3661016057005b5f80fd5b34801561016f575f80fd5b5061018861017e366004611586565b5050505050505050565b005b348015610195575f80fd5b506101ce6101a4366004611630565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b34801561020f575f80fd5b5061018861021e366004611772565b6104c9565b34801561022e575f80fd5b506101ce61023d366004611772565b6105be565b34801561024d575f80fd5b50610256610761565b6040519081526020016101fb565b34801561026f575f80fd5b5061025661027e3660046117b6565b610785565b34801561028e575f80fd5b5061025661029d366004611805565b60026020525f908152604090205481565b3480156102b9575f80fd5b506102cd6102c8366004611805565b6107c1565b60405190151581526020016101fb565b3480156102e8575f80fd5b506102566102f7366004611805565b73ffffffffffffffffffffffffffffffffffffffff165f9081526002602052604090205490565b348015610329575f80fd5b50610188610338366004611820565b610893565b348015610348575f80fd5b5061025660015481565b34801561035d575f80fd5b5061018861036c366004611837565b610981565b34801561037c575f80fd5b505f54610256565b34801561038f575f80fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fb565b6102566103d9366004611837565b6109fd565b3480156103e9575f80fd5b506101ce6103f83660046118b2565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b348015610430575f80fd5b5061044461043f366004611948565b610ac8565b6040516101fb9190611a25565b34801561045c575f80fd5b5061025661046b366004611a37565b610bb2565b34801561047b575f80fd5b506101ce61048a366004611a6e565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b3480156104c0575f80fd5b506103a6610c03565b6104d2336107c1565b806104f0575033730576a174d229e3cfa37253523e645a78a0c91b57145b610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b7f3ec84da2cdc1ce60c063642b69ff2e65f3b69787a2b90443457ba274e51e7c7282826040516105b2929190611ae5565b60405180910390a15050565b5f805f806105de85602081015160408201516060909201515f1a92909190565b9094509250905060ff81165f036106f457828583016020016105ff826107c1565b158015610622575073ffffffffffffffffffffffffffffffffffffffff82163014155b1561065557507fffffffff00000000000000000000000000000000000000000000000000000000945061075b9350505050565b6040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631626ba7e906106a9908b908590600401611ae5565b602060405180830381865afa1580156106c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e89190611afd565b9550505050505061075b565b6107036102c887838686610c20565b1561073457507f1626ba7e00000000000000000000000000000000000000000000000000000000925061075b915050565b507fffffffff00000000000000000000000000000000000000000000000000000000925050505b92915050565b5f8061076b610c3c565b80602001905181019061077e9190611b3c565b9392505050565b5f61078e610d10565b6107988484610d8f565b90506107a76040850185611b68565b90505f036107b8576107b884610e8f565b61077e82610f0d565b5f805f6107cc610c3c565b8060200190518101906107df9190611b3c565b915091508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161083591815260200190565b602060405180830381865afa158015610850573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108749190611bc9565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b61089c336107c1565b806108ba575033730576a174d229e3cfa37253523e645a78a0c91b57145b610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b610989610c3c565b51156109f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610578565b6109fa81610f81565b50565b5f600154341015610a47576001546040517fb48978280000000000000000000000000000000000000000000000000000000081523460048201526024810191909152604401610578565b610a513383610bb2565b335f908152600260205260408120805492935090610a6e83611c11565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc8284604051610abb929190611ae5565b60405180910390a2919050565b6060610ad3336107c1565b80610af1575033730576a174d229e3cfa37253523e645a78a0c91b57145b610b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b5f610b97878787878715610b9157876110f6565b5a6110f6565b9250905080610ba857815160208301fd5b5095945050505050565b5f8282604051602001610bc6929190611c48565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b5f80610c0d610c3c565b80602001905181019061075b9190611bc9565b5f805f610c2f878787876111f9565b91509150610ba8816112e1565b6060610d0b610d066040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b611493565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b5714610d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610578565b565b5f80610de7836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b90507f1626ba7e00000000000000000000000000000000000000000000000000000000610e5582610e1c610140880188611b68565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506105be92505050565b7fffffffff000000000000000000000000000000000000000000000000000000001614610e8657600191505061075b565b505f9392505050565b5f805460208301359180610ea283611c11565b91905055146109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610578565b80156109fa576040515f9033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d805f8114610f75576040519150601f19603f3d011682016040523d82523d5f602084013e610f7a565b606091505b5050505050565b5f610f8b826114e8565b90505f8151602083015ff0905061105d6040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5772697465206661696c656400000000000000000000000000000000000000006044820152606401610578565b505050565b5f6060600184600181111561110d5761110d611c76565b03611181578673ffffffffffffffffffffffffffffffffffffffff1683866040516111389190611ca3565b5f604051808303818686f4925050503d805f8114611171576040519150601f19603f3d011682016040523d82523d5f602084013e611176565b606091505b5090925090506111ef565b8673ffffffffffffffffffffffffffffffffffffffff168387876040516111a89190611ca3565b5f60405180830381858888f193505050503d805f81146111e3576040519150601f19603f3d011682016040523d82523d5f602084013e6111e8565b606091505b5090925090505b9550959350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561122e57505f905060036112d8565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561127f573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166112d2575f600192509250506112d8565b91505f90505b94509492505050565b5f8160048111156112f4576112f4611c76565b036112fc5750565b600181600481111561131057611310611c76565b03611377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610578565b600281600481111561138b5761138b611c76565b036113f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610578565b600381600481111561140657611406611c76565b036109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610578565b6060813b600181116114b457505060408051602081019091525f8152919050565b806114be81611cbe565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016114f89190611cf2565b8260405160200161150a929190611d05565b6040516020818303038152906040529050919050565b73ffffffffffffffffffffffffffffffffffffffff811681146109fa575f80fd5b5f8083601f840112611551575f80fd5b50813567ffffffffffffffff811115611568575f80fd5b60208301915083602082850101111561157f575f80fd5b9250929050565b5f805f805f805f8060c0898b03121561159d575f80fd5b88356115a881611520565b975060208901356115b881611520565b965060408901356115c881611520565b955060608901359450608089013567ffffffffffffffff808211156115eb575f80fd5b6115f78c838d01611541565b909650945060a08b013591508082111561160f575f80fd5b5061161c8b828c01611541565b999c989b5096995094979396929594505050565b5f805f805f60808688031215611644575f80fd5b853561164f81611520565b9450602086013561165f81611520565b935060408601359250606086013567ffffffffffffffff811115611681575f80fd5b61168d88828901611541565b969995985093965092949392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f8301126116da575f80fd5b813567ffffffffffffffff808211156116f5576116f561169e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561173b5761173b61169e565b81604052838152866020858801011115611753575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f8060408385031215611783575f80fd5b82359150602083013567ffffffffffffffff8111156117a0575f80fd5b6117ac858286016116cb565b9150509250929050565b5f805f606084860312156117c8575f80fd5b833567ffffffffffffffff8111156117de575f80fd5b840161016081870312156117f0575f80fd5b95602085013595506040909401359392505050565b5f60208284031215611815575f80fd5b813561077e81611520565b5f60208284031215611830575f80fd5b5035919050565b5f60208284031215611847575f80fd5b813567ffffffffffffffff81111561185d575f80fd5b611869848285016116cb565b949350505050565b5f8083601f840112611881575f80fd5b50813567ffffffffffffffff811115611898575f80fd5b6020830191508360208260051b850101111561157f575f80fd5b5f805f805f805f8060a0898b0312156118c9575f80fd5b88356118d481611520565b975060208901356118e481611520565b9650604089013567ffffffffffffffff80821115611900575f80fd5b61190c8c838d01611871565b909850965060608b0135915080821115611924575f80fd5b6119308c838d01611871565b909650945060808b013591508082111561160f575f80fd5b5f805f805f60a0868803121561195c575f80fd5b853561196781611520565b945060208601359350604086013567ffffffffffffffff811115611989575f80fd5b611995888289016116cb565b9350506060860135600281106119a9575f80fd5b949793965091946080013592915050565b5f5b838110156119d45781810151838201526020016119bc565b50505f910152565b5f81518084526119f38160208601602086016119ba565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f61077e60208301846119dc565b5f8060408385031215611a48575f80fd5b8235611a5381611520565b9150602083013567ffffffffffffffff8111156117a0575f80fd5b5f805f805f8060a08789031215611a83575f80fd5b8635611a8e81611520565b95506020870135611a9e81611520565b94506040870135935060608701359250608087013567ffffffffffffffff811115611ac7575f80fd5b611ad389828a01611541565b979a9699509497509295939492505050565b828152604060208201525f61186960408301846119dc565b5f60208284031215611b0d575f80fd5b81517fffffffff000000000000000000000000000000000000000000000000000000008116811461077e575f80fd5b5f8060408385031215611b4d575f80fd5b8251611b5881611520565b6020939093015192949293505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611b9b575f80fd5b83018035915067ffffffffffffffff821115611bb5575f80fd5b60200191503681900382131561157f575f80fd5b5f60208284031215611bd9575f80fd5b815161077e81611520565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c4157611c41611be4565b5060010190565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f61186960408301846119dc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f8251611cb48184602087016119ba565b9190910192915050565b5f81611ccc57611ccc611be4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b8082018082111561075b5761075b611be4565b7f630000000000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000008360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201525f600e8201525f8251611d9381600f8501602087016119ba565b91909101600f01939250505056fea2646970667358221220073f5be44e81b6be82780af4f2aa9c121509069750d75443ddf750e5f1dd745064736f6c63430008150033", + "deployedBytecode": "0x608060405260043610610159575f3560e01c8063a035b1fe116100bb578063bc197c8111610071578063e00b911811610057578063e00b911814610451578063f23a6e6114610470578063fc0c546a146104b5575f80fd5b8063bc197c81146103de578063c7dec3fc14610425575f80fd5b8063affed0e0116100a1578063affed0e014610371578063b0d691fe14610384578063b94207d3146103cb575f80fd5b8063a035b1fe1461033d578063a4f9edbf14610352575f80fd5b80633a871cdd116101105780636d70f7ae116100f65780636d70f7ae146102ae5780637af73473146102dd57806391b7f5ed1461031e575f80fd5b80633a871cdd146102645780635fee608514610283575f80fd5b8063157305fe11610140578063157305fe146102045780631626ba7e1461022357806317d70f7c14610242575f80fd5b806223de2914610164578063150b7a021461018a575f80fd5b3661016057005b5f80fd5b34801561016f575f80fd5b5061018861017e366004611586565b5050505050505050565b005b348015610195575f80fd5b506101ce6101a4366004611630565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b34801561020f575f80fd5b5061018861021e366004611772565b6104c9565b34801561022e575f80fd5b506101ce61023d366004611772565b6105be565b34801561024d575f80fd5b50610256610761565b6040519081526020016101fb565b34801561026f575f80fd5b5061025661027e3660046117b6565b610785565b34801561028e575f80fd5b5061025661029d366004611805565b60026020525f908152604090205481565b3480156102b9575f80fd5b506102cd6102c8366004611805565b6107c1565b60405190151581526020016101fb565b3480156102e8575f80fd5b506102566102f7366004611805565b73ffffffffffffffffffffffffffffffffffffffff165f9081526002602052604090205490565b348015610329575f80fd5b50610188610338366004611820565b610893565b348015610348575f80fd5b5061025660015481565b34801561035d575f80fd5b5061018861036c366004611837565b610981565b34801561037c575f80fd5b505f54610256565b34801561038f575f80fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fb565b6102566103d9366004611837565b6109fd565b3480156103e9575f80fd5b506101ce6103f83660046118b2565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b348015610430575f80fd5b5061044461043f366004611948565b610ac8565b6040516101fb9190611a25565b34801561045c575f80fd5b5061025661046b366004611a37565b610bb2565b34801561047b575f80fd5b506101ce61048a366004611a6e565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b3480156104c0575f80fd5b506103a6610c03565b6104d2336107c1565b806104f0575033730576a174d229e3cfa37253523e645a78a0c91b57145b610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b7f3ec84da2cdc1ce60c063642b69ff2e65f3b69787a2b90443457ba274e51e7c7282826040516105b2929190611ae5565b60405180910390a15050565b5f805f806105de85602081015160408201516060909201515f1a92909190565b9094509250905060ff81165f036106f457828583016020016105ff826107c1565b158015610622575073ffffffffffffffffffffffffffffffffffffffff82163014155b1561065557507fffffffff00000000000000000000000000000000000000000000000000000000945061075b9350505050565b6040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631626ba7e906106a9908b908590600401611ae5565b602060405180830381865afa1580156106c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e89190611afd565b9550505050505061075b565b6107036102c887838686610c20565b1561073457507f1626ba7e00000000000000000000000000000000000000000000000000000000925061075b915050565b507fffffffff00000000000000000000000000000000000000000000000000000000925050505b92915050565b5f8061076b610c3c565b80602001905181019061077e9190611b3c565b9392505050565b5f61078e610d10565b6107988484610d8f565b90506107a76040850185611b68565b90505f036107b8576107b884610e8f565b61077e82610f0d565b5f805f6107cc610c3c565b8060200190518101906107df9190611b3c565b915091508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161083591815260200190565b602060405180830381865afa158015610850573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108749190611bc9565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b61089c336107c1565b806108ba575033730576a174d229e3cfa37253523e645a78a0c91b57145b610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b610989610c3c565b51156109f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610578565b6109fa81610f81565b50565b5f600154341015610a47576001546040517fb48978280000000000000000000000000000000000000000000000000000000081523460048201526024810191909152604401610578565b610a513383610bb2565b335f908152600260205260408120805492935090610a6e83611c11565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc8284604051610abb929190611ae5565b60405180910390a2919050565b6060610ad3336107c1565b80610af1575033730576a174d229e3cfa37253523e645a78a0c91b57145b610b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e747261637400006064820152608401610578565b5f610b97878787878715610b9157876110f6565b5a6110f6565b9250905080610ba857815160208301fd5b5095945050505050565b5f8282604051602001610bc6929190611c48565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b5f80610c0d610c3c565b80602001905181019061075b9190611bc9565b5f805f610c2f878787876111f9565b91509150610ba8816112e1565b6060610d0b610d066040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b611493565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b5714610d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610578565b565b5f80610de7836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b90507f1626ba7e00000000000000000000000000000000000000000000000000000000610e5582610e1c610140880188611b68565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152506105be92505050565b7fffffffff000000000000000000000000000000000000000000000000000000001614610e8657600191505061075b565b505f9392505050565b5f805460208301359180610ea283611c11565b91905055146109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610578565b80156109fa576040515f9033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d805f8114610f75576040519150601f19603f3d011682016040523d82523d5f602084013e610f7a565b606091505b5050505050565b5f610f8b826114e8565b90505f8151602083015ff0905061105d6040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146110f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5772697465206661696c656400000000000000000000000000000000000000006044820152606401610578565b505050565b5f6060600184600181111561110d5761110d611c76565b03611181578673ffffffffffffffffffffffffffffffffffffffff1683866040516111389190611ca3565b5f604051808303818686f4925050503d805f8114611171576040519150601f19603f3d011682016040523d82523d5f602084013e611176565b606091505b5090925090506111ef565b8673ffffffffffffffffffffffffffffffffffffffff168387876040516111a89190611ca3565b5f60405180830381858888f193505050503d805f81146111e3576040519150601f19603f3d011682016040523d82523d5f602084013e6111e8565b606091505b5090925090505b9550959350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561122e57505f905060036112d8565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561127f573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166112d2575f600192509250506112d8565b91505f90505b94509492505050565b5f8160048111156112f4576112f4611c76565b036112fc5750565b600181600481111561131057611310611c76565b03611377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610578565b600281600481111561138b5761138b611c76565b036113f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610578565b600381600481111561140657611406611c76565b036109fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610578565b6060813b600181116114b457505060408051602081019091525f8152919050565b806114be81611cbe565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016114f89190611cf2565b8260405160200161150a929190611d05565b6040516020818303038152906040529050919050565b73ffffffffffffffffffffffffffffffffffffffff811681146109fa575f80fd5b5f8083601f840112611551575f80fd5b50813567ffffffffffffffff811115611568575f80fd5b60208301915083602082850101111561157f575f80fd5b9250929050565b5f805f805f805f8060c0898b03121561159d575f80fd5b88356115a881611520565b975060208901356115b881611520565b965060408901356115c881611520565b955060608901359450608089013567ffffffffffffffff808211156115eb575f80fd5b6115f78c838d01611541565b909650945060a08b013591508082111561160f575f80fd5b5061161c8b828c01611541565b999c989b5096995094979396929594505050565b5f805f805f60808688031215611644575f80fd5b853561164f81611520565b9450602086013561165f81611520565b935060408601359250606086013567ffffffffffffffff811115611681575f80fd5b61168d88828901611541565b969995985093965092949392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f8301126116da575f80fd5b813567ffffffffffffffff808211156116f5576116f561169e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561173b5761173b61169e565b81604052838152866020858801011115611753575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f8060408385031215611783575f80fd5b82359150602083013567ffffffffffffffff8111156117a0575f80fd5b6117ac858286016116cb565b9150509250929050565b5f805f606084860312156117c8575f80fd5b833567ffffffffffffffff8111156117de575f80fd5b840161016081870312156117f0575f80fd5b95602085013595506040909401359392505050565b5f60208284031215611815575f80fd5b813561077e81611520565b5f60208284031215611830575f80fd5b5035919050565b5f60208284031215611847575f80fd5b813567ffffffffffffffff81111561185d575f80fd5b611869848285016116cb565b949350505050565b5f8083601f840112611881575f80fd5b50813567ffffffffffffffff811115611898575f80fd5b6020830191508360208260051b850101111561157f575f80fd5b5f805f805f805f8060a0898b0312156118c9575f80fd5b88356118d481611520565b975060208901356118e481611520565b9650604089013567ffffffffffffffff80821115611900575f80fd5b61190c8c838d01611871565b909850965060608b0135915080821115611924575f80fd5b6119308c838d01611871565b909650945060808b013591508082111561160f575f80fd5b5f805f805f60a0868803121561195c575f80fd5b853561196781611520565b945060208601359350604086013567ffffffffffffffff811115611989575f80fd5b611995888289016116cb565b9350506060860135600281106119a9575f80fd5b949793965091946080013592915050565b5f5b838110156119d45781810151838201526020016119bc565b50505f910152565b5f81518084526119f38160208601602086016119ba565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f61077e60208301846119dc565b5f8060408385031215611a48575f80fd5b8235611a5381611520565b9150602083013567ffffffffffffffff8111156117a0575f80fd5b5f805f805f8060a08789031215611a83575f80fd5b8635611a8e81611520565b95506020870135611a9e81611520565b94506040870135935060608701359250608087013567ffffffffffffffff811115611ac7575f80fd5b611ad389828a01611541565b979a9699509497509295939492505050565b828152604060208201525f61186960408301846119dc565b5f60208284031215611b0d575f80fd5b81517fffffffff000000000000000000000000000000000000000000000000000000008116811461077e575f80fd5b5f8060408385031215611b4d575f80fd5b8251611b5881611520565b6020939093015192949293505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611b9b575f80fd5b83018035915067ffffffffffffffff821115611bb5575f80fd5b60200191503681900382131561157f575f80fd5b5f60208284031215611bd9575f80fd5b815161077e81611520565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c4157611c41611be4565b5060010190565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f61186960408301846119dc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f8251611cb48184602087016119ba565b9190910192915050565b5f81611ccc57611ccc611be4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b8082018082111561075b5761075b611be4565b7f630000000000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000008360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201525f600e8201525f8251611d9381600f8501602087016119ba565b91909101600f01939250505056fea2646970667358221220073f5be44e81b6be82780af4f2aa9c121509069750d75443ddf750e5f1dd745064736f6c63430008150033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/abis/0.8.21/AgentRegistry.json b/abis/0.8.21/AgentRegistry.json new file mode 100644 index 0000000..d79031d --- /dev/null +++ b/abis/0.8.21/AgentRegistry.json @@ -0,0 +1,1046 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "AgentRegistry", + "sourceName": "contracts/AgentRegistry.sol", + "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": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + } + ], + "name": "OperatorOnly", + "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": true, + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "agentHash", + "type": "bytes32" + } + ], + "name": "CreateAgent", + "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": true, + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "agentHash", + "type": "bytes32" + } + ], + "name": "UpdateAgentHash", + "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": "agentOwner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "agentHash", + "type": "bytes32" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "uint256", + "name": "agentId", + "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": "agentId", + "type": "uint256" + } + ], + "name": "getHashes", + "outputs": [ + { + "internalType": "uint256", + "name": "numHashes", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "agentHashes", + "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": "mapAgentIdHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "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": [ + { + "internalType": "uint256", + "name": "agentId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "agentHash", + "type": "bytes32" + } + ], + "name": "updateHash", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040526001600a5534801562000015575f80fd5b506040516200275a3803806200275a833981016040819052620000389162000144565b82825f6200004783826200025b565b5060016200005682826200025b565b506008915062000069905082826200025b565b5050600680546001600160a01b0319163317905550620003239050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112620000aa575f80fd5b81516001600160401b0380821115620000c757620000c762000086565b604051601f8301601f19908116603f01168101908282118183101715620000f257620000f262000086565b816040528381526020925086838588010111156200010e575f80fd5b5f91505b8382101562000131578582018301518183018401529082019062000112565b5f93810190920192909252949350505050565b5f805f6060848603121562000157575f80fd5b83516001600160401b03808211156200016e575f80fd5b6200017c878388016200009a565b9450602086015191508082111562000192575f80fd5b620001a0878388016200009a565b93506040860151915080821115620001b6575f80fd5b50620001c5868287016200009a565b9150509250925092565b600181811c90821680620001e457607f821691505b6020821081036200020357634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111562000256575f81815260208120601f850160051c81016020861015620002315750805b601f850160051c820191505b8181101562000252578281556001016200023d565b5050505b505050565b81516001600160401b0381111562000277576200027762000086565b6200028f81620002888454620001cf565b8462000209565b602080601f831160018114620002c5575f8415620002ad5750858301515b5f19600386901b1c1916600185901b17855562000252565b5f85815260208120601f198616915b82811015620002f557888601518255948401946001909101908401620002d4565b50858210156200031357878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b61242980620003315f395ff3fe608060405234801561000f575f80fd5b50600436106101bb575f3560e01c806370a08231116100f3578063a3fbbaae11610093578063b88d4fde1161006e578063b88d4fde14610426578063c87b56dd14610439578063e985e9c51461044c578063ffa1ad7414610479575f80fd5b8063a3fbbaae146103ed578063a6f9dae114610400578063b1f52e8014610413575f80fd5b80638da5cb5b116100ce5780638da5cb5b1461039f57806395d89b41146103bf578063a22cb465146103c7578063a3def923146103da575f80fd5b806370a082311461033d5780637647a90c146103505780637c5e63e014610363575f80fd5b806342842e0e1161015e5780634f6ccce7116101395780634f6ccce7146102fc57806355f804b31461030f5780636352211e146103225780636c0360eb14610335575f80fd5b806342842e0e146102b6578063481c6a75146102c95780634f558e79146102e9575f80fd5b8063081812fc11610199578063081812fc1461021d578063095ea7b31461027757806318160ddd1461028c57806323b872dd146102a3575f80fd5b806301ffc9a7146101bf57806302a8ca10146101e757806306fdde0314610208575b5f80fd5b6101d26101cd366004611c84565b6104b5565b60405190151581526020015b60405180910390f35b6101fa6101f5366004611ca6565b610599565b6040516101de929190611cbd565b610210610652565b6040516101de9190611d2b565b61025261022b366004611ca6565b60046020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b61028a610285366004611d9e565b6106dd565b005b61029560095481565b6040519081526020016101de565b61028a6102b1366004611dc6565b610824565b61028a6102c4366004611dc6565b610ae7565b6007546102529073ffffffffffffffffffffffffffffffffffffffff1681565b6101d26102f7366004611ca6565b610c4a565b61029561030a366004611ca6565b610c6b565b61028a61031d366004611e2c565b610cc8565b610252610330366004611ca6565b610dbc565b610210610e47565b61029561034b366004611ef5565b610e54565b61029561035e366004611f0e565b610efa565b6102106040518060400160405280600981526020017f663031373031323230000000000000000000000000000000000000000000000081525081565b6006546102529073ffffffffffffffffffffffffffffffffffffffff1681565b610210610f25565b61028a6103d5366004611f2e565b610f32565b6102956103e8366004611d9e565b610fc8565b61028a6103fb366004611ef5565b61118b565b61028a61040e366004611ef5565b6112b9565b6101d2610421366004611f0e565b6113e7565b61028a610434366004611f67565b611503565b610210610447366004611ca6565b611657565b6101d261045a366004611ffa565b600560209081525f928352604080842090915290825290205460ff1681565b6102106040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061054757507f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b8061059357507f5b5e139f000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f60605f831180156105ad57506009548311155b1561060f575f838152600b60209081526040918290208054835181840281018401909452808452909183018282801561060357602002820191905f5260205f20905b8154815260200190600101908083116105ef575b50505050509050610649565b6040517f0ede9759000000000000000000000000000000000000000000000000000000008152600481018490526024015b60405180910390fd5b80519150915091565b5f805461065e9061202b565b80601f016020809104026020016040519081016040528092919081815260200182805461068a9061202b565b80156106d55780601f106106ac576101008083540402835291602001916106d5565b820191905f5260205f20905b8154815290600101906020018083116106b857829003601f168201915b505050505081565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff163381148061073e575073ffffffffffffffffffffffffffffffffffffffff81165f90815260056020908152604080832033845290915290205460ff165b6107a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610640565b5f8281526004602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff8481169116146108b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f57524f4e475f46524f4d000000000000000000000000000000000000000000006044820152606401610640565b73ffffffffffffffffffffffffffffffffffffffff8216610930576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f494e56414c49445f524543495049454e540000000000000000000000000000006044820152606401610640565b3373ffffffffffffffffffffffffffffffffffffffff84161480610983575073ffffffffffffffffffffffffffffffffffffffff83165f90815260056020908152604080832033845290915290205460ff165b806109b057505f8181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1633145b610a16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610640565b73ffffffffffffffffffffffffffffffffffffffff8084165f81815260036020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055938616808352848320805460010190558583526002825284832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610af2838383610824565b73ffffffffffffffffffffffffffffffffffffffff82163b15610c45576040517f150b7a020000000000000000000000000000000000000000000000000000000080825233600483015273ffffffffffffffffffffffffffffffffffffffff858116602484015260448301849052608060648401525f608484015290919084169063150b7a029060a4016020604051808303815f875af1158015610b98573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bbc919061207c565b7fffffffff000000000000000000000000000000000000000000000000000000001614610c45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610640565b505050565b5f80821180156105935750600954610c639060016120c4565b821092915050565b5f610c778260016120c4565b9050600954811115610cc3576009546040517f7ae59685000000000000000000000000000000000000000000000000000000008152610640918391600401918252602082015260400190565b919050565b60065473ffffffffffffffffffffffffffffffffffffffff163314610d3b576006546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b80515f03610d75576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008610d818282612124565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf681604051610db19190611d2b565b60405180910390a150565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610cc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e4f545f4d494e544544000000000000000000000000000000000000000000006044820152606401610640565b6008805461065e9061202b565b5f73ffffffffffffffffffffffffffffffffffffffff8216610ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f5f4144445245535300000000000000000000000000000000000000006044820152606401610640565b5073ffffffffffffffffffffffffffffffffffffffff165f9081526003602052604090205490565b600b602052815f5260405f208181548110610f13575f80fd5b905f5260205f20015f91509150505481565b6001805461065e9061202b565b335f81815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f6001600a541115611006576040517f8beb9d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600a5560075473ffffffffffffffffffffffffffffffffffffffff16331461107e576007546040517f625a43fe00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b73ffffffffffffffffffffffffffffffffffffffff83166110cb576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003611105576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600954806111138161223c565b5f818152600b602090815260408220805460018101825590835291200184905560098190559150611146905083826116dd565b807f17139772d2eecff1a9acaf38c64bfda7c833f94bf253bbdc6353c31e2f50712c8360405161117891815260200190565b60405180910390a26001600a5592915050565b60065473ffffffffffffffffffffffffffffffffffffffff1633146111fe576006546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b73ffffffffffffffffffffffffffffffffffffffff811661124b576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f2c1c11af44aa5608f1dca38c00275c30ea091e02417d36e70e9a1538689c433d905f90a250565b60065473ffffffffffffffffffffffffffffffffffffffff16331461132c576006546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b73ffffffffffffffffffffffffffffffffffffffff8116611379576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b905f90a250565b5f806113f284610dbc565b905073ffffffffffffffffffffffffffffffffffffffff81163314611468576040517f10c932fe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015233602482015260448101859052606401610640565b5f8390036114a2576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f848152600b60209081526040808320805460018082018355918552938390209093018690555185815291935085917f4d9628eae8c81a6e4982f671587b937bacf76b149b3458fb5a8aec776b4c129a910160405180910390a25092915050565b61150e858585610824565b73ffffffffffffffffffffffffffffffffffffffff84163b15611650576040517f150b7a02000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063150b7a02906115879033908a90899089908990600401612273565b6020604051808303815f875af11580156115a3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c7919061207c565b7fffffffff000000000000000000000000000000000000000000000000000000001614611650576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610640565b5050505050565b60605f6116638361183b565b905060086040518060400160405280600981526020017f66303137303132323000000000000000000000000000000000000000000000008152506116a6836118d5565b6116b3608085901b6118d5565b6040516020016116c694939291906122f0565b604051602081830303815290604052915050919050565b6116e78282611abd565b73ffffffffffffffffffffffffffffffffffffffff82163b15611837576040517f150b7a02000000000000000000000000000000000000000000000000000000008082523360048301525f60248301819052604483018490526080606484015260848301529073ffffffffffffffffffffffffffffffffffffffff84169063150b7a029060a4016020604051808303815f875af115801561178a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117ae919061207c565b7fffffffff000000000000000000000000000000000000000000000000000000001614611837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610640565b5050565b5f808211801561184d57506009548211155b156118a0575f828152600b602052604081205461186c9060019061239c565b5f848152600b602052604090208054919250908290811061188f5761188f6123af565b905f5260205f200154915050919050565b6040517f0ede975900000000000000000000000000000000000000000000000000000000815260048101839052602401610640565b7aff00000000000000ff00000000000000ff00000000000000ff00006bffffffff0000000000000000604083901c9081167bffffffff00000000000000000000000000000000000000000000000084161760201c6fffffffff000000000000000000000000919091167fffffffff0000000000000000000000000000000000000000000000000000000084161717601081901c9182167eff00000000000000ff00000000000000ff00000000000000ff000000000000821617600890811c7bff00000000000000ff00000000000000ff00000000000000ff000000939093167fff00000000000000ff00000000000000ff00000000000000ff000000000000009290921691909117919091179081901c7e0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f167f0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f00600492831c161790611a59827f06060606060606060606060606060606060606060606060606060606060606066120c4565b901c7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f166027611a8991906123dc565b611ab3827f30303030303030303030303030303030303030303030303030303030303030306120c4565b61059391906120c4565b73ffffffffffffffffffffffffffffffffffffffff8216611b3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f494e56414c49445f524543495049454e540000000000000000000000000000006044820152606401610640565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615611bc5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f414c52454144595f4d494e5445440000000000000000000000000000000000006044820152606401610640565b73ffffffffffffffffffffffffffffffffffffffff82165f81815260036020908152604080832080546001019055848352600290915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611c81575f80fd5b50565b5f60208284031215611c94575f80fd5b8135611c9f81611c54565b9392505050565b5f60208284031215611cb6575f80fd5b5035919050565b5f60408201848352602060408185015281855180845260608601915082870193505f5b81811015611cfc57845183529383019391830191600101611ce0565b5090979650505050505050565b5f5b83811015611d23578181015183820152602001611d0b565b50505f910152565b602081525f8251806020840152611d49816040850160208701611d09565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cc3575f80fd5b5f8060408385031215611daf575f80fd5b611db883611d7b565b946020939093013593505050565b5f805f60608486031215611dd8575f80fd5b611de184611d7b565b9250611def60208501611d7b565b9150604084013590509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215611e3c575f80fd5b813567ffffffffffffffff80821115611e53575f80fd5b818401915084601f830112611e66575f80fd5b813581811115611e7857611e78611dff565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611ebe57611ebe611dff565b81604052828152876020848701011115611ed6575f80fd5b826020860160208301375f928101602001929092525095945050505050565b5f60208284031215611f05575f80fd5b611c9f82611d7b565b5f8060408385031215611f1f575f80fd5b50508035926020909101359150565b5f8060408385031215611f3f575f80fd5b611f4883611d7b565b915060208301358015158114611f5c575f80fd5b809150509250929050565b5f805f805f60808688031215611f7b575f80fd5b611f8486611d7b565b9450611f9260208701611d7b565b935060408601359250606086013567ffffffffffffffff80821115611fb5575f80fd5b818801915088601f830112611fc8575f80fd5b813581811115611fd6575f80fd5b896020828501011115611fe7575f80fd5b9699959850939650602001949392505050565b5f806040838503121561200b575f80fd5b61201483611d7b565b915061202260208401611d7b565b90509250929050565b600181811c9082168061203f57607f821691505b602082108103612076577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b5f6020828403121561208c575f80fd5b8151611c9f81611c54565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561059357610593612097565b601f821115610c45575f81815260208120601f850160051c810160208610156120fd5750805b601f850160051c820191505b8181101561211c57828155600101612109565b505050505050565b815167ffffffffffffffff81111561213e5761213e611dff565b6121528161214c845461202b565b846120d7565b602080601f8311600181146121a4575f841561216e5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561211c565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156121f0578886015182559484019460019091019084016121d1565b508582101561222c57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361226c5761226c612097565b5060010190565b5f73ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015260806060830152826080830152828460a08401375f60a0848401015260a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011683010190509695505050505050565b5f8086546122fd8161202b565b60018281168015612315576001811461234857612374565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168752821515830287019450612374565b8a5f526020805f205f5b8581101561236b5781548a820152908401908201612352565b50505082870194505b505050508551612388818360208a01611d09565b019384525050602082015260400192915050565b8181038181111561059357610593612097565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80820281158282048414176105935761059361209756fea2646970667358221220b3d20d7832c742ee1adf5ab9a034aa66584019f923a3cba1fa099efde885c79d64736f6c63430008150033", + "deployedBytecode": "0x608060405234801561000f575f80fd5b50600436106101bb575f3560e01c806370a08231116100f3578063a3fbbaae11610093578063b88d4fde1161006e578063b88d4fde14610426578063c87b56dd14610439578063e985e9c51461044c578063ffa1ad7414610479575f80fd5b8063a3fbbaae146103ed578063a6f9dae114610400578063b1f52e8014610413575f80fd5b80638da5cb5b116100ce5780638da5cb5b1461039f57806395d89b41146103bf578063a22cb465146103c7578063a3def923146103da575f80fd5b806370a082311461033d5780637647a90c146103505780637c5e63e014610363575f80fd5b806342842e0e1161015e5780634f6ccce7116101395780634f6ccce7146102fc57806355f804b31461030f5780636352211e146103225780636c0360eb14610335575f80fd5b806342842e0e146102b6578063481c6a75146102c95780634f558e79146102e9575f80fd5b8063081812fc11610199578063081812fc1461021d578063095ea7b31461027757806318160ddd1461028c57806323b872dd146102a3575f80fd5b806301ffc9a7146101bf57806302a8ca10146101e757806306fdde0314610208575b5f80fd5b6101d26101cd366004611c84565b6104b5565b60405190151581526020015b60405180910390f35b6101fa6101f5366004611ca6565b610599565b6040516101de929190611cbd565b610210610652565b6040516101de9190611d2b565b61025261022b366004611ca6565b60046020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101de565b61028a610285366004611d9e565b6106dd565b005b61029560095481565b6040519081526020016101de565b61028a6102b1366004611dc6565b610824565b61028a6102c4366004611dc6565b610ae7565b6007546102529073ffffffffffffffffffffffffffffffffffffffff1681565b6101d26102f7366004611ca6565b610c4a565b61029561030a366004611ca6565b610c6b565b61028a61031d366004611e2c565b610cc8565b610252610330366004611ca6565b610dbc565b610210610e47565b61029561034b366004611ef5565b610e54565b61029561035e366004611f0e565b610efa565b6102106040518060400160405280600981526020017f663031373031323230000000000000000000000000000000000000000000000081525081565b6006546102529073ffffffffffffffffffffffffffffffffffffffff1681565b610210610f25565b61028a6103d5366004611f2e565b610f32565b6102956103e8366004611d9e565b610fc8565b61028a6103fb366004611ef5565b61118b565b61028a61040e366004611ef5565b6112b9565b6101d2610421366004611f0e565b6113e7565b61028a610434366004611f67565b611503565b610210610447366004611ca6565b611657565b6101d261045a366004611ffa565b600560209081525f928352604080842090915290825290205460ff1681565b6102106040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061054757507f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b8061059357507f5b5e139f000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f60605f831180156105ad57506009548311155b1561060f575f838152600b60209081526040918290208054835181840281018401909452808452909183018282801561060357602002820191905f5260205f20905b8154815260200190600101908083116105ef575b50505050509050610649565b6040517f0ede9759000000000000000000000000000000000000000000000000000000008152600481018490526024015b60405180910390fd5b80519150915091565b5f805461065e9061202b565b80601f016020809104026020016040519081016040528092919081815260200182805461068a9061202b565b80156106d55780601f106106ac576101008083540402835291602001916106d5565b820191905f5260205f20905b8154815290600101906020018083116106b857829003601f168201915b505050505081565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff163381148061073e575073ffffffffffffffffffffffffffffffffffffffff81165f90815260056020908152604080832033845290915290205460ff165b6107a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610640565b5f8281526004602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff8481169116146108b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f57524f4e475f46524f4d000000000000000000000000000000000000000000006044820152606401610640565b73ffffffffffffffffffffffffffffffffffffffff8216610930576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f494e56414c49445f524543495049454e540000000000000000000000000000006044820152606401610640565b3373ffffffffffffffffffffffffffffffffffffffff84161480610983575073ffffffffffffffffffffffffffffffffffffffff83165f90815260056020908152604080832033845290915290205460ff165b806109b057505f8181526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1633145b610a16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415554484f52495a45440000000000000000000000000000000000006044820152606401610640565b73ffffffffffffffffffffffffffffffffffffffff8084165f81815260036020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055938616808352848320805460010190558583526002825284832080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610af2838383610824565b73ffffffffffffffffffffffffffffffffffffffff82163b15610c45576040517f150b7a020000000000000000000000000000000000000000000000000000000080825233600483015273ffffffffffffffffffffffffffffffffffffffff858116602484015260448301849052608060648401525f608484015290919084169063150b7a029060a4016020604051808303815f875af1158015610b98573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bbc919061207c565b7fffffffff000000000000000000000000000000000000000000000000000000001614610c45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610640565b505050565b5f80821180156105935750600954610c639060016120c4565b821092915050565b5f610c778260016120c4565b9050600954811115610cc3576009546040517f7ae59685000000000000000000000000000000000000000000000000000000008152610640918391600401918252602082015260400190565b919050565b60065473ffffffffffffffffffffffffffffffffffffffff163314610d3b576006546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b80515f03610d75576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6008610d818282612124565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf681604051610db19190611d2b565b60405180910390a150565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610cc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e4f545f4d494e544544000000000000000000000000000000000000000000006044820152606401610640565b6008805461065e9061202b565b5f73ffffffffffffffffffffffffffffffffffffffff8216610ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f5f4144445245535300000000000000000000000000000000000000006044820152606401610640565b5073ffffffffffffffffffffffffffffffffffffffff165f9081526003602052604090205490565b600b602052815f5260405f208181548110610f13575f80fd5b905f5260205f20015f91509150505481565b6001805461065e9061202b565b335f81815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f6001600a541115611006576040517f8beb9d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600a5560075473ffffffffffffffffffffffffffffffffffffffff16331461107e576007546040517f625a43fe00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b73ffffffffffffffffffffffffffffffffffffffff83166110cb576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003611105576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600954806111138161223c565b5f818152600b602090815260408220805460018101825590835291200184905560098190559150611146905083826116dd565b807f17139772d2eecff1a9acaf38c64bfda7c833f94bf253bbdc6353c31e2f50712c8360405161117891815260200190565b60405180910390a26001600a5592915050565b60065473ffffffffffffffffffffffffffffffffffffffff1633146111fe576006546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b73ffffffffffffffffffffffffffffffffffffffff811661124b576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f2c1c11af44aa5608f1dca38c00275c30ea091e02417d36e70e9a1538689c433d905f90a250565b60065473ffffffffffffffffffffffffffffffffffffffff16331461132c576006546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091166024820152604401610640565b73ffffffffffffffffffffffffffffffffffffffff8116611379576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b905f90a250565b5f806113f284610dbc565b905073ffffffffffffffffffffffffffffffffffffffff81163314611468576040517f10c932fe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015233602482015260448101859052606401610640565b5f8390036114a2576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f848152600b60209081526040808320805460018082018355918552938390209093018690555185815291935085917f4d9628eae8c81a6e4982f671587b937bacf76b149b3458fb5a8aec776b4c129a910160405180910390a25092915050565b61150e858585610824565b73ffffffffffffffffffffffffffffffffffffffff84163b15611650576040517f150b7a02000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063150b7a02906115879033908a90899089908990600401612273565b6020604051808303815f875af11580156115a3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c7919061207c565b7fffffffff000000000000000000000000000000000000000000000000000000001614611650576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610640565b5050505050565b60605f6116638361183b565b905060086040518060400160405280600981526020017f66303137303132323000000000000000000000000000000000000000000000008152506116a6836118d5565b6116b3608085901b6118d5565b6040516020016116c694939291906122f0565b604051602081830303815290604052915050919050565b6116e78282611abd565b73ffffffffffffffffffffffffffffffffffffffff82163b15611837576040517f150b7a02000000000000000000000000000000000000000000000000000000008082523360048301525f60248301819052604483018490526080606484015260848301529073ffffffffffffffffffffffffffffffffffffffff84169063150b7a029060a4016020604051808303815f875af115801561178a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117ae919061207c565b7fffffffff000000000000000000000000000000000000000000000000000000001614611837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f554e534146455f524543495049454e54000000000000000000000000000000006044820152606401610640565b5050565b5f808211801561184d57506009548211155b156118a0575f828152600b602052604081205461186c9060019061239c565b5f848152600b602052604090208054919250908290811061188f5761188f6123af565b905f5260205f200154915050919050565b6040517f0ede975900000000000000000000000000000000000000000000000000000000815260048101839052602401610640565b7aff00000000000000ff00000000000000ff00000000000000ff00006bffffffff0000000000000000604083901c9081167bffffffff00000000000000000000000000000000000000000000000084161760201c6fffffffff000000000000000000000000919091167fffffffff0000000000000000000000000000000000000000000000000000000084161717601081901c9182167eff00000000000000ff00000000000000ff00000000000000ff000000000000821617600890811c7bff00000000000000ff00000000000000ff00000000000000ff000000939093167fff00000000000000ff00000000000000ff00000000000000ff000000000000009290921691909117919091179081901c7e0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f167f0f000f000f000f000f000f000f000f000f000f000f000f000f000f000f000f00600492831c161790611a59827f06060606060606060606060606060606060606060606060606060606060606066120c4565b901c7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f166027611a8991906123dc565b611ab3827f30303030303030303030303030303030303030303030303030303030303030306120c4565b61059391906120c4565b73ffffffffffffffffffffffffffffffffffffffff8216611b3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f494e56414c49445f524543495049454e540000000000000000000000000000006044820152606401610640565b5f8181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615611bc5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f414c52454144595f4d494e5445440000000000000000000000000000000000006044820152606401610640565b73ffffffffffffffffffffffffffffffffffffffff82165f81815260036020908152604080832080546001019055848352600290915280822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611c81575f80fd5b50565b5f60208284031215611c94575f80fd5b8135611c9f81611c54565b9392505050565b5f60208284031215611cb6575f80fd5b5035919050565b5f60408201848352602060408185015281855180845260608601915082870193505f5b81811015611cfc57845183529383019391830191600101611ce0565b5090979650505050505050565b5f5b83811015611d23578181015183820152602001611d0b565b50505f910152565b602081525f8251806020840152611d49816040850160208701611d09565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cc3575f80fd5b5f8060408385031215611daf575f80fd5b611db883611d7b565b946020939093013593505050565b5f805f60608486031215611dd8575f80fd5b611de184611d7b565b9250611def60208501611d7b565b9150604084013590509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215611e3c575f80fd5b813567ffffffffffffffff80821115611e53575f80fd5b818401915084601f830112611e66575f80fd5b813581811115611e7857611e78611dff565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611ebe57611ebe611dff565b81604052828152876020848701011115611ed6575f80fd5b826020860160208301375f928101602001929092525095945050505050565b5f60208284031215611f05575f80fd5b611c9f82611d7b565b5f8060408385031215611f1f575f80fd5b50508035926020909101359150565b5f8060408385031215611f3f575f80fd5b611f4883611d7b565b915060208301358015158114611f5c575f80fd5b809150509250929050565b5f805f805f60808688031215611f7b575f80fd5b611f8486611d7b565b9450611f9260208701611d7b565b935060408601359250606086013567ffffffffffffffff80821115611fb5575f80fd5b818801915088601f830112611fc8575f80fd5b813581811115611fd6575f80fd5b896020828501011115611fe7575f80fd5b9699959850939650602001949392505050565b5f806040838503121561200b575f80fd5b61201483611d7b565b915061202260208401611d7b565b90509250929050565b600181811c9082168061203f57607f821691505b602082108103612076577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b5f6020828403121561208c575f80fd5b8151611c9f81611c54565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561059357610593612097565b601f821115610c45575f81815260208120601f850160051c810160208610156120fd5750805b601f850160051c820191505b8181101561211c57828155600101612109565b505050505050565b815167ffffffffffffffff81111561213e5761213e611dff565b6121528161214c845461202b565b846120d7565b602080601f8311600181146121a4575f841561216e5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b17855561211c565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156121f0578886015182559484019460019091019084016121d1565b508582101561222c57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361226c5761226c612097565b5060010190565b5f73ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015260806060830152826080830152828460a08401375f60a0848401015260a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011683010190509695505050505050565b5f8086546122fd8161202b565b60018281168015612315576001811461234857612374565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168752821515830287019450612374565b8a5f526020805f205f5b8581101561236b5781548a820152908401908201612352565b50505082870194505b505050508551612388818360208a01611d09565b019384525050602082015260400192915050565b8181038181111561059357610593612097565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80820281158282048414176105935761059361209756fea2646970667358221220b3d20d7832c742ee1adf5ab9a034aa66584019f923a3cba1fa099efde885c79d64736f6c63430008150033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/contracts/AgentFactory.sol b/contracts/AgentFactory.sol index e27acba..c99db11 100644 --- a/contracts/AgentFactory.sol +++ b/contracts/AgentFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity ^0.8.21; import {AgentMech} from "./AgentMech.sol"; import {GenericManager} from "../lib/autonolas-registries/contracts/GenericManager.sol"; diff --git a/contracts/AgentMech.sol b/contracts/AgentMech.sol index 944465b..278c9cb 100644 --- a/contracts/AgentMech.sol +++ b/contracts/AgentMech.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity ^0.8.21; import {ERC721Mech} from "../lib/mech/contracts/ERC721Mech.sol"; @@ -33,6 +33,9 @@ contract AgentMech is ERC721Mech { // Minimum required price uint256 public price; + // Map of requests counts for corresponding addresses + mapping (address => uint256) public mapRequestsCounts; + /// @dev AgentMech constructor. /// @param _token Address of the token contract. /// @param _tokenId The token ID. @@ -60,6 +63,7 @@ contract AgentMech is ERC721Mech { } requestId = getRequestId(msg.sender, data); + mapRequestsCounts[msg.sender]++; emit Request(msg.sender, requestId, data); } @@ -84,4 +88,11 @@ contract AgentMech is ERC721Mech { function getRequestId(address account, bytes memory data) public pure returns (uint256 requestId) { requestId = uint256(keccak256(abi.encode(account, data))); } + + /// @dev Gets the requests count for a specific account. + /// @param account Account address. + /// @return requestsCount Requests count. + function getRequestsCount(address account) external view returns (uint256 requestsCount) { + requestsCount = mapRequestsCounts[account]; + } } diff --git a/contracts/AgentRegistry.sol b/contracts/AgentRegistry.sol index b3dcc48..8ea4317 100644 --- a/contracts/AgentRegistry.sol +++ b/contracts/AgentRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity ^0.8.21; import {GenericRegistry} from "../lib/autonolas-registries/contracts/GenericRegistry.sol"; import {ERC721} from "../lib/autonolas-registries/lib/solmate/src/tokens/ERC721.sol"; diff --git a/contracts/ExtendedAgentFactory.sol b/contracts/ExtendedAgentFactory.sol index efe3d1a..8fd1270 100644 --- a/contracts/ExtendedAgentFactory.sol +++ b/contracts/ExtendedAgentFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity ^0.8.21; import {AgentMech} from "./AgentMech.sol"; import {AgentFactory} from "./AgentFactory.sol"; diff --git a/hardhat.config.js b/hardhat.config.js index bae162e..dca4329 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -14,8 +14,6 @@ const ALCHEMY_API_KEY_MAINNET = process.env.ALCHEMY_API_KEY_MAINNET; const ALCHEMY_API_KEY_MATIC = process.env.ALCHEMY_API_KEY_MATIC; const ALCHEMY_API_KEY_GOERLI = process.env.ALCHEMY_API_KEY_GOERLI; const ALCHEMY_API_KEY_MUMBAI = process.env.ALCHEMY_API_KEY_MUMBAI; -const GNOSIS_CHAIN_API_KEY = process.env.GNOSIS_CHAIN_API_KEY; -const CHIADO_CHAIN_API_KEY = "10200"; let TESTNET_MNEMONIC = process.env.TESTNET_MNEMONIC; const accounts = { @@ -33,6 +31,8 @@ if (!TESTNET_MNEMONIC) { const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY; const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY; +const GNOSISSCAN_API_KEY = process.env.GNOSISSCAN_API_KEY; +const CHIADOSCAN_API_KEY = "10200"; module.exports = { networks: { @@ -41,10 +41,12 @@ module.exports = { }, mainnet: { url: "https://eth-mainnet.g.alchemy.com/v2/" + ALCHEMY_API_KEY_MAINNET, + accounts: accounts, chainId: 1, }, polygon: { url: "https://polygon-mainnet.g.alchemy.com/v2/" + ALCHEMY_API_KEY_MATIC, + accounts: accounts, chainId: 137, }, gnosis: { @@ -75,8 +77,8 @@ module.exports = { network: "chiado", chainId: 10200, urls: { - apiURL: "https://blockscout.com/gnosis/chiado/api", - browserURL: "https://blockscout.com/gnosis/chiado", + apiURL: "https://gnosis-chiado.blockscout.com/api", + browserURL: "https://gnosis-chiado.blockscout.com/", }, }, { @@ -91,20 +93,20 @@ module.exports = { apiKey: { mainnet: ETHERSCAN_API_KEY, polygon: POLYGONSCAN_API_KEY, - gnosis: GNOSIS_CHAIN_API_KEY, + gnosis: GNOSISSCAN_API_KEY, goerli: ETHERSCAN_API_KEY, polygonMumbai: POLYGONSCAN_API_KEY, - chiado: CHIADO_CHAIN_API_KEY, + chiado: CHIADOSCAN_API_KEY, } }, solidity: { compilers: [ { - version: "0.8.19", + version: "0.8.21", settings: { optimizer: { enabled: true, - runs: 750, + runs: 1000000, }, }, } diff --git a/scripts/deployment/README.md b/scripts/deployment/README.md index c55b07d..b7abae4 100644 --- a/scripts/deployment/README.md +++ b/scripts/deployment/README.md @@ -30,6 +30,8 @@ The script file name identifies the number of deployment steps taken from / to t - `deploy_01_agent_registry.js` will complete step 1. NOTE: All the scripts MUST be strictly run in the sequential order from smallest to biggest numbers. +NOTE: AgentMech MUST NOT be deployed by its own script, as each AgentMech is created via the AgentFactory contract. +The `test_purposes_only_deploy_04_agent_mech.js` is provided strictly for testing purposes. Export network-related API keys defined in `hardhat.config.js` file that correspond to the required network. @@ -42,3 +44,8 @@ Each script controls the obtained values by checking them against the expected o If a contract is deployed with arguments, these arguments are taken from the corresponding `verify_number_and_name` file, where `number_and_name` corresponds to the deployment script number and name. To verify a mech use `e_check_04_agent_mech.js` and first ensure that `globals.json` contains the mech data, e.g: `"agentMechAddress":"0x3504fb5053ec12f748017248a395b4ed31739705","agentId":1,"price":"10000000000000000"` + +## Redeployment in case of changing AgentMech or AgentFactory +Each AgentMech contract is created via the AgentFactory, essentially inheriting the AgentMech contract bytecode. If AgentMech +and / or AgentFactory is changed, the AgentFactory contract must be redeployed (`deploy_02_agent_factory.js`). Moreover, +the manager of the AgentRegistry must be updated with a new deployed AgentFactory contract address (`deploy_03_change_manager.js`). diff --git a/scripts/deployment/deploy_01_agent_registry.js b/scripts/deployment/deploy_01_agent_registry.js index fc7c191..dd44c5f 100644 --- a/scripts/deployment/deploy_01_agent_registry.js +++ b/scripts/deployment/deploy_01_agent_registry.js @@ -19,8 +19,8 @@ async function main() { let networkURL; if (providerName === "gnosis") { - if (!process.env.GNOSIS_CHAIN_API_KEY) { - console.log("set GNOSIS_CHAIN_API_KEY env variable"); + if (!process.env.GNOSISSCAN_API_KEY) { + console.log("set GNOSISSCAN_API_KEY env variable"); return; } networkURL = "https://rpc.gnosischain.com"; @@ -56,10 +56,8 @@ async function main() { console.log("Contract address:", agentRegistry.address); console.log("Transaction:", result.deployTransaction.hash); - // Wait for half a minute - if (providerName === "goerli") { - await new Promise(r => setTimeout(r, 30000)); - } + // Wait for half a minute for the transaction completion + await new Promise(r => setTimeout(r, 30000)); // Writing updated parameters back to the JSON file parsedData.agentRegistryAddress = agentRegistry.address; diff --git a/scripts/deployment/deploy_02_agent_factory.js b/scripts/deployment/deploy_02_agent_factory.js index 7fd4d89..1effa6b 100644 --- a/scripts/deployment/deploy_02_agent_factory.js +++ b/scripts/deployment/deploy_02_agent_factory.js @@ -17,8 +17,8 @@ async function main() { let networkURL; if (providerName === "gnosis") { - if (!process.env.GNOSIS_CHAIN_API_KEY) { - console.log("set GNOSIS_CHAIN_API_KEY env variable"); + if (!process.env.GNOSISSCAN_API_KEY) { + console.log("set GNOSISSCAN_API_KEY env variable"); return; } networkURL = "https://rpc.gnosischain.com"; @@ -54,10 +54,8 @@ async function main() { console.log("Contract address:", agentFactory.address); console.log("Transaction:", result.deployTransaction.hash); - // Wait for half a minute - if (providerName === "goerli") { - await new Promise(r => setTimeout(r, 30000)); - } + // Wait for half a minute for the transaction completion + await new Promise(r => setTimeout(r, 30000)); // Writing updated parameters back to the JSON file parsedData.agentFactoryAddress = agentFactory.address; diff --git a/scripts/deployment/deploy_03_change_manager.js b/scripts/deployment/deploy_03_change_manager.js index 44b8eaa..dbe82b5 100644 --- a/scripts/deployment/deploy_03_change_manager.js +++ b/scripts/deployment/deploy_03_change_manager.js @@ -1,6 +1,5 @@ /*global process*/ -const { expect } = require("chai"); const { ethers } = require("hardhat"); const { LedgerSigner } = require("@anders-t/ethers-ledger"); @@ -18,8 +17,8 @@ async function main() { let networkURL; if (providerName === "gnosis") { - if (!process.env.GNOSIS_CHAIN_API_KEY) { - console.log("set GNOSIS_CHAIN_API_KEY env variable"); + if (!process.env.GNOSISSCAN_API_KEY) { + console.log("set GNOSISSCAN_API_KEY env variable"); return; } networkURL = "https://rpc.gnosischain.com"; diff --git a/scripts/deployment/e_check_04_agent_mech.js b/scripts/deployment/e_check_04_agent_mech.js index 02516be..9c7d1f3 100644 --- a/scripts/deployment/e_check_04_agent_mech.js +++ b/scripts/deployment/e_check_04_agent_mech.js @@ -1,24 +1,17 @@ /*global process*/ -const { ethers } = require("hardhat"); -const { LedgerSigner } = require("@anders-t/ethers-ledger"); - async function main() { const fs = require("fs"); const globalsFile = "globals.json"; const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); let parsedData = JSON.parse(dataFromJSON); - const useLedger = parsedData.useLedger; - const derivationPath = parsedData.derivationPath; const providerName = parsedData.providerName; - const gasPriceInGwei = parsedData.gasPriceInGwei; const agentMechAddress = parsedData.agentMechAddress; - let EOA; // Contract verification if (parsedData.contractVerification) { const execSync = require("child_process").execSync; - execSync("npx hardhat verify --constructor-args scripts/deployment/verify_03_agent_mech.js --network " + providerName + " " + agentMechAddress, { encoding: "utf-8" }); + execSync("npx hardhat verify --constructor-args scripts/deployment/verify_04_agent_mech.js --network " + providerName + " " + agentMechAddress, { encoding: "utf-8" }); } } diff --git a/scripts/deployment/globals_gnosis_chiado.json b/scripts/deployment/globals_gnosis_chiado.json index 4deb31b..ccd510d 100644 --- a/scripts/deployment/globals_gnosis_chiado.json +++ b/scripts/deployment/globals_gnosis_chiado.json @@ -1 +1 @@ -{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"chiado","gasPriceInGwei":"2","baseURI":"https://gateway.autonolas.tech/ipfs/","agentRegistryName":"AI Agent Registry","agentRegistrySymbol":"AI-AGENT-V1","agentRegistryAddress":"0x9dEc6B62c197268242A768dc3b153AE7a2701396","agentFactoryAddress":"0xB575dd20281c63288428DD58e5f579CC7d6aae4d"} \ No newline at end of file +{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"chiado","gasPriceInGwei":"2","baseURI":"https://gateway.autonolas.tech/ipfs/","agentRegistryName":"AI Agent Registry","agentRegistrySymbol":"AI-AGENT-V1","agentRegistryAddress":"0x9dEc6B62c197268242A768dc3b153AE7a2701396","agentFactoryAddress":"0x060268D4fE1Eb97843B14dd98cDf9ef7fbb3c720","agentId":"1","price":"1000000000000000000"} \ No newline at end of file diff --git a/scripts/deployment/globals_gnosis_mainnet.json b/scripts/deployment/globals_gnosis_mainnet.json index e656fbd..6e4acf6 100644 --- a/scripts/deployment/globals_gnosis_mainnet.json +++ b/scripts/deployment/globals_gnosis_mainnet.json @@ -1 +1 @@ -{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"gnosis","gasPriceInGwei":"5","baseURI":"https://gateway.autonolas.tech/ipfs/","agentRegistryName":"AI Agent Registry","agentRegistrySymbol":"AI-AGENT-V1","agentRegistryAddress":"0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA","agentFactoryAddress":"0x88DE734655184a09B70700aE4F72364d1ad23728"} \ No newline at end of file +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"gnosis","gasPriceInGwei":"5","baseURI":"https://gateway.autonolas.tech/ipfs/","agentRegistryName":"AI Agent Registry","agentRegistrySymbol":"AI-AGENT-V1","agentRegistryAddress":"0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA","agentFactoryAddress":"0x88DE734655184a09B70700aE4F72364d1ad23728","agentId":"1","price":"1000000000000000000"} \ No newline at end of file diff --git a/scripts/deployment/test_purposes_only_deploy_04_agent_mech.js b/scripts/deployment/test_purposes_only_deploy_04_agent_mech.js new file mode 100644 index 0000000..bf37d7c --- /dev/null +++ b/scripts/deployment/test_purposes_only_deploy_04_agent_mech.js @@ -0,0 +1,78 @@ +/*global process*/ + +const { ethers } = require("hardhat"); +const { LedgerSigner } = require("@anders-t/ethers-ledger"); + +async function main() { + const fs = require("fs"); + const globalsFile = "globals.json"; + const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); + let parsedData = JSON.parse(dataFromJSON); + const useLedger = parsedData.useLedger; + const derivationPath = parsedData.derivationPath; + const providerName = parsedData.providerName; + const gasPriceInGwei = parsedData.gasPriceInGwei; + const agentRegistryAddress = parsedData.agentRegistryAddress; + const agentId = parsedData.agentId; + const price = ethers.BigNumber.from(parsedData.price); + let EOA; + + let networkURL; + if (providerName === "gnosis") { + if (!process.env.GNOSISSCAN_API_KEY) { + console.log("set GNOSISSCAN_API_KEY env variable"); + return; + } + networkURL = "https://rpc.gnosischain.com"; + } else if (providerName === "chiado") { + networkURL = "https://rpc.chiadochain.net"; + } else { + console.log("Unknown network provider", providerName); + return; + } + + const provider = new ethers.providers.JsonRpcProvider(networkURL); + const signers = await ethers.getSigners(); + + if (useLedger) { + EOA = new LedgerSigner(provider, derivationPath); + } else { + EOA = signers[0]; + } + // EOA address + const deployer = await EOA.getAddress(); + console.log("EOA is:", deployer); + + // Transaction signing and execution + console.log("4. EOA to deploy AgentMech pointed to AgentRegistry, agentId and price"); + const AgentMech = await ethers.getContractFactory("AgentMech"); + console.log("You are signing the following transaction: AgentMech.connect(EOA).deploy(agentRegistryAddress, agentId, price)"); + const gasPrice = ethers.utils.parseUnits(gasPriceInGwei, "gwei"); + const agentMech = await AgentMech.connect(EOA).deploy(agentRegistryAddress, agentId, price, { gasPrice }); + const result = await agentMech.deployed(); + + // Transaction details + console.log("Contract deployment: AgentMech"); + console.log("Contract address:", agentMech.address); + console.log("Transaction:", result.deployTransaction.hash); + + // Wait for half a minute for the transaction completion + await new Promise(r => setTimeout(r, 30000)); + + // Writing updated parameters back to the JSON file + parsedData.agentMechAddress = agentMech.address; + fs.writeFileSync(globalsFile, JSON.stringify(parsedData)); + + // Contract verification + if (parsedData.contractVerification) { + const execSync = require("child_process").execSync; + execSync("npx hardhat verify --constructor-args scripts/deployment/verify_04_agent_mech.js --network " + providerName + " " + agentMech.address, { encoding: "utf-8" }); + } +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/deployment/verify_03_agent_mech.js b/scripts/deployment/verify_04_agent_mech.js similarity index 100% rename from scripts/deployment/verify_03_agent_mech.js rename to scripts/deployment/verify_04_agent_mech.js diff --git a/test/AgentMech.js b/test/AgentMech.js index 6e7aa3f..43c8d8b 100644 --- a/test/AgentMech.js +++ b/test/AgentMech.js @@ -50,7 +50,12 @@ describe("AgentMech", function () { agentMech.request(data) ).to.be.revertedWithCustomError(agentMech, "NotEnoughPaid"); + // Create a request await agentMech.request(data, {value: price}); + + // Get the requests count + const requestsCount = await agentMech.getRequestsCount(deployer.address); + expect(requestsCount).to.equal(1); }); });