From c137d7b752a8a84ade0489e5d31be2da875839bd Mon Sep 17 00:00:00 2001 From: Shady Khalifa Date: Wed, 4 Dec 2024 21:38:29 +0200 Subject: [PATCH] chore: update onRequestHook --- pallets/services/Cargo.toml | 1 + pallets/services/src/functions.rs | 94 +++++++++---------- pallets/services/src/lib.rs | 56 +++++------ .../src/test-artifacts/CGGMP21Blueprint.hex | 2 +- .../HookTestBlueprintServiceManager.hex | 2 +- .../MasterBlueprintServiceManager.hex | 2 +- primitives/src/services/mod.rs | 39 +++++++- 7 files changed, 114 insertions(+), 82 deletions(-) diff --git a/pallets/services/Cargo.toml b/pallets/services/Cargo.toml index 6b4c9ccc..e93e95d1 100644 --- a/pallets/services/Cargo.toml +++ b/pallets/services/Cargo.toml @@ -104,6 +104,7 @@ std = [ "pallet-ethereum/std", "pallet-evm/std", "pallet-evm-chain-id/std", + "pallet-assets/std", "pallet-evm-precompile-modexp/std", "pallet-evm-precompile-sha3fips/std", diff --git a/pallets/services/src/functions.rs b/pallets/services/src/functions.rs index ca084396..40ba9f37 100644 --- a/pallets/services/src/functions.rs +++ b/pallets/services/src/functions.rs @@ -9,8 +9,8 @@ use frame_support::dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo}; use sp_core::{H160, U256}; use sp_runtime::traits::{UniqueSaturatedInto, Zero}; use tangle_primitives::services::{ - BlueprintServiceManager, Field, MasterBlueprintServiceManagerRevision, OperatorPreferences, - Service, ServiceBlueprint, + Asset, BlueprintServiceManager, Field, MasterBlueprintServiceManagerRevision, + OperatorPreferences, Service, ServiceBlueprint, }; use super::*; @@ -449,6 +449,7 @@ impl Pallet { permitted_callers: &[T::AccountId], _assets: &[T::AssetId], ttl: BlockNumberFor, + paymet_asset: Asset, value: BalanceOf, ) -> Result<(bool, Weight), DispatchErrorWithPostInfo> { #[allow(deprecated)] @@ -463,40 +464,27 @@ impl Pallet { internal_type: None, }, ethabi::Param { - name: String::from("requestId"), - kind: ethabi::ParamType::Uint(64), - internal_type: None, - }, - ethabi::Param { - name: String::from("requester"), - kind: ethabi::ParamType::Address, - internal_type: None, - }, - ethabi::Param { - name: String::from("operatorsWithPreferences"), - kind: ethabi::ParamType::Array(Box::new( - OperatorPreferences::to_ethabi_param_type(), - )), - internal_type: Some(String::from("OperatorPreferences[]")), - }, - ethabi::Param { - name: String::from("requestInputs"), - kind: ethabi::ParamType::Bytes, - internal_type: None, - }, - ethabi::Param { - name: String::from("permittedCallers"), - kind: ethabi::ParamType::Array(Box::new(ethabi::ParamType::Address)), - internal_type: Some(String::from("address[]")), - }, - // ethabi::Param { - // name: String::from("assets"), - // kind: ethabi::ParamType::Array(Box::new(ethabi::ParamType::Address)), - // internal_type: Some(String::from("address[]")), - // }, - ethabi::Param { - name: String::from("ttl"), - kind: ethabi::ParamType::Uint(64), + name: String::from("params"), + kind: ethabi::ParamType::Tuple(vec![ + // requestId + ethabi::ParamType::Uint(64), + // requester + ethabi::ParamType::Address, + // operatorsWithPreferences + ethabi::ParamType::Array(Box::new( + OperatorPreferences::to_ethabi_param_type(), + )), + // requestInputs + ethabi::ParamType::Bytes, + // permittedCallers + ethabi::ParamType::Array(Box::new(ethabi::ParamType::Address)), + // ttl + ethabi::ParamType::Uint(64), + // payment asset + Asset::::to_ethabi_param_type(), + // value + ethabi::ParamType::Uint(256), + ]), internal_type: None, }, ], @@ -506,21 +494,25 @@ impl Pallet { }, &[ Token::Uint(ethabi::Uint::from(blueprint_id)), - Token::Uint(ethabi::Uint::from(request_id)), - Token::Address(T::EvmAddressMapping::into_address(requester.clone())), - Token::Array(operators.iter().map(OperatorPreferences::to_ethabi).collect()), - Token::Bytes(Field::encode_to_ethabi(request_args)), - Token::Array( - permitted_callers - .iter() - .map(|caller| { - Token::Address(T::EvmAddressMapping::into_address(caller.clone())) - .clone() - }) - .collect(), - ), - // Token::Array(vec![]), - Token::Uint(ethabi::Uint::from(ttl.into())), + Token::Tuple(vec![ + Token::Uint(ethabi::Uint::from(request_id)), + Token::Address(T::EvmAddressMapping::into_address(requester.clone())), + Token::Array(operators.iter().map(OperatorPreferences::to_ethabi).collect()), + Token::Bytes(Field::encode_to_ethabi(request_args)), + Token::Array( + permitted_callers + .iter() + .map(|caller| { + Token::Address(T::EvmAddressMapping::into_address(caller.clone())) + .clone() + }) + .collect(), + ), + // Token::Array(vec![]), + Token::Uint(ethabi::Uint::from(ttl.into())), + paymet_asset.to_ethabi(), + Token::Uint(ethabi::Uint::from(value.using_encoded(U256::from_little_endian))), + ]), ], value, ) diff --git a/pallets/services/src/lib.rs b/pallets/services/src/lib.rs index 16ae0b4a..300b915d 100644 --- a/pallets/services/src/lib.rs +++ b/pallets/services/src/lib.rs @@ -870,34 +870,35 @@ pub mod module { preferences.push(prefs); } - // Payment transfer - match payment_asset { - // Handle the case of native currency. - Asset::Custom(asset_id) if asset_id == Zero::zero() => { - T::Currency::transfer( - &caller, - &Self::account_id(), - value, - ExistenceRequirement::KeepAlive, - )?; - }, - Asset::Custom(asset_id) => { - T::Fungibles::transfer( - asset_id, - &caller, - &Self::account_id(), - value, - Preservation::Preserve, - )?; - }, - Asset::Erc20(token) => { - let (success, _weight) = - Self::erc20_transfer(token, &caller, Self::address(), value)?; - ensure!(success, Error::::ERC20TransferFailed); - }, - }; + if value != Zero::zero() { + // Payment transfer + match payment_asset { + // Handle the case of native currency. + Asset::Custom(asset_id) if asset_id == Zero::zero() => { + T::Currency::transfer( + &caller, + &Self::account_id(), + value, + ExistenceRequirement::KeepAlive, + )?; + }, + Asset::Custom(asset_id) => { + T::Fungibles::transfer( + asset_id, + &caller, + &Self::account_id(), + value, + Preservation::Preserve, + )?; + }, + Asset::Erc20(token) => { + let (success, _weight) = + Self::erc20_transfer(token, &caller, Self::address(), value)?; + ensure!(success, Error::::ERC20TransferFailed); + }, + }; + } - // Transfer the request value to the pallet let service_id = Self::next_instance_id(); let (allowed, _weight) = Self::on_request_hook( &blueprint, @@ -909,6 +910,7 @@ pub mod module { &permitted_callers, &assets, ttl, + payment_asset, value, )?; diff --git a/pallets/services/src/test-artifacts/CGGMP21Blueprint.hex b/pallets/services/src/test-artifacts/CGGMP21Blueprint.hex index 41b839f8..84bb7d1e 100644 --- a/pallets/services/src/test-artifacts/CGGMP21Blueprint.hex +++ b/pallets/services/src/test-artifacts/CGGMP21Blueprint.hex @@ -1 +1 @@ -0x60806040526004361061012a5760003560e01c8063884673ac116100ab578063a4d91fe91161006f578063a4d91fe9146102e3578063bb43abd914610301578063d7deb4821461030f578063e926cbd11461012f578063f84076621461032f578063fe0dd3711461034f57600080fd5b8063884673ac146102585780639838caa314610280578063987ab9db1461028e5780639d0410ee146102b5578063a24e8a90146102c857600080fd5b8063434698bb116100f2578063434698bb146101e15780635d79ea291461020157806365ce59fa1461022557806374ceeb55146101ae578063821c7be21461023857600080fd5b80630af7d7431461012f5780630b6535d7146101515780630d0dd3991461017157806314b4df4c146101ae57806337c29662146101ce575b600080fd5b34801561013b57600080fd5b5061014f61014a366004610638565b61035d565b005b34801561015d57600080fd5b5061014f61016c3660046106bb565b6103a9565b34801561017d57600080fd5b50600054610191906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101ba57600080fd5b506101916101c93660046106fe565b503090565b61014f6101dc366004610738565b610432565b3480156101ed57600080fd5b5061014f6101fc3660046107fd565b610478565b34801561020d57600080fd5b5061021760015481565b6040519081526020016101a5565b61014f61023336600461087d565b6104b7565b34801561024457600080fd5b5061014f610253366004610947565b6104fe565b34801561026457600080fd5b5061019173111111111111111111111111111111111111111181565b61014f61014a366004610994565b34801561029a57600080fd5b50731111111111111111111111111111111111111111610191565b61014f6102c3366004610a09565b61053e565b3480156102d457600080fd5b5061014f610253366004610a71565b3480156102ef57600080fd5b506000546001600160a01b0316610191565b61014f6102c3366004610a9b565b34801561031b57600080fd5b5061014f61032a366004610aef565b61057f565b34801561033b57600080fd5b50600254610191906001600160a01b031681565b61014f6101fc3660046107fd565b6000546001600160a01b031633146103a257600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b60405180910390fd5b5050505050565b33731111111111111111111111111111111111111111146103f557337311111111111111111111111111111111111111116040516359afe8af60e11b8152600401610399929190610b73565b6001600160401b0392909216600155600280546001600160a01b039283166001600160a01b03199182161790915560008054929093169116179055565b6000546001600160a01b0316331461046e57600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b5050505050505050565b6000546001600160a01b031633146104b457600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b50565b6000546001600160a01b031633146104f357600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b505050505050505050565b6000546001600160a01b0316331461053a57600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b5050565b6000546001600160a01b0316331461057a57600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b505050565b6000546001600160a01b031633146105bb57600054604051630c423fcf60e01b81526103999133916001600160a01b0390911690600401610b73565b505050505050565b80356001600160401b03811681146105da57600080fd5b919050565b60008083601f8401126105f157600080fd5b5081356001600160401b0381111561060857600080fd5b60208301915083602082850101111561062057600080fd5b9250929050565b803560ff811681146105da57600080fd5b60008060008060006080868803121561065057600080fd5b610659866105c3565b945060208601356001600160401b0381111561067457600080fd5b610680888289016105df565b9095509350610693905060408701610627565b949793965091946060013592915050565b80356001600160a01b03811681146105da57600080fd5b6000806000606084860312156106d057600080fd5b6106d9846105c3565b92506106e7602085016106a4565b91506106f5604085016106a4565b90509250925092565b60006020828403121561071057600080fd5b610719826105c3565b9392505050565b600060c0828403121561073257600080fd5b50919050565b60008060008060008060008060c0898b03121561075457600080fd5b61075d896105c3565b975061076b60208a01610627565b965061077960408a016105c3565b955060608901356001600160401b038082111561079557600080fd5b6107a18c838d01610720565b965060808b01359150808211156107b757600080fd5b6107c38c838d016105df565b909650945060a08b01359150808211156107dc57600080fd5b506107e98b828c016105df565b999c989b5096995094979396929594505050565b60006020828403121561080f57600080fd5b81356001600160401b0381111561082557600080fd5b61083184828501610720565b949350505050565b60008083601f84011261084b57600080fd5b5081356001600160401b0381111561086257600080fd5b6020830191508360208260051b850101111561062057600080fd5b600080600080600080600080600060c08a8c03121561089b57600080fd5b6108a48a6105c3565b98506108b260208b016106a4565b975060408a01356001600160401b03808211156108ce57600080fd5b6108da8d838e01610839565b909950975060608c01359150808211156108f357600080fd5b6108ff8d838e016105df565b909750955060808c013591508082111561091857600080fd5b506109258c828d01610839565b9094509250610938905060a08b016105c3565b90509295985092959850929598565b6000806040838503121561095a57600080fd5b82356001600160401b0381111561097057600080fd5b61097c85828601610720565b92505061098b602084016105c3565b90509250929050565b6000806000806000608086880312156109ac57600080fd5b6109b5866105c3565b94506109c360208701610627565b93506109d1604087016105c3565b925060608601356001600160401b038111156109ec57600080fd5b6109f8888289016105df565b969995985093965092949392505050565b600080600060408486031215610a1e57600080fd5b83356001600160401b0380821115610a3557600080fd5b610a4187838801610720565b94506020860135915080821115610a5757600080fd5b50610a64868287016105df565b9497909650939450505050565b60008060408385031215610a8457600080fd5b610a8d836105c3565b915061098b602084016106a4565b600080600060608486031215610ab057600080fd5b83356001600160401b03811115610ac657600080fd5b610ad286828701610720565b935050610ae1602085016105c3565b91506106f560408501610627565b60008060008060008060a08789031215610b0857600080fd5b610b11876105c3565b9550610b1f602088016105c3565b9450610b2d604088016106a4565b935060608701356001600160401b03811115610b4857600080fd5b610b5489828a01610839565b9094509250610b679050608088016105c3565b90509295509295509295565b6001600160a01b039283168152911660208201526040019056fea164736f6c6343000814000a +0x6080604052600436106101355760003560e01c80638b248065116100ab578063a4d91fe91161006f578063a4d91fe914610314578063bb43abd914610332578063d7deb48214610340578063e926cbd114610182578063f840766214610360578063fe0dd3711461038057600080fd5b80638b248065146102a35780639838caa3146102b1578063987ab9db146102bf5780639d0410ee146102e6578063a24e8a90146102f957600080fd5b806337c29662116100fd57806337c2966214610204578063434698bb146102175780635d79ea291461023757806374ceeb55146101e4578063821c7be21461025b578063884673ac1461027b57600080fd5b806308179f351461013a5780630af7d743146101825780630b6535d7146101a45780630d0dd399146101c457806314b4df4c146101e4575b600080fd5b34801561014657600080fd5b506101656101553660046105e3565b506002546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018e57600080fd5b506101a261019d36600461065f565b61038e565b005b3480156101b057600080fd5b506101a26101bf3660046106e3565b6103da565b3480156101d057600080fd5b50600054610165906001600160a01b031681565b3480156101f057600080fd5b506101656101ff3660046105e3565b503090565b6101a261021236600461073e565b610468565b34801561022357600080fd5b506101a2610232366004610804565b6104b2565b34801561024357600080fd5b5061024d60015481565b604051908152602001610179565b34801561026757600080fd5b506101a2610276366004610841565b6104f5565b34801561028757600080fd5b5061016573111111111111111111111111111111111111111181565b6101a261023236600461088f565b6101a261019d3660046108cb565b3480156102cb57600080fd5b50731111111111111111111111111111111111111111610165565b6101a26102f4366004610941565b610539565b34801561030557600080fd5b506101a26102763660046109aa565b34801561032057600080fd5b506000546001600160a01b0316610165565b6101a26102f43660046109d4565b34801561034c57600080fd5b506101a261035b366004610a29565b61057e565b34801561036c57600080fd5b50600254610165906001600160a01b031681565b6101a2610232366004610804565b6000546001600160a01b031633146103d357600054604051630c423fcf60e01b81523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b5050505050565b337311111111111111111111111111111111111111111461042a576040516359afe8af60e11b815233600482015273111111111111111111111111111111111111111160248201526044016103ca565b67ffffffffffffffff92909216600155600280546001600160a01b039283166001600160a01b03199182161790915560008054929093169116179055565b6000546001600160a01b031633146104a857600054604051630c423fcf60e01b81523360048201526001600160a01b0390911660248201526044016103ca565b5050505050505050565b6000546001600160a01b031633146104f257600054604051630c423fcf60e01b81523360048201526001600160a01b0390911660248201526044016103ca565b50565b6000546001600160a01b0316331461053557600054604051630c423fcf60e01b81523360048201526001600160a01b0390911660248201526044016103ca565b5050565b6000546001600160a01b0316331461057957600054604051630c423fcf60e01b81523360048201526001600160a01b0390911660248201526044016103ca565b505050565b6000546001600160a01b031633146105be57600054604051630c423fcf60e01b81523360048201526001600160a01b0390911660248201526044016103ca565b505050505050565b803567ffffffffffffffff811681146105de57600080fd5b919050565b6000602082840312156105f557600080fd5b6105fe826105c6565b9392505050565b60008083601f84011261061757600080fd5b50813567ffffffffffffffff81111561062f57600080fd5b60208301915083602082850101111561064757600080fd5b9250929050565b803560ff811681146105de57600080fd5b60008060008060006080868803121561067757600080fd5b610680866105c6565b9450602086013567ffffffffffffffff81111561069c57600080fd5b6106a888828901610605565b90955093506106bb90506040870161064e565b949793965091946060013592915050565b80356001600160a01b03811681146105de57600080fd5b6000806000606084860312156106f857600080fd5b610701846105c6565b925061070f602085016106cc565b915061071d604085016106cc565b90509250925092565b600060c0828403121561073857600080fd5b50919050565b60008060008060008060008060c0898b03121561075a57600080fd5b610763896105c6565b975061077160208a0161064e565b965061077f60408a016105c6565b9550606089013567ffffffffffffffff8082111561079c57600080fd5b6107a88c838d01610726565b965060808b01359150808211156107be57600080fd5b6107ca8c838d01610605565b909650945060a08b01359150808211156107e357600080fd5b506107f08b828c01610605565b999c989b5096995094979396929594505050565b60006020828403121561081657600080fd5b813567ffffffffffffffff81111561082d57600080fd5b61083984828501610726565b949350505050565b6000806040838503121561085457600080fd5b823567ffffffffffffffff81111561086b57600080fd5b61087785828601610726565b925050610886602084016105c6565b90509250929050565b6000602082840312156108a157600080fd5b813567ffffffffffffffff8111156108b857600080fd5b820161012081850312156105fe57600080fd5b6000806000806000608086880312156108e357600080fd5b6108ec866105c6565b94506108fa6020870161064e565b9350610908604087016105c6565b9250606086013567ffffffffffffffff81111561092457600080fd5b61093088828901610605565b969995985093965092949392505050565b60008060006040848603121561095657600080fd5b833567ffffffffffffffff8082111561096e57600080fd5b61097a87838801610726565b9450602086013591508082111561099057600080fd5b5061099d86828701610605565b9497909650939450505050565b600080604083850312156109bd57600080fd5b6109c6836105c6565b9150610886602084016106cc565b6000806000606084860312156109e957600080fd5b833567ffffffffffffffff811115610a0057600080fd5b610a0c86828701610726565b935050610a1b602085016105c6565b915061071d6040850161064e565b60008060008060008060a08789031215610a4257600080fd5b610a4b876105c6565b9550610a59602088016105c6565b9450610a67604088016106cc565b9350606087013567ffffffffffffffff80821115610a8457600080fd5b818901915089601f830112610a9857600080fd5b813581811115610aa757600080fd5b8a60208260051b8501011115610abc57600080fd5b602083019550809450505050610ad4608088016105c6565b9050929550929550929556fea164736f6c6343000814000a diff --git a/pallets/services/src/test-artifacts/HookTestBlueprintServiceManager.hex b/pallets/services/src/test-artifacts/HookTestBlueprintServiceManager.hex index 057611db..f405bb35 100644 --- a/pallets/services/src/test-artifacts/HookTestBlueprintServiceManager.hex +++ b/pallets/services/src/test-artifacts/HookTestBlueprintServiceManager.hex @@ -1 +1 @@ -0x60806040526004361061012a5760003560e01c8063884673ac116100ab578063a4d91fe91161006f578063a4d91fe9146102ed578063bb43abd91461030b578063d7deb4821461031e578063e926cbd11461033e578063f84076621461035e578063fe0dd3711461037e57600080fd5b8063884673ac146102585780639838caa314610280578063987ab9db146102935780639d0410ee146102ba578063a24e8a90146102cd57600080fd5b8063434698bb116100f2578063434698bb146101e15780635d79ea291461020157806365ce59fa1461022557806374ceeb55146101ae578063821c7be21461023857600080fd5b80630af7d7431461012f5780630b6535d7146101515780630d0dd3991461017157806314b4df4c146101ae57806337c29662146101ce575b600080fd5b34801561013b57600080fd5b5061014f61014a36600461098e565b610391565b005b34801561015d57600080fd5b5061014f61016c366004610a11565b6103c1565b34801561017d57600080fd5b50600054610191906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101ba57600080fd5b506101916101c9366004610a54565b503090565b61014f6101dc366004610a8e565b61047f565b3480156101ed57600080fd5b5061014f6101fc366004610b53565b6104ee565b34801561020d57600080fd5b5061021760015481565b6040519081526020016101a5565b61014f610233366004610bd3565b610556565b34801561024457600080fd5b5061014f610253366004610c9d565b6105c6565b34801561026457600080fd5b5061019173111111111111111111111111111111111111111181565b61014f61028e366004610cea565b61062f565b34801561029f57600080fd5b50731111111111111111111111111111111111111111610191565b61014f6102c8366004610d5f565b61069b565b3480156102d957600080fd5b5061014f6102e8366004610dc7565b610705565b3480156102f957600080fd5b506000546001600160a01b0316610191565b61014f610319366004610df1565b61076e565b34801561032a57600080fd5b5061014f610339366004610e45565b6107d8565b34801561034a57600080fd5b5061014f61035936600461098e565b610845565b34801561036a57600080fd5b50600254610191906001600160a01b031681565b61014f61038c366004610b53565b6108b1565b6040517fd38931c95654e0c6958f3e427ad7c53f3a131634d634c86732f8655a28c119eb90600090a15050505050565b337311111111111111111111111111111111111111111461041657337311111111111111111111111111111111111111116040516359afe8af60e11b815260040161040d929190610ec9565b60405180910390fd5b6001600160401b038316600155600280546001600160a01b038085166001600160a01b03199283161790925560008054928416929091169190911781556040517fcf7e69bd1c708d6d282a3b1525cd1c89aa8bf25ec133174b4a7299223ceb3c4f9190a1505050565b6000546001600160a01b031633146104bb57600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f025cf7c6b8939ff50c796fa1df561a4a8d4e0de035caa3d184d5929e47e33d3590600090a15050505050505050565b6000546001600160a01b0316331461052a57600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f82b9cd36e76e3328de8315cb87dd42c248cdb31558184543b45ffd52ba422f2b90600090a150565b6000546001600160a01b0316331461059257600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f3582472ca72fc6a04530f08cfa31f71919e91e34971f4743873db0dbdf02b76090600090a1505050505050505050565b6000546001600160a01b0316331461060257600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f537b387222a90168d719f1d554df67d479e37cb59651378e6d4e4939030352a790600090a15050565b6000546001600160a01b0316331461066b57600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f9de6d7077ebf9fc111bfdc873d12a9d37d80b3657797fa91476f82695c942a3490600090a15050505050565b6000546001600160a01b031633146106d757600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f9add4e5824603d31f2170069522539a6971d31dc77d08e24588e3b68ce077ee690600090a1505050565b6000546001600160a01b0316331461074157600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517fbdd650f74e0fff138cdfa7cac980a24bf480423cba6de8d8daf53042b6240a0890600090a15050565b6000546001600160a01b031633146107aa57600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517fd4162ed8e9bc92ece7ef39b8f199293e403fbea78e95ce1fcbfce0153eb86bb590600090a1505050565b6000546001600160a01b0316331461081457600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517fdd03b583a4b2c88c19891a8aee92431d65f349d08a744f72297b4f25b28095a890600090a1505050505050565b6000546001600160a01b0316331461088157600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f95bfc812251a7cb44ca7b529c8854d13c0ae581729a7d2142231a3258ecd774390600090a15050505050565b6000546001600160a01b031633146108ed57600054604051630c423fcf60e01b815261040d9133916001600160a01b0390911690600401610ec9565b6040517f7e8e44afe7f3a9205df3a9e5ffc0c6e96006905bc7ca73b2a55eeb177ec63ff590600090a150565b80356001600160401b038116811461093057600080fd5b919050565b60008083601f84011261094757600080fd5b5081356001600160401b0381111561095e57600080fd5b60208301915083602082850101111561097657600080fd5b9250929050565b803560ff8116811461093057600080fd5b6000806000806000608086880312156109a657600080fd5b6109af86610919565b945060208601356001600160401b038111156109ca57600080fd5b6109d688828901610935565b90955093506109e990506040870161097d565b949793965091946060013592915050565b80356001600160a01b038116811461093057600080fd5b600080600060608486031215610a2657600080fd5b610a2f84610919565b9250610a3d602085016109fa565b9150610a4b604085016109fa565b90509250925092565b600060208284031215610a6657600080fd5b610a6f82610919565b9392505050565b600060c08284031215610a8857600080fd5b50919050565b60008060008060008060008060c0898b031215610aaa57600080fd5b610ab389610919565b9750610ac160208a0161097d565b9650610acf60408a01610919565b955060608901356001600160401b0380821115610aeb57600080fd5b610af78c838d01610a76565b965060808b0135915080821115610b0d57600080fd5b610b198c838d01610935565b909650945060a08b0135915080821115610b3257600080fd5b50610b3f8b828c01610935565b999c989b5096995094979396929594505050565b600060208284031215610b6557600080fd5b81356001600160401b03811115610b7b57600080fd5b610b8784828501610a76565b949350505050565b60008083601f840112610ba157600080fd5b5081356001600160401b03811115610bb857600080fd5b6020830191508360208260051b850101111561097657600080fd5b600080600080600080600080600060c08a8c031215610bf157600080fd5b610bfa8a610919565b9850610c0860208b016109fa565b975060408a01356001600160401b0380821115610c2457600080fd5b610c308d838e01610b8f565b909950975060608c0135915080821115610c4957600080fd5b610c558d838e01610935565b909750955060808c0135915080821115610c6e57600080fd5b50610c7b8c828d01610b8f565b9094509250610c8e905060a08b01610919565b90509295985092959850929598565b60008060408385031215610cb057600080fd5b82356001600160401b03811115610cc657600080fd5b610cd285828601610a76565b925050610ce160208401610919565b90509250929050565b600080600080600060808688031215610d0257600080fd5b610d0b86610919565b9450610d196020870161097d565b9350610d2760408701610919565b925060608601356001600160401b03811115610d4257600080fd5b610d4e88828901610935565b969995985093965092949392505050565b600080600060408486031215610d7457600080fd5b83356001600160401b0380821115610d8b57600080fd5b610d9787838801610a76565b94506020860135915080821115610dad57600080fd5b50610dba86828701610935565b9497909650939450505050565b60008060408385031215610dda57600080fd5b610de383610919565b9150610ce1602084016109fa565b600080600060608486031215610e0657600080fd5b83356001600160401b03811115610e1c57600080fd5b610e2886828701610a76565b935050610e3760208501610919565b9150610a4b6040850161097d565b60008060008060008060a08789031215610e5e57600080fd5b610e6787610919565b9550610e7560208801610919565b9450610e83604088016109fa565b935060608701356001600160401b03811115610e9e57600080fd5b610eaa89828a01610b8f565b9094509250610ebd905060808801610919565b90509295509295509295565b6001600160a01b039283168152911660208201526040019056fea164736f6c6343000814000a +0x6080604052600436106101355760003560e01c80638b248065116100ab578063a4d91fe91161006f578063a4d91fe914610323578063bb43abd914610341578063d7deb48214610354578063e926cbd114610374578063f840766214610394578063fe0dd371146103b457600080fd5b80638b248065146102a35780639838caa3146102b6578063987ab9db146102c95780639d0410ee146102f0578063a24e8a901461030357600080fd5b806337c29662116100fd57806337c2966214610204578063434698bb146102175780635d79ea291461023757806374ceeb55146101e4578063821c7be21461025b578063884673ac1461027b57600080fd5b806308179f351461013a5780630af7d743146101825780630b6535d7146101a45780630d0dd399146101c457806314b4df4c146101e4575b600080fd5b34801561014657600080fd5b50610165610155366004610965565b506002546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018e57600080fd5b506101a261019d3660046109e1565b6103c7565b005b3480156101b057600080fd5b506101a26101bf366004610a65565b6103f7565b3480156101d057600080fd5b50600054610165906001600160a01b031681565b3480156101f057600080fd5b506101656101ff366004610965565b503090565b6101a2610212366004610ac0565b6104b6565b34801561022357600080fd5b506101a2610232366004610b86565b610525565b34801561024357600080fd5b5061024d60015481565b604051908152602001610179565b34801561026757600080fd5b506101a2610276366004610bc3565b61058d565b34801561028757600080fd5b5061016573111111111111111111111111111111111111111181565b6101a26102b1366004610c11565b6105f6565b6101a26102c4366004610c4d565b61065e565b3480156102d557600080fd5b50731111111111111111111111111111111111111111610165565b6101a26102fe366004610cc3565b6106ca565b34801561030f57600080fd5b506101a261031e366004610d2c565b610734565b34801561032f57600080fd5b506000546001600160a01b0316610165565b6101a261034f366004610d56565b61079d565b34801561036057600080fd5b506101a261036f366004610dab565b610807565b34801561038057600080fd5b506101a261038f3660046109e1565b610874565b3480156103a057600080fd5b50600254610165906001600160a01b031681565b6101a26103c2366004610b86565b6108e0565b6040517fd38931c95654e0c6958f3e427ad7c53f3a131634d634c86732f8655a28c119eb90600090a15050505050565b337311111111111111111111111111111111111111111461044c57337311111111111111111111111111111111111111116040516359afe8af60e11b8152600401610443929190610e62565b60405180910390fd5b67ffffffffffffffff8316600155600280546001600160a01b038085166001600160a01b03199283161790925560008054928416929091169190911781556040517fcf7e69bd1c708d6d282a3b1525cd1c89aa8bf25ec133174b4a7299223ceb3c4f9190a1505050565b6000546001600160a01b031633146104f257600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f025cf7c6b8939ff50c796fa1df561a4a8d4e0de035caa3d184d5929e47e33d3590600090a15050505050505050565b6000546001600160a01b0316331461056157600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f82b9cd36e76e3328de8315cb87dd42c248cdb31558184543b45ffd52ba422f2b90600090a150565b6000546001600160a01b031633146105c957600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f537b387222a90168d719f1d554df67d479e37cb59651378e6d4e4939030352a790600090a15050565b6000546001600160a01b0316331461063257600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f3582472ca72fc6a04530f08cfa31f71919e91e34971f4743873db0dbdf02b76090600090a150565b6000546001600160a01b0316331461069a57600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f9de6d7077ebf9fc111bfdc873d12a9d37d80b3657797fa91476f82695c942a3490600090a15050505050565b6000546001600160a01b0316331461070657600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f9add4e5824603d31f2170069522539a6971d31dc77d08e24588e3b68ce077ee690600090a1505050565b6000546001600160a01b0316331461077057600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517fbdd650f74e0fff138cdfa7cac980a24bf480423cba6de8d8daf53042b6240a0890600090a15050565b6000546001600160a01b031633146107d957600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517fd4162ed8e9bc92ece7ef39b8f199293e403fbea78e95ce1fcbfce0153eb86bb590600090a1505050565b6000546001600160a01b0316331461084357600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517fdd03b583a4b2c88c19891a8aee92431d65f349d08a744f72297b4f25b28095a890600090a1505050505050565b6000546001600160a01b031633146108b057600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f95bfc812251a7cb44ca7b529c8854d13c0ae581729a7d2142231a3258ecd774390600090a15050505050565b6000546001600160a01b0316331461091c57600054604051630c423fcf60e01b81526104439133916001600160a01b0390911690600401610e62565b6040517f7e8e44afe7f3a9205df3a9e5ffc0c6e96006905bc7ca73b2a55eeb177ec63ff590600090a150565b803567ffffffffffffffff8116811461096057600080fd5b919050565b60006020828403121561097757600080fd5b61098082610948565b9392505050565b60008083601f84011261099957600080fd5b50813567ffffffffffffffff8111156109b157600080fd5b6020830191508360208285010111156109c957600080fd5b9250929050565b803560ff8116811461096057600080fd5b6000806000806000608086880312156109f957600080fd5b610a0286610948565b9450602086013567ffffffffffffffff811115610a1e57600080fd5b610a2a88828901610987565b9095509350610a3d9050604087016109d0565b949793965091946060013592915050565b80356001600160a01b038116811461096057600080fd5b600080600060608486031215610a7a57600080fd5b610a8384610948565b9250610a9160208501610a4e565b9150610a9f60408501610a4e565b90509250925092565b600060c08284031215610aba57600080fd5b50919050565b60008060008060008060008060c0898b031215610adc57600080fd5b610ae589610948565b9750610af360208a016109d0565b9650610b0160408a01610948565b9550606089013567ffffffffffffffff80821115610b1e57600080fd5b610b2a8c838d01610aa8565b965060808b0135915080821115610b4057600080fd5b610b4c8c838d01610987565b909650945060a08b0135915080821115610b6557600080fd5b50610b728b828c01610987565b999c989b5096995094979396929594505050565b600060208284031215610b9857600080fd5b813567ffffffffffffffff811115610baf57600080fd5b610bbb84828501610aa8565b949350505050565b60008060408385031215610bd657600080fd5b823567ffffffffffffffff811115610bed57600080fd5b610bf985828601610aa8565b925050610c0860208401610948565b90509250929050565b600060208284031215610c2357600080fd5b813567ffffffffffffffff811115610c3a57600080fd5b8201610120818503121561098057600080fd5b600080600080600060808688031215610c6557600080fd5b610c6e86610948565b9450610c7c602087016109d0565b9350610c8a60408701610948565b9250606086013567ffffffffffffffff811115610ca657600080fd5b610cb288828901610987565b969995985093965092949392505050565b600080600060408486031215610cd857600080fd5b833567ffffffffffffffff80821115610cf057600080fd5b610cfc87838801610aa8565b94506020860135915080821115610d1257600080fd5b50610d1f86828701610987565b9497909650939450505050565b60008060408385031215610d3f57600080fd5b610d4883610948565b9150610c0860208401610a4e565b600080600060608486031215610d6b57600080fd5b833567ffffffffffffffff811115610d8257600080fd5b610d8e86828701610aa8565b935050610d9d60208501610948565b9150610a9f604085016109d0565b60008060008060008060a08789031215610dc457600080fd5b610dcd87610948565b9550610ddb60208801610948565b9450610de960408801610a4e565b9350606087013567ffffffffffffffff80821115610e0657600080fd5b818901915089601f830112610e1a57600080fd5b813581811115610e2957600080fd5b8a60208260051b8501011115610e3e57600080fd5b602083019550809450505050610e5660808801610948565b90509295509295509295565b6001600160a01b039283168152911660208201526040019056fea164736f6c6343000814000a diff --git a/pallets/services/src/test-artifacts/MasterBlueprintServiceManager.hex b/pallets/services/src/test-artifacts/MasterBlueprintServiceManager.hex index 745cb77c..a6bc701e 100644 --- a/pallets/services/src/test-artifacts/MasterBlueprintServiceManager.hex +++ b/pallets/services/src/test-artifacts/MasterBlueprintServiceManager.hex @@ -1 +1 @@ -0x60806040526004361061019c5760003560e01c8063727391f2116100ec578063a4d91fe91161008a578063b89af90411610064578063b89af9041461047c578063b9315d3a1461048f578063c97008e0146104a2578063d547741f146104c257600080fd5b8063a4d91fe914610438578063a6a7853814610456578063a8f7c5ed1461046957600080fd5b80638e6f8c60116100c65780638e6f8c60146103c257806391d14854146103e2578063987ab9db14610402578063a217fddf1461042357600080fd5b8063727391f21461036d57806382a1ece414610380578063884673ac146103a057600080fd5b80632f2ff15d11610159578063410fdec811610133578063410fdec81461030f5780634984ee6b1461032f5780634efb4b8b146103425780635c975abb1461035557600080fd5b80632f2ff15d146102af57806333db3920146102cf57806336568abe146102ef57600080fd5b806301ffc9a7146101a15780630633da77146101d65780630d0dd399146101f85780631fb27b3414610230578063248a9ca314610250578063274ef0151461028f575b600080fd5b3480156101ad57600080fd5b506101c16101bc3660046116e7565b6104e2565b60405190151581526020015b60405180910390f35b3480156101e257600080fd5b506101f66101f136600461174d565b610519565b005b34801561020457600080fd5b50600054610218906001600160a01b031681565b6040516001600160a01b0390911681526020016101cd565b34801561023c57600080fd5b506101f661024b3660046117ac565b610640565b34801561025c57600080fd5b5061028161026b3660046117f9565b6000908152600160208190526040909120015490565b6040519081526020016101cd565b34801561029b57600080fd5b506102186102aa366004611812565b610745565b3480156102bb57600080fd5b506101f66102ca366004611845565b6107d9565b3480156102db57600080fd5b506101f66102ea3660046118ce565b610805565b3480156102fb57600080fd5b506101f661030a366004611845565b610926565b34801561031b57600080fd5b506101f661032a36600461194b565b61095e565b6101f661033d3660046119a8565b610a62565b6101f6610350366004611a71565b610b72565b34801561036157600080fd5b5060025460ff166101c1565b6101f661037b366004611b4e565b610c9d565b34801561038c57600080fd5b506101f661039b366004611bc4565b610da8565b3480156103ac57600080fd5b5061021860008051602061248583398151915281565b3480156103ce57600080fd5b506102186103dd366004611812565b610ed1565b3480156103ee57600080fd5b506101c16103fd366004611845565b610f20565b34801561040e57600080fd5b50600080516020612485833981519152610218565b34801561042f57600080fd5b50610281600081565b34801561044457600080fd5b506000546001600160a01b0316610218565b6101f66104643660046117ac565b610f4b565b6101f6610477366004611c5c565b611043565b6101f661048a366004611d34565b61116b565b6101f661049d366004611d8f565b611240565b3480156104ae57600080fd5b506101f66104bd3660046118ce565b611357565b3480156104ce57600080fd5b506101f66104dd366004611845565b611467565b60006001600160e01b03198216637965db0b60e01b148061051357506301ffc9a760e01b6001600160e01b03198316145b92915050565b336000805160206124858339815191521461056257336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b60405180910390fd5b61056a61148d565b600061058060036001600160401b0386166114b3565b604051630a24e8a960e41b81526001600160401b03851660048201526001600160a01b0384811660248301529192509082169063a24e8a9090604401600060405180830381600087803b1580156105d657600080fd5b505af11580156105ea573d6000803e3d6000fd5b50506040516001600160a01b03851681526001600160401b038087169350871691507f5267932e6c1b678e74efba1e4d6c8b3fd7504cf0fa8eea462efac2c590a21d56906020015b60405180910390a350505050565b336000805160206124858339815191521461068057336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b61068861148d565b600061069e60036001600160401b0385166114b3565b60405163434698bb60e01b81529091506001600160a01b0382169063434698bb906106cd908590600401611f18565b600060405180830381600087803b1580156106e757600080fd5b505af11580156106fb573d6000803e3d6000fd5b50505050826001600160401b03167fde25c2b146db36cbc91715fdf29cb0eb556eed7678e0bf13563bf7050e8f0bbd836040516107389190611f18565b60405180910390a2505050565b60008061075c60036001600160401b0386166114b3565b6040516374ceeb5560e01b81526001600160401b03851660048201529091506001600160a01b038216906374ceeb55906024015b602060405180830381865afa1580156107ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d19190611f2b565b949350505050565b600082815260016020819052604090912001546107f5816114c6565b6107ff83836114d3565b50505050565b336000805160206124858339815191521461084557336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b61084d61148d565b600061086360036001600160401b0389166114b3565b604051630af7d74360e01b81529091506001600160a01b03821690630af7d7439061089a9089908990899089908990600401611f48565b600060405180830381600087803b1580156108b457600080fd5b505af11580156108c8573d6000803e3d6000fd5b50505050856001600160401b0316876001600160401b03167f7d2ac4c1544e07516def74ce3ada12ff791868ed07d6da82694ae2c0342c8371878787876040516109159493929190611f82565b60405180910390a350505050505050565b6001600160a01b038116331461094f5760405163334bd91960e11b815260040160405180910390fd5b610959828261154c565b505050565b336000805160206124858339815191521461099e57336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b6109a661148d565b60006109bc60036001600160401b0386166114b3565b60405163410e3df160e11b81529091506001600160a01b0382169063821c7be2906109ed9086908690600401611fac565b600060405180830381600087803b158015610a0757600080fd5b505af1158015610a1b573d6000803e3d6000fd5b50505050816001600160401b0316846001600160401b03167f4ca48d7cb411035a931da7a686ea77bc413069de12d844c47daf9242b765cba4856040516106329190611f18565b3360008051602061248583398151915214610aa257336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b610aaa61148d565b6000610ac060036001600160401b0389166114b3565b604051639838caa360e01b81529091506001600160a01b03821690639838caa390610af79089908990899089908990600401611fd7565b600060405180830381600087803b158015610b1157600080fd5b505af1158015610b25573d6000803e3d6000fd5b50506040805160ff891681526001600160401b038881166020830152808b1694508b1692507fa9aaaef624d196d961d053fc29d4331e5cb45d62195d99814d29a94f46fa9d4b9101610915565b3360008051602061248583398151915214610bb257336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b610bba61148d565b6000610bd060036001600160401b038d166114b3565b6040516332e72cfd60e11b81529091506001600160a01b038216906365ce59fa90610c0f908d908d908d908d908d908d908d908d908d90600401612061565b600060405180830381600087803b158015610c2957600080fd5b505af1158015610c3d573d6000803e3d6000fd5b50506040516001600160401b0385811682526001600160a01b038d169350808e1692508e16907f43200f1363ce7ac3780a4c2c5835bf74800937ca5cbc69c4f4d666cf92b0c54c9060200160405180910390a45050505050505050505050565b3360008051602061248583398151915214610cdd57336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b610ce561148d565b6000610cfb60036001600160401b0387166114b3565b604051634e82087760e11b81529091506001600160a01b03821690639d0410ee90610d2e90879087908790600401612136565b600060405180830381600087803b158015610d4857600080fd5b505af1158015610d5c573d6000803e3d6000fd5b50505050846001600160401b03167f7814301100cb38a35027dd63a29aa14c3f73188f15cf9f027655257c45016e8785604051610d999190611f18565b60405180910390a25050505050565b3360008051602061248583398151915214610de857336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b610df061148d565b6000610e0660036001600160401b038a166114b3565b604051636bef5a4160e11b81529091506001600160a01b0382169063d7deb48290610e3f908a908a908a908a908a908a90600401612166565b600060405180830381600087803b158015610e5957600080fd5b505af1158015610e6d573d6000803e3d6000fd5b5050604080516001600160a01b03891681526001600160401b038681166020830152808b1694508b811693508c16917f93927390d124732c66289c6e22370514ddd612a9cc6bff5671cbf2cbc15ddfe3910160405180910390a45050505050505050565b600080610ee860036001600160401b0386166114b3565b60405163052d37d360e21b81526001600160401b03851660048201529091506001600160a01b038216906314b4df4c90602401610790565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3360008051602061248583398151915214610f8b57336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b610f9361148d565b6000610fa960036001600160401b0385166114b3565b60405163fe0dd37160e01b81529091506001600160a01b0382169063fe0dd37190610fd8908590600401611f18565b600060405180830381600087803b158015610ff257600080fd5b505af1158015611006573d6000803e3d6000fd5b50505050826001600160401b03167febc442018e78570634a88dbac83d4677ae1a5cf8491fb0fc166a7306ba1ff051836040516107389190611f18565b336000805160206124858339815191521461108357336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b61108b61148d565b60006110a160036001600160401b038c166114b3565b604051631be14b3160e11b81529091506001600160a01b038216906337c29662906110de908c908c908c908c908c908c908c908c906004016121b6565b600060405180830381600087803b1580156110f857600080fd5b505af115801561110c573d6000803e3d6000fd5b50505050886001600160401b03168a6001600160401b03167f08e18861659838cad8b04f4687aca1dfb93336e750acf5c3699637ed8ca4c27a8a8a8a60405161115793929190612222565b60405180910390a350505050505050505050565b33600080516020612485833981519152146111ab57336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b6111b361148d565b6111d96001600160401b0384166111d06040840160208501612256565b600391906115b9565b506111ef60066001600160401b038516846115b9565b50826001600160401b0316826001600160a01b03167f278018182b7c51e2da72c1f465c26c12d9606099af0f08db420378344b352223836040516112339190612287565b60405180910390a3505050565b336000805160206124858339815191521461128057336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b61128861148d565b600061129e60036001600160401b0387166114b3565b60405163bb43abd960e01b81529091506001600160a01b0382169063bb43abd9906112d19087908790879060040161242a565b600060405180830381600087803b1580156112eb57600080fd5b505af11580156112ff573d6000803e3d6000fd5b50505050826001600160401b0316856001600160401b03167f219c2fdfbe4f111dda584eefbcb4eb2370cec850e2a79e4fed3a8f708006e7a9868560405161134892919061245f565b60405180910390a35050505050565b336000805160206124858339815191521461139757336000805160206124858339815191526040516359afe8af60e11b8152600401610559929190611dfd565b61139f61148d565b60006113b560036001600160401b0389166114b3565b60405163e926cbd160e01b81529091506001600160a01b0382169063e926cbd1906113ec9089908990899089908990600401611f48565b600060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b50505050856001600160401b0316876001600160401b03167f0145a8acdb5e19e431ea924e2c8997b01f0869cad2a2c6927c8645a5938cf0c3878787876040516109159493929190611f82565b60008281526001602081905260409091200154611483816114c6565b6107ff838361154c565b60025460ff16156114b15760405163d93c066560e01b815260040160405180910390fd5b565b60006114bf83836115cf565b9392505050565b6114d08133611616565b50565b60006114df8383610f20565b6115445760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a4506001610513565b506000610513565b60006115588383610f20565b156115445760008381526001602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610513565b60006107d184846001600160a01b038516611653565b6000818152600283016020526040812054801580156115f557506115f38484611670565b155b156114bf5760405163015ab34360e11b815260048101849052602401610559565b6116208282610f20565b61164f5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610559565b5050565b600082815260028401602052604081208290556107d1848461167c565b60006114bf8383611688565b60006114bf83836116a0565b600081815260018301602052604081205415156114bf565b600081815260018301602052604081205461154457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610513565b6000602082840312156116f957600080fd5b81356001600160e01b0319811681146114bf57600080fd5b80356001600160401b038116811461172857600080fd5b919050565b6001600160a01b03811681146114d057600080fd5b80356117288161172d565b60008060006060848603121561176257600080fd5b61176b84611711565b925061177960208501611711565b915060408401356117898161172d565b809150509250925092565b600060c082840312156117a657600080fd5b50919050565b600080604083850312156117bf57600080fd5b6117c883611711565b915060208301356001600160401b038111156117e357600080fd5b6117ef85828601611794565b9150509250929050565b60006020828403121561180b57600080fd5b5035919050565b6000806040838503121561182557600080fd5b61182e83611711565b915061183c60208401611711565b90509250929050565b6000806040838503121561185857600080fd5b82359150602083013561186a8161172d565b809150509250929050565b60008083601f84011261188757600080fd5b5081356001600160401b0381111561189e57600080fd5b6020830191508360208285010111156118b657600080fd5b9250929050565b803560ff8116811461172857600080fd5b60008060008060008060a087890312156118e757600080fd5b6118f087611711565b95506118fe60208801611711565b945060408701356001600160401b0381111561191957600080fd5b61192589828a01611875565b90955093506119389050606088016118bd565b9150608087013590509295509295509295565b60008060006060848603121561196057600080fd5b61196984611711565b925060208401356001600160401b0381111561198457600080fd5b61199086828701611794565b92505061199f60408501611711565b90509250925092565b60008060008060008060a087890312156119c157600080fd5b6119ca87611711565b95506119d860208801611711565b94506119e6604088016118bd565b93506119f460608801611711565b925060808701356001600160401b03811115611a0f57600080fd5b611a1b89828a01611875565b979a9699509497509295939492505050565b60008083601f840112611a3f57600080fd5b5081356001600160401b03811115611a5657600080fd5b6020830191508360208260051b85010111156118b657600080fd5b60008060008060008060008060008060e08b8d031215611a9057600080fd5b611a998b611711565b9950611aa760208c01611711565b985060408b0135611ab78161172d565b975060608b01356001600160401b0380821115611ad357600080fd5b611adf8e838f01611a2d565b909950975060808d0135915080821115611af857600080fd5b611b048e838f01611875565b909750955060a08d0135915080821115611b1d57600080fd5b50611b2a8d828e01611a2d565b9094509250611b3d905060c08c01611711565b90509295989b9194979a5092959850565b60008060008060608587031215611b6457600080fd5b611b6d85611711565b935060208501356001600160401b0380821115611b8957600080fd5b611b9588838901611794565b94506040870135915080821115611bab57600080fd5b50611bb887828801611875565b95989497509550505050565b600080600080600080600060c0888a031215611bdf57600080fd5b611be888611711565b9650611bf660208901611711565b9550611c0460408901611711565b94506060880135611c148161172d565b935060808801356001600160401b03811115611c2f57600080fd5b611c3b8a828b01611a2d565b9094509250611c4e905060a08901611711565b905092959891949750929550565b600080600080600080600080600060e08a8c031215611c7a57600080fd5b611c838a611711565b9850611c9160208b01611711565b9750611c9f60408b016118bd565b9650611cad60608b01611711565b955060808a01356001600160401b0380821115611cc957600080fd5b611cd58d838e01611794565b965060a08c0135915080821115611ceb57600080fd5b611cf78d838e01611875565b909650945060c08c0135915080821115611d1057600080fd5b50611d1d8c828d01611875565b915080935050809150509295985092959850929598565b600080600060608486031215611d4957600080fd5b611d5284611711565b92506020840135611d628161172d565b915060408401356001600160401b03811115611d7d57600080fd5b84016060818703121561178957600080fd5b60008060008060808587031215611da557600080fd5b611dae85611711565b935060208501356001600160401b03811115611dc957600080fd5b611dd587828801611794565b935050611de460408601611711565b9150611df2606086016118bd565b905092959194509250565b6001600160a01b0392831681529116602082015260400190565b6000808335601e19843603018112611e2e57600080fd5b83016020810192503590506001600160401b03811115611e4d57600080fd5b8036038213156118b657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000611e918283611e17565b60c08552611ea360c086018284611e5c565b9150506001600160401b0380611ebb60208601611711565b16602086015280611ece60408601611711565b16604086015280611ee160608601611711565b16606086015280611ef460808601611711565b16608086015280611f0760a08601611711565b1660a0860152508091505092915050565b6020815260006114bf6020830184611e85565b600060208284031215611f3d57600080fd5b81516114bf8161172d565b6001600160401b0386168152608060208201526000611f6b608083018688611e5c565b60ff94909416604083015250606001529392505050565b606081526000611f96606083018688611e5c565b60ff949094166020830152506040015292915050565b604081526000611fbf6040830185611e85565b90506001600160401b03831660208301529392505050565b60006001600160401b03808816835260ff871660208401528086166040840152506080606083015261200d608083018486611e5c565b979650505050505050565b8183526000602080850194508260005b8581101561205657813561203b8161172d565b6001600160a01b031687529582019590820190600101612028565b509495945050505050565b6001600160401b038a1681526001600160a01b038916602082015260c0604082018190528101879052600060e0600589901b830181019083018a835b8b8110156120e55785840360df190183528135368e900360be190181126120c357600080fd5b6120cf858f8301611e85565b945050602092830192919091019060010161209d565b50505082810360608401526120fb81888a611e5c565b90508281036080840152612110818688612018565b91505061212860a08301846001600160401b03169052565b9a9950505050505050505050565b6040815260006121496040830186611e85565b828103602084015261215c818587611e5c565b9695505050505050565b60006001600160401b038089168352808816602084015260018060a01b038716604084015260a060608401526121a060a084018688612018565b9150808416608084015250979650505050505050565b60006001600160401b03808b16835260ff8a16602084015280891660408401525060c060608301526121eb60c0830188611e85565b82810360808401526121fe818789611e5c565b905082810360a0840152612213818587611e5c565b9b9a5050505050505050505050565b60ff841681526001600160401b038316602082015260606040820152600061224d6060830184611e85565b95945050505050565b60006020828403121561226857600080fd5b81356114bf8161172d565b803563ffffffff8116811461172857600080fd5b602081526000823560fe198436030181126122a157600080fd5b6060602084015283016122b48180611e17565b6101008060808701526122cc61018087018385611e5c565b92506122db6020850185611e17565b9250607f19808886030160a08901526122f5858584611e5c565b94506123046040870187611e17565b94509150808886030160c089015261231d858584611e5c565b945061232c6060870187611e17565b94509150808886030160e0890152612345858584611e5c565b94506123546080870187611e17565b9450915080888603018389015261236c858584611e5c565b945061237b60a0870187611e17565b945092508088860301610120890152612395858585611e5c565b94506123a460c0870187611e17565b9450925080888603016101408901526123be858585611e5c565b94506123cd60e0870187611e17565b9650935080888603016101608901525050506123ea828483611e5c565b925050506123fa60208501611742565b6001600160a01b03811660408501525061241660408501612273565b63ffffffff81166060850152509392505050565b60608152600061243d6060830186611e85565b90506001600160401b038416602083015260ff83166040830152949350505050565b6040815260006124726040830185611e85565b905060ff83166020830152939250505056fe0000000000000000000000001111111111111111111111111111111111111111a164736f6c6343000814000a +0x60806040526004361061019c5760003560e01c806382a1ece4116100ec578063a6a785381161008a578063b9315d3a11610064578063b9315d3a1461047c578063c97008e01461048f578063d547741f146104af578063f9e13845146104cf57600080fd5b8063a6a7853814610443578063a8f7c5ed14610456578063b89af9041461046957600080fd5b806391d14854116100c657806391d14854146103cf578063987ab9db146103ef578063a217fddf14610410578063a4d91fe91461042557600080fd5b806382a1ece41461036d578063884673ac1461038d5780638e6f8c60146103af57600080fd5b80632f2ff15d11610159578063410fdec811610133578063410fdec81461030f5780634984ee6b1461032f5780635c975abb14610342578063727391f21461035a57600080fd5b80632f2ff15d146102af57806333db3920146102cf57806336568abe146102ef57600080fd5b806301ffc9a7146101a15780630633da77146101d65780630d0dd399146101f85780631fb27b3414610230578063248a9ca314610250578063274ef0151461028f575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004611707565b6104e2565b60405190151581526020015b60405180910390f35b3480156101e257600080fd5b506101f66101f136600461176d565b610519565b005b34801561020457600080fd5b50600054610218906001600160a01b031681565b6040516001600160a01b0390911681526020016101cd565b34801561023c57600080fd5b506101f661024b3660046117cc565b610640565b34801561025c57600080fd5b5061028161026b366004611819565b6000908152600160208190526040909120015490565b6040519081526020016101cd565b34801561029b57600080fd5b506102186102aa366004611832565b610745565b3480156102bb57600080fd5b506101f66102ca366004611865565b6107d9565b3480156102db57600080fd5b506101f66102ea3660046118ee565b610805565b3480156102fb57600080fd5b506101f661030a366004611865565b610926565b34801561031b57600080fd5b506101f661032a36600461196b565b61095e565b6101f661033d3660046119c8565b610a62565b34801561034e57600080fd5b5060025460ff166101c1565b6101f6610368366004611a4d565b610b72565b34801561037957600080fd5b506101f6610388366004611ac3565b610c7d565b34801561039957600080fd5b5061021860008051602061256a83398151915281565b3480156103bb57600080fd5b506102186103ca366004611832565b610da6565b3480156103db57600080fd5b506101c16103ea366004611865565b610df5565b3480156103fb57600080fd5b5060008051602061256a833981519152610218565b34801561041c57600080fd5b50610281600081565b34801561043157600080fd5b506000546001600160a01b0316610218565b6101f66104513660046117cc565b610e20565b6101f6610464366004611b8d565b610f18565b6101f6610477366004611c65565b611040565b6101f661048a366004611cc0565b611115565b34801561049b57600080fd5b506101f66104aa3660046118ee565b61122c565b3480156104bb57600080fd5b506101f66104ca366004611865565b61133c565b6101f66104dd366004611d2e565b611362565b60006001600160e01b03198216637965db0b60e01b148061051357506301ffc9a760e01b6001600160e01b03198316145b92915050565b3360008051602061256a83398151915214610562573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b60405180910390fd5b61056a6114ad565b600061058060036001600160401b0386166114d3565b604051630a24e8a960e41b81526001600160401b03851660048201526001600160a01b0384811660248301529192509082169063a24e8a9090604401600060405180830381600087803b1580156105d657600080fd5b505af11580156105ea573d6000803e3d6000fd5b50506040516001600160a01b03851681526001600160401b038087169350871691507f5267932e6c1b678e74efba1e4d6c8b3fd7504cf0fa8eea462efac2c590a21d56906020015b60405180910390a350505050565b3360008051602061256a83398151915214610680573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b6106886114ad565b600061069e60036001600160401b0385166114d3565b60405163434698bb60e01b81529091506001600160a01b0382169063434698bb906106cd908590600401611e93565b600060405180830381600087803b1580156106e757600080fd5b505af11580156106fb573d6000803e3d6000fd5b50505050826001600160401b03167fde25c2b146db36cbc91715fdf29cb0eb556eed7678e0bf13563bf7050e8f0bbd836040516107389190611e93565b60405180910390a2505050565b60008061075c60036001600160401b0386166114d3565b6040516374ceeb5560e01b81526001600160401b03851660048201529091506001600160a01b038216906374ceeb55906024015b602060405180830381865afa1580156107ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d19190611ea6565b949350505050565b600082815260016020819052604090912001546107f5816114e6565b6107ff83836114f3565b50505050565b3360008051602061256a83398151915214610845573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b61084d6114ad565b600061086360036001600160401b0389166114d3565b604051630af7d74360e01b81529091506001600160a01b03821690630af7d7439061089a9089908990899089908990600401611ec3565b600060405180830381600087803b1580156108b457600080fd5b505af11580156108c8573d6000803e3d6000fd5b50505050856001600160401b0316876001600160401b03167f7d2ac4c1544e07516def74ce3ada12ff791868ed07d6da82694ae2c0342c8371878787876040516109159493929190611efd565b60405180910390a350505050505050565b6001600160a01b038116331461094f5760405163334bd91960e11b815260040160405180910390fd5b610959828261156c565b505050565b3360008051602061256a8339815191521461099e573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b6109a66114ad565b60006109bc60036001600160401b0386166114d3565b60405163410e3df160e11b81529091506001600160a01b0382169063821c7be2906109ed9086908690600401611f27565b600060405180830381600087803b158015610a0757600080fd5b505af1158015610a1b573d6000803e3d6000fd5b50505050816001600160401b0316846001600160401b03167f4ca48d7cb411035a931da7a686ea77bc413069de12d844c47daf9242b765cba4856040516106329190611e93565b3360008051602061256a83398151915214610aa2573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b610aaa6114ad565b6000610ac060036001600160401b0389166114d3565b604051639838caa360e01b81529091506001600160a01b03821690639838caa390610af79089908990899089908990600401611f52565b600060405180830381600087803b158015610b1157600080fd5b505af1158015610b25573d6000803e3d6000fd5b50506040805160ff891681526001600160401b038881166020830152808b1694508b1692507fa9aaaef624d196d961d053fc29d4331e5cb45d62195d99814d29a94f46fa9d4b9101610915565b3360008051602061256a83398151915214610bb2573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b610bba6114ad565b6000610bd060036001600160401b0387166114d3565b604051634e82087760e11b81529091506001600160a01b03821690639d0410ee90610c0390879087908790600401611f93565b600060405180830381600087803b158015610c1d57600080fd5b505af1158015610c31573d6000803e3d6000fd5b50505050846001600160401b03167f7814301100cb38a35027dd63a29aa14c3f73188f15cf9f027655257c45016e8785604051610c6e9190611e93565b60405180910390a25050505050565b3360008051602061256a83398151915214610cbd573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b610cc56114ad565b6000610cdb60036001600160401b038a166114d3565b604051636bef5a4160e11b81529091506001600160a01b0382169063d7deb48290610d14908a908a908a908a908a908a90600401611fc3565b600060405180830381600087803b158015610d2e57600080fd5b505af1158015610d42573d6000803e3d6000fd5b5050604080516001600160a01b03891681526001600160401b038681166020830152808b1694508b811693508c16917f93927390d124732c66289c6e22370514ddd612a9cc6bff5671cbf2cbc15ddfe3910160405180910390a45050505050505050565b600080610dbd60036001600160401b0386166114d3565b60405163052d37d360e21b81526001600160401b03851660048201529091506001600160a01b038216906314b4df4c90602401610790565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b3360008051602061256a83398151915214610e60573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b610e686114ad565b6000610e7e60036001600160401b0385166114d3565b60405163fe0dd37160e01b81529091506001600160a01b0382169063fe0dd37190610ead908590600401611e93565b600060405180830381600087803b158015610ec757600080fd5b505af1158015610edb573d6000803e3d6000fd5b50505050826001600160401b03167febc442018e78570634a88dbac83d4677ae1a5cf8491fb0fc166a7306ba1ff051836040516107389190611e93565b3360008051602061256a83398151915214610f58573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b610f606114ad565b6000610f7660036001600160401b038c166114d3565b604051631be14b3160e11b81529091506001600160a01b038216906337c2966290610fb3908c908c908c908c908c908c908c908c9060040161204a565b600060405180830381600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b50505050886001600160401b03168a6001600160401b03167f08e18861659838cad8b04f4687aca1dfb93336e750acf5c3699637ed8ca4c27a8a8a8a60405161102c939291906120b6565b60405180910390a350505050505050505050565b3360008051602061256a83398151915214611080573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b6110886114ad565b6110ae6001600160401b0384166110a560408401602085016120ea565b600391906115d9565b506110c460066001600160401b038516846115d9565b50826001600160401b0316826001600160a01b03167f278018182b7c51e2da72c1f465c26c12d9606099af0f08db420378344b35222383604051611108919061211b565b60405180910390a3505050565b3360008051602061256a83398151915214611155573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b61115d6114ad565b600061117360036001600160401b0387166114d3565b60405163bb43abd960e01b81529091506001600160a01b0382169063bb43abd9906111a6908790879087906004016122be565b600060405180830381600087803b1580156111c057600080fd5b505af11580156111d4573d6000803e3d6000fd5b50505050826001600160401b0316856001600160401b03167f219c2fdfbe4f111dda584eefbcb4eb2370cec850e2a79e4fed3a8f708006e7a9868560405161121d9291906122f3565b60405180910390a35050505050565b3360008051602061256a8339815191521461126c573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b6112746114ad565b600061128a60036001600160401b0389166114d3565b60405163e926cbd160e01b81529091506001600160a01b0382169063e926cbd1906112c19089908990899089908990600401611ec3565b600060405180830381600087803b1580156112db57600080fd5b505af11580156112ef573d6000803e3d6000fd5b50505050856001600160401b0316876001600160401b03167f0145a8acdb5e19e431ea924e2c8997b01f0869cad2a2c6927c8645a5938cf0c3878787876040516109159493929190611efd565b60008281526001602081905260409091200154611358816114e6565b6107ff838361156c565b3360008051602061256a833981519152146113a2573360008051602061256a8339815191526040516359afe8af60e11b8152600401610559929190611d78565b6113aa6114ad565b60006113c060036001600160401b0385166114d3565b604051638b24806560e01b81529091506001600160a01b03821690638b248065906113ef90859060040161242d565b600060405180830381600087803b15801561140957600080fd5b505af115801561141d573d6000803e3d6000fd5b506114329250505060408301602084016120ea565b6001600160a01b03166114486020840184612523565b6001600160401b039081169085167f4def5362750954077cbc9dad1ab88058dd6d0ed894ba05f8f147a7a2fe204b2261148760c0870160a08801612523565b8660c0018761010001356040516114a09392919061253e565b60405180910390a4505050565b60025460ff16156114d15760405163d93c066560e01b815260040160405180910390fd5b565b60006114df83836115ef565b9392505050565b6114f08133611636565b50565b60006114ff8383610df5565b6115645760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a4506001610513565b506000610513565b60006115788383610df5565b156115645760008381526001602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610513565b60006107d184846001600160a01b038516611673565b60008181526002830160205260408120548015801561161557506116138484611690565b155b156114df5760405163015ab34360e11b815260048101849052602401610559565b6116408282610df5565b61166f5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610559565b5050565b600082815260028401602052604081208290556107d1848461169c565b60006114df83836116a8565b60006114df83836116c0565b600081815260018301602052604081205415156114df565b600081815260018301602052604081205461156457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610513565b60006020828403121561171957600080fd5b81356001600160e01b0319811681146114df57600080fd5b80356001600160401b038116811461174857600080fd5b919050565b6001600160a01b03811681146114f057600080fd5b80356117488161174d565b60008060006060848603121561178257600080fd5b61178b84611731565b925061179960208501611731565b915060408401356117a98161174d565b809150509250925092565b600060c082840312156117c657600080fd5b50919050565b600080604083850312156117df57600080fd5b6117e883611731565b915060208301356001600160401b0381111561180357600080fd5b61180f858286016117b4565b9150509250929050565b60006020828403121561182b57600080fd5b5035919050565b6000806040838503121561184557600080fd5b61184e83611731565b915061185c60208401611731565b90509250929050565b6000806040838503121561187857600080fd5b82359150602083013561188a8161174d565b809150509250929050565b60008083601f8401126118a757600080fd5b5081356001600160401b038111156118be57600080fd5b6020830191508360208285010111156118d657600080fd5b9250929050565b803560ff8116811461174857600080fd5b60008060008060008060a0878903121561190757600080fd5b61191087611731565b955061191e60208801611731565b945060408701356001600160401b0381111561193957600080fd5b61194589828a01611895565b90955093506119589050606088016118dd565b9150608087013590509295509295509295565b60008060006060848603121561198057600080fd5b61198984611731565b925060208401356001600160401b038111156119a457600080fd5b6119b0868287016117b4565b9250506119bf60408501611731565b90509250925092565b60008060008060008060a087890312156119e157600080fd5b6119ea87611731565b95506119f860208801611731565b9450611a06604088016118dd565b9350611a1460608801611731565b925060808701356001600160401b03811115611a2f57600080fd5b611a3b89828a01611895565b979a9699509497509295939492505050565b60008060008060608587031215611a6357600080fd5b611a6c85611731565b935060208501356001600160401b0380821115611a8857600080fd5b611a94888389016117b4565b94506040870135915080821115611aaa57600080fd5b50611ab787828801611895565b95989497509550505050565b600080600080600080600060c0888a031215611ade57600080fd5b611ae788611731565b9650611af560208901611731565b9550611b0360408901611731565b94506060880135611b138161174d565b935060808801356001600160401b0380821115611b2f57600080fd5b818a0191508a601f830112611b4357600080fd5b813581811115611b5257600080fd5b8b60208260051b8501011115611b6757600080fd5b602083019550809450505050611b7f60a08901611731565b905092959891949750929550565b600080600080600080600080600060e08a8c031215611bab57600080fd5b611bb48a611731565b9850611bc260208b01611731565b9750611bd060408b016118dd565b9650611bde60608b01611731565b955060808a01356001600160401b0380821115611bfa57600080fd5b611c068d838e016117b4565b965060a08c0135915080821115611c1c57600080fd5b611c288d838e01611895565b909650945060c08c0135915080821115611c4157600080fd5b50611c4e8c828d01611895565b915080935050809150509295985092959850929598565b600080600060608486031215611c7a57600080fd5b611c8384611731565b92506020840135611c938161174d565b915060408401356001600160401b03811115611cae57600080fd5b8401606081870312156117a957600080fd5b60008060008060808587031215611cd657600080fd5b611cdf85611731565b935060208501356001600160401b03811115611cfa57600080fd5b611d06878288016117b4565b935050611d1560408601611731565b9150611d23606086016118dd565b905092959194509250565b60008060408385031215611d4157600080fd5b611d4a83611731565b915060208301356001600160401b03811115611d6557600080fd5b8301610120818603121561188a57600080fd5b6001600160a01b0392831681529116602082015260400190565b6000808335601e19843603018112611da957600080fd5b83016020810192503590506001600160401b03811115611dc857600080fd5b8036038213156118d657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000611e0c8283611d92565b60c08552611e1e60c086018284611dd7565b9150506001600160401b0380611e3660208601611731565b16602086015280611e4960408601611731565b16604086015280611e5c60608601611731565b16606086015280611e6f60808601611731565b16608086015280611e8260a08601611731565b1660a0860152508091505092915050565b6020815260006114df6020830184611e00565b600060208284031215611eb857600080fd5b81516114df8161174d565b6001600160401b0386168152608060208201526000611ee6608083018688611dd7565b60ff94909416604083015250606001529392505050565b606081526000611f11606083018688611dd7565b60ff949094166020830152506040015292915050565b604081526000611f3a6040830185611e00565b90506001600160401b03831660208301529392505050565b60006001600160401b03808816835260ff8716602084015280861660408401525060806060830152611f88608083018486611dd7565b979650505050505050565b604081526000611fa66040830186611e00565b8281036020840152611fb9818587611dd7565b9695505050505050565b6001600160401b0387811682528681166020808401919091526001600160a01b03878116604085015260a06060850181905284018690526000928792909160c08601855b8981101561202e57853561201a8161174d565b831682529483019490830190600101612007565b5080955050505080851660808501525050979650505050505050565b60006001600160401b03808b16835260ff8a16602084015280891660408401525060c0606083015261207f60c0830188611e00565b8281036080840152612092818789611dd7565b905082810360a08401526120a7818587611dd7565b9b9a5050505050505050505050565b60ff841681526001600160401b03831660208201526060604082015260006120e16060830184611e00565b95945050505050565b6000602082840312156120fc57600080fd5b81356114df8161174d565b803563ffffffff8116811461174857600080fd5b602081526000823560fe1984360301811261213557600080fd5b6060602084015283016121488180611d92565b61010080608087015261216061018087018385611dd7565b925061216f6020850185611d92565b9250607f19808886030160a0890152612189858584611dd7565b94506121986040870187611d92565b94509150808886030160c08901526121b1858584611dd7565b94506121c06060870187611d92565b94509150808886030160e08901526121d9858584611dd7565b94506121e86080870187611d92565b94509150808886030183890152612200858584611dd7565b945061220f60a0870187611d92565b945092508088860301610120890152612229858585611dd7565b945061223860c0870187611d92565b945092508088860301610140890152612252858585611dd7565b945061226160e0870187611d92565b96509350808886030161016089015250505061227e828483611dd7565b9250505061228e60208501611762565b6001600160a01b0381166040850152506122aa60408501612107565b63ffffffff81166060850152509392505050565b6060815260006122d16060830186611e00565b90506001600160401b038416602083015260ff83166040830152949350505050565b6040815260006123066040830185611e00565b905060ff831660208301529392505050565b6000808335601e1984360301811261232f57600080fd5b83016020810192503590506001600160401b0381111561234e57600080fd5b8060051b36038213156118d657600080fd5b81835260006020808501808196508560051b81019150846000805b888110156123ba578385038a52823560be1989360301811261239b578283fd5b6123a7868a8301611e00565b9a87019a9550509185019160010161237b565b509298975050505050505050565b8183526000602080850194508260005b858110156124065781356123eb8161174d565b6001600160a01b0316875295820195908201906001016123d8565b509495945050505050565b80356002811061242057600080fd5b8252602090810135910152565b602081526001600160401b0361244283611731565b166020820152600061245660208401611762565b6001600160a01b0381166040840152506124736040840184612318565b61012080606086015261248b61014086018385612360565b925061249a6060870187611d92565b9250601f19808786030160808801526124b4858584611dd7565b94506124c36080890189612318565b94509150808786030160a0880152506124dd8484836123c8565b9350506124ec60a08701611731565b6001600160401b03811660c0870152915061250d60e0860160c08801612411565b6101008601358186015250508091505092915050565b60006020828403121561253557600080fd5b6114df82611731565b6001600160401b03841681526080810161255b6020830185612411565b82606083015294935050505056fe0000000000000000000000001111111111111111111111111111111111111111a164736f6c6343000814000a diff --git a/primitives/src/services/mod.rs b/primitives/src/services/mod.rs index 7487ee0c..d572a46a 100644 --- a/primitives/src/services/mod.rs +++ b/primitives/src/services/mod.rs @@ -642,6 +642,43 @@ impl Default for Asset { } } +impl Asset { + pub fn to_ethabi_param_type() -> ethabi::ParamType { + ethabi::ParamType::Tuple(vec![ + // Kind of the Asset + ethabi::ParamType::Uint(8), + // Data of the Asset (Contract Address or AssetId) + ethabi::ParamType::FixedBytes(32), + ]) + } + + pub fn to_ethabi_param() -> ethabi::Param { + ethabi::Param { + name: String::from("asset"), + kind: Self::to_ethabi_param_type(), + internal_type: Some(String::from("struct ServiceOperators.Asset")), + } + } + + pub fn to_ethabi(&self) -> ethabi::Token { + match self { + Asset::Custom(asset_id) => { + let asset_id = asset_id.using_encoded(ethabi::Uint::from_little_endian); + let mut asset_id_bytes = [0u8; core::mem::size_of::()]; + asset_id.to_big_endian(&mut asset_id_bytes); + ethabi::Token::Tuple(vec![ + ethabi::Token::Uint(0.into()), + ethabi::Token::FixedBytes(asset_id_bytes.into()), + ]) + }, + Asset::Erc20(addr) => ethabi::Token::Tuple(vec![ + ethabi::Token::Uint(1.into()), + ethabi::Token::FixedBytes(addr.to_fixed_bytes().into()), + ]), + } + } +} + /// Represents the pricing structure for various hardware resources. /// All prices are specified in USD/hr, calculated based on the average block time. #[derive( @@ -683,7 +720,7 @@ impl PriceTargets { ethabi::Param { name: String::from("priceTargets"), kind: Self::to_ethabi_param_type(), - internal_type: Some(String::from("struct IBlueprintServiceManager.PriceTargets")), + internal_type: Some(String::from("struct ServiceOperators.PriceTargets")), } }