diff --git a/contracts/MechAgentFactory.json b/contracts/MechAgentFactory.json deleted file mode 100644 index bfbc437..0000000 --- a/contracts/MechAgentFactory.json +++ /dev/null @@ -1,539 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "MechMarketplace", - "sourceName": "contracts/MechMarketplace.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" - }, - { - "internalType": "address", - "name": "mechMarketplace", - "type": "address" - } - ], - "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": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/contracts/MechMarketplace.json b/contracts/MechMarketplace.json index 63cc2ef..eed71e2 100644 --- a/contracts/MechMarketplace.json +++ b/contracts/MechMarketplace.json @@ -7,37 +7,59 @@ "inputs": [ { "internalType": "address", - "name": "_stakingFactory", + "name": "_serviceRegistry", "type": "address" }, { "internalType": "address", - "name": "_karmaProxy", + "name": "_karma", "type": "address" - }, + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ { "internalType": "uint256", - "name": "_minResponseTimeout", + "name": "requestId", + "type": "uint256" + } + ], + "name": "AlreadyDelivered", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyInitialized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "current", "type": "uint256" }, { "internalType": "uint256", - "name": "_maxResponseTimeout", + "name": "required", "type": "uint256" } ], - "stateMutability": "nonpayable", - "type": "constructor" + "name": "InsufficientBalance", + "type": "error" }, { "inputs": [ { "internalType": "uint256", - "name": "requestId", + "name": "amount", "type": "uint256" } ], - "name": "AlreadyDelivered", + "name": "NoDepositAllowed", "type": "error" }, { @@ -114,6 +136,17 @@ "name": "ReentrancyGuard", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "RequestIdNotFound", + "type": "error" + }, { "inputs": [ { @@ -130,6 +163,32 @@ "name": "ServiceNotStaked", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TransferFailed", + "type": "error" + }, { "inputs": [ { @@ -141,6 +200,38 @@ "name": "UnauthorizedAccount", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numValues1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numValues2", + "type": "uint256" + } + ], + "name": "WrongArrayLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "state", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" + } + ], + "name": "WrongServiceState", + "type": "error" + }, { "inputs": [], "name": "ZeroAddress", @@ -157,11 +248,61 @@ { "indexed": true, "internalType": "address", - "name": "factory", + "name": "mech", "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" } ], - "name": "FactoryUpdated", + "name": "CreateMech", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "deliveryMech", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deliveryRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "DeliveryPaymentProcessed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ImplementationUpdated", "type": "event" }, { @@ -201,6 +342,31 @@ "name": "MarketplaceDeliver", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minResponseTimeout", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxResponseTimeout", + "type": "uint256" + } + ], + "name": "MarketplaceParamsUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -238,17 +404,11 @@ { "indexed": true, "internalType": "address", - "name": "mech", + "name": "owner", "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "status", - "type": "bool" } ], - "name": "MechRegistrationStatusChanged", + "name": "OwnerUpdated", "type": "event" }, { @@ -256,31 +416,37 @@ "inputs": [ { "indexed": false, - "internalType": "uint256", - "name": "minResponseTimeout", - "type": "uint256" + "internalType": "address[]", + "name": "mechFactories", + "type": "address[]" }, { "indexed": false, - "internalType": "uint256", - "name": "maxResponseTimeout", - "type": "uint256" + "internalType": "bool[]", + "name": "statuses", + "type": "bool[]" } ], - "name": "MinMaxResponseTimeoutUpdated", + "name": "SetMechFactoryStatuses", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" + "indexed": false, + "internalType": "bytes32[]", + "name": "paymentTypes", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "balanceTrackers", + "type": "address[]" } ], - "name": "OwnerUpdated", + "name": "SetPaymentTypeBalanceTrackers", "type": "event" }, { @@ -296,6 +462,32 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "MAX_FEE_FACTOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MECH_MARKETPLACE_PROXY", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "VERSION", @@ -326,51 +518,67 @@ "inputs": [ { "internalType": "address", - "name": "mech", + "name": "newImplementation", "type": "address" + } + ], + "name": "changeImplementation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newFee", + "type": "uint256" }, { - "internalType": "address", - "name": "mechStakingInstance", - "type": "address" + "internalType": "uint256", + "name": "newMinResponseTimeout", + "type": "uint256" }, { "internalType": "uint256", - "name": "mechServiceId", + "name": "newMaxResponseTimeout", "type": "uint256" } ], - "name": "checkMech", - "outputs": [ + "name": "changeMarketplaceParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", - "name": "", + "name": "newOwner", "type": "address" } ], - "stateMutability": "view", + "name": "changeOwner", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "requester", + "name": "mech", "type": "address" - }, + } + ], + "name": "checkMech", + "outputs": [ { "internalType": "address", - "name": "requesterStakingInstance", + "name": "multisig", "type": "address" - }, - { - "internalType": "uint256", - "name": "requesterServiceId", - "type": "uint256" } ], - "name": "checkRequester", - "outputs": [], "stateMutability": "view", "type": "function" }, @@ -378,16 +586,16 @@ "inputs": [ { "internalType": "address", - "name": "stakingInstance", + "name": "requester", "type": "address" }, { "internalType": "uint256", - "name": "serviceId", + "name": "requesterServiceId", "type": "uint256" } ], - "name": "checkStakingInstance", + "name": "checkRequester", "outputs": [], "stateMutability": "view", "type": "function" @@ -396,23 +604,42 @@ "inputs": [ { "internalType": "uint256", - "name": "requestId", + "name": "serviceId", "type": "uint256" }, + { + "internalType": "address", + "name": "mechFactory", + "type": "address" + }, { "internalType": "bytes", - "name": "requestData", + "name": "payload", "type": "bytes" - }, + } + ], + "name": "create", + "outputs": [ { "internalType": "address", - "name": "deliveryMechStakingInstance", + "name": "mech", "type": "address" - }, + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "uint256", - "name": "deliveryMechServiceId", + "name": "requestId", "type": "uint256" + }, + { + "internalType": "bytes", + "name": "requestData", + "type": "bytes" } ], "name": "deliverMarketplace", @@ -434,14 +661,8 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getDeliveriesCount", + "inputs": [], + "name": "fee", "outputs": [ { "internalType": "uint256", @@ -467,40 +688,28 @@ }, { "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, { "internalType": "uint256", - "name": "requestId", + "name": "nonce", "type": "uint256" } ], - "name": "getMechDeliveryInfo", + "name": "getRequestId", "outputs": [ { - "components": [ - { - "internalType": "address", - "name": "priorityMech", - "type": "address" - }, - { - "internalType": "address", - "name": "deliveryMech", - "type": "address" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "uint32", - "name": "responseTimeout", - "type": "uint32" - } - ], - "internalType": "struct MechDelivery", - "name": "", - "type": "tuple" + "internalType": "uint256", + "name": "requestId", + "type": "uint256" } ], "stateMutability": "view", @@ -509,17 +718,17 @@ { "inputs": [ { - "internalType": "address", - "name": "mechService", - "type": "address" + "internalType": "uint256", + "name": "requestId", + "type": "uint256" } ], - "name": "getMechServiceDeliveriesCount", + "name": "getRequestStatus", "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "enum MechMarketplace.RequestStatus", + "name": "status", + "type": "uint8" } ], "stateMutability": "view", @@ -528,27 +737,34 @@ { "inputs": [ { - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "uint256", + "name": "_fee", + "type": "uint256" }, { - "internalType": "bytes", - "name": "data", - "type": "bytes" + "internalType": "uint256", + "name": "_minResponseTimeout", + "type": "uint256" }, { "internalType": "uint256", - "name": "nonce", + "name": "_maxResponseTimeout", "type": "uint256" } ], - "name": "getRequestId", + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "karma", "outputs": [ { - "internalType": "uint256", - "name": "requestId", - "type": "uint256" + "internalType": "address", + "name": "", + "type": "address" } ], "stateMutability": "view", @@ -557,17 +773,17 @@ { "inputs": [ { - "internalType": "uint256", - "name": "requestId", - "type": "uint256" + "internalType": "address", + "name": "", + "type": "address" } ], - "name": "getRequestStatus", + "name": "mapAgentMechFactories", "outputs": [ { - "internalType": "enum MechMarketplace.RequestStatus", - "name": "status", - "type": "uint8" + "internalType": "address", + "name": "", + "type": "address" } ], "stateMutability": "view", @@ -577,11 +793,11 @@ "inputs": [ { "internalType": "address", - "name": "account", + "name": "", "type": "address" } ], - "name": "getRequestsCount", + "name": "mapDeliveryCounts", "outputs": [ { "internalType": "uint256", @@ -593,15 +809,21 @@ "type": "function" }, { - "inputs": [], - "name": "karmaProxy", - "outputs": [ + "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], + "name": "mapMechDeliveryCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -613,12 +835,12 @@ "type": "address" } ], - "name": "mapDeliveryCounts", + "name": "mapMechFactories", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "stateMutability": "view", @@ -662,6 +884,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "mapPaymentTypeBalanceTrackers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -707,9 +948,33 @@ "type": "address" }, { - "internalType": "uint32", + "internalType": "uint256", "name": "responseTimeout", - "type": "uint32" + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deliveryRate", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "mapServiceIdMech", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" } ], "stateMutability": "view", @@ -741,6 +1006,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "numMechs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "numTotalRequests", @@ -767,6 +1045,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -774,26 +1065,11 @@ "name": "data", "type": "bytes" }, - { - "internalType": "address", - "name": "priorityMech", - "type": "address" - }, - { - "internalType": "address", - "name": "priorityMechStakingInstance", - "type": "address" - }, { "internalType": "uint256", "name": "priorityMechServiceId", "type": "uint256" }, - { - "internalType": "address", - "name": "requesterStakingInstance", - "type": "address" - }, { "internalType": "uint256", "name": "requesterServiceId", @@ -803,6 +1079,11 @@ "internalType": "uint256", "name": "responseTimeout", "type": "uint256" + }, + { + "internalType": "bytes", + "name": "paymentData", + "type": "bytes" } ], "name": "request", @@ -818,7 +1099,7 @@ }, { "inputs": [], - "name": "stakingFactory", + "name": "serviceRegistry", "outputs": [ { "internalType": "address", @@ -828,10 +1109,46 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "mechFactories", + "type": "address[]" + }, + { + "internalType": "bool[]", + "name": "statuses", + "type": "bool[]" + } + ], + "name": "setMechFactoryStatuses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "paymentTypes", + "type": "bytes32[]" + }, + { + "internalType": "address[]", + "name": "balanceTrackers", + "type": "address[]" + } + ], + "name": "setPaymentTypeBalanceTrackers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ], - "bytecode": "0x", - "deployedBytecode": "0x", + "bytecode": "0x6101006040526001600655348015610015575f5ffd5b506040516132653803806132658339810160408190526100349161017c565b6001600160a01b038216158061005157506001600160a01b038116155b1561006f5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0380831660e052811660c0524660a05261008e610099565b608052506101e29050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7ff376b6313a0837eb351511248cfe7dcc1cd26c49b8e0a47e1eb369dd62c425db604051806040016040528060058152602001640312e312e360dc1b81525060405160200161010a91906101ad565b60408051601f1981840301815282825280516020918201209083019490945281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80516001600160a01b0381168114610177575f5ffd5b919050565b5f5f6040838503121561018d575f5ffd5b61019683610161565b91506101a460208401610161565b90509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161301f6102465f395f818161076401528181610e9a015261106801525f8181610561015281816116f801528181611a2d0152611c4701525f81816105df01526123b501525f81816108c501526123ea015261301f5ff3fe608060405260043610610290575f3560e01c80638da5cb5b11610165578063d64bf8b0116100c6578063e8eca22d1161007c578063f5dcb7bb11610062578063f5dcb7bb14610881578063f698da25146108b4578063ffa1ad74146108e7575f5ffd5b8063e8eca22d1461083a578063ed24911d1461086d575f5ffd5b8063ddca3f43116100ac578063ddca3f43146107fc578063ded8128614610810578063e0cb19e814610825575f5ffd5b8063d64bf8b0146107b1578063d8a4676f146107d0575f5ffd5b8063bdf863171161011b578063cb261bec11610101578063cb261bec146106aa578063cbcf252a14610753578063cbd6407a14610786575f5ffd5b8063bdf8631714610654578063c69f6f9f14610669575f5ffd5b80639ec4a5bf1161014b5780639ec4a5bf14610601578063a6f9dae114610620578063af4937fc1461063f575f5ffd5b80638da5cb5b146105a25780639a8a0592146105ce575f5ffd5b806343be96431161020f57806357c0762d116101c557806363a0c91c116101ab57806363a0c91c1461053157806374a8569b1461055057806380d8591114610583575f5ffd5b806357c0762d146104ff5780635d24cd291461051e575f5ffd5b80634ada3e61116101f55780634ada3e611461048a5780634eb07dd31461049f57806355e1bfbb146104e0575f5ffd5b806343be96431461044057806346fbcbb21461046b575f5ffd5b8063176b8b01116102645780631bbbeeb81161024a5780631bbbeeb8146103905780632394290e146103bb5780632685937b14610421575f5ffd5b8063176b8b011461034657806317a68dd814610371575f5ffd5b8062427c5414610294578063087f08d4146102d25780630f41196a146102f35780631399991414610308575b5f5ffd5b34801561029f575f5ffd5b506102bf6102ae36600461265c565b60096020525f908152604090205481565b6040519081526020015b60405180910390f35b3480156102dd575f5ffd5b506102f16102ec366004612789565b61093c565b005b3480156102fe575f5ffd5b506102bf60015481565b348015610313575f5ffd5b5061033661032236600461265c565b600d6020525f908152604090205460ff1681565b60405190151581526020016102c9565b348015610351575f5ffd5b506102bf61036036600461265c565b600a6020525f908152604090205481565b34801561037c575f5ffd5b506102f161038b36600461265c565b610b56565b34801561039b575f5ffd5b506102bf6103aa36600461265c565b60086020525f908152604090205481565b3480156103c6575f5ffd5b506103fc6103d5366004612854565b60116020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102c9565b34801561042c575f5ffd5b506103fc61043b36600461265c565b610c7d565b34801561044b575f5ffd5b506102bf61045a36600461265c565b600b6020525f908152604090205481565b348015610476575f5ffd5b506103fc6104853660046128f5565b610dda565b348015610495575f5ffd5b506102bf60045481565b3480156104aa575f5ffd5b506103fc6104b9366004612854565b600f6020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156104eb575f5ffd5b506102f16104fa36600461294a565b61101a565b34801561050a575f5ffd5b506102f1610519366004612974565b6111df565b6102bf61052c36600461299d565b6112a3565b34801561053c575f5ffd5b506102f161054b366004612a1d565b611898565b34801561055b575f5ffd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058e575f5ffd5b506102f161059d366004612974565b611e3d565b3480156105ad575f5ffd5b506007546103fc9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156105d9575f5ffd5b506102bf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561060c575f5ffd5b506102bf61061b366004612a61565b611ec7565b34801561062b575f5ffd5b506102f161063a36600461265c565b611f7d565b34801561064a575f5ffd5b506102bf61271081565b34801561065f575f5ffd5b506102bf60035481565b348015610674575f5ffd5b506103fc61068336600461265c565b600e6020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106b5575f5ffd5b5061070d6106c4366004612854565b600c6020525f90815260409020805460018201546002830154600384015460049094015473ffffffffffffffffffffffffffffffffffffffff9384169492841693909116919085565b6040805173ffffffffffffffffffffffffffffffffffffffff9687168152948616602086015292909416918301919091526060820152608081019190915260a0016102c9565b34801561075e575f5ffd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b348015610791575f5ffd5b506102bf6107a036600461265c565b60106020525f908152604090205481565b3480156107bc575f5ffd5b506102f16107cb366004612ab7565b6120ab565b3480156107db575f5ffd5b506107ef6107ea366004612854565b612301565b6040516102c99190612b96565b348015610807575f5ffd5b506102bf5f5481565b34801561081b575f5ffd5b506102bf60025481565b348015610830575f5ffd5b506102bf60055481565b348015610845575f5ffd5b506102bf7fe6194b93a7bff0a54130ed8cd277223408a77f3e48bb5104a9db96d334f962ca81565b348015610878575f5ffd5b506102bf6123b2565b34801561088c575f5ffd5b506102bf7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b3480156108bf575f5ffd5b506102bf7f000000000000000000000000000000000000000000000000000000000000000081565b3480156108f2575f5ffd5b5061092f6040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516102c99190612c21565b60075473ffffffffffffffffffffffffffffffffffffffff1633146109b4576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b80518251146109fc57815181516040517f8151c110000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016109ab565b5f5b8251811015610b18575f73ffffffffffffffffffffffffffffffffffffffff16838281518110610a3057610a30612c33565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610a85576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818181518110610a9757610a97612c33565b6020026020010151600d5f858481518110610ab457610ab4612c33565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556001016109fe565b507f8cc6be981009d13170c616af494b7d671ed2d84b7e6891e4c8f21fe065c00dfc8282604051610b4a929190612cb0565b60405180910390a15050565b60075473ffffffffffffffffffffffffffffffffffffffff163314610bc9576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b73ffffffffffffffffffffffffffffffffffffffff8116610c16576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fe6194b93a7bff0a54130ed8cd277223408a77f3e48bb5104a9db96d334f962ca81905560405173ffffffffffffffffffffffffffffffffffffffff8216907f310ba5f1d2ed074b51e2eccd052a47ae9ab7c6b800d1fca3db3999d6a592ca03905f90a250565b5f5f8273ffffffffffffffffffffffffffffffffffffffff166317d70f7c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cc8573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cec9190612d0a565b5f8181526011602052604090205490915073ffffffffffffffffffffffffffffffffffffffff848116911614610d66576040517f32b2baa300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016109ab565b8273ffffffffffffffffffffffffffffffffffffffff1663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610daf573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610dd39190612d21565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82165f908152600d602052604081205460ff16610e50576040517f32b2baa300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016109ab565b6040517f0f7fb56d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690630f7fb56d90610ec6907f00000000000000000000000000000000000000000000000000000000000000009088908790600401612d3c565b6020604051808303815f875af1158015610ee2573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f069190612d21565b905073ffffffffffffffffffffffffffffffffffffffff8116610f55576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8082165f818152600e6020908152604080832080549589167fffffffffffffffffffffffff00000000000000000000000000000000000000009687161790558883526011909152812080549093169091179091556005805491610fcc83612da6565b9091555050604051849073ffffffffffffffffffffffffffffffffffffffff8316907f0dab9459b2f129b692750bed5cc716b07a2fb19ba9fe0a0dc378428a62040367905f90a39392505050565b80156111db576040517f4236aff8000000000000000000000000000000000000000000000000000000008152600481018290525f90819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690634236aff89060240160e060405180830381865afa1580156110ad573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d19190612df5565b965050505050925050600460058111156110ed576110ed612b69565b8160058111156110ff576110ff612b69565b146111535780600581111561111657611116612b69565b6040517ff014fe740000000000000000000000000000000000000000000000000000000081526004810191909152602481018490526044016109ab565b8373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146111d8576040517fa43d6ada00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8086166004830152831660248201526044016109ab565b50505b5050565b60075473ffffffffffffffffffffffffffffffffffffffff163314611252576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b61125d83838361240c565b60408051848152602081018490529081018290527f64d0972bd5d0c2828d80911b61084d86d61214c3081656ca3a720047a88320359060600160405180910390a1505050565b5f600160065411156112e1576040517f8beb9d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260065563ffffffff6112f54285612e8c565b1115611345576113054284612e8c565b6040517f7ae59685000000000000000000000000000000000000000000000000000000008152600481019190915263ffffffff60248201526044016109ab565b600154831080611356575060025483115b156113a3576001546002546040517feb373cfe00000000000000000000000000000000000000000000000000000000815260048101869052602481019290925260448201526064016109ab565b85515f036113dd576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8581526011602052604090205473ffffffffffffffffffffffffffffffffffffffff1680611438576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611442338661101a565b335f8181526010602052604090205461145d91908990611ec7565b335f90815260106020526040812080549294509061147a83612da6565b90915550505f828152600c6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161781556114d44286612e8c565b60038201556002810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055604080517f2cc0fcb2000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff841691632cc0fcb291600480830192602092919082900301815f875af115801561156f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115939190612d0a565b81600401819055505f8273ffffffffffffffffffffffffffffffffffffffff16632763b8da6040518163ffffffff1660e01b81526004016020604051808303815f875af11580156115e6573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061160a9190612d0a565b5f818152600f6020526040908190205460048086015492517f8a7e698d00000000000000000000000000000000000000000000000000000000815293945073ffffffffffffffffffffffffffffffffffffffff909116928392638a7e698d92349261167b92339290918d9101612d3c565b5f604051808303818588803b158015611692575f5ffd5b505af11580156116a4573d5f5f3e3d5ffd5b50506040517f55e7d04400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8881166024830152600160448301527f00000000000000000000000000000000000000000000000000000000000000001693506355e7d044925060640190505f604051808303815f87803b15801561173d575f5ffd5b505af115801561174f573d5f5f3e3d5ffd5b5050335f90815260086020526040812080549350915061176e83612da6565b909155505060038054905f61178283612da6565b909155505060048054905f61179683612da6565b90915550506040517f7941251800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906379412518906117f19033908e908a90600401612ea5565b5f604051808303815f87803b158015611808575f5ffd5b505af115801561181a573d5f5f3e3d5ffd5b505050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4827c9fc8074fe94dd4939d4228739ff43d7072a6504a6f413ffa4967c120175878d60405161187d929190612ee3565b60405180910390a35050600160065550909695505050505050565b600160065411156118d5576040517f8beb9d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026006555f6118e433610c7d565b5f848152600c6020526040902080549192509073ffffffffffffffffffffffffffffffffffffffff1680611944576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600182015473ffffffffffffffffffffffffffffffffffffffff1615611999576040517f5b7e8301000000000000000000000000000000000000000000000000000000008152600481018690526024016109ab565b73ffffffffffffffffffffffffffffffffffffffff81163314611b45578160030154421115611b04576040517f4225d37a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248301527f00000000000000000000000000000000000000000000000000000000000000001690634225d37a906044015f604051808303815f87803b158015611a6e575f5ffd5b505af1158015611a80573d5f5f3e3d5ffd5b50506040517fe7d915cf0000000000000000000000000000000000000000000000000000000081526004810188905273ffffffffffffffffffffffffffffffffffffffff8416925063e7d915cf91506024015f604051808303815f87803b158015611ae9575f5ffd5b505af1158015611afb573d5f5f3e3d5ffd5b50505050611b45565b60038201546040517f177d0c7900000000000000000000000000000000000000000000000000000000815260048101919091524260248201526044016109ab565b6001820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905560038054905f611b8083612f03565b9091555050600282015473ffffffffffffffffffffffffffffffffffffffff165f908152600960205260408120805491611bb983612da6565b9091555050335f908152600a60205260408120805491611bd883612da6565b909155505073ffffffffffffffffffffffffffffffffffffffff83165f908152600b60205260408120805491611c0d83612da6565b90915550506040517f4225d37a000000000000000000000000000000000000000000000000000000008152336004820152600160248201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690634225d37a906044015f604051808303815f87803b158015611c9d575f5ffd5b505af1158015611caf573d5f5f3e3d5ffd5b505050505f8173ffffffffffffffffffffffffffffffffffffffff16632763b8da6040518163ffffffff1660e01b81526004016020604051808303815f875af1158015611cfe573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d229190612d0a565b5f818152600f602052604080822054600287015460048089015484517ffe71c424000000000000000000000000000000000000000000000000000000008152339281019290925273ffffffffffffffffffffffffffffffffffffffff9283166024830152604482018d9052606482015292519495501692839263fe71c424926084808201939182900301818387803b158015611dbc575f5ffd5b505af1158015611dce573d5f5f3e3d5ffd5b505050600285015460405173ffffffffffffffffffffffffffffffffffffffff918216925033918616907fc0ecbc77097bb637f0b6fa34f169d87906113c1c45a0227113d36cdbae936fc490611e27908c908c90612ee3565b60405180910390a4505060016006555050505050565b60075473ffffffffffffffffffffffffffffffffffffffff1615611e8d576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e9883838361240c565b5050600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905550565b5f611ed06123b2565b30858585604051602001611ee79493929190612f37565b60405160208183030381529060405280519060200120604051602001611f3f9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602090910120949350505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314611ff0576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b73ffffffffffffffffffffffffffffffffffffffff811661203d576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b905f90a250565b60075473ffffffffffffffffffffffffffffffffffffffff16331461211e576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b805182511461216657815181516040517f8151c110000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016109ab565b5f5b82518110156122cf5782818151811061218357612183612c33565b60200260200101515f5f1b036121c5576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168282815181106121ee576121ee612c33565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603612243576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81818151811061225557612255612c33565b6020026020010151600f5f85848151811061227257612272612c33565b602002602001015181526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806001019050612168565b507fa9759667b17e564f26a0d91ce1c5e4a1dc3910aee992dc3f5f4da0a59d48f3cb8282604051610b4a929190612f92565b5f818152600c60209081526040808320815160a081018352815473ffffffffffffffffffffffffffffffffffffffff9081168083526001840154821695830195909552600283015416928101929092526003810154606083015260040154608082015290156123ac57602081015173ffffffffffffffffffffffffffffffffffffffff166123a757806060015142111561239e57600291506123ac565b600191506123ac565b600391505b50919050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146123e7576123e261253a565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b821580612417575081155b80612420575080155b15612457576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61271083111561249e576040517f7ae596850000000000000000000000000000000000000000000000000000000081526004810184905261271060248201526044016109ab565b808211156124e2576040517f7ae5968500000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016109ab565b63ffffffff81111561252d576040517f7ae596850000000000000000000000000000000000000000000000000000000081526004810182905263ffffffff60248201526044016109ab565b5f92909255600155600255565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7ff376b6313a0837eb351511248cfe7dcc1cd26c49b8e0a47e1eb369dd62c425db6040518060400160405280600581526020017f312e312e300000000000000000000000000000000000000000000000000000008152506040516020016125c39190612c21565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083019490945281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b73ffffffffffffffffffffffffffffffffffffffff81168114612659575f5ffd5b50565b5f6020828403121561266c575f5ffd5b8135610dd381612638565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156126eb576126eb612677565b604052919050565b5f67ffffffffffffffff82111561270c5761270c612677565b5060051b60200190565b5f82601f830112612725575f5ffd5b8135612738612733826126f3565b6126a4565b8082825260208201915060208360051b860101925085831115612759575f5ffd5b602085015b8381101561277f57803561277181612638565b83526020928301920161275e565b5095945050505050565b5f5f6040838503121561279a575f5ffd5b823567ffffffffffffffff8111156127b0575f5ffd5b6127bc85828601612716565b925050602083013567ffffffffffffffff8111156127d8575f5ffd5b8301601f810185136127e8575f5ffd5b80356127f6612733826126f3565b8082825260208201915060208360051b850101925087831115612817575f5ffd5b6020840193505b828410156128465783358015158114612835575f5ffd5b82526020938401939091019061281e565b809450505050509250929050565b5f60208284031215612864575f5ffd5b5035919050565b5f82601f83011261287a575f5ffd5b813567ffffffffffffffff81111561289457612894612677565b6128c560207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016126a4565b8181528460208386010111156128d9575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f5f60608486031215612907575f5ffd5b83359250602084013561291981612638565b9150604084013567ffffffffffffffff811115612934575f5ffd5b6129408682870161286b565b9150509250925092565b5f5f6040838503121561295b575f5ffd5b823561296681612638565b946020939093013593505050565b5f5f5f60608486031215612986575f5ffd5b505081359360208301359350604090920135919050565b5f5f5f5f5f60a086880312156129b1575f5ffd5b853567ffffffffffffffff8111156129c7575f5ffd5b6129d38882890161286b565b955050602086013593506040860135925060608601359150608086013567ffffffffffffffff811115612a04575f5ffd5b612a108882890161286b565b9150509295509295909350565b5f5f60408385031215612a2e575f5ffd5b82359150602083013567ffffffffffffffff811115612a4b575f5ffd5b612a578582860161286b565b9150509250929050565b5f5f5f60608486031215612a73575f5ffd5b8335612a7e81612638565b9250602084013567ffffffffffffffff811115612a99575f5ffd5b612aa58682870161286b565b93969395505050506040919091013590565b5f5f60408385031215612ac8575f5ffd5b823567ffffffffffffffff811115612ade575f5ffd5b8301601f81018513612aee575f5ffd5b8035612afc612733826126f3565b8082825260208201915060208360051b850101925087831115612b1d575f5ffd5b6020840193505b82841015612b3f578335825260209384019390910190612b24565b9450505050602083013567ffffffffffffffff811115612b5d575f5ffd5b612a5785828601612716565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6020810160048310612bcf577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b91905290565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f610dd36020830184612bd5565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8151808452602084019350602083015f5b82811015612ca657815173ffffffffffffffffffffffffffffffffffffffff16865260209586019590910190600101612c72565b5093949350505050565b604081525f612cc26040830185612c60565b82810360208401528084518083526020830191506020860192505f5b81811015612cfe5783511515835260209384019390920191600101612cde565b50909695505050505050565b5f60208284031215612d1a575f5ffd5b5051919050565b5f60208284031215612d31575f5ffd5b8151610dd381612638565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201525f612d706060830184612bd5565b95945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612dd657612dd6612d79565b5060010190565b805163ffffffff81168114612df0575f5ffd5b919050565b5f5f5f5f5f5f5f60e0888a031215612e0b575f5ffd5b87516bffffffffffffffffffffffff81168114612e26575f5ffd5b6020890151909750612e3781612638565b60408901519096509450612e4d60608901612ddd565b9350612e5b60808901612ddd565b9250612e6960a08901612ddd565b915060c088015160068110612e7c575f5ffd5b8091505092959891949750929550565b80820180821115612e9f57612e9f612d79565b92915050565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201525f612ed36060830185612bd5565b9050826040830152949350505050565b828152604060208201525f612efb6040830184612bd5565b949350505050565b5f81612f1157612f11612d79565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b73ffffffffffffffffffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff84166020820152608060408201525f612f816080830185612bd5565b905082606083015295945050505050565b604080825283519082018190525f9060208501906060840190835b81811015612fcb578351835260209384019390920191600101612fad565b50508381036020850152612fdf8186612c60565b969550505050505056fea2646970667358221220c953c7843b19e312d5729dece6bf9660d2fef7e8a23e225af2f577953a49769564736f6c634300081c0033", + "deployedBytecode": "0x608060405260043610610290575f3560e01c80638da5cb5b11610165578063d64bf8b0116100c6578063e8eca22d1161007c578063f5dcb7bb11610062578063f5dcb7bb14610881578063f698da25146108b4578063ffa1ad74146108e7575f5ffd5b8063e8eca22d1461083a578063ed24911d1461086d575f5ffd5b8063ddca3f43116100ac578063ddca3f43146107fc578063ded8128614610810578063e0cb19e814610825575f5ffd5b8063d64bf8b0146107b1578063d8a4676f146107d0575f5ffd5b8063bdf863171161011b578063cb261bec11610101578063cb261bec146106aa578063cbcf252a14610753578063cbd6407a14610786575f5ffd5b8063bdf8631714610654578063c69f6f9f14610669575f5ffd5b80639ec4a5bf1161014b5780639ec4a5bf14610601578063a6f9dae114610620578063af4937fc1461063f575f5ffd5b80638da5cb5b146105a25780639a8a0592146105ce575f5ffd5b806343be96431161020f57806357c0762d116101c557806363a0c91c116101ab57806363a0c91c1461053157806374a8569b1461055057806380d8591114610583575f5ffd5b806357c0762d146104ff5780635d24cd291461051e575f5ffd5b80634ada3e61116101f55780634ada3e611461048a5780634eb07dd31461049f57806355e1bfbb146104e0575f5ffd5b806343be96431461044057806346fbcbb21461046b575f5ffd5b8063176b8b01116102645780631bbbeeb81161024a5780631bbbeeb8146103905780632394290e146103bb5780632685937b14610421575f5ffd5b8063176b8b011461034657806317a68dd814610371575f5ffd5b8062427c5414610294578063087f08d4146102d25780630f41196a146102f35780631399991414610308575b5f5ffd5b34801561029f575f5ffd5b506102bf6102ae36600461265c565b60096020525f908152604090205481565b6040519081526020015b60405180910390f35b3480156102dd575f5ffd5b506102f16102ec366004612789565b61093c565b005b3480156102fe575f5ffd5b506102bf60015481565b348015610313575f5ffd5b5061033661032236600461265c565b600d6020525f908152604090205460ff1681565b60405190151581526020016102c9565b348015610351575f5ffd5b506102bf61036036600461265c565b600a6020525f908152604090205481565b34801561037c575f5ffd5b506102f161038b36600461265c565b610b56565b34801561039b575f5ffd5b506102bf6103aa36600461265c565b60086020525f908152604090205481565b3480156103c6575f5ffd5b506103fc6103d5366004612854565b60116020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102c9565b34801561042c575f5ffd5b506103fc61043b36600461265c565b610c7d565b34801561044b575f5ffd5b506102bf61045a36600461265c565b600b6020525f908152604090205481565b348015610476575f5ffd5b506103fc6104853660046128f5565b610dda565b348015610495575f5ffd5b506102bf60045481565b3480156104aa575f5ffd5b506103fc6104b9366004612854565b600f6020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156104eb575f5ffd5b506102f16104fa36600461294a565b61101a565b34801561050a575f5ffd5b506102f1610519366004612974565b6111df565b6102bf61052c36600461299d565b6112a3565b34801561053c575f5ffd5b506102f161054b366004612a1d565b611898565b34801561055b575f5ffd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058e575f5ffd5b506102f161059d366004612974565b611e3d565b3480156105ad575f5ffd5b506007546103fc9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156105d9575f5ffd5b506102bf7f000000000000000000000000000000000000000000000000000000000000000081565b34801561060c575f5ffd5b506102bf61061b366004612a61565b611ec7565b34801561062b575f5ffd5b506102f161063a36600461265c565b611f7d565b34801561064a575f5ffd5b506102bf61271081565b34801561065f575f5ffd5b506102bf60035481565b348015610674575f5ffd5b506103fc61068336600461265c565b600e6020525f908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156106b5575f5ffd5b5061070d6106c4366004612854565b600c6020525f90815260409020805460018201546002830154600384015460049094015473ffffffffffffffffffffffffffffffffffffffff9384169492841693909116919085565b6040805173ffffffffffffffffffffffffffffffffffffffff9687168152948616602086015292909416918301919091526060820152608081019190915260a0016102c9565b34801561075e575f5ffd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b348015610791575f5ffd5b506102bf6107a036600461265c565b60106020525f908152604090205481565b3480156107bc575f5ffd5b506102f16107cb366004612ab7565b6120ab565b3480156107db575f5ffd5b506107ef6107ea366004612854565b612301565b6040516102c99190612b96565b348015610807575f5ffd5b506102bf5f5481565b34801561081b575f5ffd5b506102bf60025481565b348015610830575f5ffd5b506102bf60055481565b348015610845575f5ffd5b506102bf7fe6194b93a7bff0a54130ed8cd277223408a77f3e48bb5104a9db96d334f962ca81565b348015610878575f5ffd5b506102bf6123b2565b34801561088c575f5ffd5b506102bf7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b3480156108bf575f5ffd5b506102bf7f000000000000000000000000000000000000000000000000000000000000000081565b3480156108f2575f5ffd5b5061092f6040518060400160405280600581526020017f312e312e3000000000000000000000000000000000000000000000000000000081525081565b6040516102c99190612c21565b60075473ffffffffffffffffffffffffffffffffffffffff1633146109b4576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044015b60405180910390fd5b80518251146109fc57815181516040517f8151c110000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016109ab565b5f5b8251811015610b18575f73ffffffffffffffffffffffffffffffffffffffff16838281518110610a3057610a30612c33565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610a85576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818181518110610a9757610a97612c33565b6020026020010151600d5f858481518110610ab457610ab4612c33565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff1682528101919091526040015f2080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556001016109fe565b507f8cc6be981009d13170c616af494b7d671ed2d84b7e6891e4c8f21fe065c00dfc8282604051610b4a929190612cb0565b60405180910390a15050565b60075473ffffffffffffffffffffffffffffffffffffffff163314610bc9576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b73ffffffffffffffffffffffffffffffffffffffff8116610c16576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fe6194b93a7bff0a54130ed8cd277223408a77f3e48bb5104a9db96d334f962ca81905560405173ffffffffffffffffffffffffffffffffffffffff8216907f310ba5f1d2ed074b51e2eccd052a47ae9ab7c6b800d1fca3db3999d6a592ca03905f90a250565b5f5f8273ffffffffffffffffffffffffffffffffffffffff166317d70f7c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cc8573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cec9190612d0a565b5f8181526011602052604090205490915073ffffffffffffffffffffffffffffffffffffffff848116911614610d66576040517f32b2baa300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016109ab565b8273ffffffffffffffffffffffffffffffffffffffff1663e7f43c686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610daf573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610dd39190612d21565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82165f908152600d602052604081205460ff16610e50576040517f32b2baa300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016109ab565b6040517f0f7fb56d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690630f7fb56d90610ec6907f00000000000000000000000000000000000000000000000000000000000000009088908790600401612d3c565b6020604051808303815f875af1158015610ee2573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f069190612d21565b905073ffffffffffffffffffffffffffffffffffffffff8116610f55576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8082165f818152600e6020908152604080832080549589167fffffffffffffffffffffffff00000000000000000000000000000000000000009687161790558883526011909152812080549093169091179091556005805491610fcc83612da6565b9091555050604051849073ffffffffffffffffffffffffffffffffffffffff8316907f0dab9459b2f129b692750bed5cc716b07a2fb19ba9fe0a0dc378428a62040367905f90a39392505050565b80156111db576040517f4236aff8000000000000000000000000000000000000000000000000000000008152600481018290525f90819073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690634236aff89060240160e060405180830381865afa1580156110ad573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d19190612df5565b965050505050925050600460058111156110ed576110ed612b69565b8160058111156110ff576110ff612b69565b146111535780600581111561111657611116612b69565b6040517ff014fe740000000000000000000000000000000000000000000000000000000081526004810191909152602481018490526044016109ab565b8373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146111d8576040517fa43d6ada00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8086166004830152831660248201526044016109ab565b50505b5050565b60075473ffffffffffffffffffffffffffffffffffffffff163314611252576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b61125d83838361240c565b60408051848152602081018490529081018290527f64d0972bd5d0c2828d80911b61084d86d61214c3081656ca3a720047a88320359060600160405180910390a1505050565b5f600160065411156112e1576040517f8beb9d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260065563ffffffff6112f54285612e8c565b1115611345576113054284612e8c565b6040517f7ae59685000000000000000000000000000000000000000000000000000000008152600481019190915263ffffffff60248201526044016109ab565b600154831080611356575060025483115b156113a3576001546002546040517feb373cfe00000000000000000000000000000000000000000000000000000000815260048101869052602481019290925260448201526064016109ab565b85515f036113dd576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8581526011602052604090205473ffffffffffffffffffffffffffffffffffffffff1680611438576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611442338661101a565b335f8181526010602052604090205461145d91908990611ec7565b335f90815260106020526040812080549294509061147a83612da6565b90915550505f828152600c6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161781556114d44286612e8c565b60038201556002810180547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055604080517f2cc0fcb2000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff841691632cc0fcb291600480830192602092919082900301815f875af115801561156f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115939190612d0a565b81600401819055505f8273ffffffffffffffffffffffffffffffffffffffff16632763b8da6040518163ffffffff1660e01b81526004016020604051808303815f875af11580156115e6573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061160a9190612d0a565b5f818152600f6020526040908190205460048086015492517f8a7e698d00000000000000000000000000000000000000000000000000000000815293945073ffffffffffffffffffffffffffffffffffffffff909116928392638a7e698d92349261167b92339290918d9101612d3c565b5f604051808303818588803b158015611692575f5ffd5b505af11580156116a4573d5f5f3e3d5ffd5b50506040517f55e7d04400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff8881166024830152600160448301527f00000000000000000000000000000000000000000000000000000000000000001693506355e7d044925060640190505f604051808303815f87803b15801561173d575f5ffd5b505af115801561174f573d5f5f3e3d5ffd5b5050335f90815260086020526040812080549350915061176e83612da6565b909155505060038054905f61178283612da6565b909155505060048054905f61179683612da6565b90915550506040517f7941251800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906379412518906117f19033908e908a90600401612ea5565b5f604051808303815f87803b158015611808575f5ffd5b505af115801561181a573d5f5f3e3d5ffd5b505050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4827c9fc8074fe94dd4939d4228739ff43d7072a6504a6f413ffa4967c120175878d60405161187d929190612ee3565b60405180910390a35050600160065550909695505050505050565b600160065411156118d5576040517f8beb9d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026006555f6118e433610c7d565b5f848152600c6020526040902080549192509073ffffffffffffffffffffffffffffffffffffffff1680611944576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600182015473ffffffffffffffffffffffffffffffffffffffff1615611999576040517f5b7e8301000000000000000000000000000000000000000000000000000000008152600481018690526024016109ab565b73ffffffffffffffffffffffffffffffffffffffff81163314611b45578160030154421115611b04576040517f4225d37a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248301527f00000000000000000000000000000000000000000000000000000000000000001690634225d37a906044015f604051808303815f87803b158015611a6e575f5ffd5b505af1158015611a80573d5f5f3e3d5ffd5b50506040517fe7d915cf0000000000000000000000000000000000000000000000000000000081526004810188905273ffffffffffffffffffffffffffffffffffffffff8416925063e7d915cf91506024015f604051808303815f87803b158015611ae9575f5ffd5b505af1158015611afb573d5f5f3e3d5ffd5b50505050611b45565b60038201546040517f177d0c7900000000000000000000000000000000000000000000000000000000815260048101919091524260248201526044016109ab565b6001820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905560038054905f611b8083612f03565b9091555050600282015473ffffffffffffffffffffffffffffffffffffffff165f908152600960205260408120805491611bb983612da6565b9091555050335f908152600a60205260408120805491611bd883612da6565b909155505073ffffffffffffffffffffffffffffffffffffffff83165f908152600b60205260408120805491611c0d83612da6565b90915550506040517f4225d37a000000000000000000000000000000000000000000000000000000008152336004820152600160248201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690634225d37a906044015f604051808303815f87803b158015611c9d575f5ffd5b505af1158015611caf573d5f5f3e3d5ffd5b505050505f8173ffffffffffffffffffffffffffffffffffffffff16632763b8da6040518163ffffffff1660e01b81526004016020604051808303815f875af1158015611cfe573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d229190612d0a565b5f818152600f602052604080822054600287015460048089015484517ffe71c424000000000000000000000000000000000000000000000000000000008152339281019290925273ffffffffffffffffffffffffffffffffffffffff9283166024830152604482018d9052606482015292519495501692839263fe71c424926084808201939182900301818387803b158015611dbc575f5ffd5b505af1158015611dce573d5f5f3e3d5ffd5b505050600285015460405173ffffffffffffffffffffffffffffffffffffffff918216925033918616907fc0ecbc77097bb637f0b6fa34f169d87906113c1c45a0227113d36cdbae936fc490611e27908c908c90612ee3565b60405180910390a4505060016006555050505050565b60075473ffffffffffffffffffffffffffffffffffffffff1615611e8d576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e9883838361240c565b5050600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000163317905550565b5f611ed06123b2565b30858585604051602001611ee79493929190612f37565b60405160208183030381529060405280519060200120604051602001611f3f9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602090910120949350505050565b60075473ffffffffffffffffffffffffffffffffffffffff163314611ff0576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b73ffffffffffffffffffffffffffffffffffffffff811661203d576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b905f90a250565b60075473ffffffffffffffffffffffffffffffffffffffff16331461211e576007546040517fa43d6ada00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff90911660248201526044016109ab565b805182511461216657815181516040517f8151c110000000000000000000000000000000000000000000000000000000008152600481019290925260248201526044016109ab565b5f5b82518110156122cf5782818151811061218357612183612c33565b60200260200101515f5f1b036121c5576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168282815181106121ee576121ee612c33565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603612243576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81818151811061225557612255612c33565b6020026020010151600f5f85848151811061227257612272612c33565b602002602001015181526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806001019050612168565b507fa9759667b17e564f26a0d91ce1c5e4a1dc3910aee992dc3f5f4da0a59d48f3cb8282604051610b4a929190612f92565b5f818152600c60209081526040808320815160a081018352815473ffffffffffffffffffffffffffffffffffffffff9081168083526001840154821695830195909552600283015416928101929092526003810154606083015260040154608082015290156123ac57602081015173ffffffffffffffffffffffffffffffffffffffff166123a757806060015142111561239e57600291506123ac565b600191506123ac565b600391505b50919050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146123e7576123e261253a565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b821580612417575081155b80612420575080155b15612457576040517f7c946ed700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61271083111561249e576040517f7ae596850000000000000000000000000000000000000000000000000000000081526004810184905261271060248201526044016109ab565b808211156124e2576040517f7ae5968500000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016109ab565b63ffffffff81111561252d576040517f7ae596850000000000000000000000000000000000000000000000000000000081526004810182905263ffffffff60248201526044016109ab565b5f92909255600155600255565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7ff376b6313a0837eb351511248cfe7dcc1cd26c49b8e0a47e1eb369dd62c425db6040518060400160405280600581526020017f312e312e300000000000000000000000000000000000000000000000000000008152506040516020016125c39190612c21565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083019490945281019190915260608101919091524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b73ffffffffffffffffffffffffffffffffffffffff81168114612659575f5ffd5b50565b5f6020828403121561266c575f5ffd5b8135610dd381612638565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156126eb576126eb612677565b604052919050565b5f67ffffffffffffffff82111561270c5761270c612677565b5060051b60200190565b5f82601f830112612725575f5ffd5b8135612738612733826126f3565b6126a4565b8082825260208201915060208360051b860101925085831115612759575f5ffd5b602085015b8381101561277f57803561277181612638565b83526020928301920161275e565b5095945050505050565b5f5f6040838503121561279a575f5ffd5b823567ffffffffffffffff8111156127b0575f5ffd5b6127bc85828601612716565b925050602083013567ffffffffffffffff8111156127d8575f5ffd5b8301601f810185136127e8575f5ffd5b80356127f6612733826126f3565b8082825260208201915060208360051b850101925087831115612817575f5ffd5b6020840193505b828410156128465783358015158114612835575f5ffd5b82526020938401939091019061281e565b809450505050509250929050565b5f60208284031215612864575f5ffd5b5035919050565b5f82601f83011261287a575f5ffd5b813567ffffffffffffffff81111561289457612894612677565b6128c560207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016126a4565b8181528460208386010111156128d9575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f5f60608486031215612907575f5ffd5b83359250602084013561291981612638565b9150604084013567ffffffffffffffff811115612934575f5ffd5b6129408682870161286b565b9150509250925092565b5f5f6040838503121561295b575f5ffd5b823561296681612638565b946020939093013593505050565b5f5f5f60608486031215612986575f5ffd5b505081359360208301359350604090920135919050565b5f5f5f5f5f60a086880312156129b1575f5ffd5b853567ffffffffffffffff8111156129c7575f5ffd5b6129d38882890161286b565b955050602086013593506040860135925060608601359150608086013567ffffffffffffffff811115612a04575f5ffd5b612a108882890161286b565b9150509295509295909350565b5f5f60408385031215612a2e575f5ffd5b82359150602083013567ffffffffffffffff811115612a4b575f5ffd5b612a578582860161286b565b9150509250929050565b5f5f5f60608486031215612a73575f5ffd5b8335612a7e81612638565b9250602084013567ffffffffffffffff811115612a99575f5ffd5b612aa58682870161286b565b93969395505050506040919091013590565b5f5f60408385031215612ac8575f5ffd5b823567ffffffffffffffff811115612ade575f5ffd5b8301601f81018513612aee575f5ffd5b8035612afc612733826126f3565b8082825260208201915060208360051b850101925087831115612b1d575f5ffd5b6020840193505b82841015612b3f578335825260209384019390910190612b24565b9450505050602083013567ffffffffffffffff811115612b5d575f5ffd5b612a5785828601612716565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6020810160048310612bcf577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b91905290565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f610dd36020830184612bd5565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8151808452602084019350602083015f5b82811015612ca657815173ffffffffffffffffffffffffffffffffffffffff16865260209586019590910190600101612c72565b5093949350505050565b604081525f612cc26040830185612c60565b82810360208401528084518083526020830191506020860192505f5b81811015612cfe5783511515835260209384019390920191600101612cde565b50909695505050505050565b5f60208284031215612d1a575f5ffd5b5051919050565b5f60208284031215612d31575f5ffd5b8151610dd381612638565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201525f612d706060830184612bd5565b95945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612dd657612dd6612d79565b5060010190565b805163ffffffff81168114612df0575f5ffd5b919050565b5f5f5f5f5f5f5f60e0888a031215612e0b575f5ffd5b87516bffffffffffffffffffffffff81168114612e26575f5ffd5b6020890151909750612e3781612638565b60408901519096509450612e4d60608901612ddd565b9350612e5b60808901612ddd565b9250612e6960a08901612ddd565b915060c088015160068110612e7c575f5ffd5b8091505092959891949750929550565b80820180821115612e9f57612e9f612d79565b92915050565b73ffffffffffffffffffffffffffffffffffffffff84168152606060208201525f612ed36060830185612bd5565b9050826040830152949350505050565b828152604060208201525f612efb6040830184612bd5565b949350505050565b5f81612f1157612f11612d79565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b73ffffffffffffffffffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff84166020820152608060408201525f612f816080830185612bd5565b905082606083015295945050505050565b604080825283519082018190525f9060208501906060840190835b81811015612fcb578351835260209384019390920191600101612fad565b50508381036020850152612fdf8186612c60565b969550505050505056fea2646970667358221220c953c7843b19e312d5729dece6bf9660d2fef7e8a23e225af2f577953a49769564736f6c634300081c0033", "linkReferences": {}, "deployedLinkReferences": {} -} +} \ No newline at end of file diff --git a/run_service.py b/run_service.py index 30b0a62..bf29b80 100644 --- a/run_service.py +++ b/run_service.py @@ -28,6 +28,7 @@ from dotenv import load_dotenv from halo import Halo +from web3.constants import ADDRESS_ZERO from operate.account.user import UserAccount from operate.cli import OperateApp from operate.ledger.profiles import CONTRACTS, STAKING, OLAS @@ -103,7 +104,7 @@ def get_service_template(config: MechQuickstartConfig) -> ServiceTemplate: "nft": "bafybeifgj3kackzfoq4fxjiuousm6epgwx7jbc3n2gjwzjgvtbbz7fc3su", "cost_of_bond": COST_OF_BOND, "threshold": 1, - "use_staking": True, + "use_staking": config.use_staking, "fund_requirements": FundRequirementsTemplate( { "agent": AGENT_TOPUP, @@ -309,6 +310,11 @@ def main() -> None: "SERVICE_REGISTRY_ADDRESS": CONTRACTS[home_chain_type]["service_registry"], "STAKING_TOKEN_CONTRACT_ADDRESS": STAKING[home_chain_type]["mech_marketplace"], "MECH_MARKETPLACE_ADDRESS": CHAIN_TO_MARKETPLACE[home_chain_type], + "MECH_STAKING_INSTANCE_ADDRESS": ( + STAKING[ChainType.GNOSIS]["mech_marketplace"] + if mech_quickstart_config.use_staking + else ADDRESS_ZERO + ), # TODO: no way to update this atm after its provided, user is expected to update the file itself. "API_KEYS": json.dumps(api_keys, separators=(',', ':')), "AGENT_ID": str(mech_quickstart_config.agent_id), diff --git a/utils.py b/utils.py index ed4d2ba..782b914 100644 --- a/utils.py +++ b/utils.py @@ -28,6 +28,7 @@ from operate.services.service import Service from operate.types import ChainType, ServiceTemplate, LedgerType, ConfigurationTemplate from operate.utils.gnosis import SafeOperation +from operate.ledger.profiles import CONTRACTS # Set decimal precision getcontext().prec = 18 @@ -47,6 +48,7 @@ class MechQuickstartConfig(LocalResource): path: Path gnosis_rpc: t.Optional[str] = None + mech_type: t.Optional[str] = None password_migrated: t.Optional[bool] = None use_staking: t.Optional[bool] = None api_keys_path: t.Optional[str] = None @@ -320,6 +322,16 @@ def get_local_config() -> MechQuickstartConfig: mech_quickstart_config.gnosis_rpc = input( f"Please enter a {ChainType.from_id(mech_quickstart_config.home_chain_id).name} RPC URL: " ) + + if mech_quickstart_config.mech_type is None: + mech_quickstart_config.mech_type = input_with_default_value( + "Which type of mech do you want to deploy? (Native/Token)" , "Native" + ) + + if mech_quickstart_config.use_staking is None: + mech_quickstart_config.use_staking = input_with_default_value( + "Do you wish to use staking for your service? (True/False)" , False + ) if mech_quickstart_config.mech_hash is None: mech_hash = ( @@ -473,13 +485,19 @@ def unit_to_wei(unit: float) -> int: """Convert unit to Wei.""" return int(unit * 1e18) - +# @todo update after mainnet deployment CHAIN_TO_MARKETPLACE = { - ChainType.GNOSIS: "0x4554fE75c1f5576c1d7F765B2A036c199Adae329", + ChainType.GNOSIS: "0xa13c51f1edfade9c274e0067de55e476ee20e881", } -CHAIN_TO_AGENT_FACTORY = { - ChainType.GNOSIS: "0x6D8CbEbCAD7397c63347D44448147Db05E7d17B0", +# @todo update after mainnet deployment +CHAIN_TO_NATIVE_MECH_FACTORY = { + ChainType.GNOSIS: "0xdd880caaf026c52d50d2f1ff91f95cf83d175fd2", +} + +# @todo update after mainnet deployment +CHAIN_TO_TOKEN_MECH_FACTORY = { + ChainType.GNOSIS: "0xfe48dbcb92ebe155054abf6a8273f6be82d56232", } def fetch_token_price(url: str, headers: dict) -> t.Optional[float]: @@ -502,35 +520,39 @@ def deploy_mech(sftxb: EthSafeTxBuilder, local_config: MechQuickstartConfig, ser """Deploy the Mech service.""" print_section("Creating a new Mech On Chain") chain_type = ChainType.from_id(int(local_config.home_chain_id)) - path = OPERATE_HOME / Path("../contracts/MechAgentFactory.json") + mech_type = local_config.mech_type + path = OPERATE_HOME / Path("../contracts/MechMarketplace.json") abi = json.loads(path.read_text())["abi"] instance = web3.Web3() mech_marketplace_address = CHAIN_TO_MARKETPLACE[chain_type] + if mech_type == 'Native': + mech_factory_address = CHAIN_TO_NATIVE_MECH_FACTORY[chain_type] + + if mech_type == 'Token': + mech_factory_address = CHAIN_TO_TOKEN_MECH_FACTORY[chain_type] + # 0.01xDAI hardcoded for price # better to be configurable and part of local config mech_request_price = unit_to_wei(0.01) contract = instance.eth.contract(address=Web3.to_checksum_address(mech_marketplace_address), abi=abi) data = contract.encodeABI("create", args=[ - service.chain_configs[service.home_chain_id].chain_data.multisig, - bytes.fromhex(local_config.metadata_hash.lstrip("f01701220")), - mech_request_price, - mech_marketplace_address + service.chain_configs[str(local_config.home_chain_id)].chain_data.token, + Web3.to_checksum_address(mech_factory_address), + mech_request_price.to_bytes(32, byteorder='big'), ]) tx_dict = { - "to": CHAIN_TO_AGENT_FACTORY[chain_type], + "to": mech_marketplace_address, "data": data, "value": 0, "operation": SafeOperation.CALL, } receipt = sftxb.new_tx().add(tx_dict).settle() event = contract.events.CreateMech().process_receipt(receipt)[0] - mech_address, agent_id = event["args"]["mech"], event["args"]["agentId"] + mech_address = event["args"]["mech"] print(f"Mech address: {mech_address}") - print(f"Agent ID: {agent_id}") local_config.mech_address = mech_address - local_config.agent_id = agent_id local_config.store() def generate_mech_config(local_config: MechQuickstartConfig) -> dict: