From 76f41d89913ee1d1874bb3c2ae55872c43aa5ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Thu, 9 Oct 2025 14:11:07 +0100 Subject: [PATCH 001/117] Migrate Signatures to alloy (#3759) --- .../src/infra/blockchain/contracts.rs | 17 +++--- crates/contracts/build.rs | 13 ----- crates/contracts/src/alloy.rs | 16 ++++++ crates/contracts/src/lib.rs | 1 - .../driver/src/infra/blockchain/contracts.rs | 17 +++--- crates/driver/src/tests/setup/blockchain.rs | 22 ++++---- crates/driver/src/tests/setup/driver.rs | 2 +- crates/driver/src/tests/setup/solver.rs | 2 +- crates/e2e/src/setup/deploy.rs | 13 +++-- crates/e2e/tests/e2e/cow_amm.rs | 11 ++-- crates/orderbook/src/run.rs | 7 ++- crates/shared/src/signature_validator/mod.rs | 8 +-- .../src/signature_validator/simulation.rs | 56 ++++++++++++------- 13 files changed, 105 insertions(+), 80 deletions(-) diff --git a/crates/autopilot/src/infra/blockchain/contracts.rs b/crates/autopilot/src/infra/blockchain/contracts.rs index 5aa3d43e31..c5bc050a7c 100644 --- a/crates/autopilot/src/infra/blockchain/contracts.rs +++ b/crates/autopilot/src/infra/blockchain/contracts.rs @@ -9,7 +9,7 @@ use { #[derive(Debug, Clone)] pub struct Contracts { settlement: contracts::GPv2Settlement, - signatures: contracts::support::Signatures, + signatures: contracts::alloy::support::Signatures::Instance, weth: contracts::WETH9, balances: contracts::support::Balances, chainalysis_oracle: Option, @@ -47,12 +47,13 @@ impl Contracts { ), ); - let signatures = contracts::support::Signatures::at( - web3, - address_for( - contracts::support::Signatures::raw_contract(), - addresses.signatures, - ), + let signatures = contracts::alloy::support::Signatures::Instance::new( + addresses + .signatures + .map(IntoAlloy::into_alloy) + .or_else(|| contracts::alloy::support::Signatures::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let weth = contracts::WETH9::at( @@ -119,7 +120,7 @@ impl Contracts { &self.balances } - pub fn signatures(&self) -> &contracts::support::Signatures { + pub fn signatures(&self) -> &contracts::alloy::support::Signatures::Instance { &self.signatures } diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index e1d42120ff..1f0c671e6d 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -502,19 +502,6 @@ fn main() { .add_network_str(GNOSIS, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") .add_network_str(SEPOLIA, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") }); - generate_contract_with_config("Signatures", |builder| { - builder - .add_network_str(MAINNET, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(ARBITRUM_ONE, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(BASE, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(AVALANCHE, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(BNB, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(OPTIMISM, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(POLYGON, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(LENS, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(GNOSIS, "0x8262d639c38470F38d2eff15926F7071c28057Af") - .add_network_str(SEPOLIA, "0x8262d639c38470F38d2eff15926F7071c28057Af") - }); // Test Contract for incrementing arbitrary counters. generate_contract("Counter"); diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 37d9901f9b..61e400dfd9 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -540,6 +540,22 @@ pub mod support { crate::bindings!(Trader); // Support contract used for solver fee simulations in the gnosis/solvers repo. crate::bindings!(Swapper); + + crate::bindings!( + Signatures, + crate::deployments! { + MAINNET => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + ARBITRUM_ONE => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + BASE => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + AVALANCHE => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + BNB => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + OPTIMISM => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + POLYGON => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + LENS => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + GNOSIS => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + SEPOLIA => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + } + ); } pub use alloy::providers::DynProvider as Provider; diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 6a1270e32d..6bb0e06c7c 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -71,7 +71,6 @@ include_contracts! { pub mod support { include_contracts! { Balances; - Signatures; } } diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index 608576b830..121b1250a9 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -15,7 +15,7 @@ pub struct Contracts { settlement: contracts::GPv2Settlement, vault_relayer: eth::ContractAddress, vault: contracts::BalancerV2Vault, - signatures: contracts::support::Signatures, + signatures: contracts::alloy::support::Signatures::Instance, weth: contracts::WETH9, /// The domain separator for settlement contract used for signing orders. @@ -73,12 +73,13 @@ impl Contracts { addresses.balances, ), ); - let signatures = contracts::support::Signatures::at( - web3, - address_for( - contracts::support::Signatures::raw_contract(), - addresses.signatures, - ), + let signatures = contracts::alloy::support::Signatures::Instance::new( + addresses + .signatures + .map(|addr| addr.0.into_alloy()) + .or_else(|| contracts::alloy::support::Signatures::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let weth = contracts::WETH9::at( @@ -139,7 +140,7 @@ impl Contracts { &self.settlement } - pub fn signatures(&self) -> &contracts::support::Signatures { + pub fn signatures(&self) -> &contracts::alloy::support::Signatures::Instance { &self.signatures } diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 2041112a47..280c0d54a7 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -8,7 +8,7 @@ use { tests::{self, boundary, cases::EtherExt}, }, alloy::{primitives::U256, signers::local::PrivateKeySigner}, - contracts::alloy::{ERC20Mintable, FlashLoanRouter}, + contracts::alloy::{ERC20Mintable, FlashLoanRouter, support::Signatures}, ethcontract::PrivateKey, ethrpc::{ Web3, @@ -45,7 +45,7 @@ pub struct Blockchain { pub weth: contracts::WETH9, pub settlement: contracts::GPv2Settlement, pub balances: contracts::support::Balances, - pub signatures: contracts::support::Signatures, + pub signatures: Signatures::Instance, pub flashloan_router: FlashLoanRouter::Instance, pub ethflow: Option, pub domain_separator: boundary::DomainSeparator, @@ -351,18 +351,16 @@ impl Blockchain { .await .unwrap(); - let signatures = if let Some(signatures_address) = config.signatures_address { - contracts::support::Signatures::at(&web3, signatures_address) + let signatures_address = if let Some(signatures_address) = config.signatures_address { + signatures_address.into_alloy() } else { - wait_for( - &web3, - contracts::support::Signatures::builder(&web3) - .from(main_trader_account.clone()) - .deploy(), - ) - .await - .unwrap() + Signatures::Instance::deploy_builder(web3.alloy.clone()) + .from(main_trader_account.address().into_alloy()) + .deploy() + .await + .unwrap() }; + let signatures = Signatures::Instance::new(signatures_address, web3.alloy.clone()); let flashloan_router_address = FlashLoanRouter::Instance::deploy_builder( web3.alloy.clone(), diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index ba0f8b807b..94ba6729cc 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -236,7 +236,7 @@ async fn create_config_file( hex_address(blockchain.settlement.address()), hex_address(blockchain.weth.address()), hex_address(blockchain.balances.address()), - hex_address(blockchain.signatures.address()), + blockchain.signatures.address(), hex_address(blockchain.flashloan_router.address().into_legacy()), ) .unwrap(); diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index b72b1b62ca..8a2c8baf22 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -471,7 +471,7 @@ impl Solver { settlement: Some(config.blockchain.settlement.address().into()), weth: Some(config.blockchain.weth.address().into()), balances: Some(config.blockchain.balances.address().into()), - signatures: Some(config.blockchain.signatures.address().into()), + signatures: Some(config.blockchain.signatures.address().into_legacy().into()), cow_amms: vec![], flashloan_router: Some( config diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index 4bece41054..f9d4f2ccb6 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -14,8 +14,9 @@ use { InstanceExt, UniswapV2Factory, UniswapV2Router02, + support::Signatures, }, - support::{Balances, Signatures}, + support::Balances, }, ethcontract::{Address, H256, U256, errors::DeployError}, ethrpc::alloy::conversions::IntoAlloy, @@ -33,7 +34,7 @@ pub struct Contracts { pub chain_id: u64, pub balancer_vault: BalancerV2Vault, pub gp_settlement: GPv2Settlement, - pub signatures: Signatures, + pub signatures: Signatures::Instance, pub gp_authenticator: GPv2AllowListAuthentication, pub balances: Balances, pub uniswap_v2_factory: UniswapV2Factory::Instance, @@ -71,8 +72,8 @@ impl Contracts { .expect("failed to find balances contract"), }; let signatures = match deployed.signatures { - Some(address) => Signatures::at(web3, address), - None => Signatures::deployed(web3) + Some(address) => Signatures::Instance::new(address.into_alloy(), web3.alloy.clone()), + None => Signatures::Instance::deployed(&web3.alloy) .await .expect("failed to find signatures contract"), }; @@ -169,7 +170,9 @@ impl Contracts { GPv2Settlement(gp_authenticator.address(), balancer_vault.address(),) ); let balances = deploy!(web3, Balances()); - let signatures = deploy!(web3, Signatures()); + let signatures = Signatures::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); contracts::vault::grant_required_roles( &balancer_authorizer, diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index be00292282..d9e4309e0e 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -1,9 +1,6 @@ use { app_data::AppDataHash, - contracts::{ - ERC20, - support::{Balances, Signatures}, - }, + contracts::{ERC20, alloy::support::Signatures, support::Balances}, driver::domain::eth::NonZeroU256, e2e::{ deploy, @@ -426,10 +423,12 @@ async fn cow_amm_driver_support(web3: Web3) { // syncing, we deploy the following SCs let deployed_contracts = { let balances = deploy!(&web3, Balances()); - let signatures = deploy!(&web3, Signatures()); + let signatures = Signatures::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); DeployedContracts { balances: Some(balances.address()), - signatures: Some(signatures.address()), + signatures: Some(signatures.address().into_legacy()), } }; let mut onchain = OnchainComponents::deployed_with(web3.clone(), deployed_contracts).await; diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index baee7f39f8..2af7bfaf8c 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -116,8 +116,11 @@ pub async fn run(args: Arguments) { .await .expect("Couldn't get vault relayer address"); let signatures_contract = match args.shared.signatures_contract_address { - Some(address) => contracts::support::Signatures::with_deployment_info(&web3, address, None), - None => contracts::support::Signatures::deployed(&web3) + Some(address) => contracts::alloy::support::Signatures::Instance::new( + address.into_alloy(), + web3.alloy.clone(), + ), + None => contracts::alloy::support::Signatures::Instance::deploy(web3.alloy.clone()) .await .expect("load signatures contract"), }; diff --git a/crates/shared/src/signature_validator/mod.rs b/crates/shared/src/signature_validator/mod.rs index 83f07d0009..120d94d232 100644 --- a/crates/shared/src/signature_validator/mod.rs +++ b/crates/shared/src/signature_validator/mod.rs @@ -4,7 +4,7 @@ use { BalanceOverriding, }, alloy::primitives::FixedBytes, - ethrpc::Web3, + ethrpc::{Web3, alloy::conversions::IntoAlloy}, hex_literal::hex, model::interaction::InteractionData, primitive_types::H160, @@ -98,7 +98,7 @@ pub fn check_erc1271_result(result: FixedBytes<4>) -> Result<(), SignatureValida /// Contracts required for signature verification simulation. pub struct Contracts { pub settlement: contracts::GPv2Settlement, - pub signatures: contracts::support::Signatures, + pub signatures: contracts::alloy::support::Signatures::Instance, pub vault_relayer: H160, } @@ -111,8 +111,8 @@ pub fn validator( Arc::new(simulation::Validator::new( web3, contracts.settlement, - contracts.signatures, - contracts.vault_relayer, + *contracts.signatures.address(), + contracts.vault_relayer.into_alloy(), balance_overrider, )) } diff --git a/crates/shared/src/signature_validator/simulation.rs b/crates/shared/src/signature_validator/simulation.rs index 8ffc897d54..afe1d4ee66 100644 --- a/crates/shared/src/signature_validator/simulation.rs +++ b/crates/shared/src/signature_validator/simulation.rs @@ -6,20 +6,31 @@ use { super::{SignatureCheck, SignatureValidating, SignatureValidationError}, crate::price_estimation::trade_verifier::balance_overrides::BalanceOverriding, - alloy::{dyn_abi::SolType, sol_types::sol_data}, + alloy::{ + dyn_abi::SolType, + primitives::Address, + sol_types::{SolCall, sol_data}, + }, anyhow::{Context, Result}, - contracts::{ERC1271SignatureValidator, errors::EthcontractErrorType}, + contracts::{ + ERC1271SignatureValidator, + alloy::support::Signatures, + errors::EthcontractErrorType, + }, ethcontract::{Bytes, state_overrides::StateOverrides}, - ethrpc::{Web3, alloy::conversions::IntoLegacy}, - primitive_types::{H160, U256}, + ethrpc::{ + Web3, + alloy::conversions::{IntoAlloy, IntoLegacy}, + }, + primitive_types::U256, std::sync::Arc, tracing::instrument, }; pub struct Validator { - signatures: contracts::support::Signatures, + signatures_address: Address, settlement: contracts::GPv2Settlement, - vault_relayer: H160, + vault_relayer: Address, web3: Web3, balance_overrider: Arc, } @@ -31,13 +42,13 @@ impl Validator { pub fn new( web3: &Web3, settlement: contracts::GPv2Settlement, - signatures: contracts::support::Signatures, - vault_relayer: H160, + signatures_address: Address, + vault_relayer: Address, balance_overrider: Arc, ) -> Self { let web3 = ethrpc::instrumented::instrument_with_label(web3, "signatureValidation".into()); Self { - signatures, + signatures_address, settlement, vault_relayer, web3: web3.clone(), @@ -94,22 +105,29 @@ impl Validator { // 1. How the pre-interactions would behave as part of the settlement // 2. Simulate the actual `isValidSignature` calls that would happen as part of // a settlement - let validate_call = self.signatures.methods().validate( - (self.settlement.address(), self.vault_relayer), - check.signer, - Bytes(check.hash), - Bytes(check.signature.clone()), - check + let validate_call = Signatures::Signatures::validateCall { + contracts: Signatures::Signatures::Contracts { + settlement: self.settlement.address().into_alloy(), + vaultRelayer: self.vault_relayer, + }, + signer: check.signer.into_alloy(), + order: check.hash.into(), + signature: check.signature.clone().into(), + interactions: check .interactions .iter() - .map(|i| (i.target, i.value, Bytes(i.call_data.clone()))) + .map(|i| Signatures::Signatures::Interaction { + target: i.target.into_alloy(), + value: i.value.into_alloy(), + callData: i.call_data.clone().into(), + }) .collect(), - ); + }; let simulation = self .settlement .simulate_delegatecall( - self.signatures.address(), - Bytes(validate_call.tx.data.unwrap_or_default().0), + self.signatures_address.into_legacy(), + Bytes(validate_call.abi_encode()), ) .from(crate::SIMULATION_ACCOUNT.clone()); From c1fc97041b8015ba1ca6d6ebfbe37057e18ae570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Thu, 9 Oct 2025 14:51:29 +0100 Subject: [PATCH 002/117] Fix typo `deploy` -> `deployed` (#3760) --- crates/orderbook/src/run.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 2af7bfaf8c..42dc1f2f23 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -120,7 +120,7 @@ pub async fn run(args: Arguments) { address.into_alloy(), web3.alloy.clone(), ), - None => contracts::alloy::support::Signatures::Instance::deploy(web3.alloy.clone()) + None => contracts::alloy::support::Signatures::Instance::deployed(&web3.alloy) .await .expect("load signatures contract"), }; From e7877c4e7091d6220a2bbb0bf993717924c590aa Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Thu, 9 Oct 2025 17:58:41 +0200 Subject: [PATCH 003/117] More precise metrics for measuring auction overhead (#3754) # Description Plotting the entire (or at least vast majority) of time lost just running the auction (i.e. everything besides actually computing solutions) is extremely important for guiding our optimization efforts. We already have some metrics for that but since those are histograms we have a few issues: 1. the granularity of histograms depends on the buckets we define. The necessary granularity can vary a lot depending on the task so reusing the same metric for multiple sources of overhead either means we have to introduce a TON of buckets or multiple histograms (one for each source of overhead). 2. AFAIK histograms can't be merged into 1 nice plot that visualizes all the overhead at once. Instead you basically have to look at each histogram individually and mentally piece everything together. # Changes This PR addresses both issues by measuring the overhead using 2 counters. One for measuring the total time spent in each phase and one for counting how many measurements we did. Using gauges for this would have been a bit easier but gauges have the issue that they only plot the exact value stored at the time when prometheus scrapes the metrics. Since the runtime of the individual sources of overhead can vary quite a bit from run to run there is a chance that gauges misrepresent the metrics. With the 2 counter approach we can at least always compute averages for all sources of overhead which should hopefully give us better data. As we continue to reduce this overhead it might make sense to break down some of these phases a bit more but I think this is a good starting point. Note that a lot of plotted phases look insignificant in my screenshot but only because the data comes from the playground which basically does nothing. From my previous efforts to optimize performance I know that many of these phases take a surprising amount of time. ## How to test I used https://github.com/cowprotocol/services/pull/3752 to build the new dashboard I want to build in the playground to verify that things work as I intend. As you can see that dashboard makes it a lot easier to get a sense of ALL the auction overhead at once and how much each phase contributes to the total overhead. Screenshot 2025-10-09 at 06 32 57 --- Cargo.lock | 1 + crates/autopilot/src/infra/persistence/mod.rs | 2 + .../autopilot/src/infra/solvers/dto/solve.rs | 2 + crates/autopilot/src/maintenance.rs | 8 ++-- crates/autopilot/src/solvable_orders.rs | 7 ++- crates/driver/src/domain/competition/mod.rs | 4 ++ .../src/domain/competition/pre_processing.rs | 12 +++++ crates/driver/src/infra/solver/mod.rs | 25 ++++++---- crates/observe/Cargo.toml | 1 + crates/observe/src/metrics.rs | 47 ++++++++++++++++++- 10 files changed, 95 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e94ef83497..e98982df8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4536,6 +4536,7 @@ dependencies = [ "pin-project-lite", "prometheus", "prometheus-metric-storage", + "scopeguard", "serde", "serde_json", "time", diff --git a/crates/autopilot/src/infra/persistence/mod.rs b/crates/autopilot/src/infra/persistence/mod.rs index c4b49561df..24c00e7731 100644 --- a/crates/autopilot/src/infra/persistence/mod.rs +++ b/crates/autopilot/src/infra/persistence/mod.rs @@ -72,6 +72,8 @@ impl Persistence { &self, auction: &domain::RawAuctionData, ) -> Result { + let _timer = observe::metrics::metrics() + .on_auction_overhead_start("autopilot", "replace_auction_in_db"); let auction = dto::auction::from_domain(auction.clone()); self.postgres .replace_current_auction(&auction) diff --git a/crates/autopilot/src/infra/solvers/dto/solve.rs b/crates/autopilot/src/infra/solvers/dto/solve.rs index 48242f9cd0..06e0fb549d 100644 --- a/crates/autopilot/src/infra/solvers/dto/solve.rs +++ b/crates/autopilot/src/infra/solvers/dto/solve.rs @@ -36,6 +36,8 @@ impl Request { trusted_tokens: &HashSet, time_limit: Duration, ) -> Self { + let _timer = + observe::metrics::metrics().on_auction_overhead_start("autopilot", "serialize_request"); let helper = RequestHelper { id: auction.id, orders: auction diff --git a/crates/autopilot/src/maintenance.rs b/crates/autopilot/src/maintenance.rs index 02391073d7..6249151358 100644 --- a/crates/autopilot/src/maintenance.rs +++ b/crates/autopilot/src/maintenance.rs @@ -20,7 +20,7 @@ use { core::{AtomicU64, GenericGauge}, }, shared::{event_handling::AlloyEventRetriever, maintenance::Maintaining}, - std::{future::Future, sync::Arc}, + std::{future::Future, sync::Arc, time::Instant}, tokio::sync::Mutex, }; @@ -64,7 +64,7 @@ impl Maintenance { return; } - let start = std::time::Instant::now(); + let start = Instant::now(); if let Err(err) = self.update_inner().await { tracing::warn!(?err, block = new_block.number, "failed to run maintenance"); metrics().updates.with_label_values(&["error"]).inc(); @@ -82,7 +82,8 @@ impl Maintenance { } async fn update_inner(&self) -> Result<()> { - // All these can run independently of each other. + let _timer = + observe::metrics::metrics().on_auction_overhead_start("autopilot", "maintenance_total"); tokio::try_join!( Self::timed_future( "settlement_indexer", @@ -118,6 +119,7 @@ impl Maintenance { .maintenance_stage_time .with_label_values(&[label]) .start_timer(); + let _timer2 = observe::metrics::metrics().on_auction_overhead_start("autopilot", label); fut.await } diff --git a/crates/autopilot/src/solvable_orders.rs b/crates/autopilot/src/solvable_orders.rs index 676e2f575d..2011cfe509 100644 --- a/crates/autopilot/src/solvable_orders.rs +++ b/crates/autopilot/src/solvable_orders.rs @@ -33,10 +33,10 @@ use { collections::{BTreeMap, HashMap, HashSet, btree_map::Entry}, future::Future, sync::Arc, - time::Duration, + time::{Duration, Instant}, }, strum::VariantNames, - tokio::{sync::Mutex, time::Instant}, + tokio::sync::Mutex, }; #[derive(prometheus_metric_storage::MetricStorage)] @@ -166,6 +166,9 @@ impl SolvableOrdersCache { pub async fn update(&self, block: u64, store_events: bool) -> Result<()> { let start = Instant::now(); + let _timer = observe::metrics::metrics() + .on_auction_overhead_start("autopilot", "update_solvabe_orders"); + let db_solvable_orders = self.get_solvable_orders().await?; tracing::trace!("fetched solvable orders from db"); diff --git a/crates/driver/src/domain/competition/mod.rs b/crates/driver/src/domain/competition/mod.rs index f7b9aae424..1c5fe1968d 100644 --- a/crates/driver/src/domain/competition/mod.rs +++ b/crates/driver/src/domain/competition/mod.rs @@ -115,6 +115,8 @@ impl Competition { /// Solve an auction as part of this competition. pub async fn solve(&self, auction: Arc) -> Result, Error> { let start = Instant::now(); + let timer = ::observe::metrics::metrics() + .on_auction_overhead_start("driver", "pre_processing_total"); let tasks = self .fetcher @@ -179,6 +181,7 @@ impl Competition { .auction_preprocessing .with_label_values(&["total"]) .observe(elapsed.as_secs_f64()); + drop(timer); tracing::debug!(?elapsed, "auction task execution time"); let auction = &auction; @@ -520,6 +523,7 @@ impl Competition { { task::spawn_blocking(move || { let _timer = metrics::get().processing_stage_timer(stage); + let _timer2 = ::observe::metrics::metrics().on_auction_overhead_start("driver", stage); f() }) .await diff --git a/crates/driver/src/domain/competition/pre_processing.rs b/crates/driver/src/domain/competition/pre_processing.rs index 983d36b576..edd56cd12b 100644 --- a/crates/driver/src/domain/competition/pre_processing.rs +++ b/crates/driver/src/domain/competition/pre_processing.rs @@ -206,6 +206,8 @@ impl Utilities { async fn parse_request(&self, solve_request: Arc) -> Result> { let auction_dto: SolveRequest = { let _timer = metrics::get().processing_stage_timer("parse_dto"); + let _timer2 = + observe::metrics::metrics().on_auction_overhead_start("driver", "parse_dto"); // deserialization takes tens of milliseconds so run it on a blocking task tokio::task::spawn_blocking(move || { serde_json::from_str(&solve_request).context("could not parse solve request") @@ -219,6 +221,8 @@ impl Utilities { let auction_domain = { let _timer = metrics::get().processing_stage_timer("convert_to_domain"); + let _timer2 = observe::metrics::metrics() + .on_auction_overhead_start("driver", "convert_to_domain"); let app_data = self .app_data_retriever .as_ref() @@ -237,6 +241,8 @@ impl Utilities { /// Fetches the tradable balance for every order owner. async fn fetch_balances(self: Arc, auction: Arc) -> Arc { let _timer = metrics::get().processing_stage_timer("fetch_balances"); + let _timer2 = + observe::metrics::metrics().on_auction_overhead_start("driver", "fetch_balances"); // Collect trader/token/source/interaction tuples for fetching available // balances. Note that we are pessimistic here, if a trader is selling @@ -330,6 +336,8 @@ impl Utilities { }; let _timer = metrics::get().processing_stage_timer("fetch_app_data"); + let _timer2 = + observe::metrics::metrics().on_auction_overhead_start("driver", "fetch_app_data"); let app_data = join_all( auction @@ -367,6 +375,8 @@ impl Utilities { async fn cow_amm_orders(self: Arc, auction: Arc) -> Arc> { let _timer = metrics::get().processing_stage_timer("cow_amm_orders"); + let _timer2 = + observe::metrics::metrics().on_auction_overhead_start("driver", "cow_amm_orders"); let cow_amms = self.eth.contracts().cow_amm_registry().amms().await; let domain_separator = self.eth.contracts().settlement_domain_separator(); let domain_separator = model::DomainSeparator(domain_separator.0); @@ -487,6 +497,8 @@ impl Utilities { auction: Arc, ) -> Arc> { let _timer = metrics::get().processing_stage_timer("fetch_liquidity"); + let _timer2 = + observe::metrics::metrics().on_auction_overhead_start("driver", "fetch_liquidity"); let pairs = auction.liquidity_pairs(); Arc::new( self.liquidity_fetcher diff --git a/crates/driver/src/infra/solver/mod.rs b/crates/driver/src/infra/solver/mod.rs index f3eb555fa4..e97c4dc22d 100644 --- a/crates/driver/src/infra/solver/mod.rs +++ b/crates/driver/src/infra/solver/mod.rs @@ -25,7 +25,10 @@ use { num::BigRational, observe::tracing::tracing_headers, reqwest::header::HeaderName, - std::{collections::HashMap, time::Duration}, + std::{ + collections::HashMap, + time::{Duration, Instant}, + }, tap::TapFallible, thiserror::Error, tracing::{Instrument, instrument}, @@ -233,8 +236,9 @@ impl Solver { auction: &Auction, liquidity: &[liquidity::Liquidity], ) -> Result, Error> { + let start = Instant::now(); + let flashloan_hints = self.assemble_flashloan_hints(auction); - // Fetch the solutions from the solver. let weth = self.eth.contracts().weth_address(); let auction_dto = dto::auction::new( auction, @@ -246,12 +250,6 @@ impl Solver { auction.deadline(self.timeouts()).solvers(), ); - if let Some(id) = auction.id() { - // Only auctions with IDs are real auctions (/quote requests don't have an ID, - // and it makes no sense to store them) - self.persistence.archive_auction(id, &auction_dto); - } - let body = { // pre-allocate a big enough buffer to avoid re-allocating memory // as the request gets serialized @@ -261,6 +259,17 @@ impl Solver { String::from_utf8(buffer).expect("serde_json only writes valid utf8") }; + if let Some(id) = auction.id() { + // Only auctions with IDs are real auctions (/quote requests don't have an ID). + // Only for those it makes sense to archive them and measure the execution time. + self.persistence.archive_auction(id, &auction_dto); + ::observe::metrics::metrics().measure_auction_overhead( + start, + "driver", + "serialize_request", + ); + } + let url = shared::url::join(&self.config.endpoint, "solve"); super::observe::solver_request(&url, &body); let timeout = match auction.deadline(self.timeouts()).solvers().remaining() { diff --git a/crates/observe/Cargo.toml b/crates/observe/Cargo.toml index 3c619402fd..0448d9ec3e 100644 --- a/crates/observe/Cargo.toml +++ b/crates/observe/Cargo.toml @@ -18,6 +18,7 @@ opentelemetry_sdk = { workspace = true } pin-project-lite = { workspace = true } prometheus = { workspace = true } prometheus-metric-storage = { workspace = true } +scopeguard = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } time = { workspace = true, features = ["macros"] } diff --git a/crates/observe/src/metrics.rs b/crates/observe/src/metrics.rs index 6b290df8d5..fa56930dac 100644 --- a/crates/observe/src/metrics.rs +++ b/crates/observe/src/metrics.rs @@ -1,5 +1,8 @@ use { - prometheus::Encoder, + prometheus::{ + Encoder, + core::{AtomicF64, AtomicU64, GenericCounterVec}, + }, std::{ collections::HashMap, convert::Infallible, @@ -9,6 +12,7 @@ use { OnceLock, atomic::{AtomicBool, Ordering}, }, + time::Instant, }, tokio::task::{self, JoinHandle}, warp::{Filter, Rejection, Reply}, @@ -136,3 +140,44 @@ fn handle_readiness( } }) } + +/// Metrics shared by potentially all processes. +#[derive(prometheus_metric_storage::MetricStorage)] +pub struct Metrics { + /// All the time losses we incur while arbitrating the auctions + #[metric(labels("component", "phase"))] + pub auction_overhead_time: GenericCounterVec, + + /// How many measurements we did for each source of overhead. + #[metric(labels("component", "phase"))] + pub auction_overhead_count: GenericCounterVec, +} + +impl Metrics { + /// Returns a struct that measures the overhead when it gets dropped. + #[must_use] + pub fn on_auction_overhead_start<'a, 'b, 'c>( + &'a self, + component: &'b str, + phase: &'c str, + ) -> impl Drop + use<'a, 'b, 'c> { + let start = std::time::Instant::now(); + scopeguard::guard(start, move |start| { + self.measure_auction_overhead(start, component, phase); + }) + } + + pub fn measure_auction_overhead(&self, start: Instant, component: &str, phase: &str) { + self.auction_overhead_time + .with_label_values(&[component, phase]) + .inc_by(start.elapsed().as_secs_f64()); + + self.auction_overhead_count + .with_label_values(&[component, phase]) + .inc() + } +} + +pub fn metrics() -> &'static Metrics { + Metrics::instance(get_storage_registry()).unwrap() +} From 618333403ea5611f93b837e7e9618c5d0e27c492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Fri, 10 Oct 2025 09:38:30 +0100 Subject: [PATCH 004/117] Migrate GasHog to alloy (#3761) --- crates/contracts/build.rs | 3 -- crates/contracts/src/alloy.rs | 5 +++ crates/contracts/src/lib.rs | 1 - crates/e2e/tests/e2e/smart_contract_orders.rs | 31 +++++++++++-------- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 1f0c671e6d..04fd550394 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -506,9 +506,6 @@ fn main() { // Test Contract for incrementing arbitrary counters. generate_contract("Counter"); - // Test Contract for using up a specified amount of gas. - generate_contract("GasHog"); - // Contract for Uniswap's Permit2 contract. generate_contract_with_config("Permit2", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 61e400dfd9..8840294524 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -558,6 +558,11 @@ pub mod support { ); } +pub mod test { + // Test Contract for using up a specified amount of gas. + crate::bindings!(GasHog); +} + pub use alloy::providers::DynProvider as Provider; /// Extension trait to attach some useful functions to the contract instance. diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 6bb0e06c7c..e3b35ae6f5 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -77,7 +77,6 @@ pub mod support { pub mod test { include_contracts! { Counter; - GasHog; } } diff --git a/crates/e2e/tests/e2e/smart_contract_orders.rs b/crates/e2e/tests/e2e/smart_contract_orders.rs index bbaddcf2d1..f803fd8e7d 100644 --- a/crates/e2e/tests/e2e/smart_contract_orders.rs +++ b/crates/e2e/tests/e2e/smart_contract_orders.rs @@ -1,10 +1,10 @@ use { - e2e::{ - setup::{eth, safe::Safe, *}, - tx, - }, + e2e::setup::{eth, safe::Safe, *}, ethcontract::{Bytes, H160, U256}, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::{ order::{OrderCreation, OrderCreationAppData, OrderKind, OrderStatus, OrderUid}, signature::Signature, @@ -156,8 +156,7 @@ async fn erc1271_gas_limit(web3: Web3) { let mut onchain = OnchainComponents::deploy(web3.clone()).await; let [solver] = onchain.make_solvers(to_wei(1)).await; - let trader = contracts::test::GasHog::builder(&web3) - .deploy() + let trader = contracts::alloy::test::GasHog::Instance::deploy(web3.alloy.clone()) .await .unwrap(); @@ -166,11 +165,17 @@ async fn erc1271_gas_limit(web3: Web3) { .await; // Fund trader accounts and approve relayer - cow.fund(trader.address(), to_wei(5)).await; - tx!( - solver.account(), - trader.approve(cow.address(), onchain.contracts().allowance, to_wei(10)) - ); + cow.fund(trader.address().into_legacy(), to_wei(5)).await; + trader + .approve( + cow.address().into_alloy(), + onchain.contracts().allowance.into_alloy(), + eth(10), + ) + .from(solver.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let services = Services::new(&onchain).await; services @@ -195,7 +200,7 @@ async fn erc1271_gas_limit(web3: Web3) { valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, signature: Signature::Eip1271(signature.to_vec()), - from: Some(trader.address()), + from: Some(trader.address().into_legacy()), ..Default::default() }; From 01ff7ab3ad0ea594a7a5b77af7f2458ba167a5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Fri, 10 Oct 2025 11:13:53 +0100 Subject: [PATCH 005/117] Migrate Counter into alloy (#3762) # Description Migrate Counter into alloy # Changes - [ ] Remove old bindings - [ ] Add new bindings - [ ] Adapt tests ## How to test Tests --------- Co-authored-by: ilya --- crates/contracts/build.rs | 3 --- crates/contracts/src/alloy.rs | 2 ++ crates/contracts/src/lib.rs | 6 ------ crates/e2e/tests/e2e/hooks.rs | 35 +++++++++++++++++++++-------------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 04fd550394..5415d4ad0b 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -503,9 +503,6 @@ fn main() { .add_network_str(SEPOLIA, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") }); - // Test Contract for incrementing arbitrary counters. - generate_contract("Counter"); - // Contract for Uniswap's Permit2 contract. generate_contract_with_config("Permit2", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 8840294524..df828af759 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -561,6 +561,8 @@ pub mod support { pub mod test { // Test Contract for using up a specified amount of gas. crate::bindings!(GasHog); + // Test Contract for incrementing arbitrary counters. + crate::bindings!(Counter); } pub use alloy::providers::DynProvider as Provider; diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index e3b35ae6f5..9b3fdf1dcf 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -74,12 +74,6 @@ pub mod support { } } -pub mod test { - include_contracts! { - Counter; - } -} - #[cfg(test)] mod tests { use crate::alloy::networks::{ diff --git a/crates/e2e/tests/e2e/hooks.rs b/crates/e2e/tests/e2e/hooks.rs index e9190261e2..17edd3d405 100644 --- a/crates/e2e/tests/e2e/hooks.rs +++ b/crates/e2e/tests/e2e/hooks.rs @@ -428,8 +428,7 @@ async fn partial_fills(web3: Web3) { let [solver] = onchain.make_solvers(to_wei(1)).await; let [trader] = onchain.make_accounts(to_wei(3)).await; - let counter = contracts::test::Counter::builder(&web3) - .deploy() + let counter = contracts::alloy::test::Counter::Instance::deploy(web3.alloy.clone()) .await .unwrap(); @@ -454,6 +453,20 @@ async fn partial_fills(web3: Web3) { let services = Services::new(&onchain).await; services.start_protocol(solver).await; + let pre_inc = counter.incrementCounter("pre".to_string()); + let pre_hook = Hook { + target: counter.address().into_legacy(), + call_data: pre_inc.calldata().to_vec(), + gas_limit: pre_inc.estimate_gas().await.unwrap(), + }; + + let post_inc = counter.incrementCounter("post".to_string()); + let post_hook = Hook { + target: counter.address().into_legacy(), + call_data: post_inc.calldata().to_vec(), + gas_limit: post_inc.estimate_gas().await.unwrap(), + }; + tracing::info!("Placing order"); let order = OrderCreation { sell_token: onchain.contracts().weth.address(), @@ -467,8 +480,8 @@ async fn partial_fills(web3: Web3) { full: json!({ "metadata": { "hooks": { - "pre": [hook_for_transaction(counter.increment_counter("pre".to_string()).tx).await], - "post": [hook_for_transaction(counter.increment_counter("post".to_string()).tx).await], + "pre": [pre_hook], + "post": [post_hook], }, }, }) @@ -496,13 +509,10 @@ async fn partial_fills(web3: Web3) { == 0.into() }; wait_for_condition(TIMEOUT, trade_happened).await.unwrap(); - assert_eq!( - counter.counters("pre".to_string()).call().await.unwrap(), - 1.into() - ); + assert_eq!(counter.counters("pre".to_string()).call().await.unwrap(), 1); assert_eq!( counter.counters("post".to_string()).call().await.unwrap(), - 1.into() + 1 ); tracing::info!("Fund remaining sell balance."); @@ -514,13 +524,10 @@ async fn partial_fills(web3: Web3) { tracing::info!("Waiting for second trade."); wait_for_condition(TIMEOUT, trade_happened).await.unwrap(); - assert_eq!( - counter.counters("pre".to_string()).call().await.unwrap(), - 1.into() - ); + assert_eq!(counter.counters("pre".to_string()).call().await.unwrap(), 1); assert_eq!( counter.counters("post".to_string()).call().await.unwrap(), - 2.into() + 2 ); } From 6624d381a90cae813b96d34a5bab4fdf55be8043 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 10 Oct 2025 13:48:54 +0300 Subject: [PATCH 006/117] Update DB reminder readme (#3765) Updates the DB reminder message, since currently 2 auctions are running in parallel on each deployment, and this should be taken into account when committing DB-breaking changes. --- .github/nitpicks.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/nitpicks.yml b/.github/nitpicks.yml index 7b12de0eee..46ebe3b064 100644 --- a/.github/nitpicks.yml +++ b/.github/nitpicks.yml @@ -1,7 +1,8 @@ - markdown: | Reminder: Please update the DB Readme and comment whether migrations are reversible (include rollback scripts if applicable). - If creating new tables, update the [tables list](https://github.com/cowprotocol/services/blob/main/crates/database/src/lib.rs#L51-L87). - When adding a new index, consider using `CREATE INDEX CONCURRENTLY` for tables involved in the critical execution path. + * If creating new tables, update the [tables list](https://github.com/cowprotocol/services/blob/main/crates/database/src/lib.rs#L51-L87). + * When adding a new index, consider using `CREATE INDEX CONCURRENTLY` for tables involved in the critical execution path. + * For breaking changes, remember that during rollout k8s starts the new autopilot, runs the Flyway migration, and only then shuts down the old pod. That overlap means the previous version can still be processing requests on the migrated schema, so make it compatible first and ship the breaking DB change in the following release. pathFilter: - "database/sql/**" From 41f7dfacab44bdb8b2e5f32d0bfee8690ae98538 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 10 Oct 2025 14:06:21 +0300 Subject: [PATCH 007/117] Adjust hooks counter test (#3767) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description As it [was suggested](https://github.com/cowprotocol/services/pull/3762#pullrequestreview-3320393408) in the previous PR: > Fine to merge as is but I just realized that this test is actually just verifying that both hooks get executed but not that they get executed but not WHEN they get executed. > In order to verify that we could adjust the Counter to set the count to the user's sell token balance at the time of executing the hook. Then we'd assert that the pre counter has the value of the user's sell token balance before the settlement starts and post has the value of afterwards. Since the value the count is set to depends on data that changes throughout the settlement we'd know when the hook was actually executed. # Changes - Update the test Counter helper so hooks can overwrite a counter with a live ERC20 balance snapshot. - Adjust the Counter ABI JSON to add the new function while leaving the original structure intact. To better understand the change, use this diff: https://github.com/cowprotocol/services/pull/3767/commits/9cf8761c8bcc59d5c762ff750d3b5070dfb34c38 - Rework the partial-fills hook e2e test to assert pre/post hook execution timing by checking WETH balances recorded by the new helper. --------- Co-authored-by: José Duarte --- crates/contracts/artifacts/Counter.json | 68 +++++++++++++++- crates/contracts/solidity/tests/Counter.sol | 13 +++ crates/e2e/tests/e2e/hooks.rs | 89 +++++++++++++++------ 3 files changed, 143 insertions(+), 27 deletions(-) diff --git a/crates/contracts/artifacts/Counter.json b/crates/contracts/artifacts/Counter.json index 6f8fb980ae..2ed98a28f8 100644 --- a/crates/contracts/artifacts/Counter.json +++ b/crates/contracts/artifacts/Counter.json @@ -1 +1,67 @@ -{"abi":[{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"counters","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"key","type":"string"}],"name":"incrementCounter","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b5061023e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806357cedf401461003b5780639424c8c814610078575b600080fd5b6100666100493660046100f3565b805160208183018101805160008252928201919093012091525481565b60405190815260200160405180910390f35b61008b6100863660046100f3565b61008d565b005b600160008260405161009f91906101c2565b908152602001604051809103902060008282546100bc91906101f1565b909155505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561010557600080fd5b813567ffffffffffffffff8082111561011d57600080fd5b818401915084601f83011261013157600080fd5b813581811115610143576101436100c4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610189576101896100c4565b816040528281528760208487010111156101a257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000825160005b818110156101e357602081860181015185830152016101c9565b506000920191825250919050565b8082018082111561022b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000811000a","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100365760003560e01c806357cedf401461003b5780639424c8c814610078575b600080fd5b6100666100493660046100f3565b805160208183018101805160008252928201919093012091525481565b60405190815260200160405180910390f35b61008b6100863660046100f3565b61008d565b005b600160008260405161009f91906101c2565b908152602001604051809103902060008282546100bc91906101f1565b909155505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561010557600080fd5b813567ffffffffffffffff8082111561011d57600080fd5b818401915084601f83011261013157600080fd5b813581811115610143576101436100c4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610189576101896100c4565b816040528281528760208487010111156101a257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000825160005b818110156101e357602081860181015185830152016101c9565b506000920191825250919050565b8082018082111561022b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000811000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "name": "counters", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "incrementCounter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "key", + "type": "string" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "setCounterToBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6080604052348015600e575f5ffd5b506105b28061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80630931831e1461004357806357cedf401461005f5780639424c8c81461008f575b5f5ffd5b61005d60048036038101906100589190610353565b6100ab565b005b610079600480360381019061007491906103bf565b610149565b604051610086919061041e565b60405180910390f35b6100a960048036038101906100a491906103bf565b610175565b005b8173ffffffffffffffffffffffffffffffffffffffff166370a08231826040518263ffffffff1660e01b81526004016100e49190610446565b602060405180830381865afa1580156100ff573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101239190610489565b5f846040516101329190610506565b908152602001604051809103902081905550505050565b5f818051602081018201805184825260208301602085012081835280955050505050505f915090505481565b60015f826040516101869190610506565b90815260200160405180910390205f8282546101a29190610549565b9250508190555050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61020b826101c5565b810181811067ffffffffffffffff8211171561022a576102296101d5565b5b80604052505050565b5f61023c6101ac565b90506102488282610202565b919050565b5f67ffffffffffffffff821115610267576102666101d5565b5b610270826101c5565b9050602081019050919050565b828183375f83830152505050565b5f61029d6102988461024d565b610233565b9050828152602081018484840111156102b9576102b86101c1565b5b6102c484828561027d565b509392505050565b5f82601f8301126102e0576102df6101bd565b5b81356102f084826020860161028b565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610322826102f9565b9050919050565b61033281610318565b811461033c575f5ffd5b50565b5f8135905061034d81610329565b92915050565b5f5f5f6060848603121561036a576103696101b5565b5b5f84013567ffffffffffffffff811115610387576103866101b9565b5b610393868287016102cc565b93505060206103a48682870161033f565b92505060406103b58682870161033f565b9150509250925092565b5f602082840312156103d4576103d36101b5565b5b5f82013567ffffffffffffffff8111156103f1576103f06101b9565b5b6103fd848285016102cc565b91505092915050565b5f819050919050565b61041881610406565b82525050565b5f6020820190506104315f83018461040f565b92915050565b61044081610318565b82525050565b5f6020820190506104595f830184610437565b92915050565b61046881610406565b8114610472575f5ffd5b50565b5f815190506104838161045f565b92915050565b5f6020828403121561049e5761049d6101b5565b5b5f6104ab84828501610475565b91505092915050565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f6104e0826104b4565b6104ea81856104be565b93506104fa8185602086016104c8565b80840191505092915050565b5f61051182846104d6565b915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61055382610406565b915061055e83610406565b92508282019050808211156105765761057561051c565b5b9291505056fea2646970667358221220b3c7d0a5e5f5cd95f33dc4460b7fa401be388a78b39fe8050b0c00217bad3a8264736f6c634300081e0033", + "deployedBytecode": "0x608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80630931831e1461004357806357cedf401461005f5780639424c8c81461008f575b5f5ffd5b61005d60048036038101906100589190610353565b6100ab565b005b610079600480360381019061007491906103bf565b610149565b604051610086919061041e565b60405180910390f35b6100a960048036038101906100a491906103bf565b610175565b005b8173ffffffffffffffffffffffffffffffffffffffff166370a08231826040518263ffffffff1660e01b81526004016100e49190610446565b602060405180830381865afa1580156100ff573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101239190610489565b5f846040516101329190610506565b908152602001604051809103902081905550505050565b5f818051602081018201805184825260208301602085012081835280955050505050505f915090505481565b60015f826040516101869190610506565b90815260200160405180910390205f8282546101a29190610549565b9250508190555050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61020b826101c5565b810181811067ffffffffffffffff8211171561022a576102296101d5565b5b80604052505050565b5f61023c6101ac565b90506102488282610202565b919050565b5f67ffffffffffffffff821115610267576102666101d5565b5b610270826101c5565b9050602081019050919050565b828183375f83830152505050565b5f61029d6102988461024d565b610233565b9050828152602081018484840111156102b9576102b86101c1565b5b6102c484828561027d565b509392505050565b5f82601f8301126102e0576102df6101bd565b5b81356102f084826020860161028b565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610322826102f9565b9050919050565b61033281610318565b811461033c575f5ffd5b50565b5f8135905061034d81610329565b92915050565b5f5f5f6060848603121561036a576103696101b5565b5b5f84013567ffffffffffffffff811115610387576103866101b9565b5b610393868287016102cc565b93505060206103a48682870161033f565b92505060406103b58682870161033f565b9150509250925092565b5f602082840312156103d4576103d36101b5565b5b5f82013567ffffffffffffffff8111156103f1576103f06101b9565b5b6103fd848285016102cc565b91505092915050565b5f819050919050565b61041881610406565b82525050565b5f6020820190506104315f83018461040f565b92915050565b61044081610318565b82525050565b5f6020820190506104595f830184610437565b92915050565b61046881610406565b8114610472575f5ffd5b50565b5f815190506104838161045f565b92915050565b5f6020828403121561049e5761049d6101b5565b5b5f6104ab84828501610475565b91505092915050565b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f6104e0826104b4565b6104ea81856104be565b93506104fa8185602086016104c8565b80840191505092915050565b5f61051182846104d6565b915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61055382610406565b915061055e83610406565b92508282019050808211156105765761057561051c565b5b9291505056fea2646970667358221220b3c7d0a5e5f5cd95f33dc4460b7fa401be388a78b39fe8050b0c00217bad3a8264736f6c634300081e0033", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/solidity/tests/Counter.sol b/crates/contracts/solidity/tests/Counter.sol index 2ec3fb54df..8d20031ec7 100644 --- a/crates/contracts/solidity/tests/Counter.sol +++ b/crates/contracts/solidity/tests/Counter.sol @@ -1,6 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.17; +/// Minimal ERC20 interface for balance checks. +interface IERC20 { + function balanceOf(address owner) external view returns (uint256); +} + /// @title Helper contract to count how many times a function is called contract Counter { mapping(string => uint256) public counters; @@ -8,4 +13,12 @@ contract Counter { function incrementCounter(string memory key) public { counters[key] += 1; } + + function setCounterToBalance( + string memory key, + address token, + address owner + ) public { + counters[key] = IERC20(token).balanceOf(owner); + } } diff --git a/crates/e2e/tests/e2e/hooks.rs b/crates/e2e/tests/e2e/hooks.rs index 17edd3d405..bee45ccdfb 100644 --- a/crates/e2e/tests/e2e/hooks.rs +++ b/crates/e2e/tests/e2e/hooks.rs @@ -436,31 +436,39 @@ async fn partial_fills(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; + let sell_token = onchain.contracts().weth.clone(); tx!( trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(2)) - ); - tx_value!( - trader.account(), - to_wei(1), - onchain.contracts().weth.deposit() + sell_token.approve(onchain.contracts().allowance, to_wei(2)) ); + tx_value!(trader.account(), to_wei(1), sell_token.deposit()); + + let balance_before_first_trade = sell_token + .balance_of(trader.address()) + .call() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; services.start_protocol(solver).await; - let pre_inc = counter.incrementCounter("pre".to_string()); + let pre_inc = counter.setCounterToBalance( + "pre".to_string(), + sell_token.address().into_alloy(), + trader.address().into_alloy(), + ); let pre_hook = Hook { target: counter.address().into_legacy(), call_data: pre_inc.calldata().to_vec(), gas_limit: pre_inc.estimate_gas().await.unwrap(), }; - let post_inc = counter.incrementCounter("post".to_string()); + let post_inc = counter.setCounterToBalance( + "post".to_string(), + sell_token.address().into_alloy(), + trader.address().into_alloy(), + ); let post_hook = Hook { target: counter.address().into_legacy(), call_data: post_inc.calldata().to_vec(), @@ -469,7 +477,7 @@ async fn partial_fills(web3: Web3) { tracing::info!("Placing order"); let order = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: sell_token.address(), sell_amount: to_wei(2), buy_token: token.address().into_legacy(), buy_amount: to_wei(1), @@ -499,9 +507,7 @@ async fn partial_fills(web3: Web3) { tracing::info!("Waiting for first trade."); let trade_happened = || async { - onchain - .contracts() - .weth + sell_token .balance_of(trader.address()) .call() .await @@ -509,25 +515,56 @@ async fn partial_fills(web3: Web3) { == 0.into() }; wait_for_condition(TIMEOUT, trade_happened).await.unwrap(); - assert_eq!(counter.counters("pre".to_string()).call().await.unwrap(), 1); assert_eq!( - counter.counters("post".to_string()).call().await.unwrap(), - 1 + counter + .counters("pre".to_string()) + .call() + .await + .unwrap() + .into_legacy(), + balance_before_first_trade + ); + let post_balance_after_first_trade = sell_token + .balance_of(trader.address()) + .call() + .await + .unwrap(); + assert_eq!( + counter + .counters("post".to_string()) + .call() + .await + .unwrap() + .into_legacy(), + post_balance_after_first_trade ); tracing::info!("Fund remaining sell balance."); - tx_value!( - trader.account(), - to_wei(1), - onchain.contracts().weth.deposit() - ); + tx_value!(trader.account(), to_wei(1), sell_token.deposit()); tracing::info!("Waiting for second trade."); wait_for_condition(TIMEOUT, trade_happened).await.unwrap(); - assert_eq!(counter.counters("pre".to_string()).call().await.unwrap(), 1); assert_eq!( - counter.counters("post".to_string()).call().await.unwrap(), - 2 + counter + .counters("pre".to_string()) + .call() + .await + .unwrap() + .into_legacy(), + balance_before_first_trade + ); + assert_eq!( + counter + .counters("post".to_string()) + .call() + .await + .unwrap() + .into_legacy(), + sell_token + .balance_of(trader.address()) + .call() + .await + .unwrap() ); } From d01e8e080755f2977bac7850742dc105f0436bfd Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Fri, 10 Oct 2025 13:28:01 +0200 Subject: [PATCH 008/117] Enable `tokio-console` in playground (#3768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description `tokio-console` can be nice to see what's going on in the tokio runtime. This PR makes it so that all services pods will be spawned with tokio console enabled. It also fixes a few other playground issues # Changes For Tokio Console - adjusts `Dockerfile` to add `--cfg tokio_unstable` to `.cargo/config.toml` which builds the services with `tokio-console` support - adds necessary tokio console env variables to docker compose files - `TOKIO_CONSOLE=true` to activate the feature in our processes - `TOKIO_CONSOLE_RETENTION=600s` to limit the memory used for all the metrics - `TOKIO_CONSOLE_BIND=0.0.0.0:6669` to open port listening on all devices (the default of `127.0.0.1` can not be reached from outside docker) - adds the necessary port forwards (while avoiding conflicts) - moved the log about the tokio configuration message until after the subscriber gets initialized - otherwise it doesn't actually get logged 😅 - added `tokio-console` instructions in the readme Other stuff - convert `as` to `AS` to avoid docker complaining about inconsistent capitalization - removed caching from `yarn` build step of frontend and explorer because having multiple builds use the same yarn cache regularly caused errors in my builds. Since we usually don't rebuild the frontends not having the cache here doesn't slow anything down AFAICS ## How to test 1. Install [tokio-console](https://github.com/tokio-rs/console) 2. start playground 3. run `tokio-console` (this connects to the default port which I assigned to the orderbook). Other pods can be accessed with `tokio-console http://localhost:` The port mappings are as follows: orderbook: 6669 autopilot: 6670 driver: 6671 baseline: 6672 Screenshot 2025-10-10 at 10 06 11 --- crates/observe/src/tracing.rs | 4 +-- playground/Dockerfile | 9 ++++++- playground/Dockerfile.cowswap | 4 +-- playground/Dockerfile.explorer | 4 +-- playground/README.md | 26 ++++++++++--------- playground/docker-compose.fork.yml | 16 ++++++++++++ playground/docker-compose.non-interactive.yml | 16 ++++++++++++ 7 files changed, 60 insertions(+), 19 deletions(-) diff --git a/crates/observe/src/tracing.rs b/crates/observe/src/tracing.rs index e8c207b223..eb9ae0f316 100644 --- a/crates/observe/src/tracing.rs +++ b/crates/observe/src/tracing.rs @@ -162,11 +162,11 @@ fn set_tracing_subscriber(config: &Config) { .with(tracing_layer); if cfg!(tokio_unstable) && enable_tokio_console { - tracing::info!("started program with support for tokio-console"); subscriber.with(console_subscriber::spawn()).init(); + tracing::info!("started program with support for tokio-console"); } else { - tracing::info!("started program without support for tokio-console"); subscriber.init(); + tracing::info!("started program without support for tokio-console"); } if cfg!(unix) { spawn_reload_handler(initial_filter, reload_handle); diff --git a/playground/Dockerfile b/playground/Dockerfile index f3a904433d..fd05b0fef6 100644 --- a/playground/Dockerfile +++ b/playground/Dockerfile @@ -8,9 +8,9 @@ RUN rustup component add clippy rustfmt RUN echo "\ [build]\n \ target = \"$(rustc -Vv | grep host | awk '{print $2}')\"\n \ +rustflags = [\"-C\", \"link-arg=-fuse-ld=/usr/bin/mold\", \"--cfg\", \"tokio_unstable\"]\n \ [target.$(rustc -Vv | grep host | awk '{print $2}')]\n \ linker = \"clang\"\n \ -rustflags = [\"-C\", \"link-arg=-fuse-ld=/usr/bin/mold\"]\n \ " > ~/.cargo/config.toml RUN cargo install cargo-chef @@ -30,9 +30,11 @@ CMD ["migrate"] FROM chef AS builder COPY --from=planner /src/recipe.json recipe.json +COPY --from=chef /.cargo /.cargo RUN CARGO_PROFILE_RELEASE_DEBUG=1 cargo chef cook --release --recipe-path recipe.json # Copy only the library crates for now +COPY --from=chef /.cargo /.cargo COPY Cargo.toml Cargo.lock ./ COPY ./crates/app-data/ ./crates/app-data COPY ./crates/database/ ./crates/database @@ -57,6 +59,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked apt-get update && \ apt-get clean FROM builder AS alerter-build +COPY --from=chef /.cargo /.cargo COPY ./crates/alerter/ ./crates/alerter RUN CARGO_PROFILE_RELEASE_DEBUG=1 cargo build --release --package alerter @@ -68,6 +71,7 @@ FROM builder AS autopilot-build RUN CARGO_PROFILE_RELEASE_DEBUG=1 cargo build --release --package autopilot FROM base AS autopilot +COPY --from=chef /.cargo /.cargo COPY ./crates/autopilot/ ./crates/autopilot COPY --from=autopilot-build /src/target/release/autopilot /usr/local/bin/autopilot ENTRYPOINT [ "autopilot" ] @@ -81,6 +85,7 @@ COPY --from=driver-build /src/target/release/driver /usr/local/bin/driver ENTRYPOINT [ "driver" ] FROM builder AS orderbook-build +COPY --from=chef /.cargo /.cargo COPY ./crates/orderbook/ ./crates/orderbook RUN CARGO_PROFILE_RELEASE_DEBUG=1 cargo build --release --package orderbook @@ -89,6 +94,7 @@ COPY --from=orderbook-build /src/target/release/orderbook /usr/local/bin/orderbo ENTRYPOINT [ "orderbook" ] FROM builder AS refunder-build +COPY --from=chef /.cargo /.cargo COPY ./crates/refunder/ ./crates/refunder RUN CARGO_PROFILE_RELEASE_DEBUG=1 cargo build --release --package refunder @@ -97,6 +103,7 @@ COPY --from=refunder-build /src/target/release/refunder /usr/local/bin/refunder ENTRYPOINT [ "refunder" ] FROM builder AS solvers-build +COPY --from=chef /.cargo /.cargo COPY ./crates/solvers/ ./crates/solvers RUN CARGO_PROFILE_RELEASE_DEBUG=1 cargo build --release --package solvers diff --git a/playground/Dockerfile.cowswap b/playground/Dockerfile.cowswap index ab1a3d3b9f..7ba495ced9 100644 --- a/playground/Dockerfile.cowswap +++ b/playground/Dockerfile.cowswap @@ -19,7 +19,7 @@ RUN git clone https://github.com/cowprotocol/cowswap . && \ git submodule update --init --recursive # Install npm dependencies -RUN --mount=type=cache,target=/home/node/.yarn YARN_CACHE_FOLDER=/home/node/.yarn yarn install --frozen-lockfile +RUN yarn install --frozen-lockfile --no-cache # Set the environment variable "chain" ARG CHAIN @@ -58,7 +58,7 @@ RUN if [ -n "$ETH_RPC_URL" ]; then \ fi # Stage 2: Copy the frontend to the nginx container -FROM docker.io/nginx:1.21-alpine as frontend +FROM docker.io/nginx:1.21-alpine AS frontend COPY --from=node-build /usr/src/app/build/cowswap /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/playground/Dockerfile.explorer b/playground/Dockerfile.explorer index ba83ccfd6d..34a2929007 100644 --- a/playground/Dockerfile.explorer +++ b/playground/Dockerfile.explorer @@ -1,5 +1,5 @@ # Stage 1: Build the frontend -FROM docker.io/node:22-bookworm-slim as node-build +FROM docker.io/node:22-bookworm-slim AS node-build WORKDIR /usr/src/app # Install dependencies @@ -11,7 +11,7 @@ RUN git clone https://github.com/cowprotocol/cowswap . && \ git submodule update --init --recursive # Install npm dependencies -RUN --mount=type=cache,target=/home/node/.yarn YARN_CACHE_FOLDER=/home/node/.yarn yarn install --frozen-lockfile +RUN yarn install --frozen-lockfile --no-cache ENV REACT_APP_ORDER_BOOK_URLS='{"1":"http://localhost:8080"}' diff --git a/playground/README.md b/playground/README.md index b2c690808a..44af35a9ae 100644 --- a/playground/README.md +++ b/playground/README.md @@ -103,21 +103,23 @@ await window.ethereum.request({ ## Components -| **Component** | **Container name** | **Host port** | **Container port** | **Stack** | -|---------------|--------------------|---------------|--------------------|------------| -| Autopilot | autopilot | N/A | N/A | Common | -| Driver | driver | N/A | 80 | Common | -| Baseline | baseline | N/A | 80 | Common | -| CoW Swap | cowswap | 8000 | 80 | Local/Fork | -| CoW Explorer | cowexplorer | 8001 | 80 | Local/Fork | -| Orderbook | orderbook | 8080 | 80 | Local/Fork | -| RPC | chain | 8545 | 8545 | Local/Fork | -| Postgres | postgres | 5432 | 5432 | Local/Fork | -| Adminer | adminer | 8082 | 8080 | Local/Fork | -| Grafana | grafana | 3000 | 3000 | Local/Fork | +| **Component** | **Container name** | **Host port** | **Container port** | **Tokio Console Port** | **Stack** | +|---------------|--------------------|---------------|--------------------|------------------------|------------| +| Autopilot | autopilot | N/A | N/A | 6670 | Local/Fork | +| Driver | driver | N/A | 80 | 6671 | Local/Fork | +| Baseline | baseline | N/A | 80 | 6672 | Local/Fork | +| CoW Swap | cowswap | 8000 | 80 | N/A | Local/Fork | +| CoW Explorer | cowexplorer | 8001 | 80 | N/A | Local/Fork | +| Orderbook | orderbook | 8080 | 80 | 6669 | Local/Fork | +| RPC | chain | 8545 | 8545 | N/A | Local/Fork | +| Postgres | postgres | 5432 | 5432 | N/A | Local/Fork | +| Adminer | adminer | 8082 | 8080 | N/A | Local/Fork | +| Grafana | grafana | 3000 | 3000 | N/A | Local/Fork | **NOTE**: Currently only **FORK** mode is supported. +Some services support to be inspected with [tokio-console](https://github.com/tokio-rs/console). For that simply install `tokio-console` and run `tokio-console http://localhost:`. The relevant port numbers can be found in the table above. + ## Modes ### Shadow diff --git a/playground/docker-compose.fork.yml b/playground/docker-compose.fork.yml index f3890fb728..e564106bea 100644 --- a/playground/docker-compose.fork.yml +++ b/playground/docker-compose.fork.yml @@ -88,6 +88,9 @@ services: - RUST_BACKTRACE=1 - TOML_TRACE_ERROR=1 - TRACING_COLLECTOR_ENDPOINT=http://tempo:4317 + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ../:/src depends_on: @@ -95,6 +98,7 @@ services: ports: - 8080:80 # API - 9586:9586 # metrics + - 6669:6669 # tokio console autopilot: build: @@ -126,6 +130,9 @@ services: - TOML_TRACE_ERROR=1 - ETHFLOW_CONTRACTS - ETHFLOW_INDEXING_START + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ../:/src depends_on: @@ -135,6 +142,7 @@ services: condition: service_healthy ports: - 9589:9589 # metrics + - 6670:6669 # tokio console driver: build: @@ -155,10 +163,14 @@ services: - RUST_BACKTRACE=1 - TOML_TRACE_ERROR=1 - TRACING_COLLECTOR_ENDPOINT=http://tempo:4317 + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ../:/src ports: - 9000:80 # API & metrics + - 6671:6669 # tokio console depends_on: chain: condition: service_healthy @@ -182,10 +194,14 @@ services: - LOG=solvers=trace,shared=trace - RUST_BACKTRACE=1 - TOML_TRACE_ERROR=1 + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ../:/src ports: - 9001:80 # API & metrics + - 6672:6669 # tokio console frontend: build: diff --git a/playground/docker-compose.non-interactive.yml b/playground/docker-compose.non-interactive.yml index 6866066962..ccc1833cd2 100644 --- a/playground/docker-compose.non-interactive.yml +++ b/playground/docker-compose.non-interactive.yml @@ -90,6 +90,9 @@ services: - RUST_BACKTRACE=1 - TOML_TRACE_ERROR=1 - TRACING_COLLECTOR_ENDPOINT=http://tempo:4317 + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ../:/src depends_on: @@ -97,6 +100,7 @@ services: ports: - 8080:80 # API - 9586:9586 # metrics + - 6669:6669 # tokio console autopilot: build: @@ -127,6 +131,9 @@ services: - TOML_TRACE_ERROR=1 - ETHFLOW_CONTRACTS - ETHFLOW_INDEXING_START + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ../:/src depends_on: @@ -136,6 +143,7 @@ services: condition: service_healthy ports: - 9589:9589 # metrics + - 6670:6669 # tokio console driver: build: @@ -150,10 +158,14 @@ services: - RUST_BACKTRACE=1 - TOML_TRACE_ERROR=1 - TRACING_COLLECTOR_ENDPOINT=http://tempo:4317 + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ./driver.toml:/driver.toml ports: - 9000:80 # API & metrics + - 6671:6669 # tokio console depends_on: chain: condition: service_healthy @@ -171,10 +183,14 @@ services: - LOG=solvers=trace,shared=trace - RUST_BACKTRACE=1 - TOML_TRACE_ERROR=1 + - TOKIO_CONSOLE=true + - TOKIO_CONSOLE_RETENTION=600sec + - TOKIO_CONSOLE_BIND=0.0.0.0:6669 volumes: - ./baseline.toml:/baseline.toml ports: - 9001:80 # API & metrics + - 6672:6669 # tokio console frontend: build: From 03a8458e917ec5281b634d123765ae471f09865b Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 10 Oct 2025 18:07:05 +0300 Subject: [PATCH 009/117] [TRIVIAL] Upgrade alloy to v1.0.38 (#3769) # Description Updates alloy to v1.0.38, which contains quite a lot updates: https://github.com/alloy-rs/alloy/compare/v1.0.36...v1.0.38 --- Cargo.lock | 80 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e98982df8e..51fcfc1803 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,9 +91,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67031be093311a96afdd146fb5de209ceaf0f347f2284ed71902368cd15a77ff" +checksum = "b17c19591d57add4f0c47922877a48aae1f47074e3433436545f8948353b3bbb" dependencies = [ "alloy-consensus", "alloy-contract", @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd9d29a6a0bb8d4832ff7685dcbb430011b832f2ccec1af9571a0e75c1f7e9c" +checksum = "6a0dd3ed764953a6b20458b2b7abbfdc93d20d14b38babe1a70fe631a443a9f1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -152,9 +152,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce038cb325f9a85a10fb026fb1b70cb8c62a004d85d22f8516e5d173e3eec612" +checksum = "9556182afa73cddffa91e64a5aa9508d5e8c912b3a15f26998d2388a824d2c7b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -166,9 +166,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a376305e5c3b3285e84a553fa3f9aee4f5f0e1b0aad4944191b843cd8228788d" +checksum = "b19d7092c96defc3d132ee0d8969ca1b79ef512b5eda5c66e3065266b253adf2" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -252,9 +252,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bfec530782b30151e2564edf3c900f1fa6852128b7a993e458e8e3815d8b915" +checksum = "305fa99b538ca7006b0c03cfed24ec6d82beda67aac857ef4714be24231d15e6" dependencies = [ "alloy-eip2124", "alloy-eip2930", @@ -286,9 +286,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be436893c0d1f7a57d1d8f1b6b9af9db04174468410b7e6e1d1893e78110a3bc" +checksum = "d91676d242c0ced99c0dd6d0096d7337babe9457cc43407d26aa6367fcf90553" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -301,9 +301,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f18959e1a1b40e05578e7a705f65ff4e6b354e38335da4b33ccbee876bde7c26" +checksum = "77f82150116b30ba92f588b87f08fa97a46a1bd5ffc0d0597efdf0843d36bfda" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -327,9 +327,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da0037ac546c0cae2eb776bed53687b7bbf776f4e7aa2fea0b8b89e734c319b" +checksum = "223612259a080160ce839a4e5df0125ca403a1d5e7206cc911cea54af5d769aa" dependencies = [ "alloy-consensus", "alloy-eips", @@ -367,9 +367,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca97e31bc05bd6d4780254fbb60b16d33b3548d1c657a879fffb0e7ebb642e9" +checksum = "f7283b81b6f136100b152e699171bc7ed8184a58802accbc91a7df4ebb944445" dependencies = [ "alloy-chains", "alloy-consensus", @@ -428,9 +428,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbeeeffa0bb7e95cb79f2b4b46b591763afeccfa9a797183c1b192377ffb6fac" +checksum = "1154b12d470bef59951c62676e106f4ce5de73b987d86b9faa935acebb138ded" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -451,9 +451,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21fe4c370b9e733d884ffd953eb6d654d053b1b22e26ffd591ef597a9e2bc49" +checksum = "47ab76bf97648a1c6ad8fb00f0d594618942b5a9e008afbfb5c8a8fca800d574" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -463,9 +463,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65423baf6af0ff356e254d7824b3824aa34d8ca9bd857a4e298f74795cc4b69d" +checksum = "23cc57ee0c1ac9fb14854195fc249494da7416591dc4a4d981ddfd5dd93b9bce" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -474,9 +474,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848f8ea4063bed834443081d77f840f31075f68d0d49723027f5a209615150bf" +checksum = "6d7d47bca1a2a1541e4404aa38b7e262bb4dffd9ac23b4f178729a4ddc5a5caa" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3835bdc128f2f3418f5d6c76aec63a245d72973e0eaacc9720aa0787225c5" +checksum = "6a8468f1a7f9ee3bae73c24eead0239abea720dbf7779384b9c7e20d51bfb6b0" dependencies = [ "alloy-primitives", "serde", @@ -506,9 +506,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42084a7b455ef0b94ed201b7494392a759c3e20faac2d00ded5d5762fcf71dee" +checksum = "33387c90b0a5021f45a5a77c2ce6c49b8f6980e66a318181468fb24cea771670" dependencies = [ "alloy-primitives", "async-trait", @@ -521,9 +521,9 @@ dependencies = [ [[package]] name = "alloy-signer-aws" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d190ee456bba27fc4c3bf7aa65001dd3c71cd431591f98ca3b07960d530d2336" +checksum = "83bf90f2355769ad93f790b930434b8d3d2948317f3e484de458010409024462" dependencies = [ "alloy-consensus", "alloy-network", @@ -540,9 +540,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6312ccc048a4a88aed7311fc448a2e23da55c60c2b3b6dcdb794f759d02e49d7" +checksum = "b55d9e795c85e36dcea08786d2e7ae9b73cb554b6bea6ac4c212def24e1b4d03" dependencies = [ "alloy-consensus", "alloy-network", @@ -632,9 +632,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f77fa71f6dad3aa9b97ab6f6e90f257089fb9eaa959892d153a1011618e2d6" +checksum = "702002659778d89a94cd4ff2044f6b505460df6c162e2f47d1857573845b0ace" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -656,9 +656,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1a5d0f5dd5e07187a4170bdcb7ceaff18b1133cd6b8585bc316ab442cd78a" +checksum = "0d6bdc0830e5e8f08a4c70a4c791d400a86679c694a3b4b986caf26fad680438" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -687,9 +687,9 @@ dependencies = [ [[package]] name = "alloy-tx-macros" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc79013f9ac3a8ddeb60234d43da09e6d6abfc1c9dd29d3fe97adfbece3f4a08" +checksum = "7bf39928a5e70c9755d6811a2928131b53ba785ad37c8bf85c90175b5d43b818" dependencies = [ "alloy-primitives", "darling 0.21.3", diff --git a/Cargo.toml b/Cargo.toml index 2758492d6f..e48d2bdd6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/*"] [workspace.dependencies] -alloy = { version = "1.0.36", default-features = false } +alloy = { version = "1.0.38", default-features = false } anyhow = "=1.0.76" async-trait = "0.1.80" axum = "0.6" From a532c612ca93e95f8abb896bf257b5ff7c455071 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 10 Oct 2025 18:19:39 +0300 Subject: [PATCH 010/117] Migrate from `auction_participans` to `proposed_solutions` table (#3766) # Description The `auction_participans` table has become obsolete, since the same data is now stored in the `proposed_solutions`. This PR migrates usage to the latter table. The migration script will be a part of #3753, since this is a breaking change, which requires gradual deployment to avoid panics when running 2 auctions in parallel. --- crates/autopilot/src/database/competition.rs | 16 ----- crates/database/src/auction_participants.rs | 72 -------------------- crates/database/src/auction_prices.rs | 3 + crates/database/src/lib.rs | 2 - crates/database/src/solver_competition_v2.rs | 26 +++++++ crates/e2e/tests/e2e/database.rs | 9 +-- database/README.md | 12 ---- 7 files changed, 34 insertions(+), 106 deletions(-) delete mode 100644 crates/database/src/auction_participants.rs diff --git a/crates/autopilot/src/database/competition.rs b/crates/autopilot/src/database/competition.rs index f80295bf94..84e19ebb6e 100644 --- a/crates/autopilot/src/database/competition.rs +++ b/crates/autopilot/src/database/competition.rs @@ -4,7 +4,6 @@ use { database::{ Address, auction::AuctionId, - auction_participants::Participant, auction_prices::AuctionPrice, byte_array::ByteArray, surplus_capturing_jit_order_owners, @@ -61,21 +60,6 @@ impl super::Postgres { .await .context("reference_scores::insert")?; - database::auction_participants::insert( - &mut ex, - competition - .participants - .into_iter() - .map(|p| Participant { - auction_id: competition.auction_id, - participant: ByteArray(p.0), - }) - .collect::>() - .as_slice(), - ) - .await - .context("auction_participants::insert")?; - database::auction_prices::insert( &mut ex, competition diff --git a/crates/database/src/auction_participants.rs b/crates/database/src/auction_participants.rs deleted file mode 100644 index 794b1c9fc0..0000000000 --- a/crates/database/src/auction_participants.rs +++ /dev/null @@ -1,72 +0,0 @@ -use { - crate::{Address, PgTransaction, auction::AuctionId}, - sqlx::{PgConnection, QueryBuilder}, - std::ops::DerefMut, - tracing::instrument, -}; - -/// Participant of a solver competition for a given auction. -#[derive(Debug, Clone, PartialEq, sqlx::FromRow)] -pub struct Participant { - pub auction_id: AuctionId, - pub participant: Address, -} - -#[instrument(skip_all)] -pub async fn insert( - ex: &mut PgTransaction<'_>, - participants: &[Participant], -) -> Result<(), sqlx::Error> { - const BATCH_SIZE: usize = 5000; - const QUERY: &str = "INSERT INTO auction_participants (auction_id, participant) "; - - for chunk in participants.chunks(BATCH_SIZE) { - let mut query_builder = QueryBuilder::new(QUERY); - - query_builder.push_values(chunk, |mut builder, participant| { - builder - .push_bind(participant.auction_id) - .push_bind(participant.participant); - }); - - query_builder.build().execute(ex.deref_mut()).await?; - } - - Ok(()) -} - -#[instrument(skip_all)] -pub async fn fetch( - ex: &mut PgConnection, - auction_id: AuctionId, -) -> Result, sqlx::Error> { - const QUERY: &str = r#"SELECT * FROM auction_participants WHERE auction_id = $1"#; - sqlx::query_as(QUERY).bind(auction_id).fetch_all(ex).await -} - -#[cfg(test)] -mod tests { - use {super::*, crate::byte_array::ByteArray, sqlx::Connection}; - - #[tokio::test] - #[ignore] - async fn postgres_roundtrip() { - let mut db = PgConnection::connect("postgresql://").await.unwrap(); - let mut db = db.begin().await.unwrap(); - crate::clear_DANGER_(&mut db).await.unwrap(); - - let input = vec![ - Participant { - auction_id: 1, - participant: ByteArray([2; 20]), - }, - Participant { - auction_id: 1, - participant: ByteArray([3; 20]), - }, - ]; - insert(&mut db, &input).await.unwrap(); - let output = fetch(&mut db, 1).await.unwrap(); - assert_eq!(input, output); - } -} diff --git a/crates/database/src/auction_prices.rs b/crates/database/src/auction_prices.rs index 5395c4e630..1db843d7e8 100644 --- a/crates/database/src/auction_prices.rs +++ b/crates/database/src/auction_prices.rs @@ -1,3 +1,6 @@ +//! This table is deprecated, since it contains duplicated data in the +//! `competition_auctions` table. But it can't currently be removed, since the +//! solver team is still using it. use { crate::{Address, PgTransaction, auction::AuctionId}, bigdecimal::BigDecimal, diff --git a/crates/database/src/lib.rs b/crates/database/src/lib.rs index 3ba25b9661..a84314abd6 100644 --- a/crates/database/src/lib.rs +++ b/crates/database/src/lib.rs @@ -1,6 +1,5 @@ pub mod app_data; pub mod auction; -pub mod auction_participants; pub mod auction_prices; pub mod byte_array; pub mod ethflow_orders; @@ -75,7 +74,6 @@ pub const TABLES: &[&str] = &[ /// The names of potentially big volume tables we use in the db. pub const LARGE_TABLES: &[&str] = &[ "auction_prices", - "auction_participants", "competition_auctions", "fee_policies", "orders", diff --git a/crates/database/src/solver_competition_v2.rs b/crates/database/src/solver_competition_v2.rs index a399d10a26..34be8500a4 100644 --- a/crates/database/src/solver_competition_v2.rs +++ b/crates/database/src/solver_competition_v2.rs @@ -188,6 +188,26 @@ pub async fn load_by_id( })) } +/// Participant of a solver competition for a given auction. +#[derive(Debug, Clone, PartialEq, sqlx::FromRow)] +pub struct AuctionParticipant { + pub auction_id: AuctionId, + pub participant: Address, +} + +pub async fn fetch_auction_participants( + ex: &mut PgConnection, + auction_id: AuctionId, +) -> Result, sqlx::Error> { + const QUERY: &str = r#" + SELECT DISTINCT ps.solver AS participant, ps.auction_id + FROM proposed_solutions ps + WHERE ps.auction_id = $1 + "#; + + sqlx::query_as(QUERY).bind(auction_id).fetch_all(ex).await +} + /// Identifies solvers that have consistently failed to settle solutions in /// recent N auctions. /// @@ -1213,5 +1233,11 @@ mod tests { assert_eq!(solver_competition.reference_scores.len(), 1); assert_eq!(solver_competition.solutions.len(), 1); assert_eq!(solver_competition.solutions.first().unwrap().uid, 0); + + let auction_participants = fetch_auction_participants(&mut db, auction_id) + .await + .unwrap(); + assert_eq!(auction_participants.len(), 1); + assert_eq!(auction_participants[0].participant, solutions[0].solver); } } diff --git a/crates/e2e/tests/e2e/database.rs b/crates/e2e/tests/e2e/database.rs index 0c3876fa5c..9d39d3c888 100644 --- a/crates/e2e/tests/e2e/database.rs +++ b/crates/e2e/tests/e2e/database.rs @@ -45,7 +45,7 @@ pub struct AuctionTransaction { #[derive(Clone, Debug)] pub struct Cip20Data { pub txs: Vec, - pub participants: Vec, + pub participants: Vec, pub prices: Vec, pub reference_scores: Vec, pub competition: serde_json::Value, @@ -72,9 +72,10 @@ SELECT * FROM settlements WHERE auction_id = $1"; .await .ok()?; - let participants = database::auction_participants::fetch(&mut db, auction_id) - .await - .unwrap(); + let participants = + database::solver_competition_v2::fetch_auction_participants(&mut db, auction_id) + .await + .unwrap(); let prices = database::auction_prices::fetch(&mut db, auction_id) .await .unwrap(); diff --git a/database/README.md b/database/README.md index fac41e39a2..445f5306dd 100644 --- a/database/README.md +++ b/database/README.md @@ -23,18 +23,6 @@ Column | Type | Nullable | Details Indexes: - "app\_data\_pkey" PRIMARY KEY, btree (`contract_app_data`) -### auction\_participants - -This table is used for [CIP-20](https://snapshot.org/#/cow.eth/proposal/0x2d3f9bd1ea72dca84b03e97dda3efc1f4a42a772c54bd2037e8b62e7d09a491f). It stores which solvers (identified by ethereum address) participated in which auctions (identified by auction id). CIP-20 specifies that "solver teams which consistently provide solutions" get rewarded. - - Column | Type | Nullable | Details ---------------|--------|----------|-------- - auction\_id | bigint | not null | id of the auction - participant | bytea | not null | solver that submitted a **valid** solution for the auction - -Indexes: -- PRIMARY KEY: btree(`auction_id`, `participant`) - ### auction\_prices Stores the native price of a token in a given auction. Used for computations related to CIP-20. From 0e234884e6dc1b8f4581fc80a2fa651089276162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 14 Oct 2025 11:05:25 +0100 Subject: [PATCH 011/117] Remove batching delay (#3774) --- crates/ethrpc/src/alloy/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ethrpc/src/alloy/mod.rs b/crates/ethrpc/src/alloy/mod.rs index d1a9654698..1dc3dcf5f2 100644 --- a/crates/ethrpc/src/alloy/mod.rs +++ b/crates/ethrpc/src/alloy/mod.rs @@ -5,7 +5,7 @@ mod instrumentation; mod wallet; use { - crate::AlloyProvider, + crate::{AlloyProvider, Config}, alloy::{ network::EthereumWallet, providers::{Provider, ProviderBuilder}, @@ -13,6 +13,7 @@ use { }, buffering::BatchCallLayer, instrumentation::{InstrumentationLayer, LabelingLayer}, + std::time::Duration, }; pub use {conversions::Account, instrumentation::ProviderLabelingExt, wallet::MutWallet}; @@ -24,7 +25,10 @@ fn rpc(url: &str) -> RpcClient { label: "main".into(), }) .layer(InstrumentationLayer) - .layer(BatchCallLayer::new(Default::default())) + .layer(BatchCallLayer::new(Config { + ethrpc_batch_delay: Duration::ZERO, + ..Default::default() + })) .http(url.parse().unwrap()) } From 55f1ce53314e5ad02577cdd9149390066d367c91 Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 15 Oct 2025 16:18:12 +0300 Subject: [PATCH 012/117] Fix refunder wallet (#3779) # Description After the CoWSwapEthFlow SC was migrated to alloy, we've started receiving the following errors: ``` 2025-10-14T16:46:08.171Z WARN refunder: Error while refunding ethflow orders: local usage error: Missing signing credential for 0x0214aE5fD178986fA18ff792e0b995Dc6a78cD56 Caused by: Missing signing credential for 0x0214aE5fD178986fA18ff792e0b995Dc6a78cD56 ``` That basically means that our refunder doesn't work. The reason for that is that the refunder's private key wasn't set properly in the alloy provider. This PR fixes it. ## How to test Probably not easy. --- crates/refunder/src/submitter.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/refunder/src/submitter.rs b/crates/refunder/src/submitter.rs index ebd05fdd00..d0ae1d9adf 100644 --- a/crates/refunder/src/submitter.rs +++ b/crates/refunder/src/submitter.rs @@ -14,7 +14,10 @@ use { contracts::alloy::CoWSwapEthFlow::{self, EthFlowOrder}, database::OrderUid, ethcontract::{Account, U256}, - ethrpc::alloy::conversions::IntoAlloy, + ethrpc::alloy::{ + ProviderSignerExt, + conversions::{IntoAlloy, TryIntoAlloyAsync}, + }, gas_estimation::{GasPrice1559, GasPriceEstimating}, shared::ethrpc::Web3, std::time::Duration, @@ -79,8 +82,11 @@ impl Submitter { self.gas_parameters_of_last_tx = Some(gas_price); self.nonce_of_last_submission = Some(nonce); - let ethflow_contract = - CoWSwapEthFlow::Instance::new(ethflow_contract, self.web3.alloy.clone()); + let provider = self + .web3 + .alloy + .with_signer(self.account.clone().try_into_alloy().await?); + let ethflow_contract = CoWSwapEthFlow::Instance::new(ethflow_contract, provider); let tx_result = ethflow_contract .invalidateOrdersIgnoringNotAllowed(encoded_ethflow_orders) // Gas conversions are lossy but technically the should not have decimal points even though they're floats From 493344a667b762ab8ee41744d4fb90a6354176c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 15 Oct 2025 16:31:53 +0100 Subject: [PATCH 013/117] docs: new, extensions and clarifications (#3757) Co-authored-by: Marcin Szymczak Co-authored-by: ilya --- crates/app-data/src/app_data.rs | 9 +++ crates/model/src/order.rs | 81 +++++++++++++++++-- crates/model/src/signature.rs | 2 + .../src/signature_validator/simulation.rs | 3 +- 4 files changed, 87 insertions(+), 8 deletions(-) diff --git a/crates/app-data/src/app_data.rs b/crates/app-data/src/app_data.rs index d51ae44509..4f3e31163e 100644 --- a/crates/app-data/src/app_data.rs +++ b/crates/app-data/src/app_data.rs @@ -206,6 +206,7 @@ impl serde::Serialize for FeePolicy { #[derive(Clone)] pub struct Validator { + /// App data size limit (in bytes). size_limit: usize, } @@ -217,14 +218,22 @@ impl Default for Validator { } impl Validator { + /// Creates a new app data [`Validator`] with the provided app data + /// `size_limit` (in bytes). pub fn new(size_limit: usize) -> Self { Self { size_limit } } + /// Returns the app data size limit (in bytes). pub fn size_limit(&self) -> usize { self.size_limit } + /// Parses and validates the provided app data bytes, returns the validated + /// + /// Valid app data is considered to be: + /// 1. Below or equal to [`Validator::size_limit`] in size. + /// 2. A valid JSON & app data object. pub fn validate(&self, full_app_data: &[u8]) -> Result { if full_app_data.len() > self.size_limit { return Err(anyhow!( diff --git a/crates/model/src/order.rs b/crates/model/src/order.rs index a0d2e9269f..30c6d98abc 100644 --- a/crates/model/src/order.rs +++ b/crates/model/src/order.rs @@ -293,33 +293,61 @@ pub struct QuoteAmounts { #[serde(rename_all = "camelCase")] pub struct OrderCreation { // These fields are the same as in `OrderData`. + /// The address of the token being sold. pub sell_token: H160, + /// The address of the token being bought. pub buy_token: H160, + /// The receiver of the `buy_token`. When this field is `None`, the receiver + /// is the same as the owner. #[serde(default)] pub receiver: Option, + /// The *maximum* amount of `sell_token`s that may be sold. #[serde_as(as = "HexOrDecimalU256")] pub sell_amount: U256, + /// The *minimum* amount of `buy_token`s that should be bought. #[serde_as(as = "HexOrDecimalU256")] pub buy_amount: U256, + /// The block timestamp when the order can no longer be settled (UNIX + /// timestamp in seconds). pub valid_to: u32, #[serde_as(as = "HexOrDecimalU256")] + /// (Deprecated) The fee agreed to by the user, it will be taken out in + /// `sell_token`. + /// + /// Deprecation note: orders with a non-zero `fee_amount` should be rejected + /// by the API. pub fee_amount: U256, + /// The kind of order (i.e. sell or buy). pub kind: OrderKind, + /// Whether the order can be carried out in multiple smaller trades, or it + /// must be carried out in a single trade (a.k.a. fill-or-kill). pub partially_fillable: bool, + /// Sell token's source — ERC20, internal vault or external vault (at the + /// time of writing). #[serde(default)] pub sell_token_balance: SellTokenSource, + /// Defines how tokens are transferred back to the user, either as an ERC-20 + /// token transfer or internal Balancer Vault transfer. #[serde(default)] pub buy_token_balance: BuyTokenDestination, - + /// The address of the order's owner (can be a smart contract's address). + /// + /// In the EthFlow case, it will have the address of the EthFlow smart + /// contract. pub from: Option, + /// The owner's signature of the order's data. #[serde(flatten)] pub signature: Signature, + /// The ID of the quote this order refers to. pub quote_id: Option, + /// The order's AppData (can be an hash, the JSON body or both). #[serde(flatten)] pub app_data: OrderCreationAppData, } impl OrderCreation { + /// Returns the order's data — i.e. the [`OrderCreation`] without + /// the metadata: `signature`, `quote_id` and with the `app_data`'s hash. pub fn data(&self) -> OrderData { OrderData { sell_token: self.sell_token, @@ -337,6 +365,11 @@ impl OrderCreation { } } + /// Signs the current [`OrderCreation`]'s data ([`OrderData`]) using ECDSA, + /// returning a signed [`OrderCreation`]. + /// + /// Re-signs the order data with ECDSA and returns the updated + /// `OrderCreation`. pub fn sign( mut self, signing_scheme: EcdsaSigningScheme, @@ -400,6 +433,7 @@ impl OrderCreation { } } +/// The order's AppData (can be an hash, the JSON body or both). // Note that the order of the variants is important for deserialization. #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(untagged)] @@ -813,12 +847,23 @@ impl From for OrderUid { } } +/// An order's kind — sell or buy. +/// +/// In very simple terms, when selling the owner sets the amount of tokens +/// going out of their pocket, when buying the owner sets the amount of +/// tokens coming in to their pocket. #[derive(Eq, PartialEq, Clone, Copy, Debug, Default, Deserialize, Serialize, Hash, EnumString)] #[strum(ascii_case_insensitive)] #[serde(rename_all = "lowercase")] pub enum OrderKind { + /// Buy orders state the owner's intent to *buy* X amount of token A in + /// exchange for some amount of token B (the exact amount is dependent on + /// token pairs, solvers, etc). #[default] Buy, + /// Sell orders state the owner's intent to *sell* X amount of token A in + /// exchange for some amount of token B (the exact amount is dependent on + /// token pairs, solvers, etc). Sell, } @@ -889,17 +934,36 @@ impl OrderKind { } } -/// Source from which the sellAmount should be drawn upon order fulfillment +/// Source from which the `sellAmount` should be drawn upon order fulfillment. +/// +/// It defines how tokens are transferred from the user into the settlement +/// contract, can be an ERC-20 transfer, drawn from the user's internal +/// Balancer Vault or through an ERC-20 transfer made through the Balancer +/// Vault. #[derive(Eq, PartialEq, Clone, Copy, Debug, Default, Deserialize, Serialize, Hash, EnumString)] #[strum(ascii_case_insensitive)] #[serde(rename_all = "snake_case")] pub enum SellTokenSource { - /// Direct ERC20 allowances to the Vault relayer contract + /// Sell tokens will be drawn from the users regular ERC20 token allowance + /// to the Vault relayer contract. #[default] Erc20, - /// Internal balances to the Vault with GPv2 relayer approval + /// Sell tokens will be drawn from the users regular ERC20 tokens *through* + /// the Vault, this is done by having a specific ERC20 allowance for the + /// Vault and relayer approval for the GPv2VaultRelayer. + /// + /// Check the [CoW docs on Balancer External Balances](external) for more + /// details. + /// + /// [external]: https://docs.cow.fi/cow-protocol/reference/contracts/core/vault-relayer#balancer-external-balances External, - /// ERC20 allowances to the Vault with GPv2 relayer approval + /// Sell tokens will be drawn from the users Vault internal balances, + /// requires the user to approve the GPv2VaultRelayer. + /// + /// Check the [CoW docs on Balancer Internal Balances](internal) for more + /// details. + /// + /// [internal]: https://docs.cow.fi/cow-protocol/reference/contracts/core/vault-relayer#balancer-internal-balances Internal, } @@ -932,8 +996,11 @@ impl SellTokenSource { } } -/// Destination for which the buyAmount should be transferred to order's -/// receiver to upon fulfillment +/// Destination for which the buyAmount should be transferred to the order's +/// receiver upon fulfillment. +/// +/// It defines how tokens are transferred back to the user, either as an ERC-20 +/// token transfer or internal Balancer Vault transfer. #[derive(Eq, PartialEq, Clone, Copy, Debug, Default, Deserialize, Serialize, Hash, EnumString)] #[strum(ascii_case_insensitive)] #[serde(rename_all = "snake_case")] diff --git a/crates/model/src/signature.rs b/crates/model/src/signature.rs index 6b3bbf7453..4aeb368fa6 100644 --- a/crates/model/src/signature.rs +++ b/crates/model/src/signature.rs @@ -268,6 +268,8 @@ pub fn hashed_eip712_message( struct_hash: &[u8; 32], ) -> [u8; 32] { let mut message = [0u8; 66]; + // 0x19 0x01 are the magic prefix bytes for the domain separator + // https://eips.ethereum.org/EIPS/eip-712#eth_signTypedData message[0..2].copy_from_slice(&[0x19, 0x01]); message[2..34].copy_from_slice(&domain_separator.0); message[34..66].copy_from_slice(struct_hash); diff --git a/crates/shared/src/signature_validator/simulation.rs b/crates/shared/src/signature_validator/simulation.rs index afe1d4ee66..127a67afca 100644 --- a/crates/shared/src/signature_validator/simulation.rs +++ b/crates/shared/src/signature_validator/simulation.rs @@ -82,7 +82,8 @@ impl Validator { } /// Simulates the signature validation setting balance overrides and - /// pre-interactions; returning the gas used. + /// pre-interactions; returning the gas used for the signature validation + /// only. /// /// These are required as they may interact with the signature, for example, /// adding composable CoW orders. From f423951230272161b68f77a4228793dd1896f7ae Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 17 Oct 2025 11:22:43 +0300 Subject: [PATCH 014/117] [TRIVIAL] Drop HoneyswapRouter legacy bindings (#3782) --- crates/contracts/build.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 5415d4ad0b..46886b3cc2 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -366,9 +366,6 @@ fn main() { }, ) }); - generate_contract_with_config("HoneyswapRouter", |builder| { - builder.add_network_str(GNOSIS, "0x1C232F01118CB8B424793ae03F870aa7D0ac7f77") - }); // EIP-1271 contract - SignatureValidator generate_contract("ERC1271SignatureValidator"); generate_contract_with_config("UniswapV3SwapRouterV2", |builder| { From 83fa8f4ca0c4cdeaf9246f304c391e613955ffc5 Mon Sep 17 00:00:00 2001 From: Marcin Szymczak Date: Fri, 17 Oct 2025 11:25:27 +0100 Subject: [PATCH 015/117] Add tx gas limit to driver config (#3783) # Description Required for tx gas configuration to be backwards compatible and guarantee smooth deployment. The infrastructure will be able to set tx gas limit per chain, but unless this field is expected, the driver would just panic on parsing the config. This introduces the required field as an option, and does not do anything with the value if set. https://github.com/cowprotocol/services/pull/3780 will actually make it mandatory and work. --- crates/driver/src/infra/config/file/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/driver/src/infra/config/file/mod.rs b/crates/driver/src/infra/config/file/mod.rs index 913c701d0d..55721d58a1 100644 --- a/crates/driver/src/infra/config/file/mod.rs +++ b/crates/driver/src/infra/config/file/mod.rs @@ -2,6 +2,7 @@ pub use load::load; use { crate::{domain::eth, infra, util::serialize}, alloy::primitives::Address, + number::serialization::HexOrDecimalU256, reqwest::Url, serde::{Deserialize, Deserializer, Serialize}, serde_with::serde_as, @@ -85,6 +86,10 @@ struct Config { /// Whether the flashloans feature is enabled. #[serde(default)] flashloans_enabled: bool, + + #[allow(dead_code)] + #[serde_as(as = "Option")] + tx_gas_limit: Option, } #[serde_as] From b10a0c4c2246bd9a4c13f1eb58ad38d3a1d62125 Mon Sep 17 00:00:00 2001 From: Marcin Szymczak Date: Fri, 17 Oct 2025 16:20:02 +0100 Subject: [PATCH 016/117] Make tx gas limit configurable in driver (#3780) Required to fix Sepolia after fusaka hard fork. # Description Sepolia got broken because the fusaka hard fork introduced a protocol level cap on tx gas limit which currently is being set to the block gas limit (which is too high). # Changes Make tx gas limit configurable in the driver, preserving the old behaviour (of taking block gas limit) if it is not specified. - [ ] Add tx_gas_limit command line argument (env: TX_GAS_LIMIT) ## How to test 1. Configure limit to 2^24 - 1 and test if transactions can be made on Sepolia 2. ## Related Issues Fixes #3777 --- configs/local/driver.toml | 2 ++ crates/driver/example.toml | 1 + crates/driver/src/infra/blockchain/mod.rs | 32 ++++----------------- crates/driver/src/infra/config/file/load.rs | 1 + crates/driver/src/infra/config/file/mod.rs | 5 ++-- crates/driver/src/infra/config/mod.rs | 1 + crates/driver/src/run.rs | 1 + crates/driver/src/tests/setup/driver.rs | 1 + crates/driver/src/tests/setup/solver.rs | 1 + crates/e2e/src/setup/colocation.rs | 1 + 10 files changed, 16 insertions(+), 30 deletions(-) diff --git a/configs/local/driver.toml b/configs/local/driver.toml index 3f58c4f155..5309fd6c10 100644 --- a/configs/local/driver.toml +++ b/configs/local/driver.toml @@ -1,3 +1,5 @@ +tx-gas-limit = 45000000 + [[solver]] name = "baseline" # Arbitrary name given to this solver, must be unique endpoint = "http://baseline" diff --git a/crates/driver/example.toml b/crates/driver/example.toml index 06a294a813..41573385ea 100644 --- a/crates/driver/example.toml +++ b/crates/driver/example.toml @@ -1,3 +1,4 @@ +tx-gas-limit = "45000000" [[solver]] name = "mysolver" # Arbitrary name given to this solver, must be unique endpoint = "http://0.0.0.0:7872" diff --git a/crates/driver/src/infra/blockchain/mod.rs b/crates/driver/src/infra/blockchain/mod.rs index 52ce057aae..7eca82b195 100644 --- a/crates/driver/src/infra/blockchain/mod.rs +++ b/crates/driver/src/infra/blockchain/mod.rs @@ -2,7 +2,7 @@ use { self::contracts::ContractAt, crate::{boundary, domain::eth}, chain::Chain, - ethcontract::errors::ExecutionError, + ethcontract::{U256, errors::ExecutionError}, ethrpc::{Web3, block_stream::CurrentBlockWatcher}, shared::{ account_balances::{BalanceSimulator, SimulationError}, @@ -82,6 +82,7 @@ struct Inner { current_block: CurrentBlockWatcher, balance_simulator: BalanceSimulator, balance_overrider: Arc, + tx_gas_limit: U256, } impl Ethereum { @@ -96,6 +97,7 @@ impl Ethereum { addresses: contracts::Addresses, gas: Arc, archive_node_url: Option<&Url>, + tx_gas_limit: U256, ) -> Self { let Rpc { web3, chain, args } = rpc; @@ -136,6 +138,7 @@ impl Ethereum { gas, balance_simulator, balance_overrider, + tx_gas_limit, }), web3, } @@ -190,32 +193,7 @@ impl Ethereum { CallRequest: From, { let mut tx: CallRequest = tx.into(); - // Specifically set high gas because some nodes don't pick a sensible value if - // omitted. And since we are only interested in access lists a very high - // value is fine. - tx.gas = Some(match self.inner.chain { - // Arbitrum has an exceptionally high block gas limit (1,125,899,906,842,624), - // making it unsuitable for this use case. To address this, we use a - // fixed gas limit of 100,000,000, which is sufficient - // for all solution types, while avoiding the "insufficient funds for gas * price + - // value" error that could occur when a large amount of ETH is - // needed to simulate the transaction, due to high transaction gas limit. - // - // If a new network is added, ensure its block gas limit is checked and handled - // appropriately to maintain compatibility with this logic. - Chain::ArbitrumOne => 100_000_000.into(), - Chain::Mainnet => self.block_gas_limit().0, - Chain::Goerli => self.block_gas_limit().0, - Chain::Gnosis => self.block_gas_limit().0, - Chain::Sepolia => self.block_gas_limit().0, - Chain::Base => self.block_gas_limit().0, - Chain::Bnb => self.block_gas_limit().0, - Chain::Optimism => self.block_gas_limit().0, - Chain::Avalanche => self.block_gas_limit().0, - Chain::Polygon => self.block_gas_limit().0, - Chain::Lens => self.block_gas_limit().0, - Chain::Hardhat => self.block_gas_limit().0, - }); + tx.gas = Some(self.inner.tx_gas_limit); tx.gas_price = self.simulation_gas_price().await; let json = self diff --git a/crates/driver/src/infra/config/file/load.rs b/crates/driver/src/infra/config/file/load.rs index 840a1c7d20..ffea52ec69 100644 --- a/crates/driver/src/infra/config/file/load.rs +++ b/crates/driver/src/infra/config/file/load.rs @@ -407,5 +407,6 @@ pub async fn load(chain: Chain, path: &Path) -> infra::Config { archive_node_url: config.archive_node_url, simulation_bad_token_max_age: config.simulation_bad_token_max_age, app_data_fetching: config.app_data_fetching, + tx_gas_limit: config.tx_gas_limit, } } diff --git a/crates/driver/src/infra/config/file/mod.rs b/crates/driver/src/infra/config/file/mod.rs index 55721d58a1..27898f578e 100644 --- a/crates/driver/src/infra/config/file/mod.rs +++ b/crates/driver/src/infra/config/file/mod.rs @@ -87,9 +87,8 @@ struct Config { #[serde(default)] flashloans_enabled: bool, - #[allow(dead_code)] - #[serde_as(as = "Option")] - tx_gas_limit: Option, + #[serde_as(as = "HexOrDecimalU256")] + tx_gas_limit: eth::U256, } #[serde_as] diff --git a/crates/driver/src/infra/config/mod.rs b/crates/driver/src/infra/config/mod.rs index c71623f995..389857b6f5 100644 --- a/crates/driver/src/infra/config/mod.rs +++ b/crates/driver/src/infra/config/mod.rs @@ -33,4 +33,5 @@ pub struct Config { pub archive_node_url: Option, pub simulation_bad_token_max_age: Duration, pub app_data_fetching: AppDataFetching, + pub tx_gas_limit: eth::U256, } diff --git a/crates/driver/src/run.rs b/crates/driver/src/run.rs index f33e686a89..ed7f8b7083 100644 --- a/crates/driver/src/run.rs +++ b/crates/driver/src/run.rs @@ -171,6 +171,7 @@ async fn ethereum(config: &infra::Config, ethrpc: blockchain::Rpc) -> Ethereum { config.contracts.clone(), gas, config.archive_node_url.as_ref(), + config.tx_gas_limit, ) .await } diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index 94ba6729cc..f40b55c7da 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -221,6 +221,7 @@ async fn create_config_file( ) .unwrap(); writeln!(file, "flashloans-enabled = true").unwrap(); + writeln!(file, "tx-gas-limit = \"45000000\"").unwrap(); write!( file, r#"[contracts] diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index 8a2c8baf22..ce715550ab 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -484,6 +484,7 @@ impl Solver { }, gas, None, + 45_000_000.into(), ) .await; diff --git a/crates/e2e/src/setup/colocation.rs b/crates/e2e/src/setup/colocation.rs index a7425f0973..d705bbbc71 100644 --- a/crates/e2e/src/setup/colocation.rs +++ b/crates/e2e/src/setup/colocation.rs @@ -200,6 +200,7 @@ factory = "{:?}" app-data-fetching-enabled = true orderbook-url = "http://localhost:8080" flashloans-enabled = true +tx-gas-limit = "45000000" [gas-estimator] estimator = "web3" From 3547e426d2d79af0951ab0032919fbf4a3835902 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 20 Oct 2025 13:57:07 +0300 Subject: [PATCH 017/117] [EASY] Drop `auction_orders` and `auction_participants` tables in DB (#3753) Actually drops the table from the DB. More details can be found in previous PRs: #3751, #3766. Must be released separately from the mentioned PRs. --- database/sql/V092___drop_auction_orders_table.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 database/sql/V092___drop_auction_orders_table.sql diff --git a/database/sql/V092___drop_auction_orders_table.sql b/database/sql/V092___drop_auction_orders_table.sql new file mode 100644 index 0000000000..9b44d2f08c --- /dev/null +++ b/database/sql/V092___drop_auction_orders_table.sql @@ -0,0 +1,5 @@ +-- Drop auction_orders table +DROP TABLE IF EXISTS auction_orders; + +-- Drop auction_participants table +DROP TABLE IF EXISTS auction_participants; From 6036ce9d9717cf700ee6dc9886c6900e88fd3417 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 20 Oct 2025 14:22:35 +0300 Subject: [PATCH 018/117] Drop CIP-20 data (#3771) # Description This PR drops the CIP-20 data, which has become obsolete. # Changes - [ ] univ2 test still uses this data to validate it is updated in some way, since we don't have other test to cover that. - [ ] Instead of using the CIP-20 structs, the queries migrated to separate function. ## How to test Updated existing tests. --- crates/e2e/tests/e2e/database.rs | 78 ++++++++++++-------------------- crates/e2e/tests/e2e/univ2.rs | 30 +++++++----- 2 files changed, 47 insertions(+), 61 deletions(-) diff --git a/crates/e2e/tests/e2e/database.rs b/crates/e2e/tests/e2e/database.rs index 9d39d3c888..37f7fb9df2 100644 --- a/crates/e2e/tests/e2e/database.rs +++ b/crates/e2e/tests/e2e/database.rs @@ -5,6 +5,7 @@ use { database::{Address, TransactionHash, byte_array::ByteArray, order_events}, e2e::setup::Db, model::order::OrderUid, + sqlx::PgConnection, std::ops::DerefMut, }; @@ -41,57 +42,36 @@ pub struct AuctionTransaction { pub solution_uid: i64, } -#[allow(dead_code)] -#[derive(Clone, Debug)] -pub struct Cip20Data { - pub txs: Vec, - pub participants: Vec, - pub prices: Vec, - pub reference_scores: Vec, - pub competition: serde_json::Value, +pub async fn auction_participants( + ex: &mut PgConnection, + auction_id: i64, +) -> anyhow::Result> { + const QUERY: &str = r#" + SELECT DISTINCT ps.solver + FROM proposed_solutions ps + WHERE ps.auction_id = $1 + "#; + Ok(sqlx::query_as(QUERY).bind(auction_id).fetch_all(ex).await?) } -/// Returns `Some(data)` if the all the expected CIP-20 data has been indexed -/// for the most recent `auction_id` from `settlements` table. -pub async fn most_recent_cip_20_data(db: &Db) -> Option { - let mut db = db.acquire().await.unwrap(); - - const LAST_AUCTION_ID: &str = "SELECT auction_id FROM settlements WHERE auction_id IS NOT \ - NULL ORDER BY auction_id DESC LIMIT 1"; - let auction_id: i64 = sqlx::query_scalar(LAST_AUCTION_ID) - .fetch_optional(db.deref_mut()) - .await - .unwrap()?; - - const TX_QUERY: &str = r" -SELECT * FROM settlements WHERE auction_id = $1"; - - let txs: Vec = sqlx::query_as(TX_QUERY) - .bind(auction_id) - .fetch_all(db.deref_mut()) - .await - .ok()?; +pub async fn auction_prices( + ex: &mut PgConnection, + auction_id: i64, +) -> anyhow::Result> { + const QUERY: &str = "SELECT * FROM auction_prices WHERE auction_id = $1"; + Ok(sqlx::query_as(QUERY).bind(auction_id).fetch_all(ex).await?) +} - let participants = - database::solver_competition_v2::fetch_auction_participants(&mut db, auction_id) - .await - .unwrap(); - let prices = database::auction_prices::fetch(&mut db, auction_id) - .await - .unwrap(); - let reference_scores = database::reference_scores::fetch(&mut db, auction_id) - .await - .unwrap(); - let competition = database::solver_competition::load_by_id(&mut db, auction_id) - .await - .unwrap()? - .json; +pub async fn reference_scores( + ex: &mut PgConnection, + auction_id: i64, +) -> anyhow::Result> { + const QUERY: &str = "SELECT * FROM reference_scores WHERE auction_id = $1"; + Ok(sqlx::query_as(QUERY).bind(auction_id).fetch_all(ex).await?) +} - Some(Cip20Data { - txs, - participants, - prices, - reference_scores, - competition, - }) +pub async fn latest_auction_id(ex: &mut PgConnection) -> anyhow::Result> { + const QUERY: &str = "SELECT auction_id FROM settlements WHERE auction_id IS NOT NULL ORDER BY \ + auction_id DESC LIMIT 1"; + Ok(sqlx::query_scalar(QUERY).fetch_optional(ex).await?) } diff --git a/crates/e2e/tests/e2e/univ2.rs b/crates/e2e/tests/e2e/univ2.rs index d37291ba72..f90e34eeb2 100644 --- a/crates/e2e/tests/e2e/univ2.rs +++ b/crates/e2e/tests/e2e/univ2.rs @@ -126,24 +126,30 @@ async fn test(web3: Web3) { .await .unwrap(); - let cip_20_data_updated = || async { - onchain.mint_block().await; - let data = match crate::database::most_recent_cip_20_data(services.db()).await { - Some(data) => data, - None => return false, + let data_updated = || async { + let mut db = services.db().acquire().await.unwrap(); + let Some(auction_id) = crate::database::latest_auction_id(&mut db).await.unwrap() else { + return false; }; + let participants = crate::database::auction_participants(&mut db, auction_id) + .await + .unwrap(); + let prices = crate::database::auction_prices(&mut db, auction_id) + .await + .unwrap(); + let scores = crate::database::reference_scores(&mut db, auction_id) + .await + .unwrap(); // sell and buy token price can be found - data.prices.iter().any(|p| p.token.0 == onchain.contracts().weth.address().0) - && data.prices.iter().any(|p| p.token.0 == token.address().0) + prices.iter().any(|p| p.token.0 == onchain.contracts().weth.address().0) + && prices.iter().any(|p| p.token.0 == token.address().0) // solver participated in the competition - && data.participants.iter().any(|p| p.participant.0 == solver.address().0) + && participants.iter().any(|p| p.0 == solver.address().0) // and won the auction - && data.reference_scores.first().is_some_and(|score| score.solver.0 == solver.address().0) + && scores.first().is_some_and(|score| score.solver.0 == solver.address().0) }; - wait_for_condition(TIMEOUT, cip_20_data_updated) - .await - .unwrap(); + wait_for_condition(TIMEOUT, data_updated).await.unwrap(); } fn order_events_matching_fuzzy(actual: &[OrderEvent], expected: &[OrderEventLabel]) -> bool { From 7f5cca8fc45cc69eade84ba789d95c7576f7fd9f Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 20 Oct 2025 15:17:18 +0300 Subject: [PATCH 019/117] Migrate BalancerV3BatchRouter to alloy (#3775) # Description Migrates BalancerV3BatchRouter to alloy. Alloy, by default, wasn't able to parse the ABI JSON we currently have, so I had to update it a bit. To see the exact change, see [this](https://github.com/cowprotocol/services/pull/3775/commits/d4db354ffb7c2cf33b1cfd7aa0cd17856a06bf5c#diff-6b43d7a940f1bbb3e887415e980543e0825ea48d1d5919797012f188f71b8551) commit after the formatting one. This would require changes in the gnosis/solvers repo, since the SC is used only there. --- .../artifacts/BalancerV3BatchRouter.json | 999 +++++++++++++++++- crates/contracts/build.rs | 60 -- crates/contracts/src/alloy.rs | 20 + crates/contracts/src/lib.rs | 1 - 4 files changed, 1018 insertions(+), 62 deletions(-) diff --git a/crates/contracts/artifacts/BalancerV3BatchRouter.json b/crates/contracts/artifacts/BalancerV3BatchRouter.json index cf8216c735..e4bdcf113d 100644 --- a/crates/contracts/artifacts/BalancerV3BatchRouter.json +++ b/crates/contracts/artifacts/BalancerV3BatchRouter.json @@ -1 +1,998 @@ -{"_format":"hh-sol-artifact-1","contractName":"BatchRouter","sourceName":"contracts/BatchRouter.sol","abi":[{"inputs":[{"internalType":"contractIVault","name":"vault","type":"address"},{"internalType":"contractIWETH","name":"weth","type":"address"},{"internalType":"contractIPermit2","name":"permit2","type":"address"},{"internalType":"string","name":"routerVersion","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ErrorSelectorNotFound","type":"error"},{"inputs":[],"name":"EthTransfer","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InputLengthMismatch","type":"error"},{"inputs":[],"name":"InsufficientEth","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"SenderIsNotVault","type":"error"},{"inputs":[],"name":"SwapDeadline","type":"error"},{"inputs":[],"name":"TransientIndexOutOfBounds","type":"error"},{"inputs":[],"name":"getSender","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"structIRouterCommon.PermitApproval[]","name":"permitBatch","type":"tuple[]"},{"internalType":"bytes[]","name":"permitSignatures","type":"bytes[]"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"uint48","name":"expiration","type":"uint48"},{"internalType":"uint48","name":"nonce","type":"uint48"}],"internalType":"structIAllowanceTransfer.PermitDetails[]","name":"details","type":"tuple[]"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"sigDeadline","type":"uint256"}],"internalType":"structIAllowanceTransfer.PermitBatch","name":"permit2Batch","type":"tuple"},{"internalType":"bytes","name":"permit2Signature","type":"bytes"},{"internalType":"bytes[]","name":"multicallData","type":"bytes[]"}],"name":"permitBatchAndCall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"exactAmountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountIn[]","name":"paths","type":"tuple[]"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"querySwapExactIn","outputs":[{"internalType":"uint256[]","name":"pathAmountsOut","type":"uint256[]"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"exactAmountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountIn[]","name":"paths","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"wethIsEth","type":"bool"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"structIBatchRouter.SwapExactInHookParams","name":"params","type":"tuple"}],"name":"querySwapExactInHook","outputs":[{"internalType":"uint256[]","name":"pathAmountsOut","type":"uint256[]"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"maxAmountIn","type":"uint256"},{"internalType":"uint256","name":"exactAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountOut[]","name":"paths","type":"tuple[]"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"querySwapExactOut","outputs":[{"internalType":"uint256[]","name":"pathAmountsIn","type":"uint256[]"},{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"maxAmountIn","type":"uint256"},{"internalType":"uint256","name":"exactAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountOut[]","name":"paths","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"wethIsEth","type":"bool"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"structIBatchRouter.SwapExactOutHookParams","name":"params","type":"tuple"}],"name":"querySwapExactOutHook","outputs":[{"internalType":"uint256[]","name":"pathAmountsIn","type":"uint256[]"},{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"exactAmountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountIn[]","name":"paths","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"wethIsEth","type":"bool"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"swapExactIn","outputs":[{"internalType":"uint256[]","name":"pathAmountsOut","type":"uint256[]"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"exactAmountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountIn[]","name":"paths","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"wethIsEth","type":"bool"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"structIBatchRouter.SwapExactInHookParams","name":"params","type":"tuple"}],"name":"swapExactInHook","outputs":[{"internalType":"uint256[]","name":"pathAmountsOut","type":"uint256[]"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"maxAmountIn","type":"uint256"},{"internalType":"uint256","name":"exactAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountOut[]","name":"paths","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"wethIsEth","type":"bool"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"swapExactOut","outputs":[{"internalType":"uint256[]","name":"pathAmountsIn","type":"uint256[]"},{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contractIERC20","name":"tokenIn","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"contractIERC20","name":"tokenOut","type":"address"},{"internalType":"bool","name":"isBuffer","type":"bool"}],"internalType":"structIBatchRouter.SwapPathStep[]","name":"steps","type":"tuple[]"},{"internalType":"uint256","name":"maxAmountIn","type":"uint256"},{"internalType":"uint256","name":"exactAmountOut","type":"uint256"}],"internalType":"structIBatchRouter.SwapPathExactAmountOut[]","name":"paths","type":"tuple[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"wethIsEth","type":"bool"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"structIBatchRouter.SwapExactOutHookParams","name":"params","type":"tuple"}],"name":"swapExactOutHook","outputs":[{"internalType":"uint256[]","name":"pathAmountsIn","type":"uint256[]"},{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"0x6101c0604090808252346105c957614bbd803803809161001f82856105e8565b83398101916080828403126105c95781516001600160a01b03939084811681036105c957602093848101519286841684036105c9578482015196871687036105c95760608201516001600160401b03928382116105c9570192601f908282860112156105c95784518481116105b557601f19958851946100a58b898786011601876105e8565b8286528a83830101116105c957815f928b8093018388015e8501015260805281519283116105b5575f54916001928381811c911680156105ab575b8982101461059757828111610554575b50879184116001146104f757839450908392915f946104ec575b50501b915f199060031b1c1916175f555b61014961012661060b565b835190610132826105cd565b600682526539b2b73232b960d11b86830152610669565b60a05261018561015761060b565b835190610163826105cd565b60118252701a5cd4995d1d5c9b915d1a131bd8dad959607a1b86830152610669565b60c05260e0526101009283526101cd815161019f816105cd565b601381527f63757272656e7453776170546f6b656e73496e0000000000000000000000000084820152610633565b9161012092835261021082516101e2816105cd565b601481527f63757272656e7453776170546f6b656e734f757400000000000000000000000083820152610633565b6101409081526102528351610224816105cd565b601981527f63757272656e7453776170546f6b656e496e416d6f756e74730000000000000084820152610633565b906101609182526102d8610298855161026a816105cd565b601a81527f63757272656e7453776170546f6b656e4f7574416d6f756e747300000000000086820152610633565b936101809485527f736574746c6564546f6b656e416d6f756e7473000000000000000000000000008651916102cc836105cd565b60138352820152610633565b936101a094855251946144a1968761071c88396080518781816102460152818161197c01528181611be001528181611e22015281816120790152818161221201528181612323015281816123b10152818161247301528181612aad01528181612c8c01528181612cd401528181612d5201528181612df901528181612f0701528181612f840152818161321901528181613348015281816133e5015281816134ab01528181613b6c01528181613c9101528181613ed0015281816140150152614271015260a0518781816102aa015281816105350152818161181f01526128be015260c0518781816117a901526136ba015260e051878181602201528181613afe01528181613de401528181613f5801526140af0152518681816109f001528181610b0401528181611f6e01528181611ff4015281816130790152613c6d015251858181612569015281816127500152818161295a01526135d8015251848181611c4301528181611e8f01528181612275015281816124d7015281816125ce0152818161272c01528181612b1201526135a8015251838181611d43015281816125950152818161277c0152818161328e01528181613509015261362b015251828181611c6c01528181611ec00152818161250101528181612621015281816127b401528181612b5101526132d001525181818161229f015281816125ff01528181612b8201528181612e5601526136090152f35b015192505f8061010a565b91938316915f805283885f20935f5b8a8883831061053d5750505010610525575b505050811b015f5561011b565b01515f1960f88460031b161c191690555f8080610518565b868601518855909601959485019487935001610506565b5f8052885f208380870160051c8201928b881061058e575b0160051c019084905b8281106105835750506100f0565b5f8155018490610575565b9250819261056c565b634e487b7160e01b5f52602260045260245ffd5b90607f16906100e0565b634e487b7160e01b5f52604160045260245ffd5b5f80fd5b604081019081106001600160401b038211176105b557604052565b601f909101601f19168101906001600160401b038211908210176105b557604052565b60405190610618826105cd565b600c82526b2937baba32b921b7b6b6b7b760a11b6020830152565b61066690604051610643816105cd565b60118152702130ba31b42937baba32b921b7b6b6b7b760791b6020820152610669565b90565b906106d6603a60209260405193849181808401977f62616c616e6365722d6c6162732e76332e73746f726167652e000000000000008952805191829101603986015e830190601760f91b60398301528051928391018583015e015f8382015203601a8101845201826105e8565b5190205f198101908111610707576040519060208201908152602082526106fc826105cd565b9051902060ff191690565b634e487b7160e01b5f52601160045260245ffdfe60806040526004361015610072575b3615610018575f80fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361004a57005b7f0540ddf6000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f3560e01c806308a465f614610e9d57806319c6989f1461084e578063286f580d146107b75780632950286e146106cc57806354fd4d501461058f5780635a3c3987146105665780635e01eb5a146105215780638a12a08c146104c65780638eb1b65e146103bf578063945ed33f14610344578063ac9650d8146103005763e3b5dff40361000e57346102fc576060806003193601126102fc5767ffffffffffffffff6004358181116102fc5761012d9036906004016112c4565b6101356111a1565b6044359283116102fc57610150610158933690600401610fcd565b9390916128b9565b905f5b835181101561017c57805f8761017360019488611691565b5101520161015b565b506101f06101fe610239946101b65f94886040519361019a8561111a565b30855260208501525f1960408501528660608501523691611381565b60808201526040519283917f8a12a08c0000000000000000000000000000000000000000000000000000000060208401526024830161143e565b03601f198101835282611152565b604051809481927fedfa3568000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39261028e915f916102cf575b50602080825183010191016115d4565b909391926102a7575b60405193849384610f2f565b0390f35b5f7f00000000000000000000000000000000000000000000000000000000000000005d610297565b6102eb91503d805f833e6102e38183611152565b81019061154d565b8461027e565b6040513d5f823e3d90fd5b5f80fd5b60206003193601126102fc5760043567ffffffffffffffff81116102fc576103386103326102a3923690600401610f9c565b9061179b565b60405191829182611020565b346102fc5761035236610eca565b61035a611945565b610362611972565b6103906102a3610371836128fb565b9193909461038a606061038383611344565b9201611358565b90612729565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d60405193849384610f2f565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576103ec9036906004016112c4565b906103f56111b7565b906064359081116102fc576101f061048b6102399461045161041c5f953690600401610fcd565b610425336128b9565b97604051946104338661111a565b33865260208601526024356040860152151560608501523691611381565b60808201526040519283917f945ed33f000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b604051809481927f48c89491000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b346102fc576102a36104ef6104da36610eca565b6104e2611945565b6104ea611972565b611a3b565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f009492945d60405193849384610f2f565b346102fc575f6003193601126102fc5760207f00000000000000000000000000000000000000000000000000000000000000005c6001600160a01b0360405191168152f35b346102fc576102a36104ef61057a36610eca565b610582611945565b61058a611972565b6128fb565b346102fc575f6003193601126102fc576040515f80549060018260011c91600184169182156106c2575b60209485851084146106955785879486865291825f146106575750506001146105fe575b506105ea92500383611152565b6102a3604051928284938452830190610ffb565b5f808052859250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b85831061063f5750506105ea9350820101856105dd565b80548389018501528794508693909201918101610628565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016858201526105ea95151560051b85010192508791506105dd9050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b92607f16926105b9565b346102fc5760606003193601126102fc5767ffffffffffffffff6004358181116102fc576106fe9036906004016112c4565b906107076111a1565b6044359182116102fc5761072261072a923690600401610fcd565b9290916128b9565b905f5b845181101561075f57806fffffffffffffffffffffffffffffffff604061075660019489611691565b5101520161072d565b506101f06101fe8561077d5f94610239976040519361019a8561111a565b60808201526040519283917f5a3c3987000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576107e49036906004016112c4565b906107ed6111b7565b906064359081116102fc576101f061048b6102399461081461041c5f953690600401610fcd565b60808201526040519283917f08a465f60000000000000000000000000000000000000000000000000000000060208401526024830161143e565b60a06003193601126102fc5767ffffffffffffffff600435116102fc573660236004350112156102fc5767ffffffffffffffff60043560040135116102fc5736602460c060043560040135026004350101116102fc5760243567ffffffffffffffff81116102fc576108c4903690600401610f9c565b67ffffffffffffffff604435116102fc576060600319604435360301126102fc5760643567ffffffffffffffff81116102fc57610905903690600401610fcd565b60843567ffffffffffffffff81116102fc57610925903690600401610f9c565b949093610930611945565b806004356004013503610e75575f5b600435600401358110610bd25750505060443560040135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd6044353603018212156102fc57816044350160048101359067ffffffffffffffff82116102fc5760248260071b36039101136102fc576109e3575b6102a361033886865f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d61179b565b6001600160a01b039492947f0000000000000000000000000000000000000000000000000000000000000000163b156102fc57604051947f2a2d80d10000000000000000000000000000000000000000000000000000000086523360048701526060602487015260c486019260443501602481019367ffffffffffffffff6004830135116102fc57600482013560071b360385136102fc5760606064890152600482013590529192869260e484019291905f905b60048101358210610b5457505050602091601f19601f865f9787956001600160a01b03610ac860246044350161118d565b16608488015260448035013560a48801526003198787030160448801528186528786013787868286010152011601030181836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39361033893610b45575b8294508193506109b3565b610b4e90611106565b84610b3a565b9195945091926001600160a01b03610b6b8761118d565b168152602080870135916001600160a01b0383168093036102fc57600492600192820152610b9b604089016128a6565b65ffffffffffff8091166040830152610bb660608a016128a6565b1660608201526080809101970193019050889495939291610a97565b610be7610be082848661192a565b3691611381565b604051610bf3816110a1565b5f81526020915f838301525f60408301528281015190606060408201519101515f1a91835283830152604082015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc81850260043501360301126102fc5760405190610c60826110ea565b610c73602460c08602600435010161118d565b808352610c89604460c08702600435010161118d565b908185850152610ca2606460c08802600435010161118d565b60408581019190915260043560c08802016084810135606087015260a4810135608087015260c4013560a086015283015183519386015160ff91909116926001600160a01b0383163b156102fc575f6001600160a01b03809460e4948b98849860c460c06040519c8d9b8c9a7fd505accf000000000000000000000000000000000000000000000000000000008c521660048b01523060248b0152608482820260043501013560448b0152026004350101356064880152608487015260a486015260c4850152165af19081610e66575b50610e5c57610d7f612877565b906001600160a01b0381511690836001600160a01b0381830151166044604051809581937fdd62ed3e00000000000000000000000000000000000000000000000000000000835260048301523060248301525afa9182156102f1575f92610e2c575b506060015103610df75750506001905b0161093f565b805115610e045780519101fd5b7fa7285689000000000000000000000000000000000000000000000000000000005f5260045ffd5b9091508381813d8311610e55575b610e448183611152565b810103126102fc5751906060610de1565b503d610e3a565b5050600190610df1565b610e6f90611106565b8a610d72565b7faaad13f7000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102fc57610eab36610eca565b610eb3611945565b610ebb611972565b6103906102a361037183611a3b565b600319906020828201126102fc576004359167ffffffffffffffff83116102fc578260a0920301126102fc5760040190565b9081518082526020808093019301915f5b828110610f1b575050505090565b835185529381019392810192600101610f0d565b939290610f4490606086526060860190610efc565b936020948181036020830152602080855192838152019401905f5b818110610f7f57505050610f7c9394506040818403910152610efc565b90565b82516001600160a01b031686529487019491870191600101610f5f565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc576020808501948460051b0101116102fc57565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc57602083818601950101116102fc57565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6020808201906020835283518092526040830192602060408460051b8301019501935f915b8483106110555750505050505090565b9091929394958480611091837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a51610ffb565b9801930193019194939290611045565b6060810190811067ffffffffffffffff8211176110bd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60c0810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd57604052565b60a0810190811067ffffffffffffffff8211176110bd57604052565b60e0810190811067ffffffffffffffff8211176110bd57604052565b90601f601f19910116810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd5760051b60200190565b35906001600160a01b03821682036102fc57565b602435906001600160a01b03821682036102fc57565b6044359081151582036102fc57565b9190916080818403126102fc57604090815191608083019467ffffffffffffffff95848110878211176110bd57825283956112008461118d565b8552602090818501359081116102fc57840182601f820112156102fc5780359061122982611175565b9361123686519586611152565b82855283850190846060809502840101928184116102fc578501915b8383106112745750505050508401528181013590830152606090810135910152565b84838303126102fc57875190611289826110a1565b6112928461118d565b825261129f87850161118d565b87830152888401359081151582036102fc578288928b89950152815201920191611252565b81601f820112156102fc578035916020916112de84611175565b936112ec6040519586611152565b808552838086019160051b830101928084116102fc57848301915b8483106113175750505050505090565b823567ffffffffffffffff81116102fc578691611339848480948901016111c6565b815201920191611307565b356001600160a01b03811681036102fc5790565b3580151581036102fc5790565b67ffffffffffffffff81116110bd57601f01601f191660200190565b92919261138d82611365565b9161139b6040519384611152565b8294818452818301116102fc578281602093845f960137010152565b9060808101916001600160a01b03808251168352602093848301519460808186015285518092528060a086019601925f905b83821061140b5750505050506060816040829301516040850152015191015290565b845180518216895280840151821689850152604090810151151590890152606090970196938201936001909101906113e9565b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106114bd5750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b909192939583806114f8837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611481565b81601f820112156102fc5780519061151e82611365565b9261152c6040519485611152565b828452602083830101116102fc57815f9260208093018386015e8301015290565b906020828203126102fc57815167ffffffffffffffff81116102fc57610f7c9201611507565b9080601f830112156102fc5781519060209161158e81611175565b9361159c6040519586611152565b81855260208086019260051b8201019283116102fc57602001905b8282106115c5575050505090565b815181529083019083016115b7565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc5784611600918301611573565b936020808301518581116102fc5783019082601f830112156102fc5781519161162883611175565b926116366040519485611152565b808452828085019160051b830101918583116102fc578301905b82821061167257505050509360408301519081116102fc57610f7c9201611573565b81516001600160a01b03811681036102fc578152908301908301611650565b80518210156116a55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106117515750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b9091929395838061178c837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611715565b91906117a6336128b9565b907f000000000000000000000000000000000000000000000000000000000000000093845c6118b1576001906001865d6117df83611175565b926117ed6040519485611152565b808452601f196117fc82611175565b015f5b8181106118a05750505f5b8181106118575750505050905f61184c92945d7f0000000000000000000000000000000000000000000000000000000000000000805c9161184e575b506136b1565b565b5f905d5f611846565b806118845f8061186c610be08996888a61192a565b602081519101305af461187d612877565b903061415c565b61188e8288611691565b526118998187611691565b500161180a565b8060606020809389010152016117ff565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc576020019181360383136102fc57565b908210156116a5576119419160051b8101906118d9565b9091565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805c6118b1576001905d565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036119a457565b7f089676d5000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b906119da82611175565b6119e76040519182611152565b828152601f196119f78294611175565b0190602036910137565b91908201809211611a0e57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b604081013542116126c35790611a5e611a5760208401846136f4565b90506119d0565b915f5b611a6e60208301836136f4565b90508110156125c757611a9881611a93611a8b60208601866136f4565b369391613748565b6111c6565b936040850151936001600160a01b038651169060208701518051156116a55760200151604001511515806125be575b1561256357611aec611ad886611344565b8784611ae660608a01611358565b92613add565b5f5b60208801515181101561255357611b03613788565b6020890151515f198101908111611a0e578214806020830152821582525f1461254c576060890151905b611b3b8360208c0151611691565b51604081015190919015611cee57611bd36001600160a01b03835116936001600160a01b03881685145f14611ce7576001945b60405195611b7b8761111a565b5f8752611b87816137be565b6020870152604086015260609485918d838301526080820152604051809381927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611cb0575b50506020015115611c9657816001600160a01b036020611c909360019695611c388c8c611691565b5201611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b5051167f000000000000000000000000000000000000000000000000000000000000000061420a565b01611aee565b602001519097506001600160a01b03169250600190611c90565b60209294509081611cd592903d10611ce0575b611ccd8183611152565b8101906137f5565b91505092905f611c10565b503d611cc3565b5f94611b6e565b888a6001600160a01b038495945116806001600160a01b038a16145f14612132575050815115905061206e57888a80151580612053575b611f4d575b6001600160a01b03939291611ddd82611e15978b5f95897f0000000000000000000000000000000000000000000000000000000000000000921680885282602052604088205c611f3c575b5050505b6001611d9c8983511660208401998b8b51169080158a14611f3657508391614223565b999092511694611db1608091828101906118d9565b93909460405197611dc1896110ea565b8852306020890152604088015260608701528501523691611381565b60a0820152604051809681927f21457897000000000000000000000000000000000000000000000000000000008352600483016139b1565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611f0c575b506020015115611ee95791611ebc826001600160a01b0360019695611e7a611ee49686611691565b51611e858d8d611691565b52611eb3828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b50511692611691565b51907f000000000000000000000000000000000000000000000000000000000000000061420a565b611c90565b98506001929450611f02906001600160a01b0392611691565b5197511692611c90565b6020919450611f2c903d805f833e611f248183611152565b810190613969565b5094919050611e52565b91614223565b611f4592614341565b5f8281611d75565b50611f5a90929192611344565b91611f648b6142fd565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039485166004820152306024820152908416604482015292871660648401525f8380608481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f1578a611ddd8d611e15976001600160a01b03975f95612044575b50975092505091929350611d2a565b61204d90611106565b5f612035565b5061205d82611344565b6001600160a01b0316301415611d25565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916001600160a01b0384511692803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03949094166004850152306024850152604484018c90525f908490606490829084905af180156102f1578a611ddd8d611e15976001600160a01b03975f95612123575b50611d79565b61212c90611106565b5f61211d565b6001600160a01b0360208796949701511690898183145f146123d7576121cd925061220597915060016121735f96956001600160a01b0393848b5116614223565b509282895116956020890151151588146123ae5761219082611344565b945b6121a1608093848101906118d9565b959096604051996121b18b6110ea565b8a52166020890152604088015260608701528501523691611381565b60a0820152604051809581927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f1575f93612384575b5060200151156122c357816001600160a01b036020611ee493600196956122698c8c611691565b526122998383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b60208181015191516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101859052939a50909116945081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612359575b50600190611c90565b602090813d831161237d575b61236f8183611152565b810103126102fc575f612350565b503d612365565b60209193506123a4903d805f833e61239c8183611152565b81019061387c565b5093919050612242565b837f00000000000000000000000000000000000000000000000000000000000000001694612192565b6001600160a01b036124669561242e9394956123f860809b8c8101906118d9565b9390946040519761240889611136565b5f8952602089015216604087015260609a8b978888015286015260a08501523691611381565b60c0820152604051809381927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612525575b50506020015115611c9657816001600160a01b036020611ee493600196956124cb8c8c611691565b526124fb8383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b6020929450908161254192903d10611ce057611ccd8183611152565b91505092905f6124a3565b5f90611b2d565b5091955090935050600101611a61565b61258d827f00000000000000000000000000000000000000000000000000000000000000006141c0565b506125b986837f000000000000000000000000000000000000000000000000000000000000000061420a565b611aec565b50321515611ac7565b50506125f27f0000000000000000000000000000000000000000000000000000000000000000613a71565b916125fd83516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b0380612663838b611691565b51165f528560205261269160405f205c8261267e858d611691565b51165f528860205260405f205c90611a01565b61269b8387611691565b526126a6828a611691565b51165f52856020525f604081205d01612644565b50949391509150565b7fe08b8af0000000000000000000000000000000000000000000000000000000005f5260045ffd5b905f198201918213600116611a0e57565b7f80000000000000000000000000000000000000000000000000000000000000008114611a0e575f190190565b907f000000000000000000000000000000000000000000000000000000000000000090815c7f0000000000000000000000000000000000000000000000000000000000000000612779815c6126eb565b907f0000000000000000000000000000000000000000000000000000000000000000915b5f81121561283a575050506127b1906126eb565b917f0000000000000000000000000000000000000000000000000000000000000000925b5f8112156127ea575050505061184c906136b1565b61283590825f5261282f60205f83828220015c91828252888152886040916128228a8d8587205c906001600160a01b03891690613eb0565b8484525281205d84613e0d565b506126fc565b6127d5565b61287290825f5261282f60205f8a8785848420015c938484528181526128228c6040948587205c906001600160a01b03891690613add565b61279d565b3d156128a1573d9061288882611365565b916128966040519384611152565b82523d5f602084013e565b606090565b359065ffffffffffff821682036102fc57565b905f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03815c16156128f1575050565b909192505d600190565b90604082013542116126c357612917611a5760208401846136f4565b915f5b61292760208301836136f4565b90508110156135d15761294481611a93611a8b60208601866136f4565b60608101519061297e6001600160a01b038251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506020810151515f198101908111611a0e575b5f8112156129a45750505060010161291a565b6129b2816020840151611691565b516129bb613788565b9082156020830152602084015151805f19810111611a0e575f1901831480835261358f575b6020820151156135545760408401516001600160a01b03855116915b604081015115612c1d5783916001600160a01b036060926020612aa0970151151580612c14575b612bed575b5116906001600160a01b0385168203612be6576001915b60405192612a4c8461111a565b60018452612a59816137be565b6020840152604083015288838301526080820152604051809581927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f95612bbf575b506020015115612bb057612ba69284612b02612bab979694612b7594611691565b52612b366001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506001600160a01b03612b4d8460408a01516137b1565b91167f000000000000000000000000000000000000000000000000000000000000000061420a565b6001600160a01b038551167f000000000000000000000000000000000000000000000000000000000000000061420a565b6126fc565b612991565b505050612bab919350926126fc565b6020919550612bdc9060603d606011611ce057611ccd8183611152565b5095919050612ae1565b5f91612a3f565b612c0f612bf98d611344565b8d8b611ae6886040888451169301519301611358565b612a28565b50321515612a23565b906001600160a01b03825116806001600160a01b038516145f14613137575060208401516130495750604051927f967870920000000000000000000000000000000000000000000000000000000084526001600160a01b03831660048501526020846024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156102f1575f94613015575b5083916001600160a01b038151166001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015230602482015260448101959095525f8580606481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f157612dec955f92613006575b505b611ddd6001600160a01b03612da88b828551168360208701511690614223565b50925116918c6002612dbf608092838101906118d9565b92909360405196612dcf886110ea565b875230602088015289604088015260608701528501523691611381565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612fe3575b506020015115612ecf57908291612bab9493612e45898d611691565b52612e7a836001600160a01b0384167f000000000000000000000000000000000000000000000000000000000000000061420a565b80831080612eb4575b612e90575b5050506126fc565b612ea6612eac93612ea08b611344565b926137b1565b91614356565b5f8080612e88565b50306001600160a01b03612ec78b611344565b161415612e83565b9450908094808210612ee8575b505050612bab906126fc565b91612ef8602092612f77946137b1565b90612f2d826001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683614356565b60405193849283927f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612fb8575b8080612edc565b602090813d8311612fdc575b612fce8183611152565b810103126102fc575f612fb1565b503d612fc4565b6020919450612ffb903d805f833e611f248183611152565b509094919050612e29565b61300f90611106565b5f612d86565b9093506020813d602011613041575b8161303160209383611152565b810103126102fc5751925f612cbc565b3d9150613024565b909261305489611344565b6001600160a01b033091160361306f575b5f612dec94612d88565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936130a38a611344565b6130ac846142fd565b90863b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152306024820152918116604483015285166064820152945f908690608490829084905af19081156102f157612dec955f92613128575b50945050613065565b61313190611106565b5f61311f565b6001600160a01b036020849695940151168a8282145f1461340b5750505061320c61316e5f92846001600160a01b03885116614223565b92906131d48c6001600160a01b03808a5116938951151586146133df576131a361319784611344565b935b60808101906118d9565b929093604051966131b3886110ea565b875216602086015260408501528c6060850152600260808501523691611381565b60a0820152604051809381927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f1575f916133c4575b5060208401518c908a90156133aa5783836001600160a01b03936132836132899461327c8f9c9b9a98996132b29a611691565b5192611691565b52611691565b5191167f000000000000000000000000000000000000000000000000000000000000000061420a565b51156132f457612bab92916001600160a01b036020612ba6930151167f0000000000000000000000000000000000000000000000000000000000000000614341565b516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810191909152602081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f15761337f575b50612bab906126fc565b602090813d83116133a3575b6133958183611152565b810103126102fc575f613375565b503d61338b565b50509091506133bb92939650611691565b519384916132b2565b6133d891503d805f833e61239c8183611152565b9050613249565b6131a3827f00000000000000000000000000000000000000000000000000000000000000001693613199565b61349e965090613466916060948b61342b608099989993848101906118d9565b9390946040519761343b89611136565b6001895260208901526001600160a01b038b1660408901528888015286015260a08501523691611381565b60c0820152604051809581927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f9561352d575b506020015115612bb057612ba69284613505612bab9796946001600160a01b0394611691565b52167f000000000000000000000000000000000000000000000000000000000000000061420a565b602091955061354a9060603d606011611ce057611ccd8183611152565b50959190506134df565b6fffffffffffffffffffffffffffffffff6001600160a01b0360206135858188015161357f886126eb565b90611691565b51015116916129fc565b6135cc856001600160a01b0360208401611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b6129e0565b50506135fc7f0000000000000000000000000000000000000000000000000000000000000000613a71565b9161360783516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b038061366d838b611691565b51165f528560205261368860405f205c8261267e858d611691565b6136928387611691565b5261369d828a611691565b51165f52856020525f604081205d0161364e565b4780156136f0577f00000000000000000000000000000000000000000000000000000000000000005c6136f0576001600160a01b0361184c92166140e0565b5050565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc57602001918160051b360383136102fc57565b91908110156116a55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81813603018212156102fc570190565b604051906040820182811067ffffffffffffffff8211176110bd576040525f6020838281520152565b91908203918211611a0e57565b600211156137c857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b908160609103126102fc578051916040602083015192015190565b61010060c0610f7c93602084528051613828816137be565b602085015260208101516001600160a01b0380911660408601528060408301511660608601526060820151166080850152608081015160a085015260a08101518285015201519160e0808201520190610ffb565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc57846138a8918301611573565b9360208201519360408301519081116102fc57610f7c9201611507565b9081518082526020808093019301915f5b8281106138e4575050505090565b8351855293810193928101926001016138d6565b602081526001600160a01b038083511660208301526020830151166040820152613931604083015160c0606084015260e08301906138c5565b9060608301516080820152608083015160058110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b916060838303126102fc5782519260208101519267ffffffffffffffff938481116102fc578161399a918401611573565b9360408301519081116102fc57610f7c9201611507565b602081526001600160a01b038083511660208301526020830151166040820152604082015160608201526139f4606083015160c0608084015260e08301906138c5565b90608083015160048110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b91909160808060a08301948051613a38816137be565b84526020810151613a48816137be565b60208501526001600160a01b036040820151166040850152606081015160608501520151910152565b90815c613a7d81611175565b613a8a6040519182611152565b818152613a9682611175565b601f196020910136602084013781945f5b848110613ab5575050505050565b600190825f5280845f20015c6001600160a01b03613ad38388611691565b9116905201613aa7565b919280613dd8575b15613c51575050804710613c29576001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001691823b156102fc57604051907fd0e30db00000000000000000000000000000000000000000000000000000000082525f915f8160048185895af180156102f157613c12575b506044602092937f00000000000000000000000000000000000000000000000000000000000000001694613b98838783614356565b8460405196879485937f15afd409000000000000000000000000000000000000000000000000000000008552600485015260248401525af1908115613c065750613bdf5750565b602090813d8311613bff575b613bf58183611152565b810103126102fc57565b503d613beb565b604051903d90823e3d90fd5b60209250613c1f90611106565b60445f9250613b63565b7fa01a9df6000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915f9080613c61575b50505050565b6001600160a01b0393847f00000000000000000000000000000000000000000000000000000000000000001694807f00000000000000000000000000000000000000000000000000000000000000001691613cbb846142fd565b96803b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152848316602482015297821660448901529186161660648701525f908690608490829084905af19485156102f157613d8095613dc4575b5082936020936040518097819582947f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03925af1908115613c065750613d99575b808080613c5b565b602090813d8311613dbd575b613daf8183611152565b810103126102fc575f613d91565b503d613da5565b60209350613dd190611106565b5f92613d2f565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690821614613ae5565b6001810191805f5260209183835260405f205c8015155f14613ea7575f1990818101835c8380820191828403613e6a575b5050505050815c81810192818411611a0e575f93815d835284832001015d5f52525f604081205d600190565b613e77613e87938861443a565b865f52885f2001015c918561443a565b835f52808383885f2001015d5f5285855260405f205d5f80808381613e3e565b50505050505f90565b5f949383156140d857806140a3575b15614007576001600160a01b0391827f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03929092166004830152306024830152604482018590525f908290606490829084905af180156102f157613ff4575b5084827f000000000000000000000000000000000000000000000000000000000000000016803b15613ff05781906024604051809481937f2e1a7d4d0000000000000000000000000000000000000000000000000000000083528960048401525af18015613fe557613fcd575b5061184c939450166140e0565b613fd78691611106565b613fe15784613fc0565b8480fd5b6040513d88823e3d90fd5b5080fd5b613fff919550611106565b5f935f613f53565b929350906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015293909216602484015260448301525f908290606490829084905af180156102f15761409a5750565b61184c90611106565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690831614613ebf565b505050509050565b814710614130575f8080936001600160a01b038294165af1614100612877565b501561410857565b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fcd786059000000000000000000000000000000000000000000000000000000005f523060045260245ffd5b90614171575080511561410857805190602001fd5b815115806141b7575b614182575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561417a565b6001810190825f528160205260405f205c155f1461420357805c815f52838160205f20015d60018101809111611a0e57815d5c915f5260205260405f205d600190565b5050505f90565b905f5260205261421f60405f2091825c611a01565b905d565b916044929391936001600160a01b03604094859282808551998a9586947fc9c1661b0000000000000000000000000000000000000000000000000000000086521660048501521660248301527f0000000000000000000000000000000000000000000000000000000000000000165afa9384156142f3575f935f956142bc575b50506142b96142b285946119d0565b9485611691565b52565b809295508194503d83116142ec575b6142d58183611152565b810103126102fc5760208251920151925f806142a3565b503d6142cb565b83513d5f823e3d90fd5b6001600160a01b0390818111614311571690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f5260a060045260245260445ffd5b905f5260205261421f60405f2091825c6137b1565b6040519260208401907fa9059cbb0000000000000000000000000000000000000000000000000000000082526001600160a01b038094166024860152604485015260448452608084019084821067ffffffffffffffff8311176110bd576143d5935f9384936040521694519082865af16143ce612877565b908361415c565b8051908115159182614416575b50506143eb5750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b81925090602091810103126102fc57602001518015908115036102fc575f806143e2565b5c111561444357565b7f0f4ae0e4000000000000000000000000000000000000000000000000000000005f5260045ffdfea2646970667358221220229a5cf89aa7c2d0a4b4d5db20bba6c2b3a74b080303fc6ec00ba582a5dcf75164736f6c634300081a0033","deployedBytecode":"0x60806040526004361015610072575b3615610018575f80fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361004a57005b7f0540ddf6000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f3560e01c806308a465f614610e9d57806319c6989f1461084e578063286f580d146107b75780632950286e146106cc57806354fd4d501461058f5780635a3c3987146105665780635e01eb5a146105215780638a12a08c146104c65780638eb1b65e146103bf578063945ed33f14610344578063ac9650d8146103005763e3b5dff40361000e57346102fc576060806003193601126102fc5767ffffffffffffffff6004358181116102fc5761012d9036906004016112c4565b6101356111a1565b6044359283116102fc57610150610158933690600401610fcd565b9390916128b9565b905f5b835181101561017c57805f8761017360019488611691565b5101520161015b565b506101f06101fe610239946101b65f94886040519361019a8561111a565b30855260208501525f1960408501528660608501523691611381565b60808201526040519283917f8a12a08c0000000000000000000000000000000000000000000000000000000060208401526024830161143e565b03601f198101835282611152565b604051809481927fedfa3568000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39261028e915f916102cf575b50602080825183010191016115d4565b909391926102a7575b60405193849384610f2f565b0390f35b5f7f00000000000000000000000000000000000000000000000000000000000000005d610297565b6102eb91503d805f833e6102e38183611152565b81019061154d565b8461027e565b6040513d5f823e3d90fd5b5f80fd5b60206003193601126102fc5760043567ffffffffffffffff81116102fc576103386103326102a3923690600401610f9c565b9061179b565b60405191829182611020565b346102fc5761035236610eca565b61035a611945565b610362611972565b6103906102a3610371836128fb565b9193909461038a606061038383611344565b9201611358565b90612729565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d60405193849384610f2f565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576103ec9036906004016112c4565b906103f56111b7565b906064359081116102fc576101f061048b6102399461045161041c5f953690600401610fcd565b610425336128b9565b97604051946104338661111a565b33865260208601526024356040860152151560608501523691611381565b60808201526040519283917f945ed33f000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b604051809481927f48c89491000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b346102fc576102a36104ef6104da36610eca565b6104e2611945565b6104ea611972565b611a3b565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f009492945d60405193849384610f2f565b346102fc575f6003193601126102fc5760207f00000000000000000000000000000000000000000000000000000000000000005c6001600160a01b0360405191168152f35b346102fc576102a36104ef61057a36610eca565b610582611945565b61058a611972565b6128fb565b346102fc575f6003193601126102fc576040515f80549060018260011c91600184169182156106c2575b60209485851084146106955785879486865291825f146106575750506001146105fe575b506105ea92500383611152565b6102a3604051928284938452830190610ffb565b5f808052859250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b85831061063f5750506105ea9350820101856105dd565b80548389018501528794508693909201918101610628565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016858201526105ea95151560051b85010192508791506105dd9050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b92607f16926105b9565b346102fc5760606003193601126102fc5767ffffffffffffffff6004358181116102fc576106fe9036906004016112c4565b906107076111a1565b6044359182116102fc5761072261072a923690600401610fcd565b9290916128b9565b905f5b845181101561075f57806fffffffffffffffffffffffffffffffff604061075660019489611691565b5101520161072d565b506101f06101fe8561077d5f94610239976040519361019a8561111a565b60808201526040519283917f5a3c3987000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576107e49036906004016112c4565b906107ed6111b7565b906064359081116102fc576101f061048b6102399461081461041c5f953690600401610fcd565b60808201526040519283917f08a465f60000000000000000000000000000000000000000000000000000000060208401526024830161143e565b60a06003193601126102fc5767ffffffffffffffff600435116102fc573660236004350112156102fc5767ffffffffffffffff60043560040135116102fc5736602460c060043560040135026004350101116102fc5760243567ffffffffffffffff81116102fc576108c4903690600401610f9c565b67ffffffffffffffff604435116102fc576060600319604435360301126102fc5760643567ffffffffffffffff81116102fc57610905903690600401610fcd565b60843567ffffffffffffffff81116102fc57610925903690600401610f9c565b949093610930611945565b806004356004013503610e75575f5b600435600401358110610bd25750505060443560040135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd6044353603018212156102fc57816044350160048101359067ffffffffffffffff82116102fc5760248260071b36039101136102fc576109e3575b6102a361033886865f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d61179b565b6001600160a01b039492947f0000000000000000000000000000000000000000000000000000000000000000163b156102fc57604051947f2a2d80d10000000000000000000000000000000000000000000000000000000086523360048701526060602487015260c486019260443501602481019367ffffffffffffffff6004830135116102fc57600482013560071b360385136102fc5760606064890152600482013590529192869260e484019291905f905b60048101358210610b5457505050602091601f19601f865f9787956001600160a01b03610ac860246044350161118d565b16608488015260448035013560a48801526003198787030160448801528186528786013787868286010152011601030181836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39361033893610b45575b8294508193506109b3565b610b4e90611106565b84610b3a565b9195945091926001600160a01b03610b6b8761118d565b168152602080870135916001600160a01b0383168093036102fc57600492600192820152610b9b604089016128a6565b65ffffffffffff8091166040830152610bb660608a016128a6565b1660608201526080809101970193019050889495939291610a97565b610be7610be082848661192a565b3691611381565b604051610bf3816110a1565b5f81526020915f838301525f60408301528281015190606060408201519101515f1a91835283830152604082015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc81850260043501360301126102fc5760405190610c60826110ea565b610c73602460c08602600435010161118d565b808352610c89604460c08702600435010161118d565b908185850152610ca2606460c08802600435010161118d565b60408581019190915260043560c08802016084810135606087015260a4810135608087015260c4013560a086015283015183519386015160ff91909116926001600160a01b0383163b156102fc575f6001600160a01b03809460e4948b98849860c460c06040519c8d9b8c9a7fd505accf000000000000000000000000000000000000000000000000000000008c521660048b01523060248b0152608482820260043501013560448b0152026004350101356064880152608487015260a486015260c4850152165af19081610e66575b50610e5c57610d7f612877565b906001600160a01b0381511690836001600160a01b0381830151166044604051809581937fdd62ed3e00000000000000000000000000000000000000000000000000000000835260048301523060248301525afa9182156102f1575f92610e2c575b506060015103610df75750506001905b0161093f565b805115610e045780519101fd5b7fa7285689000000000000000000000000000000000000000000000000000000005f5260045ffd5b9091508381813d8311610e55575b610e448183611152565b810103126102fc5751906060610de1565b503d610e3a565b5050600190610df1565b610e6f90611106565b8a610d72565b7faaad13f7000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102fc57610eab36610eca565b610eb3611945565b610ebb611972565b6103906102a361037183611a3b565b600319906020828201126102fc576004359167ffffffffffffffff83116102fc578260a0920301126102fc5760040190565b9081518082526020808093019301915f5b828110610f1b575050505090565b835185529381019392810192600101610f0d565b939290610f4490606086526060860190610efc565b936020948181036020830152602080855192838152019401905f5b818110610f7f57505050610f7c9394506040818403910152610efc565b90565b82516001600160a01b031686529487019491870191600101610f5f565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc576020808501948460051b0101116102fc57565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc57602083818601950101116102fc57565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6020808201906020835283518092526040830192602060408460051b8301019501935f915b8483106110555750505050505090565b9091929394958480611091837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a51610ffb565b9801930193019194939290611045565b6060810190811067ffffffffffffffff8211176110bd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60c0810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd57604052565b60a0810190811067ffffffffffffffff8211176110bd57604052565b60e0810190811067ffffffffffffffff8211176110bd57604052565b90601f601f19910116810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd5760051b60200190565b35906001600160a01b03821682036102fc57565b602435906001600160a01b03821682036102fc57565b6044359081151582036102fc57565b9190916080818403126102fc57604090815191608083019467ffffffffffffffff95848110878211176110bd57825283956112008461118d565b8552602090818501359081116102fc57840182601f820112156102fc5780359061122982611175565b9361123686519586611152565b82855283850190846060809502840101928184116102fc578501915b8383106112745750505050508401528181013590830152606090810135910152565b84838303126102fc57875190611289826110a1565b6112928461118d565b825261129f87850161118d565b87830152888401359081151582036102fc578288928b89950152815201920191611252565b81601f820112156102fc578035916020916112de84611175565b936112ec6040519586611152565b808552838086019160051b830101928084116102fc57848301915b8483106113175750505050505090565b823567ffffffffffffffff81116102fc578691611339848480948901016111c6565b815201920191611307565b356001600160a01b03811681036102fc5790565b3580151581036102fc5790565b67ffffffffffffffff81116110bd57601f01601f191660200190565b92919261138d82611365565b9161139b6040519384611152565b8294818452818301116102fc578281602093845f960137010152565b9060808101916001600160a01b03808251168352602093848301519460808186015285518092528060a086019601925f905b83821061140b5750505050506060816040829301516040850152015191015290565b845180518216895280840151821689850152604090810151151590890152606090970196938201936001909101906113e9565b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106114bd5750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b909192939583806114f8837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611481565b81601f820112156102fc5780519061151e82611365565b9261152c6040519485611152565b828452602083830101116102fc57815f9260208093018386015e8301015290565b906020828203126102fc57815167ffffffffffffffff81116102fc57610f7c9201611507565b9080601f830112156102fc5781519060209161158e81611175565b9361159c6040519586611152565b81855260208086019260051b8201019283116102fc57602001905b8282106115c5575050505090565b815181529083019083016115b7565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc5784611600918301611573565b936020808301518581116102fc5783019082601f830112156102fc5781519161162883611175565b926116366040519485611152565b808452828085019160051b830101918583116102fc578301905b82821061167257505050509360408301519081116102fc57610f7c9201611573565b81516001600160a01b03811681036102fc578152908301908301611650565b80518210156116a55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106117515750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b9091929395838061178c837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611715565b91906117a6336128b9565b907f000000000000000000000000000000000000000000000000000000000000000093845c6118b1576001906001865d6117df83611175565b926117ed6040519485611152565b808452601f196117fc82611175565b015f5b8181106118a05750505f5b8181106118575750505050905f61184c92945d7f0000000000000000000000000000000000000000000000000000000000000000805c9161184e575b506136b1565b565b5f905d5f611846565b806118845f8061186c610be08996888a61192a565b602081519101305af461187d612877565b903061415c565b61188e8288611691565b526118998187611691565b500161180a565b8060606020809389010152016117ff565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc576020019181360383136102fc57565b908210156116a5576119419160051b8101906118d9565b9091565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805c6118b1576001905d565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036119a457565b7f089676d5000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b906119da82611175565b6119e76040519182611152565b828152601f196119f78294611175565b0190602036910137565b91908201809211611a0e57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b604081013542116126c35790611a5e611a5760208401846136f4565b90506119d0565b915f5b611a6e60208301836136f4565b90508110156125c757611a9881611a93611a8b60208601866136f4565b369391613748565b6111c6565b936040850151936001600160a01b038651169060208701518051156116a55760200151604001511515806125be575b1561256357611aec611ad886611344565b8784611ae660608a01611358565b92613add565b5f5b60208801515181101561255357611b03613788565b6020890151515f198101908111611a0e578214806020830152821582525f1461254c576060890151905b611b3b8360208c0151611691565b51604081015190919015611cee57611bd36001600160a01b03835116936001600160a01b03881685145f14611ce7576001945b60405195611b7b8761111a565b5f8752611b87816137be565b6020870152604086015260609485918d838301526080820152604051809381927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611cb0575b50506020015115611c9657816001600160a01b036020611c909360019695611c388c8c611691565b5201611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b5051167f000000000000000000000000000000000000000000000000000000000000000061420a565b01611aee565b602001519097506001600160a01b03169250600190611c90565b60209294509081611cd592903d10611ce0575b611ccd8183611152565b8101906137f5565b91505092905f611c10565b503d611cc3565b5f94611b6e565b888a6001600160a01b038495945116806001600160a01b038a16145f14612132575050815115905061206e57888a80151580612053575b611f4d575b6001600160a01b03939291611ddd82611e15978b5f95897f0000000000000000000000000000000000000000000000000000000000000000921680885282602052604088205c611f3c575b5050505b6001611d9c8983511660208401998b8b51169080158a14611f3657508391614223565b999092511694611db1608091828101906118d9565b93909460405197611dc1896110ea565b8852306020890152604088015260608701528501523691611381565b60a0820152604051809681927f21457897000000000000000000000000000000000000000000000000000000008352600483016139b1565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611f0c575b506020015115611ee95791611ebc826001600160a01b0360019695611e7a611ee49686611691565b51611e858d8d611691565b52611eb3828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b50511692611691565b51907f000000000000000000000000000000000000000000000000000000000000000061420a565b611c90565b98506001929450611f02906001600160a01b0392611691565b5197511692611c90565b6020919450611f2c903d805f833e611f248183611152565b810190613969565b5094919050611e52565b91614223565b611f4592614341565b5f8281611d75565b50611f5a90929192611344565b91611f648b6142fd565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039485166004820152306024820152908416604482015292871660648401525f8380608481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f1578a611ddd8d611e15976001600160a01b03975f95612044575b50975092505091929350611d2a565b61204d90611106565b5f612035565b5061205d82611344565b6001600160a01b0316301415611d25565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916001600160a01b0384511692803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03949094166004850152306024850152604484018c90525f908490606490829084905af180156102f1578a611ddd8d611e15976001600160a01b03975f95612123575b50611d79565b61212c90611106565b5f61211d565b6001600160a01b0360208796949701511690898183145f146123d7576121cd925061220597915060016121735f96956001600160a01b0393848b5116614223565b509282895116956020890151151588146123ae5761219082611344565b945b6121a1608093848101906118d9565b959096604051996121b18b6110ea565b8a52166020890152604088015260608701528501523691611381565b60a0820152604051809581927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f1575f93612384575b5060200151156122c357816001600160a01b036020611ee493600196956122698c8c611691565b526122998383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b60208181015191516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101859052939a50909116945081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612359575b50600190611c90565b602090813d831161237d575b61236f8183611152565b810103126102fc575f612350565b503d612365565b60209193506123a4903d805f833e61239c8183611152565b81019061387c565b5093919050612242565b837f00000000000000000000000000000000000000000000000000000000000000001694612192565b6001600160a01b036124669561242e9394956123f860809b8c8101906118d9565b9390946040519761240889611136565b5f8952602089015216604087015260609a8b978888015286015260a08501523691611381565b60c0820152604051809381927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612525575b50506020015115611c9657816001600160a01b036020611ee493600196956124cb8c8c611691565b526124fb8383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b6020929450908161254192903d10611ce057611ccd8183611152565b91505092905f6124a3565b5f90611b2d565b5091955090935050600101611a61565b61258d827f00000000000000000000000000000000000000000000000000000000000000006141c0565b506125b986837f000000000000000000000000000000000000000000000000000000000000000061420a565b611aec565b50321515611ac7565b50506125f27f0000000000000000000000000000000000000000000000000000000000000000613a71565b916125fd83516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b0380612663838b611691565b51165f528560205261269160405f205c8261267e858d611691565b51165f528860205260405f205c90611a01565b61269b8387611691565b526126a6828a611691565b51165f52856020525f604081205d01612644565b50949391509150565b7fe08b8af0000000000000000000000000000000000000000000000000000000005f5260045ffd5b905f198201918213600116611a0e57565b7f80000000000000000000000000000000000000000000000000000000000000008114611a0e575f190190565b907f000000000000000000000000000000000000000000000000000000000000000090815c7f0000000000000000000000000000000000000000000000000000000000000000612779815c6126eb565b907f0000000000000000000000000000000000000000000000000000000000000000915b5f81121561283a575050506127b1906126eb565b917f0000000000000000000000000000000000000000000000000000000000000000925b5f8112156127ea575050505061184c906136b1565b61283590825f5261282f60205f83828220015c91828252888152886040916128228a8d8587205c906001600160a01b03891690613eb0565b8484525281205d84613e0d565b506126fc565b6127d5565b61287290825f5261282f60205f8a8785848420015c938484528181526128228c6040948587205c906001600160a01b03891690613add565b61279d565b3d156128a1573d9061288882611365565b916128966040519384611152565b82523d5f602084013e565b606090565b359065ffffffffffff821682036102fc57565b905f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03815c16156128f1575050565b909192505d600190565b90604082013542116126c357612917611a5760208401846136f4565b915f5b61292760208301836136f4565b90508110156135d15761294481611a93611a8b60208601866136f4565b60608101519061297e6001600160a01b038251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506020810151515f198101908111611a0e575b5f8112156129a45750505060010161291a565b6129b2816020840151611691565b516129bb613788565b9082156020830152602084015151805f19810111611a0e575f1901831480835261358f575b6020820151156135545760408401516001600160a01b03855116915b604081015115612c1d5783916001600160a01b036060926020612aa0970151151580612c14575b612bed575b5116906001600160a01b0385168203612be6576001915b60405192612a4c8461111a565b60018452612a59816137be565b6020840152604083015288838301526080820152604051809581927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f95612bbf575b506020015115612bb057612ba69284612b02612bab979694612b7594611691565b52612b366001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506001600160a01b03612b4d8460408a01516137b1565b91167f000000000000000000000000000000000000000000000000000000000000000061420a565b6001600160a01b038551167f000000000000000000000000000000000000000000000000000000000000000061420a565b6126fc565b612991565b505050612bab919350926126fc565b6020919550612bdc9060603d606011611ce057611ccd8183611152565b5095919050612ae1565b5f91612a3f565b612c0f612bf98d611344565b8d8b611ae6886040888451169301519301611358565b612a28565b50321515612a23565b906001600160a01b03825116806001600160a01b038516145f14613137575060208401516130495750604051927f967870920000000000000000000000000000000000000000000000000000000084526001600160a01b03831660048501526020846024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156102f1575f94613015575b5083916001600160a01b038151166001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015230602482015260448101959095525f8580606481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f157612dec955f92613006575b505b611ddd6001600160a01b03612da88b828551168360208701511690614223565b50925116918c6002612dbf608092838101906118d9565b92909360405196612dcf886110ea565b875230602088015289604088015260608701528501523691611381565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612fe3575b506020015115612ecf57908291612bab9493612e45898d611691565b52612e7a836001600160a01b0384167f000000000000000000000000000000000000000000000000000000000000000061420a565b80831080612eb4575b612e90575b5050506126fc565b612ea6612eac93612ea08b611344565b926137b1565b91614356565b5f8080612e88565b50306001600160a01b03612ec78b611344565b161415612e83565b9450908094808210612ee8575b505050612bab906126fc565b91612ef8602092612f77946137b1565b90612f2d826001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683614356565b60405193849283927f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612fb8575b8080612edc565b602090813d8311612fdc575b612fce8183611152565b810103126102fc575f612fb1565b503d612fc4565b6020919450612ffb903d805f833e611f248183611152565b509094919050612e29565b61300f90611106565b5f612d86565b9093506020813d602011613041575b8161303160209383611152565b810103126102fc5751925f612cbc565b3d9150613024565b909261305489611344565b6001600160a01b033091160361306f575b5f612dec94612d88565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936130a38a611344565b6130ac846142fd565b90863b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152306024820152918116604483015285166064820152945f908690608490829084905af19081156102f157612dec955f92613128575b50945050613065565b61313190611106565b5f61311f565b6001600160a01b036020849695940151168a8282145f1461340b5750505061320c61316e5f92846001600160a01b03885116614223565b92906131d48c6001600160a01b03808a5116938951151586146133df576131a361319784611344565b935b60808101906118d9565b929093604051966131b3886110ea565b875216602086015260408501528c6060850152600260808501523691611381565b60a0820152604051809381927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f1575f916133c4575b5060208401518c908a90156133aa5783836001600160a01b03936132836132899461327c8f9c9b9a98996132b29a611691565b5192611691565b52611691565b5191167f000000000000000000000000000000000000000000000000000000000000000061420a565b51156132f457612bab92916001600160a01b036020612ba6930151167f0000000000000000000000000000000000000000000000000000000000000000614341565b516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810191909152602081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f15761337f575b50612bab906126fc565b602090813d83116133a3575b6133958183611152565b810103126102fc575f613375565b503d61338b565b50509091506133bb92939650611691565b519384916132b2565b6133d891503d805f833e61239c8183611152565b9050613249565b6131a3827f00000000000000000000000000000000000000000000000000000000000000001693613199565b61349e965090613466916060948b61342b608099989993848101906118d9565b9390946040519761343b89611136565b6001895260208901526001600160a01b038b1660408901528888015286015260a08501523691611381565b60c0820152604051809581927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f9561352d575b506020015115612bb057612ba69284613505612bab9796946001600160a01b0394611691565b52167f000000000000000000000000000000000000000000000000000000000000000061420a565b602091955061354a9060603d606011611ce057611ccd8183611152565b50959190506134df565b6fffffffffffffffffffffffffffffffff6001600160a01b0360206135858188015161357f886126eb565b90611691565b51015116916129fc565b6135cc856001600160a01b0360208401611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b6129e0565b50506135fc7f0000000000000000000000000000000000000000000000000000000000000000613a71565b9161360783516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b038061366d838b611691565b51165f528560205261368860405f205c8261267e858d611691565b6136928387611691565b5261369d828a611691565b51165f52856020525f604081205d0161364e565b4780156136f0577f00000000000000000000000000000000000000000000000000000000000000005c6136f0576001600160a01b0361184c92166140e0565b5050565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc57602001918160051b360383136102fc57565b91908110156116a55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81813603018212156102fc570190565b604051906040820182811067ffffffffffffffff8211176110bd576040525f6020838281520152565b91908203918211611a0e57565b600211156137c857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b908160609103126102fc578051916040602083015192015190565b61010060c0610f7c93602084528051613828816137be565b602085015260208101516001600160a01b0380911660408601528060408301511660608601526060820151166080850152608081015160a085015260a08101518285015201519160e0808201520190610ffb565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc57846138a8918301611573565b9360208201519360408301519081116102fc57610f7c9201611507565b9081518082526020808093019301915f5b8281106138e4575050505090565b8351855293810193928101926001016138d6565b602081526001600160a01b038083511660208301526020830151166040820152613931604083015160c0606084015260e08301906138c5565b9060608301516080820152608083015160058110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b916060838303126102fc5782519260208101519267ffffffffffffffff938481116102fc578161399a918401611573565b9360408301519081116102fc57610f7c9201611507565b602081526001600160a01b038083511660208301526020830151166040820152604082015160608201526139f4606083015160c0608084015260e08301906138c5565b90608083015160048110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b91909160808060a08301948051613a38816137be565b84526020810151613a48816137be565b60208501526001600160a01b036040820151166040850152606081015160608501520151910152565b90815c613a7d81611175565b613a8a6040519182611152565b818152613a9682611175565b601f196020910136602084013781945f5b848110613ab5575050505050565b600190825f5280845f20015c6001600160a01b03613ad38388611691565b9116905201613aa7565b919280613dd8575b15613c51575050804710613c29576001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001691823b156102fc57604051907fd0e30db00000000000000000000000000000000000000000000000000000000082525f915f8160048185895af180156102f157613c12575b506044602092937f00000000000000000000000000000000000000000000000000000000000000001694613b98838783614356565b8460405196879485937f15afd409000000000000000000000000000000000000000000000000000000008552600485015260248401525af1908115613c065750613bdf5750565b602090813d8311613bff575b613bf58183611152565b810103126102fc57565b503d613beb565b604051903d90823e3d90fd5b60209250613c1f90611106565b60445f9250613b63565b7fa01a9df6000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915f9080613c61575b50505050565b6001600160a01b0393847f00000000000000000000000000000000000000000000000000000000000000001694807f00000000000000000000000000000000000000000000000000000000000000001691613cbb846142fd565b96803b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152848316602482015297821660448901529186161660648701525f908690608490829084905af19485156102f157613d8095613dc4575b5082936020936040518097819582947f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03925af1908115613c065750613d99575b808080613c5b565b602090813d8311613dbd575b613daf8183611152565b810103126102fc575f613d91565b503d613da5565b60209350613dd190611106565b5f92613d2f565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690821614613ae5565b6001810191805f5260209183835260405f205c8015155f14613ea7575f1990818101835c8380820191828403613e6a575b5050505050815c81810192818411611a0e575f93815d835284832001015d5f52525f604081205d600190565b613e77613e87938861443a565b865f52885f2001015c918561443a565b835f52808383885f2001015d5f5285855260405f205d5f80808381613e3e565b50505050505f90565b5f949383156140d857806140a3575b15614007576001600160a01b0391827f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03929092166004830152306024830152604482018590525f908290606490829084905af180156102f157613ff4575b5084827f000000000000000000000000000000000000000000000000000000000000000016803b15613ff05781906024604051809481937f2e1a7d4d0000000000000000000000000000000000000000000000000000000083528960048401525af18015613fe557613fcd575b5061184c939450166140e0565b613fd78691611106565b613fe15784613fc0565b8480fd5b6040513d88823e3d90fd5b5080fd5b613fff919550611106565b5f935f613f53565b929350906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015293909216602484015260448301525f908290606490829084905af180156102f15761409a5750565b61184c90611106565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690831614613ebf565b505050509050565b814710614130575f8080936001600160a01b038294165af1614100612877565b501561410857565b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fcd786059000000000000000000000000000000000000000000000000000000005f523060045260245ffd5b90614171575080511561410857805190602001fd5b815115806141b7575b614182575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561417a565b6001810190825f528160205260405f205c155f1461420357805c815f52838160205f20015d60018101809111611a0e57815d5c915f5260205260405f205d600190565b5050505f90565b905f5260205261421f60405f2091825c611a01565b905d565b916044929391936001600160a01b03604094859282808551998a9586947fc9c1661b0000000000000000000000000000000000000000000000000000000086521660048501521660248301527f0000000000000000000000000000000000000000000000000000000000000000165afa9384156142f3575f935f956142bc575b50506142b96142b285946119d0565b9485611691565b52565b809295508194503d83116142ec575b6142d58183611152565b810103126102fc5760208251920151925f806142a3565b503d6142cb565b83513d5f823e3d90fd5b6001600160a01b0390818111614311571690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f5260a060045260245260445ffd5b905f5260205261421f60405f2091825c6137b1565b6040519260208401907fa9059cbb0000000000000000000000000000000000000000000000000000000082526001600160a01b038094166024860152604485015260448452608084019084821067ffffffffffffffff8311176110bd576143d5935f9384936040521694519082865af16143ce612877565b908361415c565b8051908115159182614416575b50506143eb5750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b81925090602091810103126102fc57602001518015908115036102fc575f806143e2565b5c111561444357565b7f0f4ae0e4000000000000000000000000000000000000000000000000000000005f5260045ffdfea2646970667358221220229a5cf89aa7c2d0a4b4d5db20bba6c2b3a74b080303fc6ec00ba582a5dcf75164736f6c634300081a0033","linkReferences":{},"deployedLinkReferences":{}} \ No newline at end of file +{ + "_format": "hh-sol-artifact-1", + "contractName": "BatchRouter", + "sourceName": "contracts/BatchRouter.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "contract IWETH", + "name": "weth", + "type": "address" + }, + { + "internalType": "contract IPermit2", + "name": "permit2", + "type": "address" + }, + { + "internalType": "string", + "name": "routerVersion", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "ErrorSelectorNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "EthTransfer", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientEth", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SenderIsNotVault", + "type": "error" + }, + { + "inputs": [], + "name": "SwapDeadline", + "type": "error" + }, + { + "inputs": [], + "name": "TransientIndexOutOfBounds", + "type": "error" + }, + { + "inputs": [], + "name": "getSender", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "internalType": "struct IRouterCommon.PermitApproval[]", + "name": "permitBatch", + "type": "tuple[]" + }, + { + "internalType": "bytes[]", + "name": "permitSignatures", + "type": "bytes[]" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "internalType": "uint48", + "name": "expiration", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "nonce", + "type": "uint48" + } + ], + "internalType": "struct IAllowanceTransfer.PermitDetails[]", + "name": "details", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sigDeadline", + "type": "uint256" + } + ], + "internalType": "struct IAllowanceTransfer.PermitBatch", + "name": "permit2Batch", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "permit2Signature", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "multicallData", + "type": "bytes[]" + } + ], + "name": "permitBatchAndCall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "exactAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountIn[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "querySwapExactIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensOut", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "exactAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountIn[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "wethIsEth", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IBatchRouter.SwapExactInHookParams", + "name": "params", + "type": "tuple" + } + ], + "name": "querySwapExactInHook", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensOut", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "maxAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exactAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountOut[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "querySwapExactOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensIn", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "maxAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exactAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountOut[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "wethIsEth", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IBatchRouter.SwapExactOutHookParams", + "name": "params", + "type": "tuple" + } + ], + "name": "querySwapExactOutHook", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensIn", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "exactAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountIn[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "wethIsEth", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "swapExactIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensOut", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "exactAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountIn[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "wethIsEth", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IBatchRouter.SwapExactInHookParams", + "name": "params", + "type": "tuple" + } + ], + "name": "swapExactInHook", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensOut", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "maxAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exactAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountOut[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "wethIsEth", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "swapExactOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensIn", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bool", + "name": "isBuffer", + "type": "bool" + } + ], + "internalType": "struct IBatchRouter.SwapPathStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "maxAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exactAmountOut", + "type": "uint256" + } + ], + "internalType": "struct IBatchRouter.SwapPathExactAmountOut[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "wethIsEth", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IBatchRouter.SwapExactOutHookParams", + "name": "params", + "type": "tuple" + } + ], + "name": "swapExactOutHook", + "outputs": [ + { + "internalType": "uint256[]", + "name": "pathAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "tokensIn", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x6101c0604090808252346105c957614bbd803803809161001f82856105e8565b83398101916080828403126105c95781516001600160a01b03939084811681036105c957602093848101519286841684036105c9578482015196871687036105c95760608201516001600160401b03928382116105c9570192601f908282860112156105c95784518481116105b557601f19958851946100a58b898786011601876105e8565b8286528a83830101116105c957815f928b8093018388015e8501015260805281519283116105b5575f54916001928381811c911680156105ab575b8982101461059757828111610554575b50879184116001146104f757839450908392915f946104ec575b50501b915f199060031b1c1916175f555b61014961012661060b565b835190610132826105cd565b600682526539b2b73232b960d11b86830152610669565b60a05261018561015761060b565b835190610163826105cd565b60118252701a5cd4995d1d5c9b915d1a131bd8dad959607a1b86830152610669565b60c05260e0526101009283526101cd815161019f816105cd565b601381527f63757272656e7453776170546f6b656e73496e0000000000000000000000000084820152610633565b9161012092835261021082516101e2816105cd565b601481527f63757272656e7453776170546f6b656e734f757400000000000000000000000083820152610633565b6101409081526102528351610224816105cd565b601981527f63757272656e7453776170546f6b656e496e416d6f756e74730000000000000084820152610633565b906101609182526102d8610298855161026a816105cd565b601a81527f63757272656e7453776170546f6b656e4f7574416d6f756e747300000000000086820152610633565b936101809485527f736574746c6564546f6b656e416d6f756e7473000000000000000000000000008651916102cc836105cd565b60138352820152610633565b936101a094855251946144a1968761071c88396080518781816102460152818161197c01528181611be001528181611e22015281816120790152818161221201528181612323015281816123b10152818161247301528181612aad01528181612c8c01528181612cd401528181612d5201528181612df901528181612f0701528181612f840152818161321901528181613348015281816133e5015281816134ab01528181613b6c01528181613c9101528181613ed0015281816140150152614271015260a0518781816102aa015281816105350152818161181f01526128be015260c0518781816117a901526136ba015260e051878181602201528181613afe01528181613de401528181613f5801526140af0152518681816109f001528181610b0401528181611f6e01528181611ff4015281816130790152613c6d015251858181612569015281816127500152818161295a01526135d8015251848181611c4301528181611e8f01528181612275015281816124d7015281816125ce0152818161272c01528181612b1201526135a8015251838181611d43015281816125950152818161277c0152818161328e01528181613509015261362b015251828181611c6c01528181611ec00152818161250101528181612621015281816127b401528181612b5101526132d001525181818161229f015281816125ff01528181612b8201528181612e5601526136090152f35b015192505f8061010a565b91938316915f805283885f20935f5b8a8883831061053d5750505010610525575b505050811b015f5561011b565b01515f1960f88460031b161c191690555f8080610518565b868601518855909601959485019487935001610506565b5f8052885f208380870160051c8201928b881061058e575b0160051c019084905b8281106105835750506100f0565b5f8155018490610575565b9250819261056c565b634e487b7160e01b5f52602260045260245ffd5b90607f16906100e0565b634e487b7160e01b5f52604160045260245ffd5b5f80fd5b604081019081106001600160401b038211176105b557604052565b601f909101601f19168101906001600160401b038211908210176105b557604052565b60405190610618826105cd565b600c82526b2937baba32b921b7b6b6b7b760a11b6020830152565b61066690604051610643816105cd565b60118152702130ba31b42937baba32b921b7b6b6b7b760791b6020820152610669565b90565b906106d6603a60209260405193849181808401977f62616c616e6365722d6c6162732e76332e73746f726167652e000000000000008952805191829101603986015e830190601760f91b60398301528051928391018583015e015f8382015203601a8101845201826105e8565b5190205f198101908111610707576040519060208201908152602082526106fc826105cd565b9051902060ff191690565b634e487b7160e01b5f52601160045260245ffdfe60806040526004361015610072575b3615610018575f80fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361004a57005b7f0540ddf6000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f3560e01c806308a465f614610e9d57806319c6989f1461084e578063286f580d146107b75780632950286e146106cc57806354fd4d501461058f5780635a3c3987146105665780635e01eb5a146105215780638a12a08c146104c65780638eb1b65e146103bf578063945ed33f14610344578063ac9650d8146103005763e3b5dff40361000e57346102fc576060806003193601126102fc5767ffffffffffffffff6004358181116102fc5761012d9036906004016112c4565b6101356111a1565b6044359283116102fc57610150610158933690600401610fcd565b9390916128b9565b905f5b835181101561017c57805f8761017360019488611691565b5101520161015b565b506101f06101fe610239946101b65f94886040519361019a8561111a565b30855260208501525f1960408501528660608501523691611381565b60808201526040519283917f8a12a08c0000000000000000000000000000000000000000000000000000000060208401526024830161143e565b03601f198101835282611152565b604051809481927fedfa3568000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39261028e915f916102cf575b50602080825183010191016115d4565b909391926102a7575b60405193849384610f2f565b0390f35b5f7f00000000000000000000000000000000000000000000000000000000000000005d610297565b6102eb91503d805f833e6102e38183611152565b81019061154d565b8461027e565b6040513d5f823e3d90fd5b5f80fd5b60206003193601126102fc5760043567ffffffffffffffff81116102fc576103386103326102a3923690600401610f9c565b9061179b565b60405191829182611020565b346102fc5761035236610eca565b61035a611945565b610362611972565b6103906102a3610371836128fb565b9193909461038a606061038383611344565b9201611358565b90612729565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d60405193849384610f2f565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576103ec9036906004016112c4565b906103f56111b7565b906064359081116102fc576101f061048b6102399461045161041c5f953690600401610fcd565b610425336128b9565b97604051946104338661111a565b33865260208601526024356040860152151560608501523691611381565b60808201526040519283917f945ed33f000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b604051809481927f48c89491000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b346102fc576102a36104ef6104da36610eca565b6104e2611945565b6104ea611972565b611a3b565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f009492945d60405193849384610f2f565b346102fc575f6003193601126102fc5760207f00000000000000000000000000000000000000000000000000000000000000005c6001600160a01b0360405191168152f35b346102fc576102a36104ef61057a36610eca565b610582611945565b61058a611972565b6128fb565b346102fc575f6003193601126102fc576040515f80549060018260011c91600184169182156106c2575b60209485851084146106955785879486865291825f146106575750506001146105fe575b506105ea92500383611152565b6102a3604051928284938452830190610ffb565b5f808052859250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b85831061063f5750506105ea9350820101856105dd565b80548389018501528794508693909201918101610628565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016858201526105ea95151560051b85010192508791506105dd9050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b92607f16926105b9565b346102fc5760606003193601126102fc5767ffffffffffffffff6004358181116102fc576106fe9036906004016112c4565b906107076111a1565b6044359182116102fc5761072261072a923690600401610fcd565b9290916128b9565b905f5b845181101561075f57806fffffffffffffffffffffffffffffffff604061075660019489611691565b5101520161072d565b506101f06101fe8561077d5f94610239976040519361019a8561111a565b60808201526040519283917f5a3c3987000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576107e49036906004016112c4565b906107ed6111b7565b906064359081116102fc576101f061048b6102399461081461041c5f953690600401610fcd565b60808201526040519283917f08a465f60000000000000000000000000000000000000000000000000000000060208401526024830161143e565b60a06003193601126102fc5767ffffffffffffffff600435116102fc573660236004350112156102fc5767ffffffffffffffff60043560040135116102fc5736602460c060043560040135026004350101116102fc5760243567ffffffffffffffff81116102fc576108c4903690600401610f9c565b67ffffffffffffffff604435116102fc576060600319604435360301126102fc5760643567ffffffffffffffff81116102fc57610905903690600401610fcd565b60843567ffffffffffffffff81116102fc57610925903690600401610f9c565b949093610930611945565b806004356004013503610e75575f5b600435600401358110610bd25750505060443560040135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd6044353603018212156102fc57816044350160048101359067ffffffffffffffff82116102fc5760248260071b36039101136102fc576109e3575b6102a361033886865f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d61179b565b6001600160a01b039492947f0000000000000000000000000000000000000000000000000000000000000000163b156102fc57604051947f2a2d80d10000000000000000000000000000000000000000000000000000000086523360048701526060602487015260c486019260443501602481019367ffffffffffffffff6004830135116102fc57600482013560071b360385136102fc5760606064890152600482013590529192869260e484019291905f905b60048101358210610b5457505050602091601f19601f865f9787956001600160a01b03610ac860246044350161118d565b16608488015260448035013560a48801526003198787030160448801528186528786013787868286010152011601030181836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39361033893610b45575b8294508193506109b3565b610b4e90611106565b84610b3a565b9195945091926001600160a01b03610b6b8761118d565b168152602080870135916001600160a01b0383168093036102fc57600492600192820152610b9b604089016128a6565b65ffffffffffff8091166040830152610bb660608a016128a6565b1660608201526080809101970193019050889495939291610a97565b610be7610be082848661192a565b3691611381565b604051610bf3816110a1565b5f81526020915f838301525f60408301528281015190606060408201519101515f1a91835283830152604082015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc81850260043501360301126102fc5760405190610c60826110ea565b610c73602460c08602600435010161118d565b808352610c89604460c08702600435010161118d565b908185850152610ca2606460c08802600435010161118d565b60408581019190915260043560c08802016084810135606087015260a4810135608087015260c4013560a086015283015183519386015160ff91909116926001600160a01b0383163b156102fc575f6001600160a01b03809460e4948b98849860c460c06040519c8d9b8c9a7fd505accf000000000000000000000000000000000000000000000000000000008c521660048b01523060248b0152608482820260043501013560448b0152026004350101356064880152608487015260a486015260c4850152165af19081610e66575b50610e5c57610d7f612877565b906001600160a01b0381511690836001600160a01b0381830151166044604051809581937fdd62ed3e00000000000000000000000000000000000000000000000000000000835260048301523060248301525afa9182156102f1575f92610e2c575b506060015103610df75750506001905b0161093f565b805115610e045780519101fd5b7fa7285689000000000000000000000000000000000000000000000000000000005f5260045ffd5b9091508381813d8311610e55575b610e448183611152565b810103126102fc5751906060610de1565b503d610e3a565b5050600190610df1565b610e6f90611106565b8a610d72565b7faaad13f7000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102fc57610eab36610eca565b610eb3611945565b610ebb611972565b6103906102a361037183611a3b565b600319906020828201126102fc576004359167ffffffffffffffff83116102fc578260a0920301126102fc5760040190565b9081518082526020808093019301915f5b828110610f1b575050505090565b835185529381019392810192600101610f0d565b939290610f4490606086526060860190610efc565b936020948181036020830152602080855192838152019401905f5b818110610f7f57505050610f7c9394506040818403910152610efc565b90565b82516001600160a01b031686529487019491870191600101610f5f565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc576020808501948460051b0101116102fc57565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc57602083818601950101116102fc57565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6020808201906020835283518092526040830192602060408460051b8301019501935f915b8483106110555750505050505090565b9091929394958480611091837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a51610ffb565b9801930193019194939290611045565b6060810190811067ffffffffffffffff8211176110bd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60c0810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd57604052565b60a0810190811067ffffffffffffffff8211176110bd57604052565b60e0810190811067ffffffffffffffff8211176110bd57604052565b90601f601f19910116810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd5760051b60200190565b35906001600160a01b03821682036102fc57565b602435906001600160a01b03821682036102fc57565b6044359081151582036102fc57565b9190916080818403126102fc57604090815191608083019467ffffffffffffffff95848110878211176110bd57825283956112008461118d565b8552602090818501359081116102fc57840182601f820112156102fc5780359061122982611175565b9361123686519586611152565b82855283850190846060809502840101928184116102fc578501915b8383106112745750505050508401528181013590830152606090810135910152565b84838303126102fc57875190611289826110a1565b6112928461118d565b825261129f87850161118d565b87830152888401359081151582036102fc578288928b89950152815201920191611252565b81601f820112156102fc578035916020916112de84611175565b936112ec6040519586611152565b808552838086019160051b830101928084116102fc57848301915b8483106113175750505050505090565b823567ffffffffffffffff81116102fc578691611339848480948901016111c6565b815201920191611307565b356001600160a01b03811681036102fc5790565b3580151581036102fc5790565b67ffffffffffffffff81116110bd57601f01601f191660200190565b92919261138d82611365565b9161139b6040519384611152565b8294818452818301116102fc578281602093845f960137010152565b9060808101916001600160a01b03808251168352602093848301519460808186015285518092528060a086019601925f905b83821061140b5750505050506060816040829301516040850152015191015290565b845180518216895280840151821689850152604090810151151590890152606090970196938201936001909101906113e9565b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106114bd5750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b909192939583806114f8837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611481565b81601f820112156102fc5780519061151e82611365565b9261152c6040519485611152565b828452602083830101116102fc57815f9260208093018386015e8301015290565b906020828203126102fc57815167ffffffffffffffff81116102fc57610f7c9201611507565b9080601f830112156102fc5781519060209161158e81611175565b9361159c6040519586611152565b81855260208086019260051b8201019283116102fc57602001905b8282106115c5575050505090565b815181529083019083016115b7565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc5784611600918301611573565b936020808301518581116102fc5783019082601f830112156102fc5781519161162883611175565b926116366040519485611152565b808452828085019160051b830101918583116102fc578301905b82821061167257505050509360408301519081116102fc57610f7c9201611573565b81516001600160a01b03811681036102fc578152908301908301611650565b80518210156116a55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106117515750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b9091929395838061178c837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611715565b91906117a6336128b9565b907f000000000000000000000000000000000000000000000000000000000000000093845c6118b1576001906001865d6117df83611175565b926117ed6040519485611152565b808452601f196117fc82611175565b015f5b8181106118a05750505f5b8181106118575750505050905f61184c92945d7f0000000000000000000000000000000000000000000000000000000000000000805c9161184e575b506136b1565b565b5f905d5f611846565b806118845f8061186c610be08996888a61192a565b602081519101305af461187d612877565b903061415c565b61188e8288611691565b526118998187611691565b500161180a565b8060606020809389010152016117ff565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc576020019181360383136102fc57565b908210156116a5576119419160051b8101906118d9565b9091565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805c6118b1576001905d565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036119a457565b7f089676d5000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b906119da82611175565b6119e76040519182611152565b828152601f196119f78294611175565b0190602036910137565b91908201809211611a0e57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b604081013542116126c35790611a5e611a5760208401846136f4565b90506119d0565b915f5b611a6e60208301836136f4565b90508110156125c757611a9881611a93611a8b60208601866136f4565b369391613748565b6111c6565b936040850151936001600160a01b038651169060208701518051156116a55760200151604001511515806125be575b1561256357611aec611ad886611344565b8784611ae660608a01611358565b92613add565b5f5b60208801515181101561255357611b03613788565b6020890151515f198101908111611a0e578214806020830152821582525f1461254c576060890151905b611b3b8360208c0151611691565b51604081015190919015611cee57611bd36001600160a01b03835116936001600160a01b03881685145f14611ce7576001945b60405195611b7b8761111a565b5f8752611b87816137be565b6020870152604086015260609485918d838301526080820152604051809381927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611cb0575b50506020015115611c9657816001600160a01b036020611c909360019695611c388c8c611691565b5201611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b5051167f000000000000000000000000000000000000000000000000000000000000000061420a565b01611aee565b602001519097506001600160a01b03169250600190611c90565b60209294509081611cd592903d10611ce0575b611ccd8183611152565b8101906137f5565b91505092905f611c10565b503d611cc3565b5f94611b6e565b888a6001600160a01b038495945116806001600160a01b038a16145f14612132575050815115905061206e57888a80151580612053575b611f4d575b6001600160a01b03939291611ddd82611e15978b5f95897f0000000000000000000000000000000000000000000000000000000000000000921680885282602052604088205c611f3c575b5050505b6001611d9c8983511660208401998b8b51169080158a14611f3657508391614223565b999092511694611db1608091828101906118d9565b93909460405197611dc1896110ea565b8852306020890152604088015260608701528501523691611381565b60a0820152604051809681927f21457897000000000000000000000000000000000000000000000000000000008352600483016139b1565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611f0c575b506020015115611ee95791611ebc826001600160a01b0360019695611e7a611ee49686611691565b51611e858d8d611691565b52611eb3828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b50511692611691565b51907f000000000000000000000000000000000000000000000000000000000000000061420a565b611c90565b98506001929450611f02906001600160a01b0392611691565b5197511692611c90565b6020919450611f2c903d805f833e611f248183611152565b810190613969565b5094919050611e52565b91614223565b611f4592614341565b5f8281611d75565b50611f5a90929192611344565b91611f648b6142fd565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039485166004820152306024820152908416604482015292871660648401525f8380608481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f1578a611ddd8d611e15976001600160a01b03975f95612044575b50975092505091929350611d2a565b61204d90611106565b5f612035565b5061205d82611344565b6001600160a01b0316301415611d25565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916001600160a01b0384511692803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03949094166004850152306024850152604484018c90525f908490606490829084905af180156102f1578a611ddd8d611e15976001600160a01b03975f95612123575b50611d79565b61212c90611106565b5f61211d565b6001600160a01b0360208796949701511690898183145f146123d7576121cd925061220597915060016121735f96956001600160a01b0393848b5116614223565b509282895116956020890151151588146123ae5761219082611344565b945b6121a1608093848101906118d9565b959096604051996121b18b6110ea565b8a52166020890152604088015260608701528501523691611381565b60a0820152604051809581927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f1575f93612384575b5060200151156122c357816001600160a01b036020611ee493600196956122698c8c611691565b526122998383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b60208181015191516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101859052939a50909116945081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612359575b50600190611c90565b602090813d831161237d575b61236f8183611152565b810103126102fc575f612350565b503d612365565b60209193506123a4903d805f833e61239c8183611152565b81019061387c565b5093919050612242565b837f00000000000000000000000000000000000000000000000000000000000000001694612192565b6001600160a01b036124669561242e9394956123f860809b8c8101906118d9565b9390946040519761240889611136565b5f8952602089015216604087015260609a8b978888015286015260a08501523691611381565b60c0820152604051809381927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612525575b50506020015115611c9657816001600160a01b036020611ee493600196956124cb8c8c611691565b526124fb8383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b6020929450908161254192903d10611ce057611ccd8183611152565b91505092905f6124a3565b5f90611b2d565b5091955090935050600101611a61565b61258d827f00000000000000000000000000000000000000000000000000000000000000006141c0565b506125b986837f000000000000000000000000000000000000000000000000000000000000000061420a565b611aec565b50321515611ac7565b50506125f27f0000000000000000000000000000000000000000000000000000000000000000613a71565b916125fd83516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b0380612663838b611691565b51165f528560205261269160405f205c8261267e858d611691565b51165f528860205260405f205c90611a01565b61269b8387611691565b526126a6828a611691565b51165f52856020525f604081205d01612644565b50949391509150565b7fe08b8af0000000000000000000000000000000000000000000000000000000005f5260045ffd5b905f198201918213600116611a0e57565b7f80000000000000000000000000000000000000000000000000000000000000008114611a0e575f190190565b907f000000000000000000000000000000000000000000000000000000000000000090815c7f0000000000000000000000000000000000000000000000000000000000000000612779815c6126eb565b907f0000000000000000000000000000000000000000000000000000000000000000915b5f81121561283a575050506127b1906126eb565b917f0000000000000000000000000000000000000000000000000000000000000000925b5f8112156127ea575050505061184c906136b1565b61283590825f5261282f60205f83828220015c91828252888152886040916128228a8d8587205c906001600160a01b03891690613eb0565b8484525281205d84613e0d565b506126fc565b6127d5565b61287290825f5261282f60205f8a8785848420015c938484528181526128228c6040948587205c906001600160a01b03891690613add565b61279d565b3d156128a1573d9061288882611365565b916128966040519384611152565b82523d5f602084013e565b606090565b359065ffffffffffff821682036102fc57565b905f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03815c16156128f1575050565b909192505d600190565b90604082013542116126c357612917611a5760208401846136f4565b915f5b61292760208301836136f4565b90508110156135d15761294481611a93611a8b60208601866136f4565b60608101519061297e6001600160a01b038251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506020810151515f198101908111611a0e575b5f8112156129a45750505060010161291a565b6129b2816020840151611691565b516129bb613788565b9082156020830152602084015151805f19810111611a0e575f1901831480835261358f575b6020820151156135545760408401516001600160a01b03855116915b604081015115612c1d5783916001600160a01b036060926020612aa0970151151580612c14575b612bed575b5116906001600160a01b0385168203612be6576001915b60405192612a4c8461111a565b60018452612a59816137be565b6020840152604083015288838301526080820152604051809581927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f95612bbf575b506020015115612bb057612ba69284612b02612bab979694612b7594611691565b52612b366001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506001600160a01b03612b4d8460408a01516137b1565b91167f000000000000000000000000000000000000000000000000000000000000000061420a565b6001600160a01b038551167f000000000000000000000000000000000000000000000000000000000000000061420a565b6126fc565b612991565b505050612bab919350926126fc565b6020919550612bdc9060603d606011611ce057611ccd8183611152565b5095919050612ae1565b5f91612a3f565b612c0f612bf98d611344565b8d8b611ae6886040888451169301519301611358565b612a28565b50321515612a23565b906001600160a01b03825116806001600160a01b038516145f14613137575060208401516130495750604051927f967870920000000000000000000000000000000000000000000000000000000084526001600160a01b03831660048501526020846024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156102f1575f94613015575b5083916001600160a01b038151166001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015230602482015260448101959095525f8580606481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f157612dec955f92613006575b505b611ddd6001600160a01b03612da88b828551168360208701511690614223565b50925116918c6002612dbf608092838101906118d9565b92909360405196612dcf886110ea565b875230602088015289604088015260608701528501523691611381565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612fe3575b506020015115612ecf57908291612bab9493612e45898d611691565b52612e7a836001600160a01b0384167f000000000000000000000000000000000000000000000000000000000000000061420a565b80831080612eb4575b612e90575b5050506126fc565b612ea6612eac93612ea08b611344565b926137b1565b91614356565b5f8080612e88565b50306001600160a01b03612ec78b611344565b161415612e83565b9450908094808210612ee8575b505050612bab906126fc565b91612ef8602092612f77946137b1565b90612f2d826001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683614356565b60405193849283927f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612fb8575b8080612edc565b602090813d8311612fdc575b612fce8183611152565b810103126102fc575f612fb1565b503d612fc4565b6020919450612ffb903d805f833e611f248183611152565b509094919050612e29565b61300f90611106565b5f612d86565b9093506020813d602011613041575b8161303160209383611152565b810103126102fc5751925f612cbc565b3d9150613024565b909261305489611344565b6001600160a01b033091160361306f575b5f612dec94612d88565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936130a38a611344565b6130ac846142fd565b90863b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152306024820152918116604483015285166064820152945f908690608490829084905af19081156102f157612dec955f92613128575b50945050613065565b61313190611106565b5f61311f565b6001600160a01b036020849695940151168a8282145f1461340b5750505061320c61316e5f92846001600160a01b03885116614223565b92906131d48c6001600160a01b03808a5116938951151586146133df576131a361319784611344565b935b60808101906118d9565b929093604051966131b3886110ea565b875216602086015260408501528c6060850152600260808501523691611381565b60a0820152604051809381927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f1575f916133c4575b5060208401518c908a90156133aa5783836001600160a01b03936132836132899461327c8f9c9b9a98996132b29a611691565b5192611691565b52611691565b5191167f000000000000000000000000000000000000000000000000000000000000000061420a565b51156132f457612bab92916001600160a01b036020612ba6930151167f0000000000000000000000000000000000000000000000000000000000000000614341565b516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810191909152602081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f15761337f575b50612bab906126fc565b602090813d83116133a3575b6133958183611152565b810103126102fc575f613375565b503d61338b565b50509091506133bb92939650611691565b519384916132b2565b6133d891503d805f833e61239c8183611152565b9050613249565b6131a3827f00000000000000000000000000000000000000000000000000000000000000001693613199565b61349e965090613466916060948b61342b608099989993848101906118d9565b9390946040519761343b89611136565b6001895260208901526001600160a01b038b1660408901528888015286015260a08501523691611381565b60c0820152604051809581927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f9561352d575b506020015115612bb057612ba69284613505612bab9796946001600160a01b0394611691565b52167f000000000000000000000000000000000000000000000000000000000000000061420a565b602091955061354a9060603d606011611ce057611ccd8183611152565b50959190506134df565b6fffffffffffffffffffffffffffffffff6001600160a01b0360206135858188015161357f886126eb565b90611691565b51015116916129fc565b6135cc856001600160a01b0360208401611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b6129e0565b50506135fc7f0000000000000000000000000000000000000000000000000000000000000000613a71565b9161360783516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b038061366d838b611691565b51165f528560205261368860405f205c8261267e858d611691565b6136928387611691565b5261369d828a611691565b51165f52856020525f604081205d0161364e565b4780156136f0577f00000000000000000000000000000000000000000000000000000000000000005c6136f0576001600160a01b0361184c92166140e0565b5050565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc57602001918160051b360383136102fc57565b91908110156116a55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81813603018212156102fc570190565b604051906040820182811067ffffffffffffffff8211176110bd576040525f6020838281520152565b91908203918211611a0e57565b600211156137c857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b908160609103126102fc578051916040602083015192015190565b61010060c0610f7c93602084528051613828816137be565b602085015260208101516001600160a01b0380911660408601528060408301511660608601526060820151166080850152608081015160a085015260a08101518285015201519160e0808201520190610ffb565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc57846138a8918301611573565b9360208201519360408301519081116102fc57610f7c9201611507565b9081518082526020808093019301915f5b8281106138e4575050505090565b8351855293810193928101926001016138d6565b602081526001600160a01b038083511660208301526020830151166040820152613931604083015160c0606084015260e08301906138c5565b9060608301516080820152608083015160058110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b916060838303126102fc5782519260208101519267ffffffffffffffff938481116102fc578161399a918401611573565b9360408301519081116102fc57610f7c9201611507565b602081526001600160a01b038083511660208301526020830151166040820152604082015160608201526139f4606083015160c0608084015260e08301906138c5565b90608083015160048110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b91909160808060a08301948051613a38816137be565b84526020810151613a48816137be565b60208501526001600160a01b036040820151166040850152606081015160608501520151910152565b90815c613a7d81611175565b613a8a6040519182611152565b818152613a9682611175565b601f196020910136602084013781945f5b848110613ab5575050505050565b600190825f5280845f20015c6001600160a01b03613ad38388611691565b9116905201613aa7565b919280613dd8575b15613c51575050804710613c29576001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001691823b156102fc57604051907fd0e30db00000000000000000000000000000000000000000000000000000000082525f915f8160048185895af180156102f157613c12575b506044602092937f00000000000000000000000000000000000000000000000000000000000000001694613b98838783614356565b8460405196879485937f15afd409000000000000000000000000000000000000000000000000000000008552600485015260248401525af1908115613c065750613bdf5750565b602090813d8311613bff575b613bf58183611152565b810103126102fc57565b503d613beb565b604051903d90823e3d90fd5b60209250613c1f90611106565b60445f9250613b63565b7fa01a9df6000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915f9080613c61575b50505050565b6001600160a01b0393847f00000000000000000000000000000000000000000000000000000000000000001694807f00000000000000000000000000000000000000000000000000000000000000001691613cbb846142fd565b96803b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152848316602482015297821660448901529186161660648701525f908690608490829084905af19485156102f157613d8095613dc4575b5082936020936040518097819582947f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03925af1908115613c065750613d99575b808080613c5b565b602090813d8311613dbd575b613daf8183611152565b810103126102fc575f613d91565b503d613da5565b60209350613dd190611106565b5f92613d2f565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690821614613ae5565b6001810191805f5260209183835260405f205c8015155f14613ea7575f1990818101835c8380820191828403613e6a575b5050505050815c81810192818411611a0e575f93815d835284832001015d5f52525f604081205d600190565b613e77613e87938861443a565b865f52885f2001015c918561443a565b835f52808383885f2001015d5f5285855260405f205d5f80808381613e3e565b50505050505f90565b5f949383156140d857806140a3575b15614007576001600160a01b0391827f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03929092166004830152306024830152604482018590525f908290606490829084905af180156102f157613ff4575b5084827f000000000000000000000000000000000000000000000000000000000000000016803b15613ff05781906024604051809481937f2e1a7d4d0000000000000000000000000000000000000000000000000000000083528960048401525af18015613fe557613fcd575b5061184c939450166140e0565b613fd78691611106565b613fe15784613fc0565b8480fd5b6040513d88823e3d90fd5b5080fd5b613fff919550611106565b5f935f613f53565b929350906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015293909216602484015260448301525f908290606490829084905af180156102f15761409a5750565b61184c90611106565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690831614613ebf565b505050509050565b814710614130575f8080936001600160a01b038294165af1614100612877565b501561410857565b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fcd786059000000000000000000000000000000000000000000000000000000005f523060045260245ffd5b90614171575080511561410857805190602001fd5b815115806141b7575b614182575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561417a565b6001810190825f528160205260405f205c155f1461420357805c815f52838160205f20015d60018101809111611a0e57815d5c915f5260205260405f205d600190565b5050505f90565b905f5260205261421f60405f2091825c611a01565b905d565b916044929391936001600160a01b03604094859282808551998a9586947fc9c1661b0000000000000000000000000000000000000000000000000000000086521660048501521660248301527f0000000000000000000000000000000000000000000000000000000000000000165afa9384156142f3575f935f956142bc575b50506142b96142b285946119d0565b9485611691565b52565b809295508194503d83116142ec575b6142d58183611152565b810103126102fc5760208251920151925f806142a3565b503d6142cb565b83513d5f823e3d90fd5b6001600160a01b0390818111614311571690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f5260a060045260245260445ffd5b905f5260205261421f60405f2091825c6137b1565b6040519260208401907fa9059cbb0000000000000000000000000000000000000000000000000000000082526001600160a01b038094166024860152604485015260448452608084019084821067ffffffffffffffff8311176110bd576143d5935f9384936040521694519082865af16143ce612877565b908361415c565b8051908115159182614416575b50506143eb5750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b81925090602091810103126102fc57602001518015908115036102fc575f806143e2565b5c111561444357565b7f0f4ae0e4000000000000000000000000000000000000000000000000000000005f5260045ffdfea2646970667358221220229a5cf89aa7c2d0a4b4d5db20bba6c2b3a74b080303fc6ec00ba582a5dcf75164736f6c634300081a0033", + "deployedBytecode": "0x60806040526004361015610072575b3615610018575f80fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361004a57005b7f0540ddf6000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f3560e01c806308a465f614610e9d57806319c6989f1461084e578063286f580d146107b75780632950286e146106cc57806354fd4d501461058f5780635a3c3987146105665780635e01eb5a146105215780638a12a08c146104c65780638eb1b65e146103bf578063945ed33f14610344578063ac9650d8146103005763e3b5dff40361000e57346102fc576060806003193601126102fc5767ffffffffffffffff6004358181116102fc5761012d9036906004016112c4565b6101356111a1565b6044359283116102fc57610150610158933690600401610fcd565b9390916128b9565b905f5b835181101561017c57805f8761017360019488611691565b5101520161015b565b506101f06101fe610239946101b65f94886040519361019a8561111a565b30855260208501525f1960408501528660608501523691611381565b60808201526040519283917f8a12a08c0000000000000000000000000000000000000000000000000000000060208401526024830161143e565b03601f198101835282611152565b604051809481927fedfa3568000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39261028e915f916102cf575b50602080825183010191016115d4565b909391926102a7575b60405193849384610f2f565b0390f35b5f7f00000000000000000000000000000000000000000000000000000000000000005d610297565b6102eb91503d805f833e6102e38183611152565b81019061154d565b8461027e565b6040513d5f823e3d90fd5b5f80fd5b60206003193601126102fc5760043567ffffffffffffffff81116102fc576103386103326102a3923690600401610f9c565b9061179b565b60405191829182611020565b346102fc5761035236610eca565b61035a611945565b610362611972565b6103906102a3610371836128fb565b9193909461038a606061038383611344565b9201611358565b90612729565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d60405193849384610f2f565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576103ec9036906004016112c4565b906103f56111b7565b906064359081116102fc576101f061048b6102399461045161041c5f953690600401610fcd565b610425336128b9565b97604051946104338661111a565b33865260208601526024356040860152151560608501523691611381565b60808201526040519283917f945ed33f000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b604051809481927f48c89491000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b346102fc576102a36104ef6104da36610eca565b6104e2611945565b6104ea611972565b611a3b565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f009492945d60405193849384610f2f565b346102fc575f6003193601126102fc5760207f00000000000000000000000000000000000000000000000000000000000000005c6001600160a01b0360405191168152f35b346102fc576102a36104ef61057a36610eca565b610582611945565b61058a611972565b6128fb565b346102fc575f6003193601126102fc576040515f80549060018260011c91600184169182156106c2575b60209485851084146106955785879486865291825f146106575750506001146105fe575b506105ea92500383611152565b6102a3604051928284938452830190610ffb565b5f808052859250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b85831061063f5750506105ea9350820101856105dd565b80548389018501528794508693909201918101610628565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016858201526105ea95151560051b85010192508791506105dd9050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b92607f16926105b9565b346102fc5760606003193601126102fc5767ffffffffffffffff6004358181116102fc576106fe9036906004016112c4565b906107076111a1565b6044359182116102fc5761072261072a923690600401610fcd565b9290916128b9565b905f5b845181101561075f57806fffffffffffffffffffffffffffffffff604061075660019489611691565b5101520161072d565b506101f06101fe8561077d5f94610239976040519361019a8561111a565b60808201526040519283917f5a3c3987000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576107e49036906004016112c4565b906107ed6111b7565b906064359081116102fc576101f061048b6102399461081461041c5f953690600401610fcd565b60808201526040519283917f08a465f60000000000000000000000000000000000000000000000000000000060208401526024830161143e565b60a06003193601126102fc5767ffffffffffffffff600435116102fc573660236004350112156102fc5767ffffffffffffffff60043560040135116102fc5736602460c060043560040135026004350101116102fc5760243567ffffffffffffffff81116102fc576108c4903690600401610f9c565b67ffffffffffffffff604435116102fc576060600319604435360301126102fc5760643567ffffffffffffffff81116102fc57610905903690600401610fcd565b60843567ffffffffffffffff81116102fc57610925903690600401610f9c565b949093610930611945565b806004356004013503610e75575f5b600435600401358110610bd25750505060443560040135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd6044353603018212156102fc57816044350160048101359067ffffffffffffffff82116102fc5760248260071b36039101136102fc576109e3575b6102a361033886865f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d61179b565b6001600160a01b039492947f0000000000000000000000000000000000000000000000000000000000000000163b156102fc57604051947f2a2d80d10000000000000000000000000000000000000000000000000000000086523360048701526060602487015260c486019260443501602481019367ffffffffffffffff6004830135116102fc57600482013560071b360385136102fc5760606064890152600482013590529192869260e484019291905f905b60048101358210610b5457505050602091601f19601f865f9787956001600160a01b03610ac860246044350161118d565b16608488015260448035013560a48801526003198787030160448801528186528786013787868286010152011601030181836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39361033893610b45575b8294508193506109b3565b610b4e90611106565b84610b3a565b9195945091926001600160a01b03610b6b8761118d565b168152602080870135916001600160a01b0383168093036102fc57600492600192820152610b9b604089016128a6565b65ffffffffffff8091166040830152610bb660608a016128a6565b1660608201526080809101970193019050889495939291610a97565b610be7610be082848661192a565b3691611381565b604051610bf3816110a1565b5f81526020915f838301525f60408301528281015190606060408201519101515f1a91835283830152604082015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc81850260043501360301126102fc5760405190610c60826110ea565b610c73602460c08602600435010161118d565b808352610c89604460c08702600435010161118d565b908185850152610ca2606460c08802600435010161118d565b60408581019190915260043560c08802016084810135606087015260a4810135608087015260c4013560a086015283015183519386015160ff91909116926001600160a01b0383163b156102fc575f6001600160a01b03809460e4948b98849860c460c06040519c8d9b8c9a7fd505accf000000000000000000000000000000000000000000000000000000008c521660048b01523060248b0152608482820260043501013560448b0152026004350101356064880152608487015260a486015260c4850152165af19081610e66575b50610e5c57610d7f612877565b906001600160a01b0381511690836001600160a01b0381830151166044604051809581937fdd62ed3e00000000000000000000000000000000000000000000000000000000835260048301523060248301525afa9182156102f1575f92610e2c575b506060015103610df75750506001905b0161093f565b805115610e045780519101fd5b7fa7285689000000000000000000000000000000000000000000000000000000005f5260045ffd5b9091508381813d8311610e55575b610e448183611152565b810103126102fc5751906060610de1565b503d610e3a565b5050600190610df1565b610e6f90611106565b8a610d72565b7faaad13f7000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102fc57610eab36610eca565b610eb3611945565b610ebb611972565b6103906102a361037183611a3b565b600319906020828201126102fc576004359167ffffffffffffffff83116102fc578260a0920301126102fc5760040190565b9081518082526020808093019301915f5b828110610f1b575050505090565b835185529381019392810192600101610f0d565b939290610f4490606086526060860190610efc565b936020948181036020830152602080855192838152019401905f5b818110610f7f57505050610f7c9394506040818403910152610efc565b90565b82516001600160a01b031686529487019491870191600101610f5f565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc576020808501948460051b0101116102fc57565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc57602083818601950101116102fc57565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6020808201906020835283518092526040830192602060408460051b8301019501935f915b8483106110555750505050505090565b9091929394958480611091837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a51610ffb565b9801930193019194939290611045565b6060810190811067ffffffffffffffff8211176110bd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60c0810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd57604052565b60a0810190811067ffffffffffffffff8211176110bd57604052565b60e0810190811067ffffffffffffffff8211176110bd57604052565b90601f601f19910116810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd5760051b60200190565b35906001600160a01b03821682036102fc57565b602435906001600160a01b03821682036102fc57565b6044359081151582036102fc57565b9190916080818403126102fc57604090815191608083019467ffffffffffffffff95848110878211176110bd57825283956112008461118d565b8552602090818501359081116102fc57840182601f820112156102fc5780359061122982611175565b9361123686519586611152565b82855283850190846060809502840101928184116102fc578501915b8383106112745750505050508401528181013590830152606090810135910152565b84838303126102fc57875190611289826110a1565b6112928461118d565b825261129f87850161118d565b87830152888401359081151582036102fc578288928b89950152815201920191611252565b81601f820112156102fc578035916020916112de84611175565b936112ec6040519586611152565b808552838086019160051b830101928084116102fc57848301915b8483106113175750505050505090565b823567ffffffffffffffff81116102fc578691611339848480948901016111c6565b815201920191611307565b356001600160a01b03811681036102fc5790565b3580151581036102fc5790565b67ffffffffffffffff81116110bd57601f01601f191660200190565b92919261138d82611365565b9161139b6040519384611152565b8294818452818301116102fc578281602093845f960137010152565b9060808101916001600160a01b03808251168352602093848301519460808186015285518092528060a086019601925f905b83821061140b5750505050506060816040829301516040850152015191015290565b845180518216895280840151821689850152604090810151151590890152606090970196938201936001909101906113e9565b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106114bd5750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b909192939583806114f8837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611481565b81601f820112156102fc5780519061151e82611365565b9261152c6040519485611152565b828452602083830101116102fc57815f9260208093018386015e8301015290565b906020828203126102fc57815167ffffffffffffffff81116102fc57610f7c9201611507565b9080601f830112156102fc5781519060209161158e81611175565b9361159c6040519586611152565b81855260208086019260051b8201019283116102fc57602001905b8282106115c5575050505090565b815181529083019083016115b7565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc5784611600918301611573565b936020808301518581116102fc5783019082601f830112156102fc5781519161162883611175565b926116366040519485611152565b808452828085019160051b830101918583116102fc578301905b82821061167257505050509360408301519081116102fc57610f7c9201611573565b81516001600160a01b03811681036102fc578152908301908301611650565b80518210156116a55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106117515750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b9091929395838061178c837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611715565b91906117a6336128b9565b907f000000000000000000000000000000000000000000000000000000000000000093845c6118b1576001906001865d6117df83611175565b926117ed6040519485611152565b808452601f196117fc82611175565b015f5b8181106118a05750505f5b8181106118575750505050905f61184c92945d7f0000000000000000000000000000000000000000000000000000000000000000805c9161184e575b506136b1565b565b5f905d5f611846565b806118845f8061186c610be08996888a61192a565b602081519101305af461187d612877565b903061415c565b61188e8288611691565b526118998187611691565b500161180a565b8060606020809389010152016117ff565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc576020019181360383136102fc57565b908210156116a5576119419160051b8101906118d9565b9091565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805c6118b1576001905d565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036119a457565b7f089676d5000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b906119da82611175565b6119e76040519182611152565b828152601f196119f78294611175565b0190602036910137565b91908201809211611a0e57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b604081013542116126c35790611a5e611a5760208401846136f4565b90506119d0565b915f5b611a6e60208301836136f4565b90508110156125c757611a9881611a93611a8b60208601866136f4565b369391613748565b6111c6565b936040850151936001600160a01b038651169060208701518051156116a55760200151604001511515806125be575b1561256357611aec611ad886611344565b8784611ae660608a01611358565b92613add565b5f5b60208801515181101561255357611b03613788565b6020890151515f198101908111611a0e578214806020830152821582525f1461254c576060890151905b611b3b8360208c0151611691565b51604081015190919015611cee57611bd36001600160a01b03835116936001600160a01b03881685145f14611ce7576001945b60405195611b7b8761111a565b5f8752611b87816137be565b6020870152604086015260609485918d838301526080820152604051809381927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611cb0575b50506020015115611c9657816001600160a01b036020611c909360019695611c388c8c611691565b5201611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b5051167f000000000000000000000000000000000000000000000000000000000000000061420a565b01611aee565b602001519097506001600160a01b03169250600190611c90565b60209294509081611cd592903d10611ce0575b611ccd8183611152565b8101906137f5565b91505092905f611c10565b503d611cc3565b5f94611b6e565b888a6001600160a01b038495945116806001600160a01b038a16145f14612132575050815115905061206e57888a80151580612053575b611f4d575b6001600160a01b03939291611ddd82611e15978b5f95897f0000000000000000000000000000000000000000000000000000000000000000921680885282602052604088205c611f3c575b5050505b6001611d9c8983511660208401998b8b51169080158a14611f3657508391614223565b999092511694611db1608091828101906118d9565b93909460405197611dc1896110ea565b8852306020890152604088015260608701528501523691611381565b60a0820152604051809681927f21457897000000000000000000000000000000000000000000000000000000008352600483016139b1565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611f0c575b506020015115611ee95791611ebc826001600160a01b0360019695611e7a611ee49686611691565b51611e858d8d611691565b52611eb3828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b50511692611691565b51907f000000000000000000000000000000000000000000000000000000000000000061420a565b611c90565b98506001929450611f02906001600160a01b0392611691565b5197511692611c90565b6020919450611f2c903d805f833e611f248183611152565b810190613969565b5094919050611e52565b91614223565b611f4592614341565b5f8281611d75565b50611f5a90929192611344565b91611f648b6142fd565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039485166004820152306024820152908416604482015292871660648401525f8380608481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f1578a611ddd8d611e15976001600160a01b03975f95612044575b50975092505091929350611d2a565b61204d90611106565b5f612035565b5061205d82611344565b6001600160a01b0316301415611d25565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916001600160a01b0384511692803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03949094166004850152306024850152604484018c90525f908490606490829084905af180156102f1578a611ddd8d611e15976001600160a01b03975f95612123575b50611d79565b61212c90611106565b5f61211d565b6001600160a01b0360208796949701511690898183145f146123d7576121cd925061220597915060016121735f96956001600160a01b0393848b5116614223565b509282895116956020890151151588146123ae5761219082611344565b945b6121a1608093848101906118d9565b959096604051996121b18b6110ea565b8a52166020890152604088015260608701528501523691611381565b60a0820152604051809581927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f1575f93612384575b5060200151156122c357816001600160a01b036020611ee493600196956122698c8c611691565b526122998383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b60208181015191516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101859052939a50909116945081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612359575b50600190611c90565b602090813d831161237d575b61236f8183611152565b810103126102fc575f612350565b503d612365565b60209193506123a4903d805f833e61239c8183611152565b81019061387c565b5093919050612242565b837f00000000000000000000000000000000000000000000000000000000000000001694612192565b6001600160a01b036124669561242e9394956123f860809b8c8101906118d9565b9390946040519761240889611136565b5f8952602089015216604087015260609a8b978888015286015260a08501523691611381565b60c0820152604051809381927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612525575b50506020015115611c9657816001600160a01b036020611ee493600196956124cb8c8c611691565b526124fb8383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b6020929450908161254192903d10611ce057611ccd8183611152565b91505092905f6124a3565b5f90611b2d565b5091955090935050600101611a61565b61258d827f00000000000000000000000000000000000000000000000000000000000000006141c0565b506125b986837f000000000000000000000000000000000000000000000000000000000000000061420a565b611aec565b50321515611ac7565b50506125f27f0000000000000000000000000000000000000000000000000000000000000000613a71565b916125fd83516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b0380612663838b611691565b51165f528560205261269160405f205c8261267e858d611691565b51165f528860205260405f205c90611a01565b61269b8387611691565b526126a6828a611691565b51165f52856020525f604081205d01612644565b50949391509150565b7fe08b8af0000000000000000000000000000000000000000000000000000000005f5260045ffd5b905f198201918213600116611a0e57565b7f80000000000000000000000000000000000000000000000000000000000000008114611a0e575f190190565b907f000000000000000000000000000000000000000000000000000000000000000090815c7f0000000000000000000000000000000000000000000000000000000000000000612779815c6126eb565b907f0000000000000000000000000000000000000000000000000000000000000000915b5f81121561283a575050506127b1906126eb565b917f0000000000000000000000000000000000000000000000000000000000000000925b5f8112156127ea575050505061184c906136b1565b61283590825f5261282f60205f83828220015c91828252888152886040916128228a8d8587205c906001600160a01b03891690613eb0565b8484525281205d84613e0d565b506126fc565b6127d5565b61287290825f5261282f60205f8a8785848420015c938484528181526128228c6040948587205c906001600160a01b03891690613add565b61279d565b3d156128a1573d9061288882611365565b916128966040519384611152565b82523d5f602084013e565b606090565b359065ffffffffffff821682036102fc57565b905f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03815c16156128f1575050565b909192505d600190565b90604082013542116126c357612917611a5760208401846136f4565b915f5b61292760208301836136f4565b90508110156135d15761294481611a93611a8b60208601866136f4565b60608101519061297e6001600160a01b038251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506020810151515f198101908111611a0e575b5f8112156129a45750505060010161291a565b6129b2816020840151611691565b516129bb613788565b9082156020830152602084015151805f19810111611a0e575f1901831480835261358f575b6020820151156135545760408401516001600160a01b03855116915b604081015115612c1d5783916001600160a01b036060926020612aa0970151151580612c14575b612bed575b5116906001600160a01b0385168203612be6576001915b60405192612a4c8461111a565b60018452612a59816137be565b6020840152604083015288838301526080820152604051809581927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f95612bbf575b506020015115612bb057612ba69284612b02612bab979694612b7594611691565b52612b366001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506001600160a01b03612b4d8460408a01516137b1565b91167f000000000000000000000000000000000000000000000000000000000000000061420a565b6001600160a01b038551167f000000000000000000000000000000000000000000000000000000000000000061420a565b6126fc565b612991565b505050612bab919350926126fc565b6020919550612bdc9060603d606011611ce057611ccd8183611152565b5095919050612ae1565b5f91612a3f565b612c0f612bf98d611344565b8d8b611ae6886040888451169301519301611358565b612a28565b50321515612a23565b906001600160a01b03825116806001600160a01b038516145f14613137575060208401516130495750604051927f967870920000000000000000000000000000000000000000000000000000000084526001600160a01b03831660048501526020846024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156102f1575f94613015575b5083916001600160a01b038151166001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015230602482015260448101959095525f8580606481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f157612dec955f92613006575b505b611ddd6001600160a01b03612da88b828551168360208701511690614223565b50925116918c6002612dbf608092838101906118d9565b92909360405196612dcf886110ea565b875230602088015289604088015260608701528501523691611381565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612fe3575b506020015115612ecf57908291612bab9493612e45898d611691565b52612e7a836001600160a01b0384167f000000000000000000000000000000000000000000000000000000000000000061420a565b80831080612eb4575b612e90575b5050506126fc565b612ea6612eac93612ea08b611344565b926137b1565b91614356565b5f8080612e88565b50306001600160a01b03612ec78b611344565b161415612e83565b9450908094808210612ee8575b505050612bab906126fc565b91612ef8602092612f77946137b1565b90612f2d826001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683614356565b60405193849283927f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612fb8575b8080612edc565b602090813d8311612fdc575b612fce8183611152565b810103126102fc575f612fb1565b503d612fc4565b6020919450612ffb903d805f833e611f248183611152565b509094919050612e29565b61300f90611106565b5f612d86565b9093506020813d602011613041575b8161303160209383611152565b810103126102fc5751925f612cbc565b3d9150613024565b909261305489611344565b6001600160a01b033091160361306f575b5f612dec94612d88565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936130a38a611344565b6130ac846142fd565b90863b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152306024820152918116604483015285166064820152945f908690608490829084905af19081156102f157612dec955f92613128575b50945050613065565b61313190611106565b5f61311f565b6001600160a01b036020849695940151168a8282145f1461340b5750505061320c61316e5f92846001600160a01b03885116614223565b92906131d48c6001600160a01b03808a5116938951151586146133df576131a361319784611344565b935b60808101906118d9565b929093604051966131b3886110ea565b875216602086015260408501528c6060850152600260808501523691611381565b60a0820152604051809381927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f1575f916133c4575b5060208401518c908a90156133aa5783836001600160a01b03936132836132899461327c8f9c9b9a98996132b29a611691565b5192611691565b52611691565b5191167f000000000000000000000000000000000000000000000000000000000000000061420a565b51156132f457612bab92916001600160a01b036020612ba6930151167f0000000000000000000000000000000000000000000000000000000000000000614341565b516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810191909152602081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f15761337f575b50612bab906126fc565b602090813d83116133a3575b6133958183611152565b810103126102fc575f613375565b503d61338b565b50509091506133bb92939650611691565b519384916132b2565b6133d891503d805f833e61239c8183611152565b9050613249565b6131a3827f00000000000000000000000000000000000000000000000000000000000000001693613199565b61349e965090613466916060948b61342b608099989993848101906118d9565b9390946040519761343b89611136565b6001895260208901526001600160a01b038b1660408901528888015286015260a08501523691611381565b60c0820152604051809581927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f9561352d575b506020015115612bb057612ba69284613505612bab9796946001600160a01b0394611691565b52167f000000000000000000000000000000000000000000000000000000000000000061420a565b602091955061354a9060603d606011611ce057611ccd8183611152565b50959190506134df565b6fffffffffffffffffffffffffffffffff6001600160a01b0360206135858188015161357f886126eb565b90611691565b51015116916129fc565b6135cc856001600160a01b0360208401611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b6129e0565b50506135fc7f0000000000000000000000000000000000000000000000000000000000000000613a71565b9161360783516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b038061366d838b611691565b51165f528560205261368860405f205c8261267e858d611691565b6136928387611691565b5261369d828a611691565b51165f52856020525f604081205d0161364e565b4780156136f0577f00000000000000000000000000000000000000000000000000000000000000005c6136f0576001600160a01b0361184c92166140e0565b5050565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc57602001918160051b360383136102fc57565b91908110156116a55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81813603018212156102fc570190565b604051906040820182811067ffffffffffffffff8211176110bd576040525f6020838281520152565b91908203918211611a0e57565b600211156137c857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b908160609103126102fc578051916040602083015192015190565b61010060c0610f7c93602084528051613828816137be565b602085015260208101516001600160a01b0380911660408601528060408301511660608601526060820151166080850152608081015160a085015260a08101518285015201519160e0808201520190610ffb565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc57846138a8918301611573565b9360208201519360408301519081116102fc57610f7c9201611507565b9081518082526020808093019301915f5b8281106138e4575050505090565b8351855293810193928101926001016138d6565b602081526001600160a01b038083511660208301526020830151166040820152613931604083015160c0606084015260e08301906138c5565b9060608301516080820152608083015160058110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b916060838303126102fc5782519260208101519267ffffffffffffffff938481116102fc578161399a918401611573565b9360408301519081116102fc57610f7c9201611507565b602081526001600160a01b038083511660208301526020830151166040820152604082015160608201526139f4606083015160c0608084015260e08301906138c5565b90608083015160048110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b91909160808060a08301948051613a38816137be565b84526020810151613a48816137be565b60208501526001600160a01b036040820151166040850152606081015160608501520151910152565b90815c613a7d81611175565b613a8a6040519182611152565b818152613a9682611175565b601f196020910136602084013781945f5b848110613ab5575050505050565b600190825f5280845f20015c6001600160a01b03613ad38388611691565b9116905201613aa7565b919280613dd8575b15613c51575050804710613c29576001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001691823b156102fc57604051907fd0e30db00000000000000000000000000000000000000000000000000000000082525f915f8160048185895af180156102f157613c12575b506044602092937f00000000000000000000000000000000000000000000000000000000000000001694613b98838783614356565b8460405196879485937f15afd409000000000000000000000000000000000000000000000000000000008552600485015260248401525af1908115613c065750613bdf5750565b602090813d8311613bff575b613bf58183611152565b810103126102fc57565b503d613beb565b604051903d90823e3d90fd5b60209250613c1f90611106565b60445f9250613b63565b7fa01a9df6000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915f9080613c61575b50505050565b6001600160a01b0393847f00000000000000000000000000000000000000000000000000000000000000001694807f00000000000000000000000000000000000000000000000000000000000000001691613cbb846142fd565b96803b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152848316602482015297821660448901529186161660648701525f908690608490829084905af19485156102f157613d8095613dc4575b5082936020936040518097819582947f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03925af1908115613c065750613d99575b808080613c5b565b602090813d8311613dbd575b613daf8183611152565b810103126102fc575f613d91565b503d613da5565b60209350613dd190611106565b5f92613d2f565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690821614613ae5565b6001810191805f5260209183835260405f205c8015155f14613ea7575f1990818101835c8380820191828403613e6a575b5050505050815c81810192818411611a0e575f93815d835284832001015d5f52525f604081205d600190565b613e77613e87938861443a565b865f52885f2001015c918561443a565b835f52808383885f2001015d5f5285855260405f205d5f80808381613e3e565b50505050505f90565b5f949383156140d857806140a3575b15614007576001600160a01b0391827f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03929092166004830152306024830152604482018590525f908290606490829084905af180156102f157613ff4575b5084827f000000000000000000000000000000000000000000000000000000000000000016803b15613ff05781906024604051809481937f2e1a7d4d0000000000000000000000000000000000000000000000000000000083528960048401525af18015613fe557613fcd575b5061184c939450166140e0565b613fd78691611106565b613fe15784613fc0565b8480fd5b6040513d88823e3d90fd5b5080fd5b613fff919550611106565b5f935f613f53565b929350906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015293909216602484015260448301525f908290606490829084905af180156102f15761409a5750565b61184c90611106565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690831614613ebf565b505050509050565b814710614130575f8080936001600160a01b038294165af1614100612877565b501561410857565b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fcd786059000000000000000000000000000000000000000000000000000000005f523060045260245ffd5b90614171575080511561410857805190602001fd5b815115806141b7575b614182575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561417a565b6001810190825f528160205260405f205c155f1461420357805c815f52838160205f20015d60018101809111611a0e57815d5c915f5260205260405f205d600190565b5050505f90565b905f5260205261421f60405f2091825c611a01565b905d565b916044929391936001600160a01b03604094859282808551998a9586947fc9c1661b0000000000000000000000000000000000000000000000000000000086521660048501521660248301527f0000000000000000000000000000000000000000000000000000000000000000165afa9384156142f3575f935f956142bc575b50506142b96142b285946119d0565b9485611691565b52565b809295508194503d83116142ec575b6142d58183611152565b810103126102fc5760208251920151925f806142a3565b503d6142cb565b83513d5f823e3d90fd5b6001600160a01b0390818111614311571690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f5260a060045260245260445ffd5b905f5260205261421f60405f2091825c6137b1565b6040519260208401907fa9059cbb0000000000000000000000000000000000000000000000000000000082526001600160a01b038094166024860152604485015260448452608084019084821067ffffffffffffffff8311176110bd576143d5935f9384936040521694519082865af16143ce612877565b908361415c565b8051908115159182614416575b50506143eb5750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b81925090602091810103126102fc57602001518015908115036102fc575f806143e2565b5c111561444357565b7f0f4ae0e4000000000000000000000000000000000000000000000000000000005f5260045ffdfea2646970667358221220229a5cf89aa7c2d0a4b4d5db20bba6c2b3a74b080303fc6ec00ba582a5dcf75164736f6c634300081a0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 46886b3cc2..3b47b6531d 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -122,66 +122,6 @@ fn main() { ) // Not available on Lens }); - generate_contract_with_config("BalancerV3BatchRouter", |builder| { - builder - .add_network( - MAINNET, - Network { - address: addr("0x136f1EFcC3f8f88516B9E94110D56FDBfB1778d1"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(21339510)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0xe2fa4e1d17725e72dcdAfe943Ecf45dF4B9E285b"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(37377506)), - }, - ) - .add_network( - SEPOLIA, - Network { - address: addr("0xC85b652685567C1B074e8c0D4389f83a2E458b1C"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(7219301)), - }, - ) - .add_network( - ARBITRUM_ONE, - Network { - address: addr("0xaD89051bEd8d96f045E8912aE1672c6C0bF8a85E"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(297828544)), - }, - ) - .add_network( - BASE, - Network { - address: addr("0x85a80afee867aDf27B50BdB7b76DA70f1E853062"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(25347205)), - }, - ) - .add_network( - AVALANCHE, - Network { - address: addr("0xc9b36096f5201ea332Db35d6D195774ea0D5988f"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(59965747)), - }, - ) - .add_network( - OPTIMISM, - Network { - address: addr("0xaD89051bEd8d96f045E8912aE1672c6C0bF8a85E"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(133969588)), - }, - ) - // Not available on Lens - }); generate_contract("ERC20"); generate_contract_with_config("GPv2AllowListAuthentication", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index df828af759..f84f9755ba 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -316,6 +316,26 @@ crate::bindings!( // Not available on Lens } ); +crate::bindings!( + BalancerV3BatchRouter, + crate::deployments! { + // + MAINNET => (address!("0x136f1EFcC3f8f88516B9E94110D56FDBfB1778d1"), 21339510), + // + GNOSIS => (address!("0xe2fa4e1d17725e72dcdAfe943Ecf45dF4B9E285b"), 37377506), + // + SEPOLIA => (address!("0xC85b652685567C1B074e8c0D4389f83a2E458b1C"), 7219301), + // + ARBITRUM_ONE => (address!("0xaD89051bEd8d96f045E8912aE1672c6C0bF8a85E"), 297828544), + // + BASE => (address!("0x85a80afee867aDf27B50BdB7b76DA70f1E853062"), 25347205), + // + AVALANCHE => (address!("0xc9b36096f5201ea332Db35d6D195774ea0D5988f"), 59965747), + // + OPTIMISM => (address!("0xaD89051bEd8d96f045E8912aE1672c6C0bF8a85E"), 133969588), + // Not available on Lens, Polygon, BNB + } +); // UniV2 crate::bindings!( diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 9b3fdf1dcf..d4587879f4 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -51,7 +51,6 @@ macro_rules! include_contracts { include_contracts! { BalancerV2Authorizer; BalancerV2Vault; - BalancerV3BatchRouter; CowAmm; CowAmmConstantProductFactory; CowAmmLegacyHelper; From 89d71413bab75c822507dd62f94996a3c7d1a67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 21 Oct 2025 10:03:46 +0100 Subject: [PATCH 020/117] Migrate Balances into alloy (#3786) --- .../src/infra/blockchain/contracts.rs | 19 ++++---- crates/autopilot/src/run.rs | 11 ++++- crates/contracts/build.rs | 15 ------- crates/contracts/src/alloy.rs | 17 +++++++- crates/contracts/src/lib.rs | 6 --- .../driver/src/infra/blockchain/contracts.rs | 25 +++++------ crates/driver/src/tests/setup/blockchain.rs | 27 ++++++------ crates/driver/src/tests/setup/driver.rs | 2 +- crates/driver/src/tests/setup/solver.rs | 2 +- crates/e2e/src/setup/deploy.rs | 13 +++--- crates/e2e/tests/e2e/cow_amm.rs | 12 ++++-- crates/orderbook/src/run.rs | 6 +-- crates/shared/src/account_balances/mod.rs | 43 ++++++++++++------- .../shared/src/account_balances/simulation.rs | 7 +-- crates/shared/src/arguments.rs | 3 +- 15 files changed, 113 insertions(+), 95 deletions(-) diff --git a/crates/autopilot/src/infra/blockchain/contracts.rs b/crates/autopilot/src/infra/blockchain/contracts.rs index c5bc050a7c..337c8fcc89 100644 --- a/crates/autopilot/src/infra/blockchain/contracts.rs +++ b/crates/autopilot/src/infra/blockchain/contracts.rs @@ -1,7 +1,7 @@ use { crate::domain, chain::Chain, - contracts::alloy::{ChainalysisOracle, HooksTrampoline, InstanceExt}, + contracts::alloy::{ChainalysisOracle, HooksTrampoline, InstanceExt, support::Balances}, ethrpc::{Web3, alloy::conversions::IntoAlloy}, primitive_types::H160, }; @@ -11,7 +11,7 @@ pub struct Contracts { settlement: contracts::GPv2Settlement, signatures: contracts::alloy::support::Signatures::Instance, weth: contracts::WETH9, - balances: contracts::support::Balances, + balances: Balances::Instance, chainalysis_oracle: Option, trampoline: HooksTrampoline::Instance, @@ -61,12 +61,13 @@ impl Contracts { address_for(contracts::WETH9::raw_contract(), addresses.weth), ); - let balances = contracts::support::Balances::at( - web3, - address_for( - contracts::support::Balances::raw_contract(), - addresses.balances, - ), + let balances = Balances::Instance::new( + addresses + .balances + .map(IntoAlloy::into_alloy) + .or_else(|| Balances::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let trampoline = HooksTrampoline::Instance::new( @@ -116,7 +117,7 @@ impl Contracts { &self.settlement } - pub fn balances(&self) -> &contracts::support::Balances { + pub fn balances(&self) -> &Balances::Instance { &self.balances } diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index 79bdf3fe59..4c59aa8246 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -28,7 +28,11 @@ use { clap::Parser, contracts::{BalancerV2Vault, IUniswapV3Factory}, ethcontract::{BlockNumber, H160, common::DeploymentInformation, errors::DeployError}, - ethrpc::{Web3, block_stream::block_number_to_block_number_hash}, + ethrpc::{ + Web3, + alloy::conversions::IntoLegacy, + block_stream::block_number_to_block_number_hash, + }, futures::StreamExt, model::DomainSeparator, num::ToPrimitive, @@ -204,7 +208,10 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { settlement: args.shared.settlement_contract_address, signatures: args.shared.signatures_contract_address, weth: args.shared.native_token_address, - balances: args.shared.balances_contract_address, + balances: args + .shared + .balances_contract_address + .map(IntoLegacy::into_legacy), trampoline: args.shared.hooks_contract_address, }; let eth = ethereum( diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 3b47b6531d..f954dc4964 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -425,21 +425,6 @@ fn main() { }); generate_contract("CowAmmUniswapV2PriceOracle"); - // Support contracts used for various order simulations. - generate_contract_with_config("Balances", |builder| { - builder - .add_network_str(MAINNET, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(ARBITRUM_ONE, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(BASE, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(AVALANCHE, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(BNB, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(OPTIMISM, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(POLYGON, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(LENS, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(GNOSIS, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - .add_network_str(SEPOLIA, "0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b") - }); - // Contract for Uniswap's Permit2 contract. generate_contract_with_config("Permit2", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index f84f9755ba..fd9fe8ded6 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -560,7 +560,6 @@ pub mod support { crate::bindings!(Trader); // Support contract used for solver fee simulations in the gnosis/solvers repo. crate::bindings!(Swapper); - crate::bindings!( Signatures, crate::deployments! { @@ -576,6 +575,22 @@ pub mod support { SEPOLIA => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), } ); + // Support contracts used for various order simulations. + crate::bindings!( + Balances, + crate::deployments! { + MAINNET => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + ARBITRUM_ONE => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + BASE => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + AVALANCHE => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + BNB => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + OPTIMISM => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + POLYGON => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + LENS => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + GNOSIS => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + SEPOLIA => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + } + ); } pub mod test { diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index d4587879f4..34e57aadad 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -67,12 +67,6 @@ include_contracts! { WETH9; } -pub mod support { - include_contracts! { - Balances; - } -} - #[cfg(test)] mod tests { use crate::alloy::networks::{ diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index 121b1250a9..80eabe4c71 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -1,7 +1,7 @@ use { crate::{boundary, domain::eth, infra::blockchain::Ethereum}, chain::Chain, - contracts::alloy::FlashLoanRouter, + contracts::alloy::{FlashLoanRouter, support::Balances}, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -27,7 +27,7 @@ pub struct Contracts { // TODO: make this non-optional when contracts are deployed // everywhere flashloan_router: Option, - balance_helper: contracts::support::Balances, + balance_helper: Balances::Instance, } #[derive(Debug, Default, Clone)] @@ -66,12 +66,13 @@ impl Contracts { let vault_relayer = settlement.methods().vault_relayer().call().await?.into(); let vault = contracts::BalancerV2Vault::at(web3, settlement.methods().vault().call().await?); - let balance_helper = contracts::support::Balances::at( - web3, - address_for( - contracts::support::Balances::raw_contract(), - addresses.balances, - ), + let balance_helper = Balances::Instance::new( + addresses + .balances + .map(|addr| addr.0.into_alloy()) + .or_else(|| Balances::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let signatures = contracts::alloy::support::Signatures::Instance::new( addresses @@ -172,7 +173,7 @@ impl Contracts { self.flashloan_router.as_ref() } - pub fn balance_helper(&self) -> &contracts::support::Balances { + pub fn balance_helper(&self) -> &Balances::Instance { &self.balance_helper } } @@ -213,12 +214,6 @@ impl ContractAt for contracts::ERC20 { } } -impl ContractAt for contracts::support::Balances { - fn at(eth: &Ethereum, address: eth::ContractAddress) -> Self { - Self::at(ð.web3, address.into()) - } -} - #[derive(Debug, Error)] pub enum Error { #[error("method error: {0:?}")] diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 280c0d54a7..5597b832c2 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -8,7 +8,11 @@ use { tests::{self, boundary, cases::EtherExt}, }, alloy::{primitives::U256, signers::local::PrivateKeySigner}, - contracts::alloy::{ERC20Mintable, FlashLoanRouter, support::Signatures}, + contracts::alloy::{ + ERC20Mintable, + FlashLoanRouter, + support::{Balances, Signatures}, + }, ethcontract::PrivateKey, ethrpc::{ Web3, @@ -44,7 +48,7 @@ pub struct Blockchain { pub tokens: HashMap<&'static str, ERC20Mintable::Instance>, pub weth: contracts::WETH9, pub settlement: contracts::GPv2Settlement, - pub balances: contracts::support::Balances, + pub balances: Balances::Instance, pub signatures: Signatures::Instance, pub flashloan_router: FlashLoanRouter::Instance, pub ethflow: Option, @@ -328,18 +332,15 @@ impl Blockchain { settlement = contracts::GPv2Settlement::at(&web3, settlement_address); } - let balances = if let Some(balances_address) = config.balances_address { - contracts::support::Balances::at(&web3, balances_address) - } else { - wait_for( - &web3, - contracts::support::Balances::builder(&web3) - .from(main_trader_account.clone()) - .deploy(), - ) - .await - .unwrap() + let balances_address = match config.balances_address { + Some(balances_address) => balances_address.into_alloy(), + None => Balances::Instance::deploy_builder(web3.alloy.clone()) + .from(main_trader_account.address().into_alloy()) + .deploy() + .await + .unwrap(), }; + let balances = Balances::Instance::new(balances_address, web3.alloy.clone()); wait_for( &web3, diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index f40b55c7da..2c679d1026 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -236,7 +236,7 @@ async fn create_config_file( "#, hex_address(blockchain.settlement.address()), hex_address(blockchain.weth.address()), - hex_address(blockchain.balances.address()), + blockchain.balances.address(), blockchain.signatures.address(), hex_address(blockchain.flashloan_router.address().into_legacy()), ) diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index ce715550ab..cc336aad30 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -470,7 +470,7 @@ impl Solver { Addresses { settlement: Some(config.blockchain.settlement.address().into()), weth: Some(config.blockchain.weth.address().into()), - balances: Some(config.blockchain.balances.address().into()), + balances: Some(config.blockchain.balances.address().into_legacy().into()), signatures: Some(config.blockchain.signatures.address().into_legacy().into()), cow_amms: vec![], flashloan_router: Some( diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index f9d4f2ccb6..9598815c53 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -14,9 +14,8 @@ use { InstanceExt, UniswapV2Factory, UniswapV2Router02, - support::Signatures, + support::{Balances, Signatures}, }, - support::Balances, }, ethcontract::{Address, H256, U256, errors::DeployError}, ethrpc::alloy::conversions::IntoAlloy, @@ -36,7 +35,7 @@ pub struct Contracts { pub gp_settlement: GPv2Settlement, pub signatures: Signatures::Instance, pub gp_authenticator: GPv2AllowListAuthentication, - pub balances: Balances, + pub balances: Balances::Instance, pub uniswap_v2_factory: UniswapV2Factory::Instance, pub uniswap_v2_router: UniswapV2Router02::Instance, pub weth: WETH9, @@ -66,8 +65,8 @@ impl Contracts { }; let balances = match deployed.balances { - Some(address) => Balances::at(web3, address), - None => Balances::deployed(web3) + Some(address) => Balances::Instance::new(address.into_alloy(), web3.alloy.clone()), + None => Balances::Instance::deployed(&web3.alloy) .await .expect("failed to find balances contract"), }; @@ -169,7 +168,9 @@ impl Contracts { web3, GPv2Settlement(gp_authenticator.address(), balancer_vault.address(),) ); - let balances = deploy!(web3, Balances()); + let balances = Balances::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); let signatures = Signatures::Instance::deploy(web3.alloy.clone()) .await .unwrap(); diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index d9e4309e0e..aa070753f4 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -1,9 +1,11 @@ use { app_data::AppDataHash, - contracts::{ERC20, alloy::support::Signatures, support::Balances}, + contracts::{ + ERC20, + alloy::support::{Balances, Signatures}, + }, driver::domain::eth::NonZeroU256, e2e::{ - deploy, nodes::forked_node::ForkedNodeApi, setup::{ DeployedContracts, @@ -422,12 +424,14 @@ async fn cow_amm_driver_support(web3: Web3) { // since changing the forked number would result in very costly ~1 year of event // syncing, we deploy the following SCs let deployed_contracts = { - let balances = deploy!(&web3, Balances()); + let balances = Balances::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); let signatures = Signatures::Instance::deploy(web3.alloy.clone()) .await .unwrap(); DeployedContracts { - balances: Some(balances.address()), + balances: Some(balances.address().into_legacy()), signatures: Some(signatures.address().into_legacy()), } }; diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 42dc1f2f23..6e97eaebec 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -17,7 +17,7 @@ use { GPv2Settlement, IUniswapV3Factory, WETH9, - alloy::{ChainalysisOracle, HooksTrampoline, InstanceExt}, + alloy::{ChainalysisOracle, HooksTrampoline, InstanceExt, support::Balances}, }, ethcontract::errors::DeployError, ethrpc::alloy::conversions::IntoAlloy, @@ -105,8 +105,8 @@ pub async fn run(args: Arguments) { .expect("load settlement contract"), }; let balances_contract = match args.shared.balances_contract_address { - Some(address) => contracts::support::Balances::with_deployment_info(&web3, address, None), - None => contracts::support::Balances::deployed(&web3) + Some(address) => Balances::Instance::new(address, web3.alloy.clone()), + None => Balances::Instance::deployed(&web3.alloy.clone()) .await .expect("load balances contract"), }; diff --git a/crates/shared/src/account_balances/mod.rs b/crates/shared/src/account_balances/mod.rs index 339e846754..c1556e23ab 100644 --- a/crates/shared/src/account_balances/mod.rs +++ b/crates/shared/src/account_balances/mod.rs @@ -3,14 +3,19 @@ use { BalanceOverrideRequest, BalanceOverriding, }, - alloy::sol_types::{SolType, sol_data}, + alloy::sol_types::{SolCall, SolType, sol_data}, + contracts::alloy::support::Balances, ethcontract::{ Bytes, contract::MethodBuilder, dyns::DynTransport, state_overrides::StateOverrides, }, - ethrpc::{Web3, block_stream::CurrentBlockWatcher}, + ethrpc::{ + Web3, + alloy::conversions::{IntoAlloy, IntoLegacy}, + block_stream::CurrentBlockWatcher, + }, model::{ interaction::InteractionData, order::{Order, SellTokenSource}, @@ -99,7 +104,7 @@ pub fn cached( #[derive(Clone)] pub struct BalanceSimulator { settlement: contracts::GPv2Settlement, - balances: contracts::support::Balances, + balances: Balances::Instance, vault_relayer: H160, vault: H160, balance_overrider: Arc, @@ -108,7 +113,7 @@ pub struct BalanceSimulator { impl BalanceSimulator { pub fn new( settlement: contracts::GPv2Settlement, - balances: contracts::support::Balances, + balances: Balances::Instance, vault_relayer: H160, vault: Option, balance_overrider: Arc, @@ -161,23 +166,31 @@ impl BalanceSimulator { // settlement // // This allows us to end up with very accurate balance simulations. - let balance_call = self.balances.balance( - (self.settlement.address(), self.vault_relayer, self.vault), - owner, - token, - amount.unwrap_or_default(), - Bytes(source.as_bytes()), - interactions + let balance_call = Balances::Balances::balanceCall { + contracts: Balances::Balances::Contracts { + settlement: self.settlement.address().into_alloy(), + vaultRelayer: self.vault_relayer.into_alloy(), + vault: self.vault.into_alloy(), + }, + trader: owner.into_alloy(), + token: token.into_alloy(), + amount: amount.unwrap_or_default().into_alloy(), + source: source.as_bytes().into(), + interactions: interactions .iter() - .map(|i| (i.target, i.value, Bytes(i.call_data.clone()))) + .map(|i| Balances::Balances::Interaction { + target: i.target.into_alloy(), + value: i.value.into_alloy(), + callData: i.call_data.clone().into(), + }) .collect(), - ); + }; let delegate_call = self .settlement .simulate_delegatecall( - self.balances.address(), - Bytes(balance_call.tx.data.unwrap_or_default().0), + self.balances.address().into_legacy(), + Bytes(balance_call.abi_encode()), ) .from(crate::SIMULATION_ACCOUNT.clone()); diff --git a/crates/shared/src/account_balances/simulation.rs b/crates/shared/src/account_balances/simulation.rs index 661533881c..9152074cb1 100644 --- a/crates/shared/src/account_balances/simulation.rs +++ b/crates/shared/src/account_balances/simulation.rs @@ -166,6 +166,7 @@ mod tests { use { super::*, crate::price_estimation::trade_verifier::balance_overrides::DummyOverrider, + alloy::primitives::address, ethrpc::Web3, model::order::SellTokenSource, std::sync::Arc, @@ -177,9 +178,9 @@ mod tests { let web3 = Web3::new_from_env(); let settlement = contracts::GPv2Settlement::at(&web3, addr!("9008d19f58aabd9ed0d60971565aa8510560ab41")); - let balances = contracts::support::Balances::at( - &web3, - addr!("3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + let balances = contracts::alloy::support::Balances::Instance::new( + address!("3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + web3.alloy.clone(), ); let balances = Balances::new( &web3, diff --git a/crates/shared/src/arguments.rs b/crates/shared/src/arguments.rs index cc5f7a21e7..b42b40ecb6 100644 --- a/crates/shared/src/arguments.rs +++ b/crates/shared/src/arguments.rs @@ -11,6 +11,7 @@ use { }, tenderly_api, }, + alloy::primitives::Address, anyhow::{Context, Result, ensure}, bigdecimal::BigDecimal, ethcontract::{H160, U256}, @@ -252,7 +253,7 @@ pub struct Arguments { /// Override address of the Balances contract. #[clap(long, env)] - pub balances_contract_address: Option, + pub balances_contract_address: Option
, /// Override address of the Signatures contract. #[clap(long, env)] From 8162abe336a6c86c61e61c93b1c268ca856b6dec Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Oct 2025 12:25:31 +0300 Subject: [PATCH 021/117] Use refunder's wallet in alloy transport (#3781) # Description This is a follow-up to #3779, which implements @jmg-duarte's proposal to set the refunder's wallet when creating the alloy transport, rather than doing it on each relevant function call. # Changes - Replace ethcontract `Account` with alloy's `TxSigner` - Register the signer with the Web3 transport during RefundService initialization - Simplify transaction submission by removing per-call signer setup --- crates/e2e/tests/e2e/refunder.rs | 10 ++++++++-- crates/refunder/src/lib.rs | 11 +++++++++-- crates/refunder/src/refund_service.rs | 16 +++++++++++----- crates/refunder/src/submitter.rs | 20 +++++++------------- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/crates/e2e/tests/e2e/refunder.rs b/crates/e2e/tests/e2e/refunder.rs index ebc36a639f..f79a5a6790 100644 --- a/crates/e2e/tests/e2e/refunder.rs +++ b/crates/e2e/tests/e2e/refunder.rs @@ -5,7 +5,7 @@ use { ethcontract::{H160, U256}, ethrpc::{ Web3, - alloy::conversions::{IntoAlloy, IntoLegacy}, + alloy::conversions::{IntoAlloy, IntoLegacy, TryIntoAlloyAsync}, block_stream::timestamp_of_current_block_in_seconds, }, model::quote::{OrderQuoteRequest, OrderQuoteSide, QuoteSigningScheme, Validity}, @@ -125,13 +125,19 @@ async fn refunder_tx(web3: Web3) { // Create the refund service and execute the refund tx let pg_pool = PgPool::connect_lazy("postgresql://").expect("failed to create database"); + let refunder_signer = { + match refunder.account().clone().try_into_alloy().await.unwrap() { + ethrpc::alloy::Account::Signer(signer) => signer, + _ => panic!("Refunder account must be a signer"), + } + }; let mut refunder = RefundService::new( pg_pool, web3, vec![ethflow_contract.clone(), ethflow_contract_2.clone()], validity_duration as i64 / 2, 10i64, - refunder.account().clone(), + refunder_signer, ); assert_ne!( diff --git a/crates/refunder/src/lib.rs b/crates/refunder/src/lib.rs index 5680f3e1d5..640200df86 100644 --- a/crates/refunder/src/lib.rs +++ b/crates/refunder/src/lib.rs @@ -7,7 +7,7 @@ use { crate::arguments::Arguments, clap::Parser, contracts::alloy::CoWSwapEthFlow, - ethcontract::{Account, PrivateKey}, + ethcontract::PrivateKey, observe::metrics::LivenessChecking, refund_service::RefundService, shared::http_client::HttpClientFactory, @@ -69,7 +69,14 @@ pub async fn run(args: arguments::Arguments) { .iter() .map(|contract| CoWSwapEthFlow::Instance::new(*contract, web3.alloy.clone())) .collect(); - let refunder_account = Account::Offline(args.refunder_pk.parse::().unwrap(), None); + let refunder_pk = args + .refunder_pk + .parse::() + .expect("couldn't parse refunder private key"); + let refunder_account = Box::new( + alloy::signers::local::PrivateKeySigner::from_slice(&refunder_pk.secret_bytes()) + .expect("invalid refunder private key bytes"), + ); let mut refunder = RefundService::new( pg_pool, web3, diff --git a/crates/refunder/src/refund_service.rs b/crates/refunder/src/refund_service.rs index dd279a5694..cf7bce4d7c 100644 --- a/crates/refunder/src/refund_service.rs +++ b/crates/refunder/src/refund_service.rs @@ -1,7 +1,10 @@ use { super::ethflow_order::{EthflowOrder, order_to_ethflow_data}, crate::submitter::Submitter, - alloy::primitives::{Address, address}, + alloy::{ + network::TxSigner, + primitives::{Address, Signature, address}, + }, anyhow::{Context, Result, anyhow}, contracts::alloy::CoWSwapEthFlow, database::{ @@ -9,7 +12,7 @@ use { ethflow_orders::{EthOrderPlacement, read_order, refundable_orders}, orders::read_order as read_db_order, }, - ethcontract::{Account, H256}, + ethcontract::H256, ethrpc::{Web3, block_stream::timestamp_of_current_block_in_seconds}, futures::{StreamExt, stream}, sqlx::PgPool, @@ -45,8 +48,11 @@ impl RefundService { ethflow_contracts: Vec, min_validity_duration: i64, min_price_deviation_bps: i64, - account: Account, + signer: Box + Send + Sync + 'static>, ) -> Self { + let signer_address = signer.address(); + let mut submitter_web3 = web3.clone(); + submitter_web3.wallet.register_signer(signer); RefundService { db, web3: web3.clone(), @@ -54,8 +60,8 @@ impl RefundService { min_validity_duration, min_price_deviation: min_price_deviation_bps as f64 / 10000f64, submitter: Submitter { - web3: web3.clone(), - account, + web3: submitter_web3, + signer_address, gas_estimator: Box::new(web3.legacy), gas_parameters_of_last_tx: None, nonce_of_last_submission: None, diff --git a/crates/refunder/src/submitter.rs b/crates/refunder/src/submitter.rs index d0ae1d9adf..c0cbcfa7a0 100644 --- a/crates/refunder/src/submitter.rs +++ b/crates/refunder/src/submitter.rs @@ -13,11 +13,8 @@ use { anyhow::{Result, anyhow}, contracts::alloy::CoWSwapEthFlow::{self, EthFlowOrder}, database::OrderUid, - ethcontract::{Account, U256}, - ethrpc::alloy::{ - ProviderSignerExt, - conversions::{IntoAlloy, TryIntoAlloyAsync}, - }, + ethcontract::U256, + ethrpc::alloy::conversions::IntoLegacy, gas_estimation::{GasPrice1559, GasPriceEstimating}, shared::ethrpc::Web3, std::time::Duration, @@ -45,7 +42,7 @@ const fn f64_to_u128(n: f64) -> u128 { pub struct Submitter { pub web3: Web3, - pub account: Account, + pub signer_address: Address, pub gas_estimator: Box, pub gas_parameters_of_last_tx: Option, pub nonce_of_last_submission: Option, @@ -57,7 +54,7 @@ impl Submitter { // Mempool tx are not considered. self.web3 .eth() - .transaction_count(self.account.address(), None) + .transaction_count(self.signer_address.into_legacy(), None) .await .map_err(|err| anyhow!("Could not get latest nonce due to err: {err}")) } @@ -82,17 +79,14 @@ impl Submitter { self.gas_parameters_of_last_tx = Some(gas_price); self.nonce_of_last_submission = Some(nonce); - let provider = self - .web3 - .alloy - .with_signer(self.account.clone().try_into_alloy().await?); - let ethflow_contract = CoWSwapEthFlow::Instance::new(ethflow_contract, provider); + let ethflow_contract = + CoWSwapEthFlow::Instance::new(ethflow_contract, self.web3.alloy.clone()); let tx_result = ethflow_contract .invalidateOrdersIgnoringNotAllowed(encoded_ethflow_orders) // Gas conversions are lossy but technically the should not have decimal points even though they're floats .max_priority_fee_per_gas(f64_to_u128(gas_price.max_priority_fee_per_gas)) .max_fee_per_gas(f64_to_u128(gas_price.max_fee_per_gas)) - .from(self.account.address().into_alloy()) + .from(self.signer_address) .nonce(nonce.low_u64()) .send() .await?.with_timeout(Some(TIMEOUT_5_BLOCKS)).get_receipt().await; From a1789d5c2a0475d87d13040d0c758b6b178bac32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 21 Oct 2025 10:50:02 +0100 Subject: [PATCH 022/117] Migrate ERC1271SignatureValidator to alloy (#3778) Co-authored-by: ilya --- crates/contracts/build.rs | 2 -- crates/contracts/src/alloy.rs | 1 + crates/contracts/src/lib.rs | 1 - .../src/signature_validator/simulation.rs | 18 ++++++++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index f954dc4964..593893d776 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -306,8 +306,6 @@ fn main() { }, ) }); - // EIP-1271 contract - SignatureValidator - generate_contract("ERC1271SignatureValidator"); generate_contract_with_config("UniswapV3SwapRouterV2", |builder| { // builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index fd9fe8ded6..c7813e1c3a 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -507,6 +507,7 @@ crate::bindings!( } ); crate::bindings!(CoWSwapOnchainOrders); +crate::bindings!(ERC1271SignatureValidator); // Used in the gnosis/solvers repo for the balancer solver crate::bindings!( diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 34e57aadad..b480188d5c 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -56,7 +56,6 @@ include_contracts! { CowAmmLegacyHelper; CowAmmUniswapV2PriceOracle; CowProtocolToken; - ERC1271SignatureValidator; ERC20; GPv2AllowListAuthentication; GPv2Settlement; diff --git a/crates/shared/src/signature_validator/simulation.rs b/crates/shared/src/signature_validator/simulation.rs index 127a67afca..868b65d86c 100644 --- a/crates/shared/src/signature_validator/simulation.rs +++ b/crates/shared/src/signature_validator/simulation.rs @@ -10,11 +10,11 @@ use { dyn_abi::SolType, primitives::Address, sol_types::{SolCall, sol_data}, + transports::RpcError, }, anyhow::{Context, Result}, contracts::{ - ERC1271SignatureValidator, - alloy::support::Signatures, + alloy::{ERC1271SignatureValidator::ERC1271SignatureValidator, support::Signatures}, errors::EthcontractErrorType, }, ethcontract::{Bytes, state_overrides::StateOverrides}, @@ -66,13 +66,19 @@ impl Validator { // change), the order's validity can be directly determined by whether // the signature matches the expected hash of the order data, checked // with isValidSignature method called on the owner's contract - let contract = ERC1271SignatureValidator::at(&self.web3, check.signer); + let contract = ERC1271SignatureValidator::new(check.signer.into_alloy(), &self.web3.alloy); let magic_bytes = contract - .methods() - .is_valid_signature(Bytes(check.hash), Bytes(check.signature.clone())) + .isValidSignature(check.hash.into(), check.signature.clone().into()) .call() .await - .map(|value| hex::encode(value.0))?; + .map(|value| hex::encode(value.0)) + .map_err(|err| match err { + alloy::contract::Error::TransportError(RpcError::ErrorResp(err)) => { + tracing::error!(?err, "failed to call isValidSignature"); + SignatureValidationError::Invalid + } + err => SignatureValidationError::Other(err.into()), + })?; if magic_bytes != Self::IS_VALID_SIGNATURE_MAGIC_BYTES { return Err(SignatureValidationError::Invalid); From 110837744ab0047bc1ff4a65424ae7657448ae8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 21 Oct 2025 11:03:03 +0100 Subject: [PATCH 023/117] Migrate BalancerV2Authorizer to alloy (#3789) --- crates/contracts/build.rs | 3 --- crates/contracts/src/alloy.rs | 1 + crates/contracts/src/lib.rs | 1 - crates/contracts/src/vault.rs | 19 +++++++++++-------- crates/driver/src/tests/setup/blockchain.rs | 12 ++++++------ crates/e2e/src/setup/deploy.rs | 11 +++++++---- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 593893d776..a03fb3fce4 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -32,9 +32,6 @@ fn main() { // - https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-changedpath println!("cargo:rerun-if-changed=build.rs"); - generate_contract_with_config("BalancerV2Authorizer", |builder| { - builder.contract_mod_override("balancer_v2_authorizer") - }); // Balancer addresses can be obtained from: // generate_contract_with_config("BalancerV2Vault", |builder| { diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index c7813e1c3a..07317586e9 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -46,6 +46,7 @@ crate::bindings!(GnosisSafeCompatibilityFallbackHandler); crate::bindings!(GnosisSafeProxy); crate::bindings!(GnosisSafeProxyFactory); +crate::bindings!(BalancerV2Authorizer); crate::bindings!(BalancerV2BasePool); crate::bindings!(BalancerV2BasePoolFactory); crate::bindings!(BalancerV2WeightedPool); diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index b480188d5c..203825b5e9 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -49,7 +49,6 @@ macro_rules! include_contracts { } include_contracts! { - BalancerV2Authorizer; BalancerV2Vault; CowAmm; CowAmmConstantProductFactory; diff --git a/crates/contracts/src/vault.rs b/crates/contracts/src/vault.rs index 7e9c6c57a7..644e160d8f 100644 --- a/crates/contracts/src/vault.rs +++ b/crates/contracts/src/vault.rs @@ -2,8 +2,9 @@ //! contract. use { - crate::{BalancerV2Authorizer, BalancerV2Vault}, - ethcontract::{Bytes, H160, common::FunctionExt as _, errors::MethodError, web3::signing}, + crate::{BalancerV2Vault, alloy::BalancerV2Authorizer}, + alloy::primitives::Address, + ethcontract::{Bytes, H160, common::FunctionExt as _, web3::signing}, }; fn role_id(target: H160, function_name: &str) -> Bytes<[u8; 32]> { @@ -23,19 +24,21 @@ fn role_id(target: H160, function_name: &str) -> Bytes<[u8; 32]> { } pub async fn grant_required_roles( - authorizer: &BalancerV2Authorizer, + authorizer: &BalancerV2Authorizer::Instance, vault: H160, vault_relayer: H160, -) -> Result<(), MethodError> { +) -> Result<(), alloy::contract::Error> { authorizer - .grant_roles( + .grantRoles( vec![ - role_id(vault, "manageUserBalance"), - role_id(vault, "batchSwap"), + role_id(vault, "manageUserBalance").0.into(), + role_id(vault, "batchSwap").0.into(), ], - vault_relayer, + Address::from(vault_relayer.0), ) .send() + .await? + .watch() .await?; Ok(()) } diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 5597b832c2..4f6cb29b7b 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -272,19 +272,19 @@ impl Blockchain { .unwrap(); // Set up the settlement contract and related contracts. - let vault_authorizer = wait_for( - &web3, - contracts::BalancerV2Authorizer::builder(&web3, main_trader_account.address()) - .from(main_trader_account.clone()) - .deploy(), + let vault_authorizer = contracts::alloy::BalancerV2Authorizer::Instance::deploy_builder( + web3.alloy.clone(), + main_trader_account.address().into_alloy(), ) + .from(main_trader_account.address().into_alloy()) + .deploy() .await .unwrap(); let vault = wait_for( &web3, contracts::BalancerV2Vault::builder( &web3, - vault_authorizer.address(), + vault_authorizer.into_legacy(), weth.address(), 0.into(), 0.into(), diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index 9598815c53..cd3cebea79 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -1,13 +1,13 @@ use { crate::deploy, contracts::{ - BalancerV2Authorizer, BalancerV2Vault, CowAmmLegacyHelper, GPv2AllowListAuthentication, GPv2Settlement, WETH9, alloy::{ + BalancerV2Authorizer, CoWSwapEthFlow, FlashLoanRouter, HooksTrampoline, @@ -18,7 +18,7 @@ use { }, }, ethcontract::{Address, H256, U256, errors::DeployError}, - ethrpc::alloy::conversions::IntoAlloy, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::DomainSeparator, shared::ethrpc::Web3, }; @@ -135,11 +135,14 @@ impl Contracts { let weth = deploy!(web3, WETH9()); - let balancer_authorizer = deploy!(web3, BalancerV2Authorizer(admin)); + let balancer_authorizer = + BalancerV2Authorizer::Instance::deploy(web3.alloy.clone(), admin.into_alloy()) + .await + .unwrap(); let balancer_vault = deploy!( web3, BalancerV2Vault( - balancer_authorizer.address(), + balancer_authorizer.address().into_legacy(), weth.address(), U256::from(0), U256::from(0), From b4d88c564dea01cf2bad6e25c7bcd669523a47a6 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Oct 2025 13:40:26 +0300 Subject: [PATCH 024/117] Use pending nonce for tx submission (#3787) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description We’ve seen occasional race conditions between cancellation and settlement transactions caused by how the `web3` library handles nonces, which currently happens on Base. The `web3` lib [fetches](https://github.com/tomusdrw/rust-web3/blob/190c21de7ebf8a3ad58a541aa3175300d3a3f36a/src/api/accounts.rs#L93-L97) the [Latest](https://github.com/tomusdrw/rust-web3/blob/19cc946650eb1400526b7a98ee15fa4fc21813c8/src/api/eth.rs#L214) nonce when it is None, which is always the case with our current implementation(we don't set nonce anywhere in the driver crate, the same happens in the ethcontract-rs lib[[code](https://github.com/cowprotocol/ethcontract-rs/blob/da717d73557c7448467a34ff169cdf2ceaac1810/ethcontract/src/transaction/build.rs#L232-L233)]). This can result in using a stale nonce when two txs are sent close together. Switching to Pending makes the node include txs already accepted into the mempool when reporting the next nonce. This should be enough to prevent most of these race conditions, since the cancel will immediately bump the pending nonce and the next settle will use the correct one. The alloy lib already uses it by default. https://github.com/alloy-rs/alloy/blob/93d1c98cc841720b5fcb4c577d6881cb51275afe/crates/provider/src/fillers/nonce.rs#L35-L45 There’s still a chance for internal propagation lag: even via the same RPC, the node’s mempool view can momentarily lag its submission path / upstream sequencer, so pending might not reflect the just-submitted tx for a brief window. This should be much rarer than the latest-vs-pending race we're fixing. ## How to test Staging to ensure it works fine and then chain by chain on prod. ## Further implementation A proper fix would be a local nonce management in the driver (per-address cache + sync logic), since only the driver hass access to solvers private keys, but that’s more complex to get right. Even though alloy already provides [CachedNonceManager](https://docs.rs/alloy/latest/alloy/providers/fillers/struct.CachedNonceManager.html), it can easily go out of sync since it optimistically updates the local cache without ensuring whether the tx was mined and the nonce is updated, so it would require a much more sophisticated approach. --- crates/driver/src/domain/mempools.rs | 15 +++++++++++---- crates/driver/src/infra/mempool/mod.rs | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/crates/driver/src/domain/mempools.rs b/crates/driver/src/domain/mempools.rs index 844eb8baa6..5792a79134 100644 --- a/crates/driver/src/domain/mempools.rs +++ b/crates/driver/src/domain/mempools.rs @@ -130,7 +130,13 @@ impl Mempools { } } - let hash = mempool.submit(tx.clone(), settlement.gas, solver).await?; + // Fetch the pending nonce to avoid race conditions between concurrent + // transactions (e.g., settlement tx and cancellation tx) from the same + // solver address. + let nonce = mempool.get_pending_nonce(solver.address()).await?; + let hash = mempool + .submit(tx.clone(), settlement.gas, solver, nonce) + .await?; let submitted_at_block = self.ethereum.current_block().borrow().number; tracing::debug!(?hash, current_block = ?submitted_at_block, "submitted tx to the mempool"); @@ -165,7 +171,7 @@ impl Mempools { // Check if the current block reached the submission deadline block number if block.number >= submission_deadline { let cancellation_tx_hash = self - .cancel(mempool, settlement.gas.price, solver, blocks_elapsed) + .cancel(mempool, settlement.gas.price, solver, blocks_elapsed, nonce) .await .context("cancellation tx due to deadline failed")?; tracing::info!( @@ -185,7 +191,7 @@ impl Mempools { if let Err(err) = self.ethereum.estimate_gas(tx).await { if err.is_revert() { let cancellation_tx_hash = self - .cancel(mempool, settlement.gas.price, solver, blocks_elapsed) + .cancel(mempool, settlement.gas.price, solver, blocks_elapsed, nonce) .await .context("cancellation tx due to revert failed")?; tracing::info!( @@ -240,6 +246,7 @@ impl Mempools { pending: eth::GasPrice, solver: &Solver, blocks_elapsed: u64, + nonce: eth::U256, ) -> Result { let cancellation = eth::Tx { from: solver.address(), @@ -263,7 +270,7 @@ impl Mempools { "Cancelling transaction with adjusted gas price" ); - mempool.submit(cancellation, gas, solver).await + mempool.submit(cancellation, gas, solver, nonce).await } } diff --git a/crates/driver/src/infra/mempool/mod.rs b/crates/driver/src/infra/mempool/mod.rs index 5a341ce4bf..f80d03ce04 100644 --- a/crates/driver/src/infra/mempool/mod.rs +++ b/crates/driver/src/infra/mempool/mod.rs @@ -76,6 +76,24 @@ impl Mempool { Self { config, transport } } + /// Fetches the pending transaction count (nonce) for the given address. + /// This includes both mined transactions and pending transactions in the + /// mempool. + pub async fn get_pending_nonce( + &self, + address: eth::Address, + ) -> Result { + self.transport + .eth() + .transaction_count(address.into(), Some(web3::types::BlockNumber::Pending)) + .await + .map_err(|err| { + mempools::Error::Other( + anyhow::Error::from(err).context("failed to fetch pending nonce"), + ) + }) + } + /// Submits a transaction to the mempool. Returns optimistically as soon as /// the transaction is pending. pub async fn submit( @@ -83,10 +101,12 @@ impl Mempool { tx: eth::Tx, gas: competition::solution::settlement::Gas, solver: &infra::Solver, + nonce: eth::U256, ) -> Result { ethcontract::transaction::TransactionBuilder::new(self.transport.legacy.clone()) .from(solver.account().clone()) .to(tx.to.into()) + .nonce(nonce) .gas_price(ethcontract::GasPrice::Eip1559 { max_fee_per_gas: gas.price.max().into(), max_priority_fee_per_gas: gas.price.tip().into(), From b196b99b2ec7ade28f9ffd9a2baf07e0ed89f894 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Oct 2025 16:23:37 +0300 Subject: [PATCH 025/117] [EASY] MutWallet accepts shared reference (#3792) # Description As it was suggested in [another PR comment](https://github.com/cowprotocol/services/pull/3781#discussion_r2446875763), the `MutWallet::register_signer()` function doesn't require a mutable reference to self. This PR fixes this. # Changes Change `MutWallet::register_signer()` to take `&self` instead of `&mut self`. Since the wallet is internally wrapped in `Arc>`, mutation through a shared reference is safe and intended. --- crates/driver/src/tests/setup/blockchain.rs | 2 +- crates/e2e/src/setup/mod.rs | 2 +- crates/ethrpc/src/alloy/wallet.rs | 2 +- crates/refunder/src/refund_service.rs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 4f6cb29b7b..2563002169 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -223,7 +223,7 @@ impl Blockchain { // should be happening from the primary_account of the node, will do this // later let node = Node::new(&config.rpc_args).await; - let mut web3 = Web3::new_from_url(&node.url()); + let web3 = Web3::new_from_url(&node.url()); let private_key = config.main_trader_secret_key.as_ref(); let main_trader_account = ethcontract::Account::Offline( diff --git a/crates/e2e/src/setup/mod.rs b/crates/e2e/src/setup/mod.rs index a563d152e6..40423f647b 100644 --- a/crates/e2e/src/setup/mod.rs +++ b/crates/e2e/src/setup/mod.rs @@ -214,7 +214,7 @@ async fn run( let _ = node_panic_handle.lock().unwrap().take(); })); - let mut web3 = Web3::new_from_url(NODE_HOST); + let web3 = Web3::new_from_url(NODE_HOST); let phrase = "test test test test test test test test test test test junk"; let signers = (0..10).map(|i| { MnemonicBuilder::::default() diff --git a/crates/ethrpc/src/alloy/wallet.rs b/crates/ethrpc/src/alloy/wallet.rs index 9875679531..69ee7a6d0c 100644 --- a/crates/ethrpc/src/alloy/wallet.rs +++ b/crates/ethrpc/src/alloy/wallet.rs @@ -28,7 +28,7 @@ impl MutWallet { /// [`register_signer`](EthereumWallet::register_signer), if no default /// signer has been setup (i.e. the wallet was created using /// [`MutWallet::default`]) it will register one. - pub fn register_signer(&mut self, signer: S) + pub fn register_signer(&self, signer: S) where S: TxSigner + Send + Sync + 'static, { diff --git a/crates/refunder/src/refund_service.rs b/crates/refunder/src/refund_service.rs index cf7bce4d7c..cce920f118 100644 --- a/crates/refunder/src/refund_service.rs +++ b/crates/refunder/src/refund_service.rs @@ -51,8 +51,8 @@ impl RefundService { signer: Box + Send + Sync + 'static>, ) -> Self { let signer_address = signer.address(); - let mut submitter_web3 = web3.clone(); - submitter_web3.wallet.register_signer(signer); + let gas_estimator = Box::new(web3.legacy.clone()); + web3.wallet.register_signer(signer); RefundService { db, web3: web3.clone(), @@ -60,9 +60,9 @@ impl RefundService { min_validity_duration, min_price_deviation: min_price_deviation_bps as f64 / 10000f64, submitter: Submitter { - web3: submitter_web3, + web3, signer_address, - gas_estimator: Box::new(web3.legacy), + gas_estimator, gas_parameters_of_last_tx: None, nonce_of_last_submission: None, }, From 615cf7bb6d16d38d4a15298ca6fcdbcc152459c2 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Tue, 21 Oct 2025 21:50:29 +0200 Subject: [PATCH 026/117] Fetch appdata in background (#3710) # Description @marcovc reported that enabling appdata fetching in the driver leads to very slow driver restarts. Since we used `join_all` the driver will only continuing the auction pre-processing if ALL futures finished. Because drivers running in the same k8s cluster as the orderbook have significantly lower latency we never saw that issue. # Changes In order to not block the pre-processing for an unreasonable amount of time I adjusted the logic to only await new appdatas for 500ms. That should give it enough time to fetch completely new appdatas we've never seen before (basically every new auction introduces at most a couple of new orders + appdatas). If that were the only change we would likely need MANY auctions to completely fill the cache with only 500ms per auction. To address that issue I adjusted the appdata fetcher to spawn 1 tokio task per appdata that needs to be fetched. That way the caller can await however many requests they want and all the ones they didn't wait for will still make progress while their solver already computes a solution for the current auction. In the next auction all (or at least many) of the missing appdata values should already be available in the cache. ## How to test e2e tests should already cover that appdatas become available eventually. --- .../src/domain/competition/order/app_data.rs | 89 +++++++------------ .../src/domain/competition/pre_processing.rs | 73 +++++++-------- 2 files changed, 72 insertions(+), 90 deletions(-) diff --git a/crates/driver/src/domain/competition/order/app_data.rs b/crates/driver/src/domain/competition/order/app_data.rs index 516ca39a47..73345760c8 100644 --- a/crates/driver/src/domain/competition/order/app_data.rs +++ b/crates/driver/src/domain/competition/order/app_data.rs @@ -3,10 +3,8 @@ use { anyhow::Context, app_data::AppDataDocument, derive_more::From, - futures::FutureExt, moka::future::Cache, reqwest::StatusCode, - shared::request_sharing::BoxRequestSharing, std::{collections::HashMap, sync::Arc}, thiserror::Error, url::Url, @@ -30,10 +28,6 @@ pub struct AppDataRetriever(Arc); struct Inner { client: reqwest::Client, base_url: Url, - request_sharing: BoxRequestSharing< - AppDataHash, - Result>, FetchingError>, - >, cache: Cache>>, } @@ -42,7 +36,6 @@ impl AppDataRetriever { Self(Arc::new(Inner { client: reqwest::Client::new(), base_url: orderbook_url, - request_sharing: BoxRequestSharing::labelled("app_data".to_string()), cache: Cache::new(cache_size), })) } @@ -57,6 +50,9 @@ impl AppDataRetriever { } /// Retrieves the full app-data for the given `app_data` hash, if it exists. + /// HTTP requests needed to fetch the data are spawned in background tasks + /// such that they eventually populate the cache even in case the caller + /// stops awaiting the returned future. pub async fn get_cached_or_fetch( &self, app_data: &AppDataHash, @@ -65,47 +61,38 @@ impl AppDataRetriever { return Ok(app_data.clone()); } - let app_data_fut = move |app_data: &AppDataHash| { - let app_data = *app_data; - let self_ = self.clone(); - - async move { - let url = self_ - .0 - .base_url - .join(&format!("api/v1/app_data/{:?}", app_data.0))?; - let response = self_.0.client.get(url).send().await?; - let validated_app_data = match response.status() { - StatusCode::NOT_FOUND => None, - _ => { - let appdata: AppDataDocument = - serde_json::from_str(&response.text().await?) - .context("invalid app data document")?; - match appdata.full_app_data == app_data::EMPTY { - true => None, // empty app data - false => Some(Arc::new(app_data::ValidatedAppData { - hash: app_data::AppDataHash(app_data.0.0), - protocol: app_data::parse(appdata.full_app_data.as_bytes())?, - document: appdata.full_app_data, - })), - } + let inner = self.0.clone(); + let app_data = *app_data; + + let fut = async move { + let url = inner + .base_url + .join(&format!("api/v1/app_data/{:?}", app_data.0))?; + let response = inner.client.get(url).send().await?; + let validated_app_data = match response.status() { + StatusCode::NOT_FOUND => None, + _ => { + let appdata: AppDataDocument = serde_json::from_str(&response.text().await?) + .context("invalid app data document")?; + match appdata.full_app_data == app_data::EMPTY { + true => None, // empty app data + false => Some(Arc::new(app_data::ValidatedAppData { + hash: app_data::AppDataHash(app_data.0.0), + protocol: app_data::parse(appdata.full_app_data.as_bytes())?, + document: appdata.full_app_data, + })), } - }; - self_ - .0 - .cache - .insert(app_data, validated_app_data.clone()) - .await; - - Ok(validated_app_data) - } - .boxed() + } + }; + inner + .cache + .insert(app_data, validated_app_data.clone()) + .await; + + Ok(validated_app_data) }; - self.0 - .request_sharing - .shared_or_else(*app_data, app_data_fut) - .await + tokio::task::spawn(fut).await? } } @@ -182,6 +169,8 @@ pub enum FetchingError { InvalidAppData(#[from] anyhow::Error), #[error("internal error: {0}")] Internal(String), + #[error("failed to join task: {0}")] + TaskJoinFailed(#[from] tokio::task::JoinError), } impl From for FetchingError { @@ -195,13 +184,3 @@ impl From for FetchingError { FetchingError::Internal(err.to_string()) } } - -impl Clone for FetchingError { - fn clone(&self) -> Self { - match self { - Self::Http(message) => Self::Http(message.clone()), - Self::InvalidAppData(err) => Self::InvalidAppData(shared::clone_anyhow_error(err)), - Self::Internal(message) => Self::Internal(message.clone()), - } - } -} diff --git a/crates/driver/src/domain/competition/pre_processing.rs b/crates/driver/src/domain/competition/pre_processing.rs index edd56cd12b..3289a2a5cf 100644 --- a/crates/driver/src/domain/competition/pre_processing.rs +++ b/crates/driver/src/domain/competition/pre_processing.rs @@ -11,10 +11,7 @@ use { }, anyhow::{Context, Result}, chrono::Utc, - futures::{ - FutureExt, - future::{BoxFuture, join_all}, - }, + futures::{FutureExt, StreamExt, future::BoxFuture, stream::FuturesUnordered}, itertools::Itertools, model::{ interaction::InteractionData, @@ -26,8 +23,7 @@ use { price_estimation::trade_verifier::balance_overrides::BalanceOverrideRequest, signature_validator::SignatureValidating, }, - std::{collections::HashMap, future::Future, sync::Arc}, - tap::TapFallible, + std::{collections::HashMap, future::Future, sync::Arc, time::Duration}, tokio::sync::Mutex, tracing::Instrument, }; @@ -339,36 +335,43 @@ impl Utilities { let _timer2 = observe::metrics::metrics().on_auction_overhead_start("driver", "fetch_app_data"); - let app_data = join_all( - auction - .orders - .iter() - .flat_map(|order| match order.app_data { - AppData::Full(_) => None, - // only fetch appdata we don't already have in full - AppData::Hash(hash) => Some(hash), - }) - .unique() - .map(|app_data_hash| { - let app_data_retriever = app_data_retriever.clone(); - async move { - let fetched_app_data = app_data_retriever - .get_cached_or_fetch(&app_data_hash) - .await - .tap_err(|err| { - tracing::warn!(?app_data_hash, ?err, "failed to fetch app data"); - }) - .ok() - .flatten(); + let futures: FuturesUnordered<_> = auction + .orders + .iter() + .flat_map(|order| match order.app_data { + AppData::Full(_) => None, + // only fetch appdata we don't already have in full + AppData::Hash(hash) => Some(hash), + }) + .unique() + .map(async move |app_data_hash| { + let fetched_app_data = app_data_retriever + .get_cached_or_fetch(&app_data_hash) + .await + .inspect_err(|err| { + tracing::warn!(?app_data_hash, ?err, "failed to fetch app data"); + }) + .ok() + .flatten(); + + (app_data_hash, fetched_app_data) + }) + .collect(); - (app_data_hash, fetched_app_data) - } - }), - ) - .await - .into_iter() - .filter_map(|(app_data_hash, app_data)| app_data.map(|app_data| (app_data_hash, app_data))) - .collect::>(); + // Only await responses for a short amount of time. Even if we don't await + // all futures fully the remaining appdata requests will finish in background + // tasks. That way we should have enough time to immediately fetch appdatas + // of new orders (once the cache is filled). But we also don't run the risk + // of stalling the driver completely until everything is fetched. + // In practice that means the solver will only see a few appdatas in the first + // auction after a restart. But on subsequent auctions everything should be + // available. + const MAX_APP_DATA_WAIT: Duration = Duration::from_millis(500); + let app_data: HashMap<_, _> = futures + .take_until(tokio::time::sleep(MAX_APP_DATA_WAIT)) + .filter_map(async move |(hash, json)| Some((hash, json?))) + .collect() + .await; Arc::new(app_data) } From 472261a1b4739ea71e1a486a223a391d1c78f131 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Wed, 22 Oct 2025 09:55:48 +0200 Subject: [PATCH 027/117] Remove contracts dependency from ethrpc (#3796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description `ethrpc` only depends on 1 function from `contracts` which arguably shouldn't have been re-exported to begin with since it's only needed for `ethcontract` bindings. Removing that function from `ethrpc` means it no longer depends on `contracts` which allows `cargo` to compile it in parallel with `contracts`. Also where this `dummy` functionality lives become irrelevant when we finally switch to `alloy` completely since `alloy` does not need these dummy instances just to encode calldata. 🥳 # Changes - remove `contracts` dependency from `ethrpc` ## How to test compiler --- Cargo.lock | 1 - crates/driver/src/boundary/liquidity/balancer/v2/mod.rs | 2 +- crates/driver/src/boundary/liquidity/uniswap/v2.rs | 2 +- crates/driver/src/boundary/liquidity/uniswap/v3.rs | 2 +- crates/ethrpc/Cargo.toml | 1 - crates/ethrpc/src/dummy.rs | 3 --- crates/ethrpc/src/lib.rs | 1 - crates/solver/src/interactions/uniswap_v2.rs | 8 +++++--- 8 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 crates/ethrpc/src/dummy.rs diff --git a/Cargo.lock b/Cargo.lock index 51fcfc1803..fdb9518a01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2933,7 +2933,6 @@ dependencies = [ "alloy", "anyhow", "async-trait", - "contracts", "ethcontract", "futures", "hex", diff --git a/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs b/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs index 8cd532b49d..7d35cf081f 100644 --- a/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs +++ b/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs @@ -53,7 +53,7 @@ fn to_interaction( output: &liquidity::ExactOutput, receiver: ð::Address, ) -> eth::Interaction { - let web3 = ethrpc::dummy::web3(); + let web3 = contracts::web3::dummy(); let handler = balancer_v2::SettlementHandler::new( pool.id.into(), // Note that this code assumes `receiver == sender`. This assumption is diff --git a/crates/driver/src/boundary/liquidity/uniswap/v2.rs b/crates/driver/src/boundary/liquidity/uniswap/v2.rs index 81d8c65058..8e06bb54ad 100644 --- a/crates/driver/src/boundary/liquidity/uniswap/v2.rs +++ b/crates/driver/src/boundary/liquidity/uniswap/v2.rs @@ -99,7 +99,7 @@ pub fn to_interaction( ) -> eth::Interaction { let handler = uniswap_v2::Inner::new( pool.router.0.into_alloy(), - GPv2Settlement::at(ðrpc::dummy::web3(), receiver.0), + GPv2Settlement::at(&contracts::web3::dummy(), receiver.0), Mutex::new(Allowances::empty(receiver.0)), ); diff --git a/crates/driver/src/boundary/liquidity/uniswap/v3.rs b/crates/driver/src/boundary/liquidity/uniswap/v3.rs index 2686e3904f..e2ddb20b3b 100644 --- a/crates/driver/src/boundary/liquidity/uniswap/v3.rs +++ b/crates/driver/src/boundary/liquidity/uniswap/v3.rs @@ -78,7 +78,7 @@ pub fn to_interaction( output: &liquidity::ExactOutput, receiver: ð::Address, ) -> eth::Interaction { - let web3 = ethrpc::dummy::web3(); + let web3 = contracts::web3::dummy(); let handler = UniswapV3SettlementHandler::new( UniswapV3SwapRouterV2::at(&web3, pool.router.0), diff --git a/crates/ethrpc/Cargo.toml b/crates/ethrpc/Cargo.toml index 017b7adaf5..e9fdf8c8e1 100644 --- a/crates/ethrpc/Cargo.toml +++ b/crates/ethrpc/Cargo.toml @@ -14,7 +14,6 @@ path = "src/lib.rs" alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-aws", "signer-local", "eips"] } anyhow = { workspace = true } async-trait = { workspace = true } -contracts = { workspace = true } ethcontract = { workspace = true } futures = { workspace = true } hex = { workspace = true } diff --git a/crates/ethrpc/src/dummy.rs b/crates/ethrpc/src/dummy.rs deleted file mode 100644 index 5e78309cf6..0000000000 --- a/crates/ethrpc/src/dummy.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub fn web3() -> web3::Web3 { - contracts::web3::dummy() -} diff --git a/crates/ethrpc/src/lib.rs b/crates/ethrpc/src/lib.rs index b2dc575c4f..6c53042187 100644 --- a/crates/ethrpc/src/lib.rs +++ b/crates/ethrpc/src/lib.rs @@ -1,7 +1,6 @@ pub mod alloy; pub mod block_stream; pub mod buffered; -pub mod dummy; pub mod extensions; pub mod http; pub mod instrumented; diff --git a/crates/solver/src/interactions/uniswap_v2.rs b/crates/solver/src/interactions/uniswap_v2.rs index 86f9dbc20a..39b6e0893e 100644 --- a/crates/solver/src/interactions/uniswap_v2.rs +++ b/crates/solver/src/interactions/uniswap_v2.rs @@ -42,7 +42,7 @@ mod tests { use { super::*, alloy::primitives::Address, - ethrpc::{alloy::conversions::IntoLegacy, dummy}, + ethrpc::alloy::conversions::IntoLegacy, hex_literal::hex, }; @@ -61,8 +61,10 @@ mod tests { let payout_to = 9u8; let router_address = Address::from(&[1u8; 20]); - let settlement = - GPv2Settlement::at(&dummy::web3(), H160::from_low_u64_be(payout_to as u64)); + let settlement = GPv2Settlement::at( + &contracts::web3::dummy(), + H160::from_low_u64_be(payout_to as u64), + ); let interaction = UniswapInteraction { router: router_address, settlement, From c0564c454473ecf3ac06b1f7b242058d1b5556e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 10:56:15 +0100 Subject: [PATCH 028/117] Migrate BalancerV2Vault to alloy (#3793) --- crates/autopilot/src/run.rs | 35 ++++---- crates/contracts/build.rs | 87 ------------------- crates/contracts/src/alloy.rs | 2 + crates/contracts/src/lib.rs | 3 - crates/contracts/src/vault.rs | 62 ++++++------- .../driver/src/infra/blockchain/contracts.rs | 12 +-- crates/driver/src/infra/blockchain/mod.rs | 4 +- crates/driver/src/infra/liquidity/config.rs | 3 +- crates/driver/src/tests/setup/blockchain.rs | 25 +++--- crates/e2e/src/setup/deploy.rs | 38 ++++---- crates/e2e/tests/e2e/vault_balances.rs | 28 +++--- crates/orderbook/src/run.rs | 39 +++++---- .../shared/src/account_balances/simulation.rs | 57 +++++++----- crates/shared/src/arguments.rs | 2 +- .../bad_token/token_owner_finder/liquidity.rs | 7 +- .../src/bad_token/token_owner_finder/mod.rs | 4 +- crates/shared/src/bad_token/trace_call.rs | 9 +- .../src/sources/balancer_v2/pools/common.rs | 1 + crates/solver/src/interactions/balancer_v2.rs | 9 +- 19 files changed, 183 insertions(+), 244 deletions(-) diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index 4c59aa8246..ac6fca8e91 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -26,7 +26,7 @@ use { }, chain::Chain, clap::Parser, - contracts::{BalancerV2Vault, IUniswapV3Factory}, + contracts::{IUniswapV3Factory, alloy::BalancerV2Vault}, ethcontract::{BlockNumber, H160, common::DeploymentInformation, errors::DeployError}, ethrpc::{ Web3, @@ -232,22 +232,21 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { .instrument(info_span!("vault_relayer_call")) .await .expect("Couldn't get vault relayer address"); - let vault = match args.shared.balancer_v2_vault_address { - Some(address) => Some(contracts::BalancerV2Vault::with_deployment_info( - &web3, address, None, - )), - None => match BalancerV2Vault::deployed(&web3) - .instrument(info_span!("balancerV2vault_deployed")) - .await - { - Ok(contract) => Some(contract), - Err(DeployError::NotFound(_)) => { - tracing::warn!("balancer contracts are not deployed on this network"); - None - } - Err(err) => panic!("failed to get balancer vault contract: {err}"), - }, - }; + + let vault_address = args.shared.balancer_v2_vault_address.or_else(|| { + let chain_id = chain.id(); + let addr = BalancerV2Vault::deployment_address(&chain_id); + if addr.is_none() { + tracing::warn!( + chain_id, + "balancer contracts are not deployed on this network" + ); + } + addr + }); + let vault = + vault_address.map(|address| BalancerV2Vault::Instance::new(address, web3.alloy.clone())); + let uniswapv3_factory = match IUniswapV3Factory::deployed(&web3) .instrument(info_span!("uniswapv3_deployed")) .await @@ -275,7 +274,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { eth.contracts().settlement().clone(), eth.contracts().balances().clone(), vault_relayer, - vault.as_ref().map(|contract| contract.address()), + vault_address.map(IntoLegacy::into_legacy), balance_overrider, ), eth.current_block().clone(), diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index a03fb3fce4..302fb5fc57 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -32,93 +32,6 @@ fn main() { // - https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-changedpath println!("cargo:rerun-if-changed=build.rs"); - // Balancer addresses can be obtained from: - // - generate_contract_with_config("BalancerV2Vault", |builder| { - builder - .contract_mod_override("balancer_v2_vault") - .add_network( - MAINNET, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(12272146)), - }, - ) - .add_network( - GOERLI, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(4648099)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(24821598)), - }, - ) - .add_network( - SEPOLIA, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(3418831)), - }, - ) - .add_network( - ARBITRUM_ONE, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(222832)), - }, - ) - .add_network( - BASE, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(1196036)), - }, - ) - .add_network( - AVALANCHE, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(26386141)), - }, - ) - .add_network( - BNB, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(22691002)), - }, - ) - .add_network( - OPTIMISM, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(7003431)), - }, - ) - .add_network( - POLYGON, - Network { - address: addr("0xBA12222222228d8Ba445958a75a0704d566BF2C8"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(15832990)), - }, - ) - // Not available on Lens - }); generate_contract("ERC20"); generate_contract_with_config("GPv2AllowListAuthentication", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 07317586e9..053164f2e6 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -294,6 +294,8 @@ crate::bindings!( } ); crate::bindings!( + // Balancer addresses can be obtained from: + // BalancerV2Vault, crate::deployments! { // diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 203825b5e9..b29800cfd3 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -49,7 +49,6 @@ macro_rules! include_contracts { } include_contracts! { - BalancerV2Vault; CowAmm; CowAmmConstantProductFactory; CowAmmLegacyHelper; @@ -134,7 +133,6 @@ mod tests { for network in &[MAINNET, GNOSIS, SEPOLIA, ARBITRUM_ONE] { assert_has_deployment_address!(GPv2Settlement for *network); assert_has_deployment_address!(WETH9 for *network); - assert_has_deployment_address!(BalancerV2Vault for *network); assert!( alloy::BalancerV2NoProtocolFeeLiquidityBootstrappingPoolFactory::deployment_address(network).is_some() ) @@ -187,7 +185,6 @@ mod tests { for network in &[MAINNET, GNOSIS, SEPOLIA, ARBITRUM_ONE] { assert_has_deployment_information!(GPv2Settlement for *network); - assert_has_deployment_information!(BalancerV2Vault for *network); } assert!(alloy::BalancerV2WeightedPoolFactory::deployment_address(&MAINNET).is_some()); for network in &[MAINNET, ARBITRUM_ONE] { diff --git a/crates/contracts/src/vault.rs b/crates/contracts/src/vault.rs index 644e160d8f..af5c3d8f52 100644 --- a/crates/contracts/src/vault.rs +++ b/crates/contracts/src/vault.rs @@ -2,39 +2,32 @@ //! contract. use { - crate::{BalancerV2Vault, alloy::BalancerV2Authorizer}, - alloy::primitives::Address, - ethcontract::{Bytes, H160, common::FunctionExt as _, web3::signing}, + crate::alloy::BalancerV2Authorizer, + alloy::{primitives::Address, sol_types::SolCall}, }; -fn role_id(target: H160, function_name: &str) -> Bytes<[u8; 32]> { - let function = match BalancerV2Vault::raw_contract() - .interface - .abi - .function(function_name) - { - Ok(function) => function, - Err(_) => return Bytes([0u8; 32]), - }; - +fn role_id(vault: Address) -> alloy::primitives::B256 { let mut data = [0u8; 36]; - data[12..32].copy_from_slice(&target.0); - data[32..36].copy_from_slice(&function.selector()); - Bytes(signing::keccak256(&data)) + data[12..32].copy_from_slice(vault.as_slice()); + data[32..36].copy_from_slice(&Call::SELECTOR); + alloy::primitives::keccak256(data) } pub async fn grant_required_roles( authorizer: &BalancerV2Authorizer::Instance, - vault: H160, - vault_relayer: H160, + vault: Address, + vault_relayer: Address, ) -> Result<(), alloy::contract::Error> { + use crate::alloy::BalancerV2Vault::BalancerV2Vault::batchSwapCall; + use crate::alloy::BalancerV2Vault::BalancerV2Vault::manageUserBalanceCall; + authorizer .grantRoles( vec![ - role_id(vault, "manageUserBalance").0.into(), - role_id(vault, "batchSwap").0.into(), + role_id::(vault).0.into(), + role_id::(vault).0.into(), ], - Address::from(vault_relayer.0), + vault_relayer, ) .send() .await? @@ -45,7 +38,12 @@ pub async fn grant_required_roles( #[cfg(test)] mod tests { - use {super::*, ethcontract::H256}; + use alloy::primitives::b256; + + use super::*; + use crate::alloy::BalancerV2Vault; + use crate::alloy::BalancerV2Vault::BalancerV2Vault::batchSwapCall; + use crate::alloy::BalancerV2Vault::BalancerV2Vault::manageUserBalanceCall; #[test] fn role_ids() { @@ -53,24 +51,14 @@ mod tests { // `batchSwap` transactions in Tenderly and then inspecting the `role` // value that was passed to the authenticator contract. - let vault = BalancerV2Vault::raw_contract().networks["1"].address; + let vault = BalancerV2Vault::deployment_address(&1).unwrap(); assert_eq!( - role_id(vault, "manageUserBalance"), - Bytes( - "0xeba777d811cd36c06d540d7ff2ed18ed042fd67bbf7c9afcf88c818c7ee6b498" - .parse::() - .unwrap() - .0 - ) + role_id::(vault), + b256!("0xeba777d811cd36c06d540d7ff2ed18ed042fd67bbf7c9afcf88c818c7ee6b498") ); assert_eq!( - role_id(vault, "batchSwap"), - Bytes( - "0x1282ab709b2b70070f829c46bc36f76b32ad4989fecb2fcb09a1b3ce00bbfc30" - .parse::() - .unwrap() - .0 - ) + role_id::(vault), + b256!("0x1282ab709b2b70070f829c46bc36f76b32ad4989fecb2fcb09a1b3ce00bbfc30") ); } } diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index 80eabe4c71..7ab426c813 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -1,7 +1,7 @@ use { crate::{boundary, domain::eth, infra::blockchain::Ethereum}, chain::Chain, - contracts::alloy::{FlashLoanRouter, support::Balances}, + contracts::alloy::{BalancerV2Vault, FlashLoanRouter, support::Balances}, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -14,7 +14,7 @@ use { pub struct Contracts { settlement: contracts::GPv2Settlement, vault_relayer: eth::ContractAddress, - vault: contracts::BalancerV2Vault, + vault: BalancerV2Vault::Instance, signatures: contracts::alloy::support::Signatures::Instance, weth: contracts::WETH9, @@ -64,8 +64,10 @@ impl Contracts { ), ); let vault_relayer = settlement.methods().vault_relayer().call().await?.into(); - let vault = - contracts::BalancerV2Vault::at(web3, settlement.methods().vault().call().await?); + let vault = BalancerV2Vault::Instance::new( + settlement.methods().vault().call().await?.into_alloy(), + web3.alloy.clone(), + ); let balance_helper = Balances::Instance::new( addresses .balances @@ -149,7 +151,7 @@ impl Contracts { self.vault_relayer } - pub fn vault(&self) -> &contracts::BalancerV2Vault { + pub fn vault(&self) -> &BalancerV2Vault::Instance { &self.vault } diff --git a/crates/driver/src/infra/blockchain/mod.rs b/crates/driver/src/infra/blockchain/mod.rs index 7eca82b195..bcdb65f16f 100644 --- a/crates/driver/src/infra/blockchain/mod.rs +++ b/crates/driver/src/infra/blockchain/mod.rs @@ -3,7 +3,7 @@ use { crate::{boundary, domain::eth}, chain::Chain, ethcontract::{U256, errors::ExecutionError}, - ethrpc::{Web3, block_stream::CurrentBlockWatcher}, + ethrpc::{Web3, alloy::conversions::IntoLegacy, block_stream::CurrentBlockWatcher}, shared::{ account_balances::{BalanceSimulator, SimulationError}, price_estimation::trade_verifier::balance_overrides::{ @@ -126,7 +126,7 @@ impl Ethereum { contracts.settlement().clone(), contracts.balance_helper().clone(), contracts.vault_relayer().0, - Some(contracts.vault().address()), + Some(contracts.vault().address().into_legacy()), balance_overrider.clone(), ); diff --git a/crates/driver/src/infra/liquidity/config.rs b/crates/driver/src/infra/liquidity/config.rs index 85035581a8..732de41bc3 100644 --- a/crates/driver/src/infra/liquidity/config.rs +++ b/crates/driver/src/infra/liquidity/config.rs @@ -5,6 +5,7 @@ use { }, alloy::primitives::Address, chain::Chain, + contracts::alloy::BalancerV2Vault, derive_more::Debug, ethrpc::alloy::conversions::IntoLegacy, hex_literal::hex, @@ -255,7 +256,7 @@ impl BalancerV2 { } Some(Self { - vault: deployment_address(contracts::BalancerV2Vault::raw_contract(), chain)?, + vault: ContractAddress(BalancerV2Vault::deployment_address(&chain.id())?.into_legacy()), weighted: address_for!( chain, [ diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 2563002169..d32a383fdf 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -9,6 +9,8 @@ use { }, alloy::{primitives::U256, signers::local::PrivateKeySigner}, contracts::alloy::{ + BalancerV2Authorizer, + BalancerV2Vault, ERC20Mintable, FlashLoanRouter, support::{Balances, Signatures}, @@ -272,7 +274,7 @@ impl Blockchain { .unwrap(); // Set up the settlement contract and related contracts. - let vault_authorizer = contracts::alloy::BalancerV2Authorizer::Instance::deploy_builder( + let vault_authorizer = BalancerV2Authorizer::Instance::deploy_builder( web3.alloy.clone(), main_trader_account.address().into_alloy(), ) @@ -280,18 +282,15 @@ impl Blockchain { .deploy() .await .unwrap(); - let vault = wait_for( - &web3, - contracts::BalancerV2Vault::builder( - &web3, - vault_authorizer.into_legacy(), - weth.address(), - 0.into(), - 0.into(), - ) - .from(main_trader_account.clone()) - .deploy(), + let vault = BalancerV2Vault::Instance::deploy_builder( + web3.alloy.clone(), + vault_authorizer, + weth.address().into_alloy(), + alloy::primitives::U256::ZERO, + alloy::primitives::U256::ZERO, ) + .from(main_trader_account.address().into_alloy()) + .deploy() .await .unwrap(); let authenticator = wait_for( @@ -304,7 +303,7 @@ impl Blockchain { .unwrap(); let mut settlement = wait_for( &web3, - contracts::GPv2Settlement::builder(&web3, authenticator.address(), vault.address()) + contracts::GPv2Settlement::builder(&web3, authenticator.address(), vault.into_legacy()) .from(main_trader_account.clone()) .deploy(), ) diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index cd3cebea79..b1ce292992 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -1,13 +1,13 @@ use { crate::deploy, contracts::{ - BalancerV2Vault, CowAmmLegacyHelper, GPv2AllowListAuthentication, GPv2Settlement, WETH9, alloy::{ BalancerV2Authorizer, + BalancerV2Vault, CoWSwapEthFlow, FlashLoanRouter, HooksTrampoline, @@ -17,7 +17,7 @@ use { support::{Balances, Signatures}, }, }, - ethcontract::{Address, H256, U256, errors::DeployError}, + ethcontract::{Address, H256, errors::DeployError}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::DomainSeparator, shared::ethrpc::Web3, @@ -31,7 +31,7 @@ pub struct DeployedContracts { pub struct Contracts { pub chain_id: u64, - pub balancer_vault: BalancerV2Vault, + pub balancer_vault: BalancerV2Vault::Instance, pub gp_settlement: GPv2Settlement, pub signatures: Signatures::Instance, pub gp_authenticator: GPv2AllowListAuthentication, @@ -83,7 +83,9 @@ impl Contracts { chain_id: network_id .parse() .expect("Couldn't parse network ID to u64"), - balancer_vault: BalancerV2Vault::deployed(web3).await.unwrap(), + balancer_vault: BalancerV2Vault::Instance::deployed(&web3.alloy) + .await + .unwrap(), gp_authenticator: GPv2AllowListAuthentication::deployed(web3).await.unwrap(), uniswap_v2_factory: UniswapV2Factory::Instance::deployed(&web3.alloy) .await @@ -139,15 +141,15 @@ impl Contracts { BalancerV2Authorizer::Instance::deploy(web3.alloy.clone(), admin.into_alloy()) .await .unwrap(); - let balancer_vault = deploy!( - web3, - BalancerV2Vault( - balancer_authorizer.address().into_legacy(), - weth.address(), - U256::from(0), - U256::from(0), - ) - ); + let balancer_vault = BalancerV2Vault::Instance::deploy( + web3.alloy.clone(), + *balancer_authorizer.address(), + weth.address().into_alloy(), + alloy::primitives::U256::ZERO, + alloy::primitives::U256::ZERO, + ) + .await + .unwrap(); let uniswap_v2_factory = UniswapV2Factory::Instance::deploy(web3.alloy.clone(), accounts[0].into_alloy()) @@ -169,7 +171,10 @@ impl Contracts { .expect("failed to initialize manager"); let gp_settlement = deploy!( web3, - GPv2Settlement(gp_authenticator.address(), balancer_vault.address(),) + GPv2Settlement( + gp_authenticator.address(), + balancer_vault.address().into_legacy(), + ) ); let balances = Balances::Instance::deploy(web3.alloy.clone()) .await @@ -180,12 +185,13 @@ impl Contracts { contracts::vault::grant_required_roles( &balancer_authorizer, - balancer_vault.address(), + *balancer_vault.address(), gp_settlement .vault_relayer() .call() .await - .expect("failed to retrieve Vault relayer contract address"), + .expect("failed to retrieve Vault relayer contract address") + .into_alloy(), ) .await .expect("failed to authorize Vault relayer"); diff --git a/crates/e2e/tests/e2e/vault_balances.rs b/crates/e2e/tests/e2e/vault_balances.rs index 8cef6b6fc6..780efc2c8b 100644 --- a/crates/e2e/tests/e2e/vault_balances.rs +++ b/crates/e2e/tests/e2e/vault_balances.rs @@ -1,8 +1,5 @@ use { - e2e::{ - setup::{eth, *}, - tx, - }, + e2e::setup::{eth, *}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -36,22 +33,23 @@ async fn vault_balances(web3: Web3) { // Approve GPv2 for trading token - .approve( - onchain.contracts().balancer_vault.address().into_alloy(), - eth(10), - ) + .approve(*onchain.contracts().balancer_vault.address(), eth(10)) .from(trader.address().into_alloy()) .send_and_watch() .await .unwrap(); - tx!( - trader.account(), - onchain.contracts().balancer_vault.set_relayer_approval( - trader.address(), - onchain.contracts().allowance, - true + onchain + .contracts() + .balancer_vault + .setRelayerApproval( + trader.address().into_alloy(), + onchain.contracts().allowance.into_alloy(), + true, ) - ); + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let services = Services::new(&onchain).await; services.start_protocol(solver).await; diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 6e97eaebec..981bcbb397 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -13,14 +13,19 @@ use { chain::Chain, clap::Parser, contracts::{ - BalancerV2Vault, GPv2Settlement, IUniswapV3Factory, WETH9, - alloy::{ChainalysisOracle, HooksTrampoline, InstanceExt, support::Balances}, + alloy::{ + BalancerV2Vault, + ChainalysisOracle, + HooksTrampoline, + InstanceExt, + support::Balances, + }, }, ethcontract::errors::DeployError, - ethrpc::alloy::conversions::IntoAlloy, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, futures::{FutureExt, StreamExt}, model::{DomainSeparator, order::BUY_ETH_ADDRESS}, num::ToPrimitive, @@ -144,19 +149,21 @@ pub async fn run(args: Arguments) { balance_overrider.clone(), ); - let vault = match args.shared.balancer_v2_vault_address { - Some(address) => Some(contracts::BalancerV2Vault::with_deployment_info( - &web3, address, None, - )), - None => match BalancerV2Vault::deployed(&web3).await { - Ok(contract) => Some(contract), - Err(DeployError::NotFound(_)) => { - tracing::warn!("balancer contracts are not deployed on this network"); - None + let vault_address = args.shared.balancer_v2_vault_address.or_else(|| { + let chain_id = chain.id(); + match BalancerV2Vault::deployment_address(&chain_id) { + addr @ Some(_) => addr, + addr @ None => { + tracing::warn!( + chain_id, + "balancer contracts are not deployed on this network" + ); + addr } - Err(err) => panic!("failed to get balancer vault contract: {err}"), - }, - }; + } + }); + let vault = + vault_address.map(|address| BalancerV2Vault::Instance::new(address, web3.alloy.clone())); let hooks_contract = match args.shared.hooks_contract_address { Some(address) => HooksTrampoline::Instance::new(address.into_alloy(), web3.alloy.clone()), @@ -186,7 +193,7 @@ pub async fn run(args: Arguments) { settlement_contract.clone(), balances_contract.clone(), vault_relayer, - vault.as_ref().map(|contract| contract.address()), + vault_address.map(IntoLegacy::into_legacy), balance_overrider, ), ); diff --git a/crates/shared/src/account_balances/simulation.rs b/crates/shared/src/account_balances/simulation.rs index 9152074cb1..a2acaff004 100644 --- a/crates/shared/src/account_balances/simulation.rs +++ b/crates/shared/src/account_balances/simulation.rs @@ -6,10 +6,13 @@ use { super::{BalanceFetching, Query, TransferSimulationError}, crate::account_balances::BalanceSimulator, anyhow::Result, - contracts::{BalancerV2Vault, erc20::Contract}, + contracts::{alloy::BalancerV2Vault::BalancerV2Vault, erc20::Contract}, ethcontract::{H160, U256}, - ethrpc::Web3, - futures::future, + ethrpc::{ + Web3, + alloy::conversions::{IntoAlloy, IntoLegacy}, + }, + futures::{TryFutureExt, future}, model::order::SellTokenSource, tracing::instrument, }; @@ -73,13 +76,25 @@ impl Balances { std::cmp::min(balance, allowance) } SellTokenSource::External => { - let vault = BalancerV2Vault::at(&self.web3, self.vault()); - let balance = token.balance_of(query.owner).call(); - let approved = vault - .methods() - .has_approved_relayer(query.owner, self.vault_relayer()) - .call(); - let allowance = token.allowance(query.owner, self.vault()).call(); + let vault = BalancerV2Vault::new(self.vault().into_alloy(), &self.web3.alloy); + // NOTE: the anyhow error conversion can be removed after migrating the token to + // alloy + let balance = token + .balance_of(query.owner) + .call() + .map_err(anyhow::Error::from); + let has_approved_relayer = vault.hasApprovedRelayer( + query.owner.into_alloy(), + self.vault_relayer().into_alloy(), + ); + let approved = has_approved_relayer + .call() + .into_future() + .map_err(anyhow::Error::from); + let allowance = token + .allowance(query.owner, self.vault()) + .call() + .map_err(anyhow::Error::from); let (balance, approved, allowance) = futures::try_join!(balance, approved, allowance)?; match approved { @@ -88,18 +103,20 @@ impl Balances { } } SellTokenSource::Internal => { - let vault = BalancerV2Vault::at(&self.web3, self.vault()); - let balance = vault - .methods() - .get_internal_balance(query.owner, vec![query.token]) - .call(); - let approved = vault - .methods() - .has_approved_relayer(query.owner, self.vault_relayer()) - .call(); + let vault = BalancerV2Vault::new(self.vault().into_alloy(), &self.web3.alloy); + + let get_internal_balance = vault + .getInternalBalance(query.owner.into_alloy(), vec![query.token.into_alloy()]); + let balance = get_internal_balance.call().into_future(); + + let has_approved_relayer = vault.hasApprovedRelayer( + query.owner.into_alloy(), + self.vault_relayer().into_alloy(), + ); + let approved = has_approved_relayer.call().into_future(); let (balance, approved) = futures::try_join!(balance, approved)?; match approved { - true => balance[0], // internal approvals are always U256::MAX + true => balance[0].into_legacy(), // internal approvals are always U256::MAX false => 0.into(), } } diff --git a/crates/shared/src/arguments.rs b/crates/shared/src/arguments.rs index b42b40ecb6..b951635376 100644 --- a/crates/shared/src/arguments.rs +++ b/crates/shared/src/arguments.rs @@ -271,7 +271,7 @@ pub struct Arguments { /// Override address of the balancer vault contract. #[clap(long, env)] - pub balancer_v2_vault_address: Option, + pub balancer_v2_vault_address: Option
, /// The amount of time a classification of a token into good or /// bad is valid for. diff --git a/crates/shared/src/bad_token/token_owner_finder/liquidity.rs b/crates/shared/src/bad_token/token_owner_finder/liquidity.rs index c5021470b2..f9869b3001 100644 --- a/crates/shared/src/bad_token/token_owner_finder/liquidity.rs +++ b/crates/shared/src/bad_token/token_owner_finder/liquidity.rs @@ -4,8 +4,9 @@ use { super::TokenOwnerProposing, crate::sources::{uniswap_v2::pair_provider::PairProvider, uniswap_v3_pair_provider}, anyhow::Result, - contracts::{BalancerV2Vault, IUniswapV3Factory}, + contracts::{IUniswapV3Factory, alloy::BalancerV2Vault}, ethcontract::{BlockNumber, H160}, + ethrpc::alloy::conversions::IntoLegacy, model::TokenPair, }; @@ -27,12 +28,12 @@ impl TokenOwnerProposing for UniswapLikePairProviderFinder { } /// The balancer vault contract contains all the balances of all pools. -pub struct BalancerVaultFinder(pub BalancerV2Vault); +pub struct BalancerVaultFinder(pub BalancerV2Vault::Instance); #[async_trait::async_trait] impl TokenOwnerProposing for BalancerVaultFinder { async fn find_candidate_owners(&self, _: H160) -> Result> { - Ok(vec![self.0.address()]) + Ok(vec![self.0.address().into_legacy()]) } } diff --git a/crates/shared/src/bad_token/token_owner_finder/mod.rs b/crates/shared/src/bad_token/token_owner_finder/mod.rs index 94cc4e97af..94182b6277 100644 --- a/crates/shared/src/bad_token/token_owner_finder/mod.rs +++ b/crates/shared/src/bad_token/token_owner_finder/mod.rs @@ -31,7 +31,7 @@ use { }, anyhow::{Context, Result}, chain::Chain, - contracts::{BalancerV2Vault, ERC20, IUniswapV3Factory, errors::EthcontractErrorType}, + contracts::{ERC20, IUniswapV3Factory, alloy::BalancerV2Vault, errors::EthcontractErrorType}, ethcontract::U256, futures::{Stream, StreamExt as _}, primitive_types::H160, @@ -282,7 +282,7 @@ pub async fn init( chain: &Chain, http_factory: &HttpClientFactory, pair_providers: &[PairProvider], - vault: Option<&BalancerV2Vault>, + vault: Option<&BalancerV2Vault::Instance>, uniswapv3_factory: Option<&IUniswapV3Factory>, base_tokens: &BaseTokens, settlement_contract: H160, diff --git a/crates/shared/src/bad_token/trace_call.rs b/crates/shared/src/bad_token/trace_call.rs index e71769dbb3..548f511cc5 100644 --- a/crates/shared/src/bad_token/trace_call.rs +++ b/crates/shared/src/bad_token/trace_call.rs @@ -378,7 +378,10 @@ mod tests { sources::{BaselineSource, uniswap_v2}, }, chain::Chain, - contracts::{BalancerV2Vault, IUniswapV3Factory}, + contracts::{ + IUniswapV3Factory, + alloy::{BalancerV2Vault, InstanceExt}, + }, ethrpc::Web3, hex_literal::hex, std::{env, time::Duration}, @@ -732,7 +735,9 @@ mod tests { base_tokens: base_tokens.to_vec(), }), Arc::new(BalancerVaultFinder( - BalancerV2Vault::deployed(&web3).await.unwrap(), + BalancerV2Vault::Instance::deployed(&web3.alloy) + .await + .unwrap(), )), Arc::new( UniswapV3Finder::new( diff --git a/crates/shared/src/sources/balancer_v2/pools/common.rs b/crates/shared/src/sources/balancer_v2/pools/common.rs index c7efa46c8b..23a3d90c7c 100644 --- a/crates/shared/src/sources/balancer_v2/pools/common.rs +++ b/crates/shared/src/sources/balancer_v2/pools/common.rs @@ -376,6 +376,7 @@ mod tests { transports::mock::Asserter, }, anyhow::bail, + contracts::alloy::BalancerV2Vault, ethcontract::U256, maplit::{btreemap, hashmap}, mockall::predicate, diff --git a/crates/solver/src/interactions/balancer_v2.rs b/crates/solver/src/interactions/balancer_v2.rs index a91d4f8810..727b598d9d 100644 --- a/crates/solver/src/interactions/balancer_v2.rs +++ b/crates/solver/src/interactions/balancer_v2.rs @@ -1,6 +1,9 @@ use { alloy::primitives::U256, - contracts::{GPv2Settlement, alloy::BalancerV2Vault}, + contracts::{ + GPv2Settlement, + alloy::BalancerV2Vault::{self, IVault}, + }, ethcontract::{Bytes, H256}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, shared::{ @@ -27,7 +30,7 @@ pub static NEVER: LazyLock = LazyLock::new(|| U256::from(1) << 255); impl BalancerSwapGivenOutInteraction { pub fn encode_swap(&self) -> EncodedInteraction { - let single_swap = BalancerV2Vault::IVault::SingleSwap { + let single_swap = IVault::SingleSwap { poolId: self.pool_id.into_alloy(), kind: 1, // GivenOut assetIn: self.asset_in_max.token.into_alloy(), @@ -35,7 +38,7 @@ impl BalancerSwapGivenOutInteraction { amount: self.asset_out.amount.into_alloy(), userData: self.user_data.clone().into_alloy(), }; - let funds = BalancerV2Vault::IVault::FundManagement { + let funds = IVault::FundManagement { sender: self.settlement.address().into_alloy(), fromInternalBalance: false, recipient: self.settlement.address().into_alloy(), From 70eda658739a6cb6602d6a5be5b842a6afc45bfc Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Wed, 22 Oct 2025 12:08:53 +0200 Subject: [PATCH 029/117] Replace `hex` with `const_hex` (#3797) # Description @jmg-duarte noticed that there are crates significantly faster than `hex` for de/encoding bytes (10-50x). Since a lot of our time is spent (de)/serializing bytes and addresses this should give us a nice free performance boost. # Changes - replaced `hex` with `const_hex` everywhere - replace handrolled `0x` prefixing with `const_hex::encode_prefixed` ## How to test e2e tests should be sufficient to cover these changes --- Cargo.lock | 40 ++++++++---------- Cargo.toml | 2 +- crates/app-data/Cargo.toml | 2 +- crates/app-data/src/app_data.rs | 4 +- crates/app-data/src/app_data_hash.rs | 12 +++--- crates/app-data/src/hooks.rs | 5 +-- crates/autopilot/Cargo.toml | 2 +- crates/autopilot/src/domain/auction/order.rs | 8 ++-- crates/autopilot/src/shadow.rs | 2 +- crates/autopilot/src/util/bytes.rs | 2 +- crates/bytes-hex/Cargo.toml | 2 +- crates/bytes-hex/src/lib.rs | 4 +- crates/cow-amm/Cargo.toml | 2 +- crates/cow-amm/src/amm.rs | 6 +-- crates/database/Cargo.toml | 2 +- crates/database/src/byte_array.rs | 4 +- crates/driver/Cargo.toml | 2 +- .../liquidity_sources/liquorice/notifier.rs | 2 +- crates/driver/src/infra/simulator/enso/mod.rs | 2 +- crates/driver/src/tests/mod.rs | 2 +- crates/driver/src/tests/setup/blockchain.rs | 2 +- crates/driver/src/tests/setup/driver.rs | 4 +- crates/driver/src/tests/setup/mod.rs | 17 ++++---- crates/driver/src/tests/setup/solver.rs | 10 ++--- crates/driver/src/util/bytes.rs | 2 +- crates/driver/src/util/serialize/hex.rs | 10 ++--- crates/e2e/Cargo.toml | 2 +- crates/e2e/src/api/liquorice/onchain.rs | 2 +- crates/e2e/src/setup/colocation.rs | 2 +- crates/e2e/src/setup/services.rs | 6 +-- crates/e2e/tests/e2e/autopilot_leader.rs | 4 +- crates/e2e/tests/e2e/buffers.rs | 2 +- crates/e2e/tests/e2e/cow_amm.rs | 42 ++++++++++++------- crates/e2e/tests/e2e/ethflow.rs | 4 +- crates/e2e/tests/e2e/jit_orders.rs | 2 +- crates/e2e/tests/e2e/limit_orders.rs | 2 +- crates/e2e/tests/e2e/liquidity.rs | 2 +- .../e2e/liquidity_source_notification.rs | 2 +- crates/e2e/tests/e2e/quote_verification.rs | 4 +- crates/e2e/tests/e2e/solver_competition.rs | 8 ++-- crates/ethrpc/Cargo.toml | 2 +- crates/model/Cargo.toml | 2 +- crates/model/src/interaction.rs | 5 +-- crates/model/src/lib.rs | 4 +- crates/model/src/order.rs | 10 ++--- crates/model/src/signature.rs | 6 +-- crates/orderbook/Cargo.toml | 2 +- crates/orderbook/src/run.rs | 6 +-- crates/refunder/Cargo.toml | 2 +- crates/refunder/src/refund_service.rs | 2 +- crates/shared/Cargo.toml | 2 +- crates/shared/src/signature_validator/mod.rs | 7 +--- .../src/signature_validator/simulation.rs | 4 +- crates/shared/src/trade_finding/mod.rs | 2 +- crates/shared/src/zeroex_api.rs | 6 +-- crates/solver/Cargo.toml | 2 +- crates/solver/src/interactions/allowances.rs | 2 +- crates/solver/src/interactions/balancer_v2.rs | 2 +- crates/solver/src/liquidity/zeroex.rs | 2 +- crates/solvers-dto/Cargo.toml | 2 +- crates/solvers-dto/src/lib.rs | 6 +-- crates/solvers/Cargo.toml | 5 +-- crates/solvers/src/util/bytes.rs | 2 +- crates/solvers/src/util/fmt/hex.rs | 6 +-- 64 files changed, 159 insertions(+), 168 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fdb9518a01..4fb7937d0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -774,8 +774,8 @@ version = "0.1.0" dependencies = [ "anyhow", "bytes-hex", + "const-hex", "ethcontract", - "hex", "hex-literal", "number", "primitive-types", @@ -1102,6 +1102,7 @@ dependencies = [ "chain", "chrono", "clap", + "const-hex", "contracts", "cow-amm", "dashmap", @@ -1110,7 +1111,6 @@ dependencies = [ "ethcontract", "ethrpc", "futures", - "hex", "hex-literal", "humantime", "indexmap 2.10.0", @@ -1823,7 +1823,7 @@ dependencies = [ name = "bytes-hex" version = "0.1.0" dependencies = [ - "hex", + "const-hex", "serde", "serde_json", "serde_with", @@ -2057,15 +2057,14 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.14.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" +checksum = "3bb320cac8a0750d7f25280aa97b09c26edfe161164238ecbbb31092b079e735" dependencies = [ "cfg-if", "cpufeatures", - "hex", "proptest", - "serde", + "serde_core", ] [[package]] @@ -2176,10 +2175,10 @@ dependencies = [ "anyhow", "app-data", "async-trait", + "const-hex", "contracts", "ethcontract", "ethrpc", - "hex", "hex-literal", "model", "shared", @@ -2437,9 +2436,9 @@ version = "0.1.0" dependencies = [ "bigdecimal", "chrono", + "const-hex", "const_format", "futures", - "hex", "maplit", "serde_json", "sqlx", @@ -2589,6 +2588,7 @@ dependencies = [ "chain", "chrono", "clap", + "const-hex", "contracts", "cow-amm", "dashmap", @@ -2599,7 +2599,6 @@ dependencies = [ "ethrpc", "futures", "gas-estimation", - "hex", "hex-literal", "humantime", "humantime-serde", @@ -2659,13 +2658,13 @@ dependencies = [ "bigdecimal", "chrono", "clap", + "const-hex", "contracts", "database", "driver", "ethcontract", "ethrpc", "futures", - "hex", "hex-literal", "model", "number", @@ -2933,9 +2932,9 @@ dependencies = [ "alloy", "anyhow", "async-trait", + "const-hex", "ethcontract", "futures", - "hex", "hex-literal", "itertools 0.14.0", "maplit", @@ -3479,9 +3478,6 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] [[package]] name = "hex-conservative" @@ -4254,8 +4250,8 @@ dependencies = [ "bigdecimal", "bytes-hex", "chrono", + "const-hex", "derive_more 1.0.0", - "hex", "hex-literal", "maplit", "num", @@ -4698,12 +4694,12 @@ dependencies = [ "chain", "chrono", "clap", + "const-hex", "contracts", "database", "ethcontract", "ethrpc", "futures", - "hex", "hex-literal", "humantime", "hyper 0.14.29", @@ -5333,13 +5329,13 @@ dependencies = [ "anyhow", "async-trait", "clap", + "const-hex", "contracts", "database", "ethcontract", "ethrpc", "futures", "gas-estimation", - "hex", "humantime", "itertools 0.14.0", "mimalloc", @@ -6082,6 +6078,7 @@ dependencies = [ "chain", "chrono", "clap", + "const-hex", "contracts", "dashmap", "database", @@ -6092,7 +6089,6 @@ dependencies = [ "ethrpc", "futures", "gas-estimation", - "hex", "hex-literal", "humantime", "indexmap 2.10.0", @@ -6203,12 +6199,12 @@ dependencies = [ "anyhow", "arc-swap", "async-trait", + "const-hex", "contracts", "derivative", "ethcontract", "ethrpc", "futures", - "hex", "hex-literal", "itertools 0.14.0", "maplit", @@ -6240,13 +6236,13 @@ dependencies = [ "chain", "chrono", "clap", + "const-hex", "contracts", "derive_more 1.0.0", "ethcontract", "ethereum-types", "ethrpc", "futures", - "hex", "hex-literal", "hyper 0.14.29", "itertools 0.14.0", @@ -6283,7 +6279,7 @@ dependencies = [ "bigdecimal", "bytes-hex", "chrono", - "hex", + "const-hex", "number", "serde", "serde_with", diff --git a/Cargo.toml b/Cargo.toml index e48d2bdd6f..0bfbaf3dce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ ethereum-types = "0.14.1" flate2 = "1.0.30" futures = "0.3.30" gas-estimation = { git = "https://github.com/cowprotocol/gas-estimation", tag = "v0.7.3", features = ["web3_", "tokio_"] } -hex = { version = "0.4.3", default-features = false } +const-hex = "1.17.0" hex-literal = "0.4.1" humantime = "2.1.0" humantime-serde = "1.1.1" diff --git a/crates/app-data/Cargo.toml b/crates/app-data/Cargo.toml index 83f6626078..1669d90f5e 100644 --- a/crates/app-data/Cargo.toml +++ b/crates/app-data/Cargo.toml @@ -13,7 +13,7 @@ serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } primitive-types = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } number = { path = "../number" } diff --git a/crates/app-data/src/app_data.rs b/crates/app-data/src/app_data.rs index 4f3e31163e..ddd00cb5d8 100644 --- a/crates/app-data/src/app_data.rs +++ b/crates/app-data/src/app_data.rs @@ -332,7 +332,7 @@ impl Display for OrderUid { let mut bytes = [0u8; 2 + 56 * 2]; bytes[..2].copy_from_slice(b"0x"); // Unwrap because the length is always correct. - hex::encode_to_slice(self.0.as_slice(), &mut bytes[2..]).unwrap(); + const_hex::encode_to_slice(self.0.as_slice(), &mut bytes[2..]).unwrap(); // Unwrap because the string is always valid utf8. let str = std::str::from_utf8(&bytes).unwrap(); f.write_str(str) @@ -383,7 +383,7 @@ impl<'de> Deserialize<'de> for OrderUid { )) })?; let mut value = [0u8; 56]; - hex::decode_to_slice(s, value.as_mut()).map_err(|err| { + const_hex::decode_to_slice(s, value.as_mut()).map_err(|err| { de::Error::custom(format!("failed to decode {s:?} as hex uid: {err}")) })?; Ok(OrderUid(value)) diff --git a/crates/app-data/src/app_data_hash.rs b/crates/app-data/src/app_data_hash.rs index 8e8bbd9c06..506e00363e 100644 --- a/crates/app-data/src/app_data_hash.rs +++ b/crates/app-data/src/app_data_hash.rs @@ -55,16 +55,16 @@ impl AppDataHash { impl Debug for AppDataHash { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - write!(f, "0x{}", hex::encode(self.0)) + write!(f, "{}", const_hex::encode_prefixed(self.0)) } } impl FromStr for AppDataHash { - type Err = hex::FromHexError; + type Err = const_hex::FromHexError; fn from_str(s: &str) -> Result { let mut bytes = [0u8; 32]; - hex::decode_to_slice(s.strip_prefix("0x").unwrap_or(s), &mut bytes)?; + const_hex::decode_to_slice(s.strip_prefix("0x").unwrap_or(s), &mut bytes)?; Ok(Self(bytes)) } } @@ -77,7 +77,7 @@ impl Serialize for AppDataHash { let mut bytes = [0u8; 2 + 32 * 2]; bytes[..2].copy_from_slice(b"0x"); // Can only fail if the buffer size does not match but we know it is correct. - hex::encode_to_slice(self.0, &mut bytes[2..]).unwrap(); + const_hex::encode_to_slice(self.0, &mut bytes[2..]).unwrap(); // Hex encoding is always valid utf8. let s = std::str::from_utf8(&bytes).unwrap(); serializer.serialize_str(s) @@ -152,7 +152,7 @@ mod tests { ) .unwrap_err() .to_string(), - "Invalid character 'x' at position 0" + "invalid character 'x' at position 0" ); } @@ -160,7 +160,7 @@ mod tests { fn invalid_length() { assert_eq!( AppDataHash::from_str("0x00").unwrap_err().to_string(), - "Invalid string length" + "invalid string length" ); } diff --git a/crates/app-data/src/hooks.rs b/crates/app-data/src/hooks.rs index 32e6714491..8c072e6f45 100644 --- a/crates/app-data/src/hooks.rs +++ b/crates/app-data/src/hooks.rs @@ -44,10 +44,7 @@ impl Debug for Hook { fn fmt(&self, f: &mut Formatter) -> fmt::Result { f.debug_struct("Hook") .field("target", &self.target) - .field( - "call_data", - &format_args!("0x{}", hex::encode(&self.call_data)), - ) + .field("call_data", &const_hex::encode_prefixed(&self.call_data)) .field("gas_limit", &self.gas_limit) .finish() } diff --git a/crates/autopilot/Cargo.toml b/crates/autopilot/Cargo.toml index bbbd52a57e..cbf827442b 100644 --- a/crates/autopilot/Cargo.toml +++ b/crates/autopilot/Cargo.toml @@ -33,7 +33,7 @@ ethcontract = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } observe = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } humantime = { workspace = true } indexmap = { workspace = true } diff --git a/crates/autopilot/src/domain/auction/order.rs b/crates/autopilot/src/domain/auction/order.rs index 30771df53e..24434c687e 100644 --- a/crates/autopilot/src/domain/auction/order.rs +++ b/crates/autopilot/src/domain/auction/order.rs @@ -55,7 +55,7 @@ impl Display for OrderUid { let mut bytes = [0u8; 2 + 56 * 2]; bytes[..2].copy_from_slice(b"0x"); // Unwrap because the length is always correct. - hex::encode_to_slice(self.0.as_slice(), &mut bytes[2..]).unwrap(); + const_hex::encode_to_slice(self.0.as_slice(), &mut bytes[2..]).unwrap(); // Unwrap because the string is always valid utf8. let str = std::str::from_utf8(&bytes).unwrap(); f.write_str(str) @@ -105,7 +105,9 @@ pub enum BuyTokenDestination { /// json document, which associates arbitrary information with an order while /// being signed by the user. #[derive(Clone, derive_more::Debug, PartialEq)] -pub struct AppDataHash(#[debug("0x{}", hex::encode::<&[u8]>(self.0.as_ref()))] pub [u8; 32]); +pub struct AppDataHash( + #[debug("{}", const_hex::encode_prefixed::<&[u8]>(self.0.as_ref()))] pub [u8; 32], +); /// Signature over the order data. /// All variants rely on the EIP-712 hash of the order data, referred to as the @@ -161,7 +163,7 @@ impl Debug for Signature { } let scheme = format!("{:?}", self.scheme()); - let bytes = format!("0x{}", hex::encode(self.to_bytes())); + let bytes = const_hex::encode_prefixed(self.to_bytes()); f.debug_tuple(&scheme).field(&bytes).finish() } } diff --git a/crates/autopilot/src/shadow.rs b/crates/autopilot/src/shadow.rs index 50dfacf3c1..71b31c9b85 100644 --- a/crates/autopilot/src/shadow.rs +++ b/crates/autopilot/src/shadow.rs @@ -241,7 +241,7 @@ impl RunLoop { } tracing::debug!( driver = %driver.name, - calldata = format!("0x{}", hex::encode(calldata)), + calldata = const_hex::encode_prefixed(calldata), "revealed calldata" ); })) diff --git a/crates/autopilot/src/util/bytes.rs b/crates/autopilot/src/util/bytes.rs index bf55ab60e5..c8b2d0992a 100644 --- a/crates/autopilot/src/util/bytes.rs +++ b/crates/autopilot/src/util/bytes.rs @@ -7,7 +7,7 @@ where T: AsRef<[u8]>, { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "0x{}", hex::encode(&self.0)) + write!(f, "{}", const_hex::encode_prefixed(&self.0)) } } diff --git a/crates/bytes-hex/Cargo.toml b/crates/bytes-hex/Cargo.toml index 316c5092fc..dcfaee348b 100644 --- a/crates/bytes-hex/Cargo.toml +++ b/crates/bytes-hex/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } -hex = { workspace = true, features = ["alloc"] } +const-hex = { workspace = true } [lints] workspace = true diff --git a/crates/bytes-hex/src/lib.rs b/crates/bytes-hex/src/lib.rs index eddb23abd8..a8d24c506a 100644 --- a/crates/bytes-hex/src/lib.rs +++ b/crates/bytes-hex/src/lib.rs @@ -15,7 +15,7 @@ where v[0] = b'0'; v[1] = b'x'; // Unwrap because only possible error is vector wrong size which cannot happen. - hex::encode_to_slice(bytes, &mut v[2..]).unwrap(); + const_hex::encode_to_slice(bytes, &mut v[2..]).unwrap(); // Unwrap because encoded data is always valid utf8. serializer.serialize_str(&String::from_utf8(v).unwrap()) } @@ -28,7 +28,7 @@ where let hex_str = prefixed_hex_str .strip_prefix("0x") .ok_or_else(|| D::Error::custom("missing '0x' prefix"))?; - hex::decode(hex_str).map_err(D::Error::custom) + const_hex::decode(hex_str).map_err(D::Error::custom) } pub struct BytesHex(()); diff --git a/crates/cow-amm/Cargo.toml b/crates/cow-amm/Cargo.toml index 11b7517c97..787a4a80b3 100644 --- a/crates/cow-amm/Cargo.toml +++ b/crates/cow-amm/Cargo.toml @@ -14,7 +14,7 @@ model = { workspace = true } shared = { workspace = true } tokio = { workspace = true, features = [] } tracing = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } [lints] diff --git a/crates/cow-amm/src/amm.rs b/crates/cow-amm/src/amm.rs index 41176fabb4..42369fa7e4 100644 --- a/crates/cow-amm/src/amm.rs +++ b/crates/cow-amm/src/amm.rs @@ -155,7 +155,7 @@ fn convert_interactions(interactions: Vec) -> Vec fn convert_kind(bytes: &[u8]) -> Result { - match hex::encode(bytes).as_str() { + match const_hex::encode(bytes).as_str() { "f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775" => Ok(OrderKind::Sell), "6ed88e868af0a1983e3886d5f3e95a2fafbd6c3450bc229e27342283dc429ccc" => Ok(OrderKind::Buy), bytes => anyhow::bail!("unknown order type: {bytes}"), @@ -167,7 +167,7 @@ const BALANCE_INTERNAL: &str = "4ac99ace14ee0a5ef932dc609df0943ab7ac16b758363461 const BALANCE_EXTERNAL: &str = "abee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea0632"; fn convert_sell_token_source(bytes: &[u8]) -> Result { - match hex::encode(bytes).as_str() { + match const_hex::encode(bytes).as_str() { BALANCE_ERC20 => Ok(SellTokenSource::Erc20), BALANCE_INTERNAL => Ok(SellTokenSource::Internal), BALANCE_EXTERNAL => Ok(SellTokenSource::External), @@ -176,7 +176,7 @@ fn convert_sell_token_source(bytes: &[u8]) -> Result { } fn convert_buy_token_destination(bytes: &[u8]) -> Result { - match hex::encode(bytes).as_str() { + match const_hex::encode(bytes).as_str() { BALANCE_ERC20 => Ok(BuyTokenDestination::Erc20), BALANCE_INTERNAL => Ok(BuyTokenDestination::Internal), bytes => anyhow::bail!("unknown buy token destination: {bytes}"), diff --git a/crates/database/Cargo.toml b/crates/database/Cargo.toml index 22c2442ffe..13ee6bc92f 100644 --- a/crates/database/Cargo.toml +++ b/crates/database/Cargo.toml @@ -10,7 +10,7 @@ bigdecimal = { workspace = true } chrono = { workspace = true, features = ["clock"] } const_format = { workspace = true } futures = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } sqlx = { workspace = true } strum = { workspace = true } serde_json = { workspace = true } diff --git a/crates/database/src/byte_array.rs b/crates/database/src/byte_array.rs index 106b1096fe..e4886bbe40 100644 --- a/crates/database/src/byte_array.rs +++ b/crates/database/src/byte_array.rs @@ -18,7 +18,7 @@ pub struct ByteArray(pub [u8; N]); impl Debug for ByteArray { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - write!(f, "0x{}", hex::encode(self.0)) + write!(f, "{}", const_hex::encode_prefixed(self.0)) } } @@ -54,7 +54,7 @@ impl Decode<'_, Postgres> for ByteArray { .as_bytes()? .strip_prefix(b"\\x") .ok_or("text does not start with \\x")?; - hex::decode_to_slice(text, &mut bytes)? + const_hex::decode_to_slice(text, &mut bytes)? } }; Ok(Self(bytes)) diff --git a/crates/driver/Cargo.toml b/crates/driver/Cargo.toml index f1bd1dab9c..87bcbab1fe 100644 --- a/crates/driver/Cargo.toml +++ b/crates/driver/Cargo.toml @@ -31,7 +31,7 @@ ethabi = { workspace = true } ethereum-types = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } humantime = { workspace = true } humantime-serde = { workspace = true } diff --git a/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs b/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs index 2da783a47b..b321a1979d 100644 --- a/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs +++ b/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs @@ -172,7 +172,7 @@ mod utils { #[test] fn test_extract_rfq_id_from_valid_settle_single_call() { - let calldata = hex::decode("9935c868000000000000000000000000b10b9c690a681b6285c2e2df7734f9d729c5c4d500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000001dcd65000000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab410000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000001dcd6500000000000000000000000000000000000000000000000000000000001dcd650000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000068a76fd0000000000000000000000000b10b9c690a681b6285c2e2df7734f9d729c5c4d5000000000000000000000000000000000000000000000000000000000000002463393964326533662d373032622d343963392d386262382d343337373537373066326633000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000041d44f6881d24cd3ad94561d1aad5e220929181cf728f89620629e0efbe3daa9833b9f2967bf37381f56b41266327a3804c92204f30a2d660cae8b42cd6f7d9b701c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000041000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); + let calldata = const_hex::decode("9935c868000000000000000000000000b10b9c690a681b6285c2e2df7734f9d729c5c4d500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000001dcd65000000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab410000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000001dcd6500000000000000000000000000000000000000000000000000000000001dcd650000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000068a76fd0000000000000000000000000b10b9c690a681b6285c2e2df7734f9d729c5c4d5000000000000000000000000000000000000000000000000000000000000002463393964326533662d373032622d343963392d386262382d343337373537373066326633000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000041d44f6881d24cd3ad94561d1aad5e220929181cf728f89620629e0efbe3daa9833b9f2967bf37381f56b41266327a3804c92204f30a2d660cae8b42cd6f7d9b701c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000041000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap(); let liquorice_settlement_address = H160::random().into(); let rfq_id = extract_rfq_id_from_interaction( diff --git a/crates/driver/src/infra/simulator/enso/mod.rs b/crates/driver/src/infra/simulator/enso/mod.rs index 59cf644b73..e7f30948ef 100644 --- a/crates/driver/src/infra/simulator/enso/mod.rs +++ b/crates/driver/src/infra/simulator/enso/mod.rs @@ -95,7 +95,7 @@ impl From for Result { return Err(Error::Revert(format!( "{}: {}", response.exit_reason, - hex::encode(&response.return_data) + const_hex::encode(&response.return_data) ))); } Ok(response.gas_used.into()) diff --git a/crates/driver/src/tests/mod.rs b/crates/driver/src/tests/mod.rs index b0def01db9..80718b9ed7 100644 --- a/crates/driver/src/tests/mod.rs +++ b/crates/driver/src/tests/mod.rs @@ -5,5 +5,5 @@ mod setup; pub use setup::setup; fn hex_address(value: ethcontract::H160) -> String { - format!("0x{}", hex::encode(value.as_bytes())) + const_hex::encode_prefixed(value.as_bytes()) } diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index d32a383fdf..b45471b3d0 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -1020,7 +1020,7 @@ pub async fn set_code(web3: &Web3, address: eth::H160, code: &[u8]) { web3.transport() .execute( "anvil_setCode", - vec![json!(address), json!(format!("0x{}", hex::encode(code)))], + vec![json!(address), json!(const_hex::encode_prefixed(code))], ) .await .unwrap(); diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index 2c679d1026..161530bf98 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -110,7 +110,7 @@ pub fn solve_req(test: &Test) -> serde_json::Value { }, "appData": app_data::AppDataHash(quote.order.app_data.hash().0 .0), "signingScheme": "eip712", - "signature": format!("0x{}", hex::encode(quote.order_signature(&test.blockchain))), + "signature": const_hex::encode_prefixed(quote.order_signature(&test.blockchain)), "quote": quote.order.quote, }); if let Some(receiver) = quote.order.receiver { @@ -329,7 +329,7 @@ async fn create_config_file( .map(|abs| abs.0) .unwrap_or_default(), solver.slippage.relative, - hex::encode(solver.private_key.secret_bytes()), + const_hex::encode(solver.private_key.secret_bytes()), solver.timeouts.solving_share_of_deadline.get(), solver.timeouts.http_delay.num_milliseconds(), serde_json::to_string(&solver.fee_handler).unwrap(), diff --git a/crates/driver/src/tests/setup/mod.rs b/crates/driver/src/tests/setup/mod.rs index 32299e4467..d920a19755 100644 --- a/crates/driver/src/tests/setup/mod.rs +++ b/crates/driver/src/tests/setup/mod.rs @@ -371,7 +371,7 @@ pub fn test_solver() -> Solver { name: solver::NAME.to_owned(), balance: eth::U256::exp10(18), private_key: ethcontract::PrivateKey::from_slice( - hex::decode("a131a35fb8f614b31611f4fe68b6fc538b0febd2f75cd68e1282d8fd45b63326") + const_hex::decode("a131a35fb8f614b31611f4fe68b6fc538b0febd2f75cd68e1282d8fd45b63326") .unwrap(), ) .unwrap(), @@ -924,7 +924,7 @@ impl Setup { // Hardcoded trader account. Don't use this account for anything else!!! let trader_address = eth::H160::from_str(TRADER_ADDRESS).unwrap(); let trader_secret_key = SecretKey::from_slice( - &hex::decode("f9f831cee763ef826b8d45557f0f8677b27045e0e011bcd78571a40acc8a6cc3") + &const_hex::decode("f9f831cee763ef826b8d45557f0f8677b27045e0e011bcd78571a40acc8a6cc3") .unwrap(), ) .unwrap(); @@ -1586,9 +1586,9 @@ impl QuoteOk<'_> { let target = interaction.get("target").unwrap().as_str().unwrap(); let value = interaction.get("value").unwrap().as_str().unwrap(); let calldata = interaction.get("callData").unwrap().as_str().unwrap(); - assert_eq!(target, format!("0x{}", hex::encode(expected.address))); + assert_eq!(target, const_hex::encode_prefixed(expected.address)); assert_eq!(value, "0"); - assert_eq!(calldata, format!("0x{}", hex::encode(&expected.calldata))); + assert_eq!(calldata, const_hex::encode_prefixed(&expected.calldata)); } self } @@ -1614,10 +1614,7 @@ impl QuoteOk<'_> { let app_data = result_jit_order.get("appData").unwrap().as_str().unwrap(); assert_eq!( app_data, - format!( - "0x{}", - hex::encode(expected.quoted_order.order.app_data.hash().0.0) - ) + const_hex::encode_prefixed(expected.quoted_order.order.app_data.hash().0.0) ); let result_pre_interactions = result @@ -1637,9 +1634,9 @@ impl QuoteOk<'_> { let target = interaction.get("target").unwrap().as_str().unwrap(); let value = interaction.get("value").unwrap().as_str().unwrap(); let calldata = interaction.get("callData").unwrap().as_str().unwrap(); - assert_eq!(target, format!("0x{}", hex::encode(expected.address))); + assert_eq!(target, const_hex::encode_prefixed(expected.address)); assert_eq!(value, "0"); - assert_eq!(calldata, format!("0x{}", hex::encode(&expected.calldata))); + assert_eq!(calldata, const_hex::encode_prefixed(&expected.calldata)); } self } diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index cc336aad30..2bfe616d6c 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -145,7 +145,7 @@ impl Solver { order::Kind::Limit => "limit", }, "appData": app_data::AppDataHash(quote.order.app_data.hash().0.0), - "signature": if config.quote { "0x".to_string() } else { format!("0x{}", hex::encode(quote.order_signature(config.blockchain))) }, + "signature": if config.quote { "0x".to_string() } else { const_hex::encode_prefixed(quote.order_signature(config.blockchain)) }, "signingScheme": if config.quote { "eip1271" } else { "eip712" }, }); if let Some(receiver) = quote.order.receiver { @@ -195,7 +195,7 @@ impl Solver { "internalize": interaction.internalize, "target": hex_address(interaction.address), "value": "0", - "callData": format!("0x{}", hex::encode(&interaction.calldata)), + "callData": const_hex::encode_prefixed(&interaction.calldata), "allowances": [], "inputs": interaction.inputs.iter().map(|input| { json!({ @@ -275,7 +275,7 @@ impl Solver { "internalize": interaction.internalize, "target": hex_address(interaction.address), "value": "0", - "callData": format!("0x{}", hex::encode(&interaction.calldata)), + "callData": const_hex::encode_prefixed(&interaction.calldata), "allowances": [], "inputs": interaction.inputs.iter().map(|input| { json!({ @@ -298,7 +298,7 @@ impl Solver { "internalize": interaction.internalize, "target": hex_address(interaction.address), "value": "0", - "callData": format!("0x{}", hex::encode(&interaction.calldata)), + "callData": const_hex::encode_prefixed(&interaction.calldata), "allowances": [], "inputs": interaction.inputs.iter().map(|input| { json!({ @@ -365,7 +365,7 @@ impl Solver { }, "sellTokenBalance": jit.quoted_order.order.sell_token_source, "buyTokenBalance": jit.quoted_order.order.buy_token_destination, - "signature": format!("0x{}", hex::encode(jit.quoted_order.order_signature_with_private_key(config.blockchain, &config.private_key))), + "signature": const_hex::encode_prefixed(jit.quoted_order.order_signature_with_private_key(config.blockchain, &config.private_key)), "signingScheme": if config.quote { "eip1271" } else { "eip712" }, }); trades_json.push(json!({ diff --git a/crates/driver/src/util/bytes.rs b/crates/driver/src/util/bytes.rs index 1ff531c545..7e3ade9e18 100644 --- a/crates/driver/src/util/bytes.rs +++ b/crates/driver/src/util/bytes.rs @@ -7,7 +7,7 @@ where T: AsRef<[u8]>, { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "0x{}", hex::encode(&self.0)) + write!(f, "{}", const_hex::encode_prefixed(&self.0)) } } diff --git a/crates/driver/src/util/serialize/hex.rs b/crates/driver/src/util/serialize/hex.rs index 20af6c411e..3e04b3c3ce 100644 --- a/crates/driver/src/util/serialize/hex.rs +++ b/crates/driver/src/util/serialize/hex.rs @@ -27,7 +27,7 @@ impl<'de> DeserializeAs<'de, Vec> for Hex { "failed to decode {s:?} as a hex string: missing \"0x\" prefix", ))); } - hex::decode(&s[2..]).map_err(|err| { + const_hex::decode(&s[2..]).map_err(|err| { de::Error::custom(format!("failed to decode {s:?} as a hex string: {err}",)) }) } @@ -39,8 +39,7 @@ impl<'de> DeserializeAs<'de, Vec> for Hex { impl SerializeAs> for Hex { fn serialize_as(source: &Vec, serializer: S) -> Result { - let hex = hex::encode(source); - serializer.serialize_str(&format!("0x{hex}")) + serializer.serialize_str(&const_hex::encode_prefixed(source)) } } @@ -69,7 +68,7 @@ impl<'de, const N: usize> DeserializeAs<'de, [u8; N]> for Hex { "failed to decode {s:?} as a hex string: missing \"0x\" prefix", ))); } - let decoded = hex::decode(&s[2..]).map_err(|err| { + let decoded = const_hex::decode(&s[2..]).map_err(|err| { de::Error::custom(format!("failed to decode {s:?} as a hex string: {err}",)) })?; if decoded.len() != N { @@ -89,7 +88,6 @@ impl<'de, const N: usize> DeserializeAs<'de, [u8; N]> for Hex { impl SerializeAs<[u8; N]> for Hex { fn serialize_as(source: &[u8; N], serializer: S) -> Result { - let hex = hex::encode(source); - serializer.serialize_str(&format!("0x{hex}")) + serializer.serialize_str(&const_hex::encode_prefixed(source)) } } diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 6913a17762..50201b605d 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -23,7 +23,7 @@ driver = { workspace = true } ethcontract = { workspace = true } ethrpc = { workspace = true, features = ["test-util"] } futures = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } model = { workspace = true, features = ["e2e"] } number = { workspace = true } diff --git a/crates/e2e/src/api/liquorice/onchain.rs b/crates/e2e/src/api/liquorice/onchain.rs index 094988fe29..d2d2154556 100644 --- a/crates/e2e/src/api/liquorice/onchain.rs +++ b/crates/e2e/src/api/liquorice/onchain.rs @@ -165,7 +165,7 @@ pub mod order { assert_eq!( "d11023397b6e58bf8137e479bc552f06eb3b7527652528a047eae91bb391858d", - hex::encode(hash) + const_hex::encode(hash) ); } } diff --git a/crates/e2e/src/setup/colocation.rs b/crates/e2e/src/setup/colocation.rs index d705bbbc71..34e11c8330 100644 --- a/crates/e2e/src/setup/colocation.rs +++ b/crates/e2e/src/setup/colocation.rs @@ -141,7 +141,7 @@ pub fn start_driver_with_config_override( base_tokens: _, merge_solutions, }| { - let account = hex::encode(account.private_key()); + let account = const_hex::encode(account.private_key()); format!( r#" [[solver]] diff --git a/crates/e2e/src/setup/services.rs b/crates/e2e/src/setup/services.rs index 42f711018e..f0e3bb6a07 100644 --- a/crates/e2e/src/setup/services.rs +++ b/crates/e2e/src/setup/services.rs @@ -279,7 +279,7 @@ impl<'a> Services<'a> { vec![ format!( "--drivers=test_solver|http://localhost:11088/test_solver|{}|requested-timeout-on-problems", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), "--price-estimation-drivers=test_quoter|http://localhost:11088/test_solver" .to_string(), @@ -339,7 +339,7 @@ impl<'a> Services<'a> { // Here we call the baseline_solver "test_quoter" to make the native price // estimation use the baseline_solver instead of the test_quoter let autopilot_args = vec![ - format!("--drivers=test_solver|http://localhost:11088/test_solver|{}", hex::encode(solver.address())), + format!("--drivers=test_solver|http://localhost:11088/test_solver|{}", const_hex::encode(solver.address())), "--price-estimation-drivers=test_quoter|http://localhost:11088/baseline_solver,test_solver|http://localhost:11088/test_solver".to_string(), "--native-price-estimators=test_quoter|http://localhost:11088/baseline_solver,test_solver|http://localhost:11088/test_solver".to_string(), ]; @@ -352,7 +352,7 @@ impl<'a> Services<'a> { let autopilot_args = vec![ format!( "--drivers=test_solver|http://localhost:11088/test_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), "--price-estimation-drivers=test_quoter|http://localhost:11088/test_solver" .to_string(), diff --git a/crates/e2e/tests/e2e/autopilot_leader.rs b/crates/e2e/tests/e2e/autopilot_leader.rs index 9ba11e06b2..1119b1be47 100644 --- a/crates/e2e/tests/e2e/autopilot_leader.rs +++ b/crates/e2e/tests/e2e/autopilot_leader.rs @@ -88,7 +88,7 @@ async fn dual_autopilot_only_leader_produces_auctions(web3: Web3) { // Configure autopilot-leader only with test_solver let autopilot_leader = services.start_autopilot_with_shutdown_controller(None, vec![ format!("--drivers=test_solver|http://localhost:11088/test_solver|{}|requested-timeout-on-problems", - hex::encode(solver1.address())), + const_hex::encode(solver1.address())), "--price-estimation-drivers=test_quoter|http://localhost:11088/test_solver".to_string(), "--gas-estimators=http://localhost:11088/gasprice".to_string(), "--metrics-address=0.0.0.0:9590".to_string(), @@ -98,7 +98,7 @@ async fn dual_autopilot_only_leader_produces_auctions(web3: Web3) { // Configure autopilot-backup only with test_solver2 let _autopilot_follower = services.start_autopilot(None, vec![ format!("--drivers=test_solver2|http://localhost:11088/test_solver2|{}|requested-timeout-on-problems", - hex::encode(solver2.address())), + const_hex::encode(solver2.address())), "--price-estimation-drivers=test_quoter|http://localhost:11088/test_solver2".to_string(), "--gas-estimators=http://localhost:11088/gasprice".to_string(), "--enable-leader-lock=true".to_string(), diff --git a/crates/e2e/tests/e2e/buffers.rs b/crates/e2e/tests/e2e/buffers.rs index 121e62d7b1..ac7c16cbe8 100644 --- a/crates/e2e/tests/e2e/buffers.rs +++ b/crates/e2e/tests/e2e/buffers.rs @@ -76,7 +76,7 @@ async fn onchain_settlement_without_liquidity(web3: Web3) { ), format!( "--drivers=test_solver|http://localhost:11088/test_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), "--price-estimation-drivers=test_quoter|http://localhost:11088/test_solver" .to_string(), diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index aa070753f4..b6950a05f0 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -185,7 +185,7 @@ async fn cow_amm_jit(web3: Web3) { vec![ format!( "--drivers=mock_solver|http://localhost:11088/mock_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), "--price-estimation-drivers=test_solver|http://localhost:11088/test_solver" .to_string(), @@ -245,17 +245,23 @@ async fn cow_amm_jit(web3: Web3) { // enum hashes taken from // Token::FixedBytes( - hex::decode("f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775") - .unwrap(), + const_hex::decode( + "f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775", + ) + .unwrap(), ), // sell order Token::Bool(cow_amm_order.partially_fillable), Token::FixedBytes( - hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") - .unwrap(), + const_hex::decode( + "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", + ) + .unwrap(), ), // sell_token_source == erc20 Token::FixedBytes( - hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") - .unwrap(), + const_hex::decode( + "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", + ) + .unwrap(), ), // buy_token_destination == erc20 ]), Token::Tuple(vec![ @@ -548,7 +554,7 @@ async fn cow_amm_driver_support(web3: Web3) { .start_autopilot( None, vec![ - format!("--drivers=test_solver|http://localhost:11088/test_solver|{},mock_solver|http://localhost:11088/mock_solver|{}", hex::encode(solver.address()), hex::encode(solver.address())), + format!("--drivers=test_solver|http://localhost:11088/test_solver|{},mock_solver|http://localhost:11088/mock_solver|{}", const_hex::encode(solver.address()), const_hex::encode(solver.address())), "--price-estimation-drivers=test_solver|http://localhost:11088/test_solver" .to_string(), "--cow-amm-configs=0x3705ceee5eaa561e3157cf92641ce28c45a3999c|0x3705ceee5eaa561e3157cf92641ce28c45a3999c|20332744".to_string() @@ -812,7 +818,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { vec![ format!( "--drivers=mock_solver|http://localhost:11088/mock_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), "--price-estimation-drivers=mock_solver|http://localhost:11088/mock_solver" .to_string(), @@ -863,17 +869,23 @@ async fn cow_amm_opposite_direction(web3: Web3) { Token::FixedBytes(cow_amm_order.app_data.0.to_vec()), Token::Uint(cow_amm_order.fee_amount), Token::FixedBytes( - hex::decode("f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775") - .unwrap(), + const_hex::decode( + "f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775", + ) + .unwrap(), ), // sell order Token::Bool(cow_amm_order.partially_fillable), Token::FixedBytes( - hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") - .unwrap(), + const_hex::decode( + "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", + ) + .unwrap(), ), // sell_token_source == erc20 Token::FixedBytes( - hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") - .unwrap(), + const_hex::decode( + "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", + ) + .unwrap(), ), // buy_token_destination == erc20 ]), Token::Tuple(vec![ diff --git a/crates/e2e/tests/e2e/ethflow.rs b/crates/e2e/tests/e2e/ethflow.rs index 0ca52aaecf..664d6e54fe 100644 --- a/crates/e2e/tests/e2e/ethflow.rs +++ b/crates/e2e/tests/e2e/ethflow.rs @@ -126,7 +126,7 @@ async fn eth_flow_tx(web3: Web3) { let approve_call_data = { let call_builder = dai.approve(trader.address().into_alloy(), eth(10)); let calldata = call_builder.calldata(); - format!("0x{}", hex::encode(calldata)) + const_hex::encode_prefixed(calldata) }; let hash = services @@ -164,7 +164,7 @@ async fn eth_flow_tx(web3: Web3) { let quote_request = OrderQuoteRequest { app_data: OrderCreationAppData::Hash { - hash: app_data::AppDataHash(hex::decode(&hash[2..]).unwrap().try_into().unwrap()), + hash: app_data::AppDataHash(const_hex::decode(&hash[2..]).unwrap().try_into().unwrap()), }, ..intent.to_quote_request(trader.account().address(), &onchain.contracts().weth) }; diff --git a/crates/e2e/tests/e2e/jit_orders.rs b/crates/e2e/tests/e2e/jit_orders.rs index 4994c6d2bb..91e1b28c44 100644 --- a/crates/e2e/tests/e2e/jit_orders.rs +++ b/crates/e2e/tests/e2e/jit_orders.rs @@ -97,7 +97,7 @@ async fn single_limit_order_test(web3: Web3) { vec![ format!( "--drivers=mock_solver|http://localhost:11088/mock_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), "--price-estimation-drivers=test_solver|http://localhost:11088/test_solver" .to_string(), diff --git a/crates/e2e/tests/e2e/limit_orders.rs b/crates/e2e/tests/e2e/limit_orders.rs index d85b494cc5..b30f5fc77c 100644 --- a/crates/e2e/tests/e2e/limit_orders.rs +++ b/crates/e2e/tests/e2e/limit_orders.rs @@ -487,7 +487,7 @@ async fn two_limit_orders_multiple_winners_test(web3: Web3) { None, vec![ format!("--drivers=solver1|http://localhost:11088/test_solver|{}|10000000000000000,solver2|http://localhost:11088/solver2|{}", - hex::encode(solver_a.address()), hex::encode(solver_b.address())), + const_hex::encode(solver_a.address()), const_hex::encode(solver_b.address())), "--price-estimation-drivers=solver1|http://localhost:11088/test_solver".to_string(), "--max-winners-per-auction=2".to_string(), ], diff --git a/crates/e2e/tests/e2e/liquidity.rs b/crates/e2e/tests/e2e/liquidity.rs index 2761a94d46..d7fcbcd584 100644 --- a/crates/e2e/tests/e2e/liquidity.rs +++ b/crates/e2e/tests/e2e/liquidity.rs @@ -166,7 +166,7 @@ async fn zero_ex_liquidity(web3: Web3) { .to_string(), format!( "--drivers=test_solver|http://localhost:11088/test_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), ], ) diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index d8a2cfb96f..a66e63a760 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -186,7 +186,7 @@ http-timeout = "10s" .to_string(), format!( "--drivers=liquorice_solver|http://localhost:11088/liquorice_solver|{}", - hex::encode(solver.address()) + const_hex::encode(solver.address()) ), ], ) diff --git a/crates/e2e/tests/e2e/quote_verification.rs b/crates/e2e/tests/e2e/quote_verification.rs index f79845b000..f1fae1b7a5 100644 --- a/crates/e2e/tests/e2e/quote_verification.rs +++ b/crates/e2e/tests/e2e/quote_verification.rs @@ -183,7 +183,7 @@ async fn test_bypass_verification_for_rfq_quotes(web3: Web3) { interactions: vec![Interaction { target: H160::from_str("0xdef1c0ded9bec7f1a1670819833240f027b25eff") .unwrap(), - data: hex::decode("aa77476c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000000000000000000000000000e357b42c3a9d8ccf0000000000000000000000000000000000000000000000000000000004d0e79e000000000000000000000000a69babef1ca67a37ffaf7a485dfff3382056e78c0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066360af101ffffffffffffffffffffffffffffffffffffff0f3f47f166360a8d0000003f0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001c66b3383f287dd9c85ad90e7c5a576ea4ba1bdf5a001d794a9afa379e6b2517b47e487a1aef32e75af432cbdbd301ada42754eaeac21ec4ca744afd92732f47540000000000000000000000000000000000000000000000000000000004d0c80f").unwrap(), + data: const_hex::decode("aa77476c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000000000000000000000000000e357b42c3a9d8ccf0000000000000000000000000000000000000000000000000000000004d0e79e000000000000000000000000a69babef1ca67a37ffaf7a485dfff3382056e78c0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066360af101ffffffffffffffffffffffffffffffffffffff0f3f47f166360a8d0000003f0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001c66b3383f287dd9c85ad90e7c5a576ea4ba1bdf5a001d794a9afa379e6b2517b47e487a1aef32e75af432cbdbd301ada42754eaeac21ec4ca744afd92732f47540000000000000000000000000000000000000000000000000000000004d0c80f").unwrap(), value: 0.into(), }], solver: H160::from_str("0xe3067c7c27c1038de4e8ad95a83b927d23dfbd99") @@ -204,7 +204,7 @@ async fn test_bypass_verification_for_rfq_quotes(web3: Web3) { interactions: vec![InteractionData { target: H160::from_str("0xdef1c0ded9bec7f1a1670819833240f027b25eff").unwrap(), value: 0.into(), - call_data: hex::decode("aa77476c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000000000000000000000000000e357b42c3a9d8ccf0000000000000000000000000000000000000000000000000000000004d0e79e000000000000000000000000a69babef1ca67a37ffaf7a485dfff3382056e78c0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066360af101ffffffffffffffffffffffffffffffffffffff0f3f47f166360a8d0000003f0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001c66b3383f287dd9c85ad90e7c5a576ea4ba1bdf5a001d794a9afa379e6b2517b47e487a1aef32e75af432cbdbd301ada42754eaeac21ec4ca744afd92732f47540000000000000000000000000000000000000000000000000000000004d0c80f").unwrap() + call_data: const_hex::decode("aa77476c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000000000000000000000000000e357b42c3a9d8ccf0000000000000000000000000000000000000000000000000000000004d0e79e000000000000000000000000a69babef1ca67a37ffaf7a485dfff3382056e78c0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066360af101ffffffffffffffffffffffffffffffffffffff0f3f47f166360a8d0000003f0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001c66b3383f287dd9c85ad90e7c5a576ea4ba1bdf5a001d794a9afa379e6b2517b47e487a1aef32e75af432cbdbd301ada42754eaeac21ec4ca744afd92732f47540000000000000000000000000000000000000000000000000000000004d0c80f").unwrap() }], pre_interactions: vec![], jit_orders: vec![], diff --git a/crates/e2e/tests/e2e/solver_competition.rs b/crates/e2e/tests/e2e/solver_competition.rs index f57b9ce5f8..1f20ec3b80 100644 --- a/crates/e2e/tests/e2e/solver_competition.rs +++ b/crates/e2e/tests/e2e/solver_competition.rs @@ -87,7 +87,7 @@ async fn solver_competition(web3: Web3) { services.start_autopilot( None, vec![ - format!("--drivers=test_solver|http://localhost:11088/test_solver|{},solver2|http://localhost:11088/solver2|{}", hex::encode(solver.address()), hex::encode(solver.address()) + format!("--drivers=test_solver|http://localhost:11088/test_solver|{},solver2|http://localhost:11088/solver2|{}", const_hex::encode(solver.address()), const_hex::encode(solver.address()) ), "--price-estimation-drivers=test_quoter|http://localhost:11088/test_solver,solver2|http://localhost:11088/solver2".to_string(), ], @@ -228,7 +228,7 @@ async fn wrong_solution_submission_address(web3: Web3) { None, // Solver 1 has a wrong submission address, meaning that the solutions should be discarded from solver1 vec![ - format!("--drivers=solver1|http://localhost:11088/test_solver|0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,solver2|http://localhost:11088/solver2|{}", hex::encode(solver.address())), + format!("--drivers=solver1|http://localhost:11088/test_solver|0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,solver2|http://localhost:11088/solver2|{}", const_hex::encode(solver.address())), "--price-estimation-drivers=solver1|http://localhost:11088/test_solver".to_string(), ], ).await; @@ -378,8 +378,8 @@ async fn store_filtered_solutions(web3: Web3) { vec![ format!( "--drivers=good_solver|http://localhost:11088/good_solver|{},bad_solver|http://localhost:11088/bad_solver|{}", - hex::encode(good_solver_account.address()), - hex::encode(bad_solver_account.address()), + const_hex::encode(good_solver_account.address()), + const_hex::encode(bad_solver_account.address()), ), "--price-estimation-drivers=test_solver|http://localhost:11088/test_solver" .to_string(), diff --git a/crates/ethrpc/Cargo.toml b/crates/ethrpc/Cargo.toml index e9fdf8c8e1..a1159ccff8 100644 --- a/crates/ethrpc/Cargo.toml +++ b/crates/ethrpc/Cargo.toml @@ -16,7 +16,7 @@ anyhow = { workspace = true } async-trait = { workspace = true } ethcontract = { workspace = true } futures = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } itertools = { workspace = true } mockall = { workspace = true } diff --git a/crates/model/Cargo.toml b/crates/model/Cargo.toml index 13b1dc670f..43648b246a 100644 --- a/crates/model/Cargo.toml +++ b/crates/model/Cargo.toml @@ -15,7 +15,7 @@ bytes-hex = { workspace = true } bigdecimal = { workspace = true } chrono = { workspace = true, features = ["serde", "clock"] } derive_more = { workspace = true } -hex = { workspace = true, default-features = false } +const-hex = { workspace = true } hex-literal = { workspace = true } number = { workspace = true } num = { workspace = true } diff --git a/crates/model/src/interaction.rs b/crates/model/src/interaction.rs index 1b2d8c4832..49e4c7b92c 100644 --- a/crates/model/src/interaction.rs +++ b/crates/model/src/interaction.rs @@ -22,10 +22,7 @@ impl Debug for InteractionData { f.debug_struct("InteractionData") .field("target", &self.target) .field("value", &self.value) - .field( - "call_data", - &format_args!("0x{}", hex::encode(&self.call_data)), - ) + .field("call_data", &const_hex::encode_prefixed(&self.call_data)) .finish() } } diff --git a/crates/model/src/lib.rs b/crates/model/src/lib.rs index b2155fda57..05db8bff6e 100644 --- a/crates/model/src/lib.rs +++ b/crates/model/src/lib.rs @@ -12,7 +12,7 @@ pub mod time; pub mod trade; use { - hex::{FromHex, FromHexError}, + const_hex::{FromHex, FromHexError}, primitive_types::H160, std::{fmt, sync::LazyLock}, web3::{ @@ -107,7 +107,7 @@ impl std::fmt::Debug for DomainSeparator { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut hex = [0u8; 64]; // Unwrap because we know the length is correct. - hex::encode_to_slice(self.0, &mut hex).unwrap(); + const_hex::encode_to_slice(self.0, &mut hex).unwrap(); // Unwrap because we know it is valid utf8. f.write_str(std::str::from_utf8(&hex).unwrap()) } diff --git a/crates/model/src/order.rs b/crates/model/src/order.rs index 30c6d98abc..b014bbdc65 100644 --- a/crates/model/src/order.rs +++ b/crates/model/src/order.rs @@ -764,12 +764,12 @@ impl OrderUid { } impl FromStr for OrderUid { - type Err = hex::FromHexError; + type Err = const_hex::FromHexError; - fn from_str(s: &str) -> Result { + fn from_str(s: &str) -> Result { let mut value = [0u8; 56]; let s_without_prefix = s.strip_prefix("0x").unwrap_or(s); - hex::decode_to_slice(s_without_prefix, value.as_mut())?; + const_hex::decode_to_slice(s_without_prefix, value.as_mut())?; Ok(OrderUid(value)) } } @@ -779,7 +779,7 @@ impl Display for OrderUid { let mut bytes = [0u8; 2 + 56 * 2]; bytes[..2].copy_from_slice(b"0x"); // Unwrap because the length is always correct. - hex::encode_to_slice(self.0.as_slice(), &mut bytes[2..]).unwrap(); + const_hex::encode_to_slice(self.0.as_slice(), &mut bytes[2..]).unwrap(); // Unwrap because the string is always valid utf8. let str = std::str::from_utf8(&bytes).unwrap(); f.write_str(str) @@ -830,7 +830,7 @@ impl<'de> Deserialize<'de> for OrderUid { )) })?; let mut value = [0u8; 56]; - hex::decode_to_slice(s, value.as_mut()).map_err(|err| { + const_hex::decode_to_slice(s, value.as_mut()).map_err(|err| { de::Error::custom(format!("failed to decode {s:?} as hex uid: {err}")) })?; Ok(OrderUid(value)) diff --git a/crates/model/src/signature.rs b/crates/model/src/signature.rs index 4aeb368fa6..7b8a875e42 100644 --- a/crates/model/src/signature.rs +++ b/crates/model/src/signature.rs @@ -77,7 +77,7 @@ impl Debug for Signature { } let scheme = format!("{:?}", self.scheme()); - let bytes = format!("0x{}", hex::encode(self.to_bytes())); + let bytes = const_hex::encode_prefixed(self.to_bytes()); f.debug_tuple(&scheme).field(&bytes).finish() } } @@ -374,7 +374,7 @@ impl Serialize for EcdsaSignature { let mut bytes = [0u8; 2 + 65 * 2]; bytes[..2].copy_from_slice(b"0x"); // Can only fail if the buffer size does not match but we know it is correct. - hex::encode_to_slice(self.to_bytes(), &mut bytes[2..]).unwrap(); + const_hex::encode_to_slice(self.to_bytes(), &mut bytes[2..]).unwrap(); // Hex encoding is always valid utf8. let str = std::str::from_utf8(&bytes).unwrap(); serializer.serialize_str(str) @@ -409,7 +409,7 @@ impl<'de> Deserialize<'de> for EcdsaSignature { )) })?; let mut bytes = [0u8; 65]; - hex::decode_to_slice(s, &mut bytes).map_err(|err| { + const_hex::decode_to_slice(s, &mut bytes).map_err(|err| { de::Error::custom(format!( "failed to decode {s:?} as hex ecdsa signature: {err}" )) diff --git a/crates/orderbook/Cargo.toml b/crates/orderbook/Cargo.toml index 090de918c8..70c62cfa1b 100644 --- a/crates/orderbook/Cargo.toml +++ b/crates/orderbook/Cargo.toml @@ -30,7 +30,7 @@ database = { workspace = true } ethcontract = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } humantime = { workspace = true } hyper = { workspace = true } diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 981bcbb397..4c0b5d5d61 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -568,7 +568,7 @@ async fn verify_deployed_contract_constants( chain_id: u64, ) -> Result<()> { let web3 = contract.raw_instance().web3(); - let bytecode = hex::encode( + let bytecode = const_hex::encode( web3.eth() .code(contract.address(), None) .await @@ -577,11 +577,11 @@ async fn verify_deployed_contract_constants( ); let domain_separator = DomainSeparator::new(chain_id, contract.address()); - if !bytecode.contains(&hex::encode(domain_separator.0)) { + if !bytecode.contains(&const_hex::encode(domain_separator.0)) { return Err(anyhow!("Bytecode did not contain domain separator")); } - if !bytecode.contains(&hex::encode(model::order::OrderData::TYPE_HASH)) { + if !bytecode.contains(&const_hex::encode(model::order::OrderData::TYPE_HASH)) { return Err(anyhow!("Bytecode did not contain order type hash")); } Ok(()) diff --git a/crates/refunder/Cargo.toml b/crates/refunder/Cargo.toml index cc289bf4f6..5c9b980d1e 100644 --- a/crates/refunder/Cargo.toml +++ b/crates/refunder/Cargo.toml @@ -16,7 +16,7 @@ ethcontract = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } gas-estimation = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } humantime = { workspace = true } itertools = { workspace = true } mimalloc = { workspace = true } diff --git a/crates/refunder/src/refund_service.rs b/crates/refunder/src/refund_service.rs index cce920f118..8c2d4dd6fe 100644 --- a/crates/refunder/src/refund_service.rs +++ b/crates/refunder/src/refund_service.rs @@ -115,7 +115,7 @@ impl RefundService { .find(|contract| *contract.address() == ethflow_contract_address); if ethflow_contract.is_none() { tracing::warn!( - uid = format!("0x{}", hex::encode(eth_order_placement.uid.0)), + uid = const_hex::encode_prefixed(eth_order_placement.uid.0), ethflow = ?ethflow_contract_address, "refunding orders from specific contract is not enabled", ); diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index ee11366154..f90feb29d2 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -29,7 +29,7 @@ ethrpc = { workspace = true } futures = { workspace = true } gas-estimation = { workspace = true } observe = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } humantime = { workspace = true } indexmap = { workspace = true } diff --git a/crates/shared/src/signature_validator/mod.rs b/crates/shared/src/signature_validator/mod.rs index 120d94d232..d7552f91c1 100644 --- a/crates/shared/src/signature_validator/mod.rs +++ b/crates/shared/src/signature_validator/mod.rs @@ -46,11 +46,8 @@ impl std::fmt::Debug for SignatureCheck { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("SignatureCheck") .field("signer", &self.signer) - .field("hash", &format_args!("0x{}", hex::encode(self.hash))) - .field( - "signature", - &format_args!("0x{}", hex::encode(&self.signature)), - ) + .field("hash", &const_hex::encode_prefixed(self.hash)) + .field("signature", &const_hex::encode_prefixed(&self.signature)) .field("interactions", &self.interactions) .finish() } diff --git a/crates/shared/src/signature_validator/simulation.rs b/crates/shared/src/signature_validator/simulation.rs index 868b65d86c..bdb1d39455 100644 --- a/crates/shared/src/signature_validator/simulation.rs +++ b/crates/shared/src/signature_validator/simulation.rs @@ -71,7 +71,7 @@ impl Validator { .isValidSignature(check.hash.into(), check.signature.clone().into()) .call() .await - .map(|value| hex::encode(value.0)) + .map(|value| const_hex::encode(value.0)) .map_err(|err| match err { alloy::contract::Error::TransportError(RpcError::ErrorResp(err)) => { tracing::error!(?err, "failed to call isValidSignature"); @@ -157,7 +157,7 @@ impl Validator { .with_context(|| { format!( "could not decode signature check result: {}", - hex::encode(&response_bytes.0) + const_hex::encode(&response_bytes.0) ) })? .into_legacy(); diff --git a/crates/shared/src/trade_finding/mod.rs b/crates/shared/src/trade_finding/mod.rs index 68fe993ca9..66cb91a61f 100644 --- a/crates/shared/src/trade_finding/mod.rs +++ b/crates/shared/src/trade_finding/mod.rs @@ -195,7 +195,7 @@ impl Trade { pub struct Interaction { pub target: H160, pub value: U256, - #[debug("0x{}", hex::encode::<&[u8]>(data.as_ref()))] + #[debug("{}", const_hex::encode_prefixed::<&[u8]>(data.as_ref()))] pub data: Vec, } diff --git a/crates/shared/src/zeroex_api.rs b/crates/shared/src/zeroex_api.rs index fd52dd9a53..e67ab657a2 100644 --- a/crates/shared/src/zeroex_api.rs +++ b/crates/shared/src/zeroex_api.rs @@ -558,11 +558,11 @@ mod tests { signature: ZeroExSignature { signature_type: 3, r: H256::from_slice( - &hex::decode("db60e4fa2b4f2ee073d88eed3502149ba2231d699bc5d92d5627dcd21f915237") + &const_hex::decode("db60e4fa2b4f2ee073d88eed3502149ba2231d699bc5d92d5627dcd21f915237") .unwrap() ), s: H256::from_slice( - &hex::decode("4cb1e9c15788b86d5187b99c0d929ad61d2654c242095c26f9ace17e64aca0fd") + &const_hex::decode("4cb1e9c15788b86d5187b99c0d929ad61d2654c242095c26f9ace17e64aca0fd") .unwrap() ), v: 28u8, @@ -575,7 +575,7 @@ mod tests { }, OrderMetadata { order_hash: - hex::decode( + const_hex::decode( "003427369d4c2a6b0aceeb7b315bb9a6086bc6fc4c887aa51efc73b662c9d127" ).unwrap(), remaining_fillable_taker_amount: 262467000000000000u128, diff --git a/crates/solver/Cargo.toml b/crates/solver/Cargo.toml index fd036272a8..bf58e44756 100644 --- a/crates/solver/Cargo.toml +++ b/crates/solver/Cargo.toml @@ -20,7 +20,7 @@ ethcontract = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } observe = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } itertools = { workspace = true } maplit = { workspace = true } diff --git a/crates/solver/src/interactions/allowances.rs b/crates/solver/src/interactions/allowances.rs index 29e1056892..d1463cf5c2 100644 --- a/crates/solver/src/interactions/allowances.rs +++ b/crates/solver/src/interactions/allowances.rs @@ -374,7 +374,7 @@ mod tests { token, 0.into(), Bytes( - hex::decode( + const_hex::decode( "095ea7b3\ 0000000000000000000000000202020202020202020202020202020202020202\ ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" diff --git a/crates/solver/src/interactions/balancer_v2.rs b/crates/solver/src/interactions/balancer_v2.rs index 727b598d9d..7d6146ab88 100644 --- a/crates/solver/src/interactions/balancer_v2.rs +++ b/crates/solver/src/interactions/balancer_v2.rs @@ -112,7 +112,7 @@ mod tests { vault.address().into_legacy(), 0.into(), Bytes( - hex::decode( + const_hex::decode( "52bbbe29\ 00000000000000000000000000000000000000000000000000000000000000e0\ 0000000000000000000000000202020202020202020202020202020202020202\ diff --git a/crates/solver/src/liquidity/zeroex.rs b/crates/solver/src/liquidity/zeroex.rs index 8b8f74c8e0..70bac4e903 100644 --- a/crates/solver/src/liquidity/zeroex.rs +++ b/crates/solver/src/liquidity/zeroex.rs @@ -79,7 +79,7 @@ impl ZeroExLiquidity { } let limit_order = LimitOrder { - id: LimitOrderId::Liquidity(LiquidityOrderId::ZeroEx(hex::encode( + id: LimitOrderId::Liquidity(LiquidityOrderId::ZeroEx(const_hex::encode( &record.metadata().order_hash, ))), sell_token: record.order().maker_token, diff --git a/crates/solvers-dto/Cargo.toml b/crates/solvers-dto/Cargo.toml index 4a361d33dd..858a482097 100644 --- a/crates/solvers-dto/Cargo.toml +++ b/crates/solvers-dto/Cargo.toml @@ -10,7 +10,7 @@ bytes-hex = { workspace = true } app-data = { workspace = true } bigdecimal = { workspace = true, features = ["serde"] } chrono = { workspace = true } -hex = { workspace = true } +const-hex = { workspace = true } number = { workspace = true } serde = { workspace = true } serde_with = { workspace = true } diff --git a/crates/solvers-dto/src/lib.rs b/crates/solvers-dto/src/lib.rs index dd2c5b7745..2fe62793e6 100644 --- a/crates/solvers-dto/src/lib.rs +++ b/crates/solvers-dto/src/lib.rs @@ -35,7 +35,7 @@ mod serialize { "failed to decode {s:?} as a hex string: missing \"0x\" prefix", ))); } - hex::decode(&s[2..]).map_err(|err| { + const_hex::decode(&s[2..]).map_err(|err| { de::Error::custom(format!("failed to decode {s:?} as a hex string: {err}",)) }) } @@ -76,7 +76,7 @@ mod serialize { "failed to decode {s:?} as a hex string: missing \"0x\" prefix", ))); } - let decoded = hex::decode(&s[2..]).map_err(|err| { + let decoded = const_hex::decode(&s[2..]).map_err(|err| { de::Error::custom(format!("failed to decode {s:?} as a hex string: {err}",)) })?; if decoded.len() != N { @@ -105,7 +105,7 @@ mod serialize { v[0] = b'0'; v[1] = b'x'; // Unwrap because only possible error is vector wrong size which cannot happen. - hex::encode_to_slice(bytes, &mut v[2..]).unwrap(); + const_hex::encode_to_slice(bytes, &mut v[2..]).unwrap(); // Unwrap because encoded data is always valid utf8. String::from_utf8(v).unwrap() } diff --git a/crates/solvers/Cargo.toml b/crates/solvers/Cargo.toml index bdbb1ff4b2..0868f1f110 100644 --- a/crates/solvers/Cargo.toml +++ b/crates/solvers/Cargo.toml @@ -22,9 +22,9 @@ derive_more = { workspace = true } ethereum-types = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } -hex = { workspace = true } -hyper = { workspace = true } +const-hex = { workspace = true } hex-literal = { workspace = true } +hyper = { workspace = true } ethcontract = { workspace = true } itertools = { workspace = true } mimalloc = { workspace = true } @@ -56,7 +56,6 @@ tracing-opentelemetry = "0.31.0" [dev-dependencies] tempfile = { workspace = true } -hex-literal = { workspace = true } ethcontract = { workspace = true } [build-dependencies] diff --git a/crates/solvers/src/util/bytes.rs b/crates/solvers/src/util/bytes.rs index 83a91f06d4..b6e52c8a07 100644 --- a/crates/solvers/src/util/bytes.rs +++ b/crates/solvers/src/util/bytes.rs @@ -7,6 +7,6 @@ where T: AsRef<[u8]>, { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "0x{}", hex::encode(&self.0)) + write!(f, "{}", const_hex::encode_prefixed(&self.0)) } } diff --git a/crates/solvers/src/util/fmt/hex.rs b/crates/solvers/src/util/fmt/hex.rs index 1178c1da3c..7d63c34b2b 100644 --- a/crates/solvers/src/util/fmt/hex.rs +++ b/crates/solvers/src/util/fmt/hex.rs @@ -10,10 +10,6 @@ impl Debug for Hex<'_> { impl Display for Hex<'_> { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - f.write_str("0x")?; - for byte in self.0 { - write!(f, "{byte:02x}")?; - } - Ok(()) + f.write_str(&const_hex::encode_prefixed(self.0)) } } From e5dd944b620e2067928efa1ebd76b3e80b14a26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 12:03:09 +0100 Subject: [PATCH 030/117] Remove unused and outdated dependencies (#3795) --- Cargo.lock | 14 -------------- Cargo.toml | 1 - crates/autopilot/Cargo.toml | 2 +- crates/chain/Cargo.toml | 1 - crates/contracts/Cargo.toml | 2 -- crates/driver/Cargo.toml | 11 +++-------- crates/driver/src/domain/competition/mod.rs | 5 ++--- .../driver/src/infra/api/routes/quote/mod.rs | 3 +-- crates/driver/src/infra/solver/mod.rs | 18 +++++++++--------- crates/e2e/Cargo.toml | 1 - crates/order-validation/Cargo.toml | 1 - crates/refunder/Cargo.toml | 1 - crates/solver/Cargo.toml | 1 - crates/solvers-dto/Cargo.toml | 2 +- crates/solvers/Cargo.toml | 2 -- 15 files changed, 17 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fb7937d0c..bd8b7ebfb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1893,7 +1893,6 @@ version = "0.1.0" dependencies = [ "derive_more 1.0.0", "ethcontract", - "serde", "serde_json", "thiserror 1.0.61", ] @@ -2101,9 +2100,7 @@ dependencies = [ "anyhow", "ethcontract", "ethcontract-generate", - "maplit", "paste", - "serde", "serde_json", "tracing", "tracing-subscriber", @@ -2593,7 +2590,6 @@ dependencies = [ "cow-amm", "dashmap", "derive_more 1.0.0", - "ethabi", "ethcontract", "ethereum-types", "ethrpc", @@ -2603,11 +2599,9 @@ dependencies = [ "humantime", "humantime-serde", "hyper 0.14.29", - "indexmap 2.10.0", "itertools 0.14.0", "maplit", "mimalloc", - "mockall 0.12.1", "model", "moka", "num", @@ -2626,7 +2620,6 @@ dependencies = [ "shared", "solver", "solvers-dto", - "tap", "tempfile", "thiserror 1.0.61", "tokio", @@ -2636,7 +2629,6 @@ dependencies = [ "tracing", "url", "vergen", - "warp", "web3", ] @@ -2673,7 +2665,6 @@ dependencies = [ "refunder", "reqwest 0.11.27", "secp256k1 0.27.0", - "serde", "serde_json", "shared", "solver", @@ -4673,7 +4664,6 @@ version = "0.1.0" dependencies = [ "alloy", "contracts", - "ethrpc", "futures", "moka", "thiserror 1.0.61", @@ -5337,7 +5327,6 @@ dependencies = [ "futures", "gas-estimation", "humantime", - "itertools 0.14.0", "mimalloc", "number", "observe", @@ -6216,7 +6205,6 @@ dependencies = [ "primitive-types", "prometheus", "prometheus-metric-storage", - "serde", "serde_json", "shared", "strum 0.26.2", @@ -6250,7 +6238,6 @@ dependencies = [ "model", "num", "observe", - "opentelemetry", "prometheus", "prometheus-metric-storage", "reqwest 0.11.27", @@ -6266,7 +6253,6 @@ dependencies = [ "tower 0.4.13", "tower-http", "tracing", - "tracing-opentelemetry", "vergen", "web3", ] diff --git a/Cargo.toml b/Cargo.toml index 0bfbaf3dce..b56f4340d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,7 +93,6 @@ solver = { path = "crates/solver" } solvers = { path = "crates/solvers" } solvers-dto = { path = "crates/solvers-dto" } strum_macros = "0.26.4" -tap = "1.0.1" testlib = { path = "crates/testlib" } time = "0.3.37" tiny-keccak = "2.0.2" diff --git a/crates/autopilot/Cargo.toml b/crates/autopilot/Cargo.toml index cbf827442b..8527e2afb2 100644 --- a/crates/autopilot/Cargo.toml +++ b/crates/autopilot/Cargo.toml @@ -17,7 +17,7 @@ path = "src/main.rs" [dependencies] alloy = { workspace = true } app-data = { workspace = true } -bytes-hex = { workspace = true } +bytes-hex = { workspace = true } # may get marked as unused but it's used with serde anyhow = { workspace = true } async-trait = { workspace = true } bigdecimal = { workspace = true } diff --git a/crates/chain/Cargo.toml b/crates/chain/Cargo.toml index 22c9b771ae..a87d53f844 100644 --- a/crates/chain/Cargo.toml +++ b/crates/chain/Cargo.toml @@ -8,7 +8,6 @@ license = "MIT OR Apache-2.0" [dependencies] derive_more = { workspace = true } ethcontract = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } [dev-dependencies] diff --git a/crates/contracts/Cargo.toml b/crates/contracts/Cargo.toml index 5b981ca22e..dbd069dbe8 100644 --- a/crates/contracts/Cargo.toml +++ b/crates/contracts/Cargo.toml @@ -23,9 +23,7 @@ bin = [ [dependencies] alloy = { workspace = true, features = ["sol-types", "json", "contract", "json-abi"] } paste = { workspace = true } -maplit = { workspace = true } ethcontract = { workspace = true } -serde = { workspace = true } serde_json = { workspace = true } # [bin-dependencies] diff --git a/crates/driver/Cargo.toml b/crates/driver/Cargo.toml index 87bcbab1fe..445466539d 100644 --- a/crates/driver/Cargo.toml +++ b/crates/driver/Cargo.toml @@ -17,17 +17,15 @@ path = "src/main.rs" [dependencies] alloy = { workspace = true, features = ["sol-types"] } app-data = { workspace = true } -bytes-hex = { workspace = true } -chain = { workspace = true } -s3 = { workspace = true } async-trait = { workspace = true } axum = { workspace = true } bigdecimal = { workspace = true } +bytes-hex = { workspace = true } # may get marked as unused but it's used with serde +chain = { workspace = true } chrono = { workspace = true, features = ["clock"], default-features = false } cow-amm = { workspace = true } dashmap = { workspace = true } derive_more = { workspace = true } -ethabi = { workspace = true } ethereum-types = { workspace = true } ethrpc = { workspace = true } futures = { workspace = true } @@ -36,7 +34,6 @@ hex-literal = { workspace = true } humantime = { workspace = true } humantime-serde = { workspace = true } hyper = { workspace = true } -indexmap = { workspace = true, features = ["serde"] } itertools = { workspace = true } mimalloc = { workspace = true } moka = { workspace = true, features = ["future"] } @@ -46,11 +43,11 @@ prometheus = { workspace = true } prometheus-metric-storage = { workspace = true } rand = { workspace = true } reqwest = { workspace = true } +s3 = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } solvers-dto = { path = "../solvers-dto" } -tap = "1.0.1" thiserror = { workspace = true } tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "time"] } toml = { workspace = true } @@ -76,12 +73,10 @@ observe = { workspace = true, features = ["axum-tracing"] } shared = { workspace = true } solver = { workspace = true } tracing = { workspace = true } -warp = { workspace = true } [dev-dependencies] app-data = { workspace = true, features = ["test_helpers"] } maplit = { workspace = true } -mockall = { workspace = true } tokio = { workspace = true, features = ["test-util", "process"] } tempfile = { workspace = true } ethrpc = {workspace = true, features = ["test-util"]} diff --git a/crates/driver/src/domain/competition/mod.rs b/crates/driver/src/domain/competition/mod.rs index 1c5fe1968d..13a395f1fc 100644 --- a/crates/driver/src/domain/competition/mod.rs +++ b/crates/driver/src/domain/competition/mod.rs @@ -30,7 +30,6 @@ use { sync::{Arc, Mutex}, time::{Duration, Instant}, }, - tap::TapFallible, tokio::{ sync::{mpsc, oneshot}, task, @@ -191,7 +190,7 @@ impl Competition { .solver .solve(auction, &liquidity) .await - .tap_err(|err| { + .inspect_err(|err| { if err.is_timeout() { notify::solver_timeout(&self.solver, auction.id()); } @@ -302,7 +301,7 @@ impl Competition { .into_iter() .filter_map(|(result, settlement)| { result - .tap_err(|err| { + .inspect_err(|err| { observe::scoring_failed(self.solver.name(), err); notify::scoring_failed( &self.solver, diff --git a/crates/driver/src/infra/api/routes/quote/mod.rs b/crates/driver/src/infra/api/routes/quote/mod.rs index ad179da746..77de817213 100644 --- a/crates/driver/src/infra/api/routes/quote/mod.rs +++ b/crates/driver/src/infra/api/routes/quote/mod.rs @@ -3,7 +3,6 @@ use { api::{Error, State}, observe, }, - tap::TapFallible, tracing::Instrument, }; @@ -20,7 +19,7 @@ async fn route( order: axum::extract::Query, ) -> Result, (hyper::StatusCode, axum::Json)> { let handle_request = async { - let order = order.0.into_domain().tap_err(|err| { + let order = order.0.into_domain().inspect_err(|err| { observe::invalid_dto(err, "order"); })?; observe::quoting(&order); diff --git a/crates/driver/src/infra/solver/mod.rs b/crates/driver/src/infra/solver/mod.rs index e97c4dc22d..fa0de7aff4 100644 --- a/crates/driver/src/infra/solver/mod.rs +++ b/crates/driver/src/infra/solver/mod.rs @@ -29,7 +29,6 @@ use { collections::HashMap, time::{Duration, Instant}, }, - tap::TapFallible, thiserror::Error, tracing::{Instrument, instrument}, }; @@ -298,14 +297,15 @@ impl Solver { started_at.elapsed(), ); let res = res?; - let res: solvers_dto::solution::Solutions = serde_json::from_str(&res).tap_err(|err| { - tracing::warn!(res, ?err, "failed to parse solver response"); - self.notify( - auction.id(), - None, - notify::Kind::DeserializationError(format!("Request format invalid: {err}")), - ); - })?; + let res: solvers_dto::solution::Solutions = + serde_json::from_str(&res).inspect_err(|err| { + tracing::warn!(res, ?err, "failed to parse solver response"); + self.notify( + auction.id(), + None, + notify::Kind::DeserializationError(format!("Request format invalid: {err}")), + ); + })?; let solutions = dto::Solutions::from(res).into_domain( auction, liquidity, diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 50201b605d..831f45d740 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -31,7 +31,6 @@ observe = { workspace = true } orderbook = { workspace = true, features = ["e2e"] } reqwest = { workspace = true, features = ["blocking"] } secp256k1 = { workspace = true } -serde = { workspace = true } serde_json = { workspace = true } shared = { workspace = true } solver = { workspace = true } diff --git a/crates/order-validation/Cargo.toml b/crates/order-validation/Cargo.toml index 2609d62989..88196cfdd0 100644 --- a/crates/order-validation/Cargo.toml +++ b/crates/order-validation/Cargo.toml @@ -8,7 +8,6 @@ license = "MIT OR Apache-2.0" [dependencies] alloy = { workspace = true } contracts = { workspace = true } -ethrpc = { workspace = true } moka = { workspace = true, features = ["sync"] } thiserror = { workspace = true } tokio = { workspace = true } diff --git a/crates/refunder/Cargo.toml b/crates/refunder/Cargo.toml index 5c9b980d1e..5bbf48df3c 100644 --- a/crates/refunder/Cargo.toml +++ b/crates/refunder/Cargo.toml @@ -18,7 +18,6 @@ futures = { workspace = true } gas-estimation = { workspace = true } const-hex = { workspace = true } humantime = { workspace = true } -itertools = { workspace = true } mimalloc = { workspace = true } number = { workspace = true } observe = { workspace = true } diff --git a/crates/solver/Cargo.toml b/crates/solver/Cargo.toml index bf58e44756..982c2059ac 100644 --- a/crates/solver/Cargo.toml +++ b/crates/solver/Cargo.toml @@ -31,7 +31,6 @@ number = { workspace = true } primitive-types = { workspace = true } prometheus = { workspace = true } prometheus-metric-storage = { workspace = true } -serde = { workspace = true } serde_json = { workspace = true } shared = { workspace = true } strum = { workspace = true } diff --git a/crates/solvers-dto/Cargo.toml b/crates/solvers-dto/Cargo.toml index 858a482097..56377b6635 100644 --- a/crates/solvers-dto/Cargo.toml +++ b/crates/solvers-dto/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" license = "MIT OR Apache-2.0" [dependencies] -bytes-hex = { workspace = true } +bytes-hex = { workspace = true } # may get marked as unused but it's used with serde app-data = { workspace = true } bigdecimal = { workspace = true, features = ["serde"] } chrono = { workspace = true } diff --git a/crates/solvers/Cargo.toml b/crates/solvers/Cargo.toml index 0868f1f110..08239501a5 100644 --- a/crates/solvers/Cargo.toml +++ b/crates/solvers/Cargo.toml @@ -51,8 +51,6 @@ observe = { workspace = true, features = ["axum-tracing"] } shared = { workspace = true } solver = { workspace = true } tracing = { workspace = true } -opentelemetry = { workspace = true } -tracing-opentelemetry = "0.31.0" [dev-dependencies] tempfile = { workspace = true } From 2bc45bc8820ab3d37553e02238dadd431c93225b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 12:17:16 +0100 Subject: [PATCH 031/117] Move BalancerV2Vault::Instance to Address in some places (#3798) --- .../src/boundary/liquidity/balancer/v2/mod.rs | 4 +- .../boundary/liquidity/balancer/v2/stable.rs | 1 - .../liquidity/balancer/v2/weighted.rs | 1 - crates/solver/src/interactions/balancer_v2.rs | 39 +++++++++---------- crates/solver/src/liquidity/balancer_v2.rs | 29 +++++++------- 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs b/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs index 7d35cf081f..b71017a154 100644 --- a/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs +++ b/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs @@ -60,7 +60,7 @@ fn to_interaction( // also baked into the Balancer V2 logic in the `shared` crate, so to // change this assumption, we would need to change it there as well. GPv2Settlement::at(&web3, receiver.0), - BalancerV2Vault::Instance::new(pool.vault.0.into_alloy(), ethrpc::mock::web3().alloy), + pool.vault.0.into_alloy(), Allowances::empty(receiver.0), ); @@ -195,6 +195,6 @@ async fn init_liquidity( web3, balancer_pool_fetcher, eth.contracts().settlement().clone(), - contracts.vault, + *contracts.vault.address(), )) } diff --git a/crates/driver/src/boundary/liquidity/balancer/v2/stable.rs b/crates/driver/src/boundary/liquidity/balancer/v2/stable.rs index 1ce175a390..dc252d7312 100644 --- a/crates/driver/src/boundary/liquidity/balancer/v2/stable.rs +++ b/crates/driver/src/boundary/liquidity/balancer/v2/stable.rs @@ -52,7 +52,6 @@ fn vault(pool: &StablePoolOrder) -> eth::ContractAddress { .downcast_ref::() .expect("downcast balancer settlement handler") .vault() - .address() .into_legacy() .into() } diff --git a/crates/driver/src/boundary/liquidity/balancer/v2/weighted.rs b/crates/driver/src/boundary/liquidity/balancer/v2/weighted.rs index 5d86fe77db..1b7af883f8 100644 --- a/crates/driver/src/boundary/liquidity/balancer/v2/weighted.rs +++ b/crates/driver/src/boundary/liquidity/balancer/v2/weighted.rs @@ -56,7 +56,6 @@ fn vault(pool: &WeightedProductOrder) -> eth::ContractAddress { .downcast_ref::() .expect("downcast balancer settlement handler") .vault() - .address() .into_legacy() .into() } diff --git a/crates/solver/src/interactions/balancer_v2.rs b/crates/solver/src/interactions/balancer_v2.rs index 7d6146ab88..b8786bd424 100644 --- a/crates/solver/src/interactions/balancer_v2.rs +++ b/crates/solver/src/interactions/balancer_v2.rs @@ -1,8 +1,11 @@ use { - alloy::primitives::U256, + alloy::{ + primitives::{Address, U256}, + sol_types::SolCall, + }, contracts::{ GPv2Settlement, - alloy::BalancerV2Vault::{self, IVault}, + alloy::BalancerV2Vault::{BalancerV2Vault::swapCall, IVault}, }, ethcontract::{Bytes, H256}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -16,7 +19,7 @@ use { #[derive(Clone, Debug)] pub struct BalancerSwapGivenOutInteraction { pub settlement: GPv2Settlement, - pub vault: BalancerV2Vault::Instance, + pub vault: Address, pub pool_id: H256, pub asset_in_max: TokenAmount, pub asset_out: TokenAmount, @@ -44,22 +47,16 @@ impl BalancerSwapGivenOutInteraction { recipient: self.settlement.address().into_alloy(), toInternalBalance: false, }; - let method = self - .vault - .swap( - single_swap, - funds, - self.asset_in_max.amount.into_alloy(), - *NEVER, - ) - .calldata() - .clone(); - ( - self.vault.address().into_legacy(), - 0.into(), - Bytes(method.to_vec()), - ) + let method = swapCall { + singleSwap: single_swap, + funds, + limit: self.asset_in_max.amount.into_alloy(), + deadline: *NEVER, + } + .abi_encode(); + + (self.vault.into_legacy(), 0.into(), Bytes(method)) } } @@ -75,10 +72,10 @@ mod tests { #[test] fn encode_unwrap_weth() { - let vault = BalancerV2Vault::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy); + let vault_address = [0x01; 20].into(); let interaction = BalancerSwapGivenOutInteraction { settlement: dummy_contract!(GPv2Settlement, [0x02; 20]), - vault: vault.clone(), + vault: vault_address, pool_id: H256([0x03; 32]), asset_in_max: TokenAmount::new(H160([0x04; 20]), 1_337_000_000_000_000_000_000u128), asset_out: TokenAmount::new(H160([0x05; 20]), 42_000_000_000_000_000_000u128), @@ -109,7 +106,7 @@ mod tests { assert_eq!( interaction.encode(), ( - vault.address().into_legacy(), + vault_address.into_legacy(), 0.into(), Bytes( const_hex::decode( diff --git a/crates/solver/src/liquidity/balancer_v2.rs b/crates/solver/src/liquidity/balancer_v2.rs index 441cbcf43d..524c33cb1f 100644 --- a/crates/solver/src/liquidity/balancer_v2.rs +++ b/crates/solver/src/liquidity/balancer_v2.rs @@ -16,8 +16,9 @@ use { liquidity_collector::LiquidityCollecting, settlement::SettlementEncoder, }, + alloy::primitives::Address, anyhow::Result, - contracts::{GPv2Settlement, alloy::BalancerV2Vault}, + contracts::GPv2Settlement, ethcontract::H256, ethrpc::alloy::conversions::IntoLegacy, model::TokenPair, @@ -34,7 +35,7 @@ use { /// A liquidity provider for Balancer V2 weighted pools. pub struct BalancerV2Liquidity { settlement: GPv2Settlement, - vault: BalancerV2Vault::Instance, + vault: Address, pool_fetcher: Arc, allowance_manager: Box, } @@ -44,7 +45,7 @@ impl BalancerV2Liquidity { web3: Web3, pool_fetcher: Arc, settlement: GPv2Settlement, - vault: BalancerV2Vault::Instance, + vault: Address, ) -> Self { let allowance_manager = AllowanceManager::new(web3, settlement.address()); Self { @@ -66,13 +67,13 @@ impl BalancerV2Liquidity { let allowances = self .allowance_manager - .get_allowances(tokens, self.vault.address().into_legacy()) + .get_allowances(tokens, self.vault.into_legacy()) .await?; let inner = Arc::new(Inner { allowances, settlement: self.settlement.clone(), - vault: self.vault.clone(), + vault: self.vault, }); let weighted_product_orders: Vec<_> = pools @@ -135,7 +136,7 @@ pub struct SettlementHandler { struct Inner { settlement: GPv2Settlement, - vault: BalancerV2Vault::Instance, + vault: Address, allowances: Allowances, } @@ -143,7 +144,7 @@ impl SettlementHandler { pub fn new( pool_id: H256, settlement: GPv2Settlement, - vault: BalancerV2Vault::Instance, + vault: Address, allowances: Allowances, ) -> Self { SettlementHandler { @@ -156,7 +157,7 @@ impl SettlementHandler { } } - pub fn vault(&self) -> &BalancerV2Vault::Instance { + pub fn vault(&self) -> &Address { &self.inner.vault } @@ -171,7 +172,7 @@ impl SettlementHandler { ) -> BalancerSwapGivenOutInteraction { BalancerSwapGivenOutInteraction { settlement: self.inner.settlement.clone(), - vault: self.inner.vault.clone(), + vault: self.inner.vault, pool_id: self.pool_id, asset_in_max: input_max, asset_out: output, @@ -233,7 +234,7 @@ mod tests { use { super::*, crate::interactions::allowances::{Approval, MockAllowanceManaging}, - contracts::dummy_contract, + contracts::{alloy::BalancerV2Vault, dummy_contract}, maplit::{btreemap, hashmap, hashset}, mockall::predicate::*, model::TokenPair, @@ -406,7 +407,7 @@ mod tests { let (settlement, vault) = dummy_contracts(); let liquidity_provider = BalancerV2Liquidity { settlement, - vault, + vault: *vault.address(), pool_fetcher: Arc::new(pool_fetcher), allowance_manager: Box::new(allowance_manager), }; @@ -453,7 +454,7 @@ mod tests { let (settlement, vault) = dummy_contracts(); let inner = Arc::new(Inner { settlement: settlement.clone(), - vault: vault.clone(), + vault: *vault.address(), allowances: Allowances::new( vault.address().into_legacy(), hashmap! { @@ -502,7 +503,7 @@ mod tests { .encode(), BalancerSwapGivenOutInteraction { settlement: settlement.clone(), - vault: vault.clone(), + vault: *vault.address(), pool_id: H256([0x90; 32]), asset_in_max: TokenAmount::new(H160([0x70; 20]), 10), asset_out: TokenAmount::new(H160([0x71; 20]), 11), @@ -511,7 +512,7 @@ mod tests { .encode(), BalancerSwapGivenOutInteraction { settlement, - vault, + vault: *vault.address(), pool_id: H256([0x90; 32]), asset_in_max: TokenAmount::new(H160([0x71; 20]), 12), asset_out: TokenAmount::new(H160([0x72; 20]), 13), From 3067bd4e35a57216a26afef69d6934f7ac415459 Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 22 Oct 2025 15:09:27 +0300 Subject: [PATCH 032/117] Remove CoW AMM indexer from driver (#3680) # Description Currently, both autopilot and driver use the same CoW AMM indexer functionality in parallel to serve different purposes: autopilot needs to fill out surplus capturing jit order owners in the auction and driver uses it to fetch tradable tokens and then prepare CoW AMM template orders. Since autopilot already sends CoW AMM addresses within each auction, the only missing part is the CoW AMM helper SC address. It can be received by fetching the CoW AMM factory address and then using a config mapping to find the helper address. This should also reduce the RPC traffic. # Changes - [ ] Driver now contains only the mapping between AMM factory and helper SC. - [ ] When it receives a CoW AMM in the auction, it tries to fetch the AMM factory address by calling the `FACTORY` function. Since we can now completely deprecate legacy CoW AMMs, this logic is simplified. I also used a simple abi to create rust bindings for this interface. The fetched data is stored in the memory cache. - [ ] Using the factory address, it gets the helper SC instance based on the config. - [ ] Simplify the e2e tests config. - [ ] Adjusted a forked e2e test to start using the new factory address with some caveats(the test with its comments should be self-descriptive). ## How to test Adjusted forked e2e test. --- .../artifacts/CowAmmFactoryGetter.json | 17 +++ crates/contracts/src/alloy.rs | 4 + crates/cow-amm/src/amm.rs | 5 +- crates/driver/example.toml | 2 - .../src/domain/competition/pre_processing.rs | 23 +++- crates/driver/src/domain/cow_amm.rs | 128 ++++++++++++++++++ crates/driver/src/domain/mod.rs | 1 + .../driver/src/infra/blockchain/contracts.rs | 47 ++----- crates/driver/src/infra/blockchain/mod.rs | 17 +-- crates/driver/src/infra/config/file/load.rs | 9 +- crates/driver/src/infra/config/file/mod.rs | 12 +- crates/driver/src/infra/config/mod.rs | 2 - crates/driver/src/run.rs | 9 +- crates/driver/src/tests/setup/solver.rs | 3 +- crates/e2e/src/setup/colocation.rs | 29 +--- crates/e2e/src/setup/deploy.rs | 12 +- crates/e2e/tests/e2e/cow_amm.rs | 90 +++++++----- 17 files changed, 247 insertions(+), 163 deletions(-) create mode 100644 crates/contracts/artifacts/CowAmmFactoryGetter.json create mode 100644 crates/driver/src/domain/cow_amm.rs diff --git a/crates/contracts/artifacts/CowAmmFactoryGetter.json b/crates/contracts/artifacts/CowAmmFactoryGetter.json new file mode 100644 index 0000000000..ac5a71b314 --- /dev/null +++ b/crates/contracts/artifacts/CowAmmFactoryGetter.json @@ -0,0 +1,17 @@ +{ + "abi": [ + { + "inputs": [], + "name": "FACTORY", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 053164f2e6..81cfa43fb4 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -556,6 +556,10 @@ crate::bindings!( } ); +pub mod cow_amm { + crate::bindings!(CowAmmFactoryGetter); +} + pub mod support { // Support contracts used for trade and token simulations. crate::bindings!(AnyoneAuthenticator); diff --git a/crates/cow-amm/src/amm.rs b/crates/cow-amm/src/amm.rs index 42369fa7e4..ead5f1dfa0 100644 --- a/crates/cow-amm/src/amm.rs +++ b/crates/cow-amm/src/amm.rs @@ -20,10 +20,7 @@ pub struct Amm { } impl Amm { - pub(crate) async fn new( - address: Address, - helper: &CowAmmLegacyHelper, - ) -> Result { + pub async fn new(address: Address, helper: &CowAmmLegacyHelper) -> Result { let tradeable_tokens = helper.tokens(address).call().await?; Ok(Self { diff --git a/crates/driver/example.toml b/crates/driver/example.toml index 41573385ea..bdc1e5a4b7 100644 --- a/crates/driver/example.toml +++ b/crates/driver/example.toml @@ -44,8 +44,6 @@ flashloan-router = "0x0000000000000000000000000000000000000000" factory = "0x86f3df416979136cb4fdea2c0886301b911c163b" # address of contract to help interfacing with the created CoW AMMs helper = "0x86f3df416979136cb4fdea2c0886301b911c163b" -# at which block the driver should start indexing the factory (1 block before deployment) -index-start = 20188649 [liquidity] base-tokens = [ diff --git a/crates/driver/src/domain/competition/pre_processing.rs b/crates/driver/src/domain/competition/pre_processing.rs index 3289a2a5cf..f56aada688 100644 --- a/crates/driver/src/domain/competition/pre_processing.rs +++ b/crates/driver/src/domain/competition/pre_processing.rs @@ -3,6 +3,7 @@ use { crate::{ domain::{ competition::order::{SellTokenBalance, app_data::AppData}, + cow_amm, eth, liquidity, }, @@ -58,6 +59,7 @@ pub struct Utilities { liquidity_fetcher: infra::liquidity::Fetcher, tokens: tokens::Fetcher, balance_fetcher: Arc, + cow_amm_cache: cow_amm::Cache, } impl std::fmt::Debug for Utilities { @@ -130,6 +132,14 @@ impl DataAggregator { eth.balance_overrider(), ); + let cow_amm_helper_by_factory = eth + .contracts() + .cow_amm_helper_by_factory() + .iter() + .map(|(factory, helper)| (factory.0.into(), helper.0.into())) + .collect(); + let cow_amm_cache = cow_amm::Cache::new(eth.web3().clone(), cow_amm_helper_by_factory); + Self { utilities: Arc::new(Utilities { eth, @@ -138,6 +148,7 @@ impl DataAggregator { liquidity_fetcher, tokens, balance_fetcher, + cow_amm_cache, }), control: Mutex::new(ControlBlock { solve_request: Default::default(), @@ -380,17 +391,19 @@ impl Utilities { let _timer = metrics::get().processing_stage_timer("cow_amm_orders"); let _timer2 = observe::metrics::metrics().on_auction_overhead_start("driver", "cow_amm_orders"); - let cow_amms = self.eth.contracts().cow_amm_registry().amms().await; + + let cow_amms = self + .cow_amm_cache + .get_or_create_amms(&auction.surplus_capturing_jit_order_owners) + .await; + let domain_separator = self.eth.contracts().settlement_domain_separator(); let domain_separator = model::DomainSeparator(domain_separator.0); let validator = self.signature_validator.as_ref(); + let results: Vec<_> = futures::future::join_all( cow_amms .into_iter() - // Only generate orders for cow amms the auction told us about. - // Otherwise the solver would expect the order to get surplus but - // the autopilot would actually not count it. - .filter(|amm| auction.surplus_capturing_jit_order_owners.contains(ð::Address(*amm.address()))) // Only generate orders where the auction provided the required // reference prices. Otherwise there will be an error during the // surplus calculation which will also result in 0 surplus for diff --git a/crates/driver/src/domain/cow_amm.rs b/crates/driver/src/domain/cow_amm.rs new file mode 100644 index 0000000000..34d47821bb --- /dev/null +++ b/crates/driver/src/domain/cow_amm.rs @@ -0,0 +1,128 @@ +use { + crate::domain::eth, + contracts::CowAmmLegacyHelper, + cow_amm::Amm, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + itertools::{ + Either::{Left, Right}, + Itertools, + }, + std::{ + collections::{HashMap, HashSet}, + sync::Arc, + }, + tokio::sync::RwLock, +}; + +/// Cache for CoW AMM data to avoid using the registry dependency. +/// Maps AMM address to the corresponding Amm instance. +pub struct Cache { + inner: RwLock>>, + web3: ethrpc::Web3, + helper_by_factory: HashMap, +} + +impl Cache { + pub fn new(web3: ethrpc::Web3, factory_mapping: HashMap) -> Self { + let helper_by_factory = factory_mapping + .into_iter() + .map(|(factory, helper)| (factory, CowAmmLegacyHelper::at(&web3, helper.0))) + .collect(); + Self { + inner: RwLock::new(HashMap::new()), + web3, + helper_by_factory, + } + } + + /// Gets or creates AMM instances for the given surplus capturing JIT order + /// owners. + pub async fn get_or_create_amms( + &self, + surplus_capturing_jit_order_owners: &HashSet, + ) -> Vec> { + let (mut cached_amms, missing_amms): (Vec>, Vec) = { + let cache = self.inner.read().await; + surplus_capturing_jit_order_owners + .iter() + .partition_map(|&address| match cache.get(&address) { + Some(amm) => Left(amm.clone()), + None => Right(address), + }) + }; + + if missing_amms.is_empty() { + return cached_amms; + } + + let fetch_futures = missing_amms.into_iter().map(|amm_address| async move { + let factory_address = self + .fetch_amm_factory_address(amm_address) + .await + .inspect_err(|err| { + tracing::warn!( + ?err, + amm_address = ?amm_address.0, + "failed to fetch CoW AMM factory address" + ); + }) + .ok()?; + + let Some(helper) = self.helper_by_factory.get(&factory_address) else { + tracing::warn!( + factory_address = ?factory_address.0, + amm_address = ?amm_address.0, + "no helper contract configured for CoW AMM factory" + ); + return None; + }; + + match Amm::new(amm_address.0, helper).await { + Ok(amm) => Some((amm_address, Arc::new(amm))), + Err(err) => { + let helper_address = helper.address().0; + tracing::warn!( + ?err, + amm_address = ?amm_address.0, + ?helper_address, + "failed to create CoW AMM instance" + ); + None + } + } + }); + + let fetched_results = futures::future::join_all(fetch_futures).await; + + // Update cache with newly fetched AMMs + let newly_created_amms = { + let mut cache = self.inner.write().await; + fetched_results + .into_iter() + .flatten() + .map(|(amm_address, amm)| { + cache.insert(amm_address, amm.clone()); + amm + }) + .collect::>() + }; + + // Combine cached and newly created AMMs + cached_amms.extend(newly_created_amms); + cached_amms + } + + /// Fetches the factory address for the given AMM by calling the + /// `FACTORY` function. + async fn fetch_amm_factory_address( + &self, + amm_address: eth::Address, + ) -> anyhow::Result { + let factory_getter = + contracts::alloy::cow_amm::CowAmmFactoryGetter::CowAmmFactoryGetter::new( + amm_address.0.into_alloy(), + &self.web3.alloy, + ); + Ok(factory_getter.FACTORY().call().await?.into_legacy().into()) + } +} diff --git a/crates/driver/src/domain/mod.rs b/crates/driver/src/domain/mod.rs index 19eacd112f..cc7bb1bc7d 100644 --- a/crates/driver/src/domain/mod.rs +++ b/crates/driver/src/domain/mod.rs @@ -1,4 +1,5 @@ pub mod competition; +pub mod cow_amm; pub mod eth; pub mod liquidity; pub mod mempools; diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index 7ab426c813..45ab8ffcf5 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -1,12 +1,12 @@ use { - crate::{boundary, domain::eth, infra::blockchain::Ethereum}, + crate::{domain::eth, infra::blockchain::Ethereum}, chain::Chain, contracts::alloy::{BalancerV2Vault, FlashLoanRouter, support::Balances}, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, - block_stream::CurrentBlockWatcher, }, + std::collections::HashMap, thiserror::Error, }; @@ -20,7 +20,6 @@ pub struct Contracts { /// The domain separator for settlement contract used for signing orders. settlement_domain_separator: eth::DomainSeparator, - cow_amm_registry: cow_amm::Registry, /// Single router that supports multiple flashloans in the /// same settlement. @@ -28,6 +27,9 @@ pub struct Contracts { // everywhere flashloan_router: Option, balance_helper: Balances::Instance, + /// Mapping from CoW AMM factory address to the corresponding CoW AMM + /// helper. + cow_amm_helper_by_factory: HashMap, } #[derive(Debug, Default, Clone)] @@ -36,7 +38,7 @@ pub struct Addresses { pub signatures: Option, pub weth: Option, pub balances: Option, - pub cow_amms: Vec, + pub cow_amm_helper_by_factory: HashMap, pub flashloan_router: Option, } @@ -45,8 +47,6 @@ impl Contracts { web3: &Web3, chain: Chain, addresses: Addresses, - block_stream: CurrentBlockWatcher, - archive_node: Option, ) -> Result { let address_for = |contract: ðcontract::Contract, address: Option| { @@ -99,21 +99,6 @@ impl Contracts { .0, ); - let archive_node_web3 = archive_node.as_ref().map_or(web3.clone(), |args| { - boundary::buffered_web3_client( - &args.url, - args.max_batch_size, - args.max_concurrent_requests, - ) - }); - let mut cow_amm_registry = cow_amm::Registry::new(archive_node_web3); - for config in addresses.cow_amms { - cow_amm_registry - .add_listener(config.index_start, config.factory, config.helper) - .await; - } - cow_amm_registry.spawn_maintenance_task(block_stream); - // TODO: use `address_for()` once contracts are deployed let flashloan_router = addresses .flashloan_router @@ -133,9 +118,9 @@ impl Contracts { signatures, weth, settlement_domain_separator, - cow_amm_registry, flashloan_router, balance_helper, + cow_amm_helper_by_factory: addresses.cow_amm_helper_by_factory, }) } @@ -167,10 +152,6 @@ impl Contracts { &self.settlement_domain_separator } - pub fn cow_amm_registry(&self) -> &cow_amm::Registry { - &self.cow_amm_registry - } - pub fn flashloan_router(&self) -> Option<&FlashLoanRouter::Instance> { self.flashloan_router.as_ref() } @@ -178,16 +159,12 @@ impl Contracts { pub fn balance_helper(&self) -> &Balances::Instance { &self.balance_helper } -} -#[derive(Debug, Clone)] -pub struct CowAmmConfig { - /// Which contract to index for CoW AMM deployment events. - pub factory: eth::H160, - /// Which helper contract to use for interfacing with the indexed CoW AMMs. - pub helper: eth::H160, - /// At which block indexing should start on the factory. - pub index_start: u64, + pub fn cow_amm_helper_by_factory( + &self, + ) -> &HashMap { + &self.cow_amm_helper_by_factory + } } /// Returns the address of a contract for the specified network, or `None` if diff --git a/crates/driver/src/infra/blockchain/mod.rs b/crates/driver/src/infra/blockchain/mod.rs index bcdb65f16f..de6fb6a021 100644 --- a/crates/driver/src/infra/blockchain/mod.rs +++ b/crates/driver/src/infra/blockchain/mod.rs @@ -96,7 +96,6 @@ impl Ethereum { rpc: Rpc, addresses: contracts::Addresses, gas: Arc, - archive_node_url: Option<&Url>, tx_gas_limit: U256, ) -> Self { let Rpc { web3, chain, args } = rpc; @@ -108,19 +107,9 @@ impl Ethereum { .await .expect("couldn't initialize current block stream"); - let contracts = Contracts::new( - &web3, - chain, - addresses, - current_block_stream.clone(), - archive_node_url.map(|url| RpcArgs { - url: url.clone(), - max_batch_size: args.max_batch_size, - max_concurrent_requests: args.max_concurrent_requests, - }), - ) - .await - .expect("could not initialize important smart contracts"); + let contracts = Contracts::new(&web3, chain, addresses) + .await + .expect("could not initialize important smart contracts"); let balance_overrider = Arc::new(BalanceOverrides::new(web3.clone())); let balance_simulator = BalanceSimulator::new( contracts.settlement().clone(), diff --git a/crates/driver/src/infra/config/file/load.rs b/crates/driver/src/infra/config/file/load.rs index ffea52ec69..a4a32a4e53 100644 --- a/crates/driver/src/infra/config/file/load.rs +++ b/crates/driver/src/infra/config/file/load.rs @@ -388,15 +388,11 @@ pub async fn load(chain: Chain, path: &Path) -> infra::Config { weth: config.contracts.weth.map(Into::into), balances: config.contracts.balances.map(Into::into), signatures: config.contracts.signatures.map(Into::into), - cow_amms: config + cow_amm_helper_by_factory: config .contracts .cow_amms .into_iter() - .map(|cfg| blockchain::contracts::CowAmmConfig { - index_start: cfg.index_start, - factory: cfg.factory, - helper: cfg.helper, - }) + .map(|cfg| (cfg.factory.into(), cfg.helper.into())) .collect(), flashloan_router: config.contracts.flashloan_router.map(Into::into), }, @@ -404,7 +400,6 @@ pub async fn load(chain: Chain, path: &Path) -> infra::Config { disable_gas_simulation: config.disable_gas_simulation.map(Into::into), gas_estimator: config.gas_estimator, order_priority_strategies: config.order_priority_strategies, - archive_node_url: config.archive_node_url, simulation_bad_token_max_age: config.simulation_bad_token_max_age, app_data_fetching: config.app_data_fetching, tx_gas_limit: config.tx_gas_limit, diff --git a/crates/driver/src/infra/config/file/mod.rs b/crates/driver/src/infra/config/file/mod.rs index 27898f578e..d27579a3e1 100644 --- a/crates/driver/src/infra/config/file/mod.rs +++ b/crates/driver/src/infra/config/file/mod.rs @@ -68,9 +68,6 @@ struct Config { )] order_priority_strategies: Vec, - /// Archive node URL used to index CoW AMM - archive_node_url: Option, - /// How long should the token quality computed by the simulation /// based logic be cached. #[serde( @@ -380,8 +377,7 @@ struct ContractsConfig { /// Override the default address of the Signatures contract. signatures: Option, - /// List of all cow amm factories the driver should generate - /// rebalancing orders for. + /// List of all cow amm factories with the corresponding helper contract. #[serde(default)] cow_amms: Vec, @@ -393,12 +389,10 @@ struct ContractsConfig { #[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "kebab-case", deny_unknown_fields)] pub struct CowAmmConfig { - /// Which contract to index for CoW AMM deployment events. + /// CoW AMM factory address. pub factory: eth::H160, - /// Which helper contract to use for interfacing with the indexed CoW AMMs. + /// Which helper contract to use for interfacing with CoW AMMs. pub helper: eth::H160, - /// At which block indexing should start on the factory. - pub index_start: u64, } #[derive(Debug, Deserialize)] diff --git a/crates/driver/src/infra/config/mod.rs b/crates/driver/src/infra/config/mod.rs index 389857b6f5..26e0b84c72 100644 --- a/crates/driver/src/infra/config/mod.rs +++ b/crates/driver/src/infra/config/mod.rs @@ -12,7 +12,6 @@ use { }, }, std::time::Duration, - url::Url, }; pub mod file; @@ -30,7 +29,6 @@ pub struct Config { pub mempools: Vec, pub contracts: blockchain::contracts::Addresses, pub order_priority_strategies: Vec, - pub archive_node_url: Option, pub simulation_bad_token_max_age: Duration, pub app_data_fetching: AppDataFetching, pub tx_gas_limit: eth::U256, diff --git a/crates/driver/src/run.rs b/crates/driver/src/run.rs index ed7f8b7083..dafda9c86d 100644 --- a/crates/driver/src/run.rs +++ b/crates/driver/src/run.rs @@ -166,14 +166,7 @@ async fn ethereum(config: &infra::Config, ethrpc: blockchain::Rpc) -> Ethereum { .await .expect("initialize gas price estimator"), ); - Ethereum::new( - ethrpc, - config.contracts.clone(), - gas, - config.archive_node_url.as_ref(), - config.tx_gas_limit, - ) - .await + Ethereum::new(ethrpc, config.contracts.clone(), gas, config.tx_gas_limit).await } async fn solvers(config: &config::Config, eth: &Ethereum) -> Vec { diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index 2bfe616d6c..475c796534 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -472,7 +472,7 @@ impl Solver { weth: Some(config.blockchain.weth.address().into()), balances: Some(config.blockchain.balances.address().into_legacy().into()), signatures: Some(config.blockchain.signatures.address().into_legacy().into()), - cow_amms: vec![], + cow_amm_helper_by_factory: Default::default(), flashloan_router: Some( config .blockchain @@ -483,7 +483,6 @@ impl Solver { ), }, gas, - None, 45_000_000.into(), ) .await; diff --git a/crates/e2e/src/setup/colocation.rs b/crates/e2e/src/setup/colocation.rs index 34e11c8330..9869dc715e 100644 --- a/crates/e2e/src/setup/colocation.rs +++ b/crates/e2e/src/setup/colocation.rs @@ -1,6 +1,6 @@ use { crate::setup::*, - ethcontract::{H160, common::DeploymentInformation}, + ethcontract::H160, reqwest::Url, std::collections::HashSet, tokio::task::JoinHandle, @@ -164,31 +164,6 @@ solving-share-of-deadline = 1.0 let liquidity = liquidity.to_string(contracts); let encoded_base_tokens = encode_base_tokens(base_tokens.clone()); - - let cow_amms = contracts - .cow_amm_helper - .iter() - .map(|contract| { - let Some(DeploymentInformation::BlockNumber(block)) = contract.deployment_information() - else { - panic!("unknown deployment block for cow amm contract"); - }; - - format!( - r#" -[[contracts.cow-amms]] -index-start = {} -helper = "{:?}" -factory = "{:?}" -"#, - block - 1, // start indexing 1 block before the contract was deployed - contract.address(), - contract.address(), - ) - }) - .collect::>() - .join("\n"); - let flashloan_router_config = contracts .flashloan_router .as_ref() @@ -212,8 +187,6 @@ balances = "{:?}" signatures = "{:?}" {flashloan_router_config} -{cow_amms} - {solvers} [liquidity] diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index b1ce292992..8ca1486f16 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -1,7 +1,6 @@ use { crate::deploy, contracts::{ - CowAmmLegacyHelper, GPv2AllowListAuthentication, GPv2Settlement, WETH9, @@ -17,7 +16,7 @@ use { support::{Balances, Signatures}, }, }, - ethcontract::{Address, H256, errors::DeployError}, + ethcontract::{Address, H256}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::DomainSeparator, shared::ethrpc::Web3, @@ -43,7 +42,6 @@ pub struct Contracts { pub domain_separator: DomainSeparator, pub ethflows: Vec, pub hooks: HooksTrampoline::Instance, - pub cow_amm_helper: Option, pub flashloan_router: Option, } @@ -58,12 +56,6 @@ impl Contracts { tracing::info!("connected to forked test network {}", network_id); let gp_settlement = GPv2Settlement::deployed(web3).await.unwrap(); - let cow_amm_helper = match contracts::CowAmmLegacyHelper::deployed(web3).await { - Err(DeployError::NotFound(_)) => None, - Err(err) => panic!("failed to find deployed contract: {err:?}"), - Ok(contract) => Some(contract), - }; - let balances = match deployed.balances { Some(address) => Balances::Instance::new(address.into_alloy(), web3.alloy.clone()), None => Balances::Instance::deployed(&web3.alloy) @@ -118,7 +110,6 @@ impl Contracts { gp_settlement, balances, signatures, - cow_amm_helper, flashloan_router, } } @@ -254,7 +245,6 @@ impl Contracts { ethflows: vec![ethflow, ethflow_secondary], hooks, // Current helper contract only works in forked tests - cow_amm_helper: None, flashloan_router: Some(flashloan_router), } } diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index b6950a05f0..dad6adc16c 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -1,5 +1,6 @@ use { app_data::AppDataHash, + autopilot::util::conv::U256Ext, contracts::{ ERC20, alloy::support::{Balances, Signatures}, @@ -416,9 +417,8 @@ async fn forked_node_mainnet_cow_amm_driver_support() { cow_amm_driver_support, std::env::var("FORK_URL_MAINNET") .expect("FORK_URL_MAINNET must be set to run forked tests"), - // block at which helper was deployed, this block can't be updated since it would lead to - // the long indexing problem and, as a result, failing tests - 20332745, + // block before relevant cow amm was finalized + 20476674, ) .await; } @@ -444,7 +444,7 @@ async fn cow_amm_driver_support(web3: Web3) { let mut onchain = OnchainComponents::deployed_with(web3.clone(), deployed_contracts).await; let forked_node_api = web3.api::>(); - let [solver] = onchain.make_solvers_forked(to_wei(1)).await; + let [solver] = onchain.make_solvers_forked(to_wei(11)).await; let [trader] = onchain.make_accounts(to_wei(1)).await; // find some USDC available onchain @@ -474,12 +474,33 @@ async fn cow_amm_driver_support(web3: Web3) { // Unbalance the cow amm enough that baseline is able to rebalance // it with the current liquidity. const USDC_WETH_COW_AMM: H160 = H160(hex_literal::hex!( - "301076c36e034948a747bb61bab9cd03f62672e3" + "f08d4dea369c456d26a3168ff0024b904f2d8b91" )); + + let weth_balance = onchain + .contracts() + .weth + .balance_of(USDC_WETH_COW_AMM) + .call() + .await + .unwrap(); + // Assuming that the pool is balanced, imbalance it by 30%, so the driver can + // crate a CoW AMM JIT order. This imbalance shouldn't exceed 50%, since + // such an order will be rejected by the SC: + let weth_to_send = weth_balance.checked_mul_f64(0.3).unwrap(); + tx_value!( + solver.account(), + weth_to_send, + onchain.contracts().weth.deposit() + ); tx!( - usdc_whale, - usdc.transfer(USDC_WETH_COW_AMM, to_wei_with_exp(5_000_000, 6)) + solver.account(), + onchain + .contracts() + .weth + .transfer(USDC_WETH_COW_AMM, weth_to_send) ); + let amm_usdc_balance_before = usdc.balance_of(USDC_WETH_COW_AMM).call().await.unwrap(); // Now we create an unfillable order just so the orderbook is not empty. @@ -525,7 +546,7 @@ async fn cow_amm_driver_support(web3: Web3) { // spawn a mock solver so we can later assert things about the received auction let mock_solver = Mock::default(); - colocation::start_driver( + colocation::start_driver_with_config_override( onchain.contracts(), vec![ colocation::start_baseline_solver( @@ -547,6 +568,13 @@ async fn cow_amm_driver_support(web3: Web3) { ], colocation::LiquidityProvider::UniswapV2, false, + Some( + r#" +[[contracts.cow-amms]] +helper = "0x3FF0041A614A9E6Bf392cbB961C97DA214E9CB31" +factory = "0xf76c421bAb7df8548604E60deCCcE50477C10462" +"#, + ), ); let services = Services::new(&onchain).await; @@ -557,7 +585,8 @@ async fn cow_amm_driver_support(web3: Web3) { format!("--drivers=test_solver|http://localhost:11088/test_solver|{},mock_solver|http://localhost:11088/mock_solver|{}", const_hex::encode(solver.address()), const_hex::encode(solver.address())), "--price-estimation-drivers=test_solver|http://localhost:11088/test_solver" .to_string(), - "--cow-amm-configs=0x3705ceee5eaa561e3157cf92641ce28c45a3999c|0x3705ceee5eaa561e3157cf92641ce28c45a3999c|20332744".to_string() + // it uses an older helper contract that was deployed before the desired cow amm + "--cow-amm-configs=0xf76c421bAb7df8548604E60deCCcE50477C10462|0x3FF0041A614A9E6Bf392cbB961C97DA214E9CB31|20476672".to_string() ], ) .await; @@ -620,18 +649,6 @@ async fn cow_amm_driver_support(web3: Web3) { // all cow amms on mainnet the helper contract is aware of tracing::info!("Waiting for all cow amms to be indexed."); - let expected_cow_amms = [ - addr!("027e1cbf2c299cba5eb8a2584910d04f1a8aa403"), - // This AMM should be removed by the EmptyPoolRemoval due to empty liquidity pool. - // addr!("b3bf81714f704720dcb0351ff0d42eca61b069fc"), - addr!("301076c36e034948a747bb61bab9cd03f62672e3"), - addr!("d7cb8cc1b56356bb7b78d02e785ead28e2158660"), - addr!("9941fd7db2003308e7ee17b04400012278f12ac6"), - // no native prices for the tokens traded by this AMM (COW token price) - // addr!("beef5afe88ef73337e5070ab2855d37dbf5493a4"), - addr!("c6b13d5e662fa0458f03995bcb824a1934aa895f"), - ]; - wait_for_condition(TIMEOUT, || async { let auctions = mock_solver.get_auctions(); let found_cow_amms: HashSet<_> = auctions @@ -639,9 +656,7 @@ async fn cow_amm_driver_support(web3: Web3) { .flat_map(|a| a.surplus_capturing_jit_order_owners.clone()) .collect(); - expected_cow_amms - .iter() - .all(|amm| found_cow_amms.contains(amm)) + found_cow_amms.contains(&USDC_WETH_COW_AMM) }) .await .unwrap(); @@ -649,31 +664,34 @@ async fn cow_amm_driver_support(web3: Web3) { // all tokens traded by the cow amms tracing::info!("Waiting for all relevant native prices to be indexed."); let expected_prices = [ - // missing due to insufficient liquidity in e2e test (we only index univ2) - // addr!("808507121B80c02388fAd14726482e061B8da827"), // PENDLE - // addr!("DEf1CA1fb7FBcDC777520aa7f396b4E015F497aB"), // COW addr!("C02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"), // WETH addr!("A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"), // USDC - addr!("aea46A60368A7bD060eec7DF8CBa43b7EF41Ad85"), // FET - addr!("8390a1DA07E376ef7aDd4Be859BA74Fb83aA02D5"), // GROK - addr!("514910771AF9Ca656af840dff83E8264EcF986CA"), // LINK - addr!("5afe3855358e112b5647b952709e6165e1c1eeee"), // SAFE ]; wait_for_condition(TIMEOUT, || async { let auctions = mock_solver.get_auctions(); let auction_prices: HashSet<_> = auctions .iter() - .flat_map(|a| { - a.tokens + .flat_map(|auction| { + auction + .tokens .iter() .filter_map(|(token, info)| info.reference_price.map(|_| token)) }) .collect(); - expected_prices - .iter() - .all(|token| auction_prices.contains(token)) + let found_amm_jit_orders = auctions.iter().any(|auction| { + auction.orders.iter().any(|order| { + order.owner == USDC_WETH_COW_AMM + && order.sell_token == H160(onchain.contracts().weth.address().0) + && order.buy_token == usdc.address() + }) + }); + + found_amm_jit_orders + && expected_prices + .iter() + .all(|token| auction_prices.contains(token)) }) .await .unwrap(); From 3616e1c2807ef4e7cbee57d2e316f82471ec80e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 16:00:35 +0100 Subject: [PATCH 033/117] Remove unused artifacts (#3800) --- crates/contracts/artifacts/Multicall.json | 1 - crates/contracts/artifacts/Roles.json | 1 - crates/contracts/artifacts/SolverTrampoline.json | 1 - 3 files changed, 3 deletions(-) delete mode 100644 crates/contracts/artifacts/Multicall.json delete mode 100644 crates/contracts/artifacts/Roles.json delete mode 100644 crates/contracts/artifacts/SolverTrampoline.json diff --git a/crates/contracts/artifacts/Multicall.json b/crates/contracts/artifacts/Multicall.json deleted file mode 100644 index ec839684ce..0000000000 --- a/crates/contracts/artifacts/Multicall.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"gas","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Multicall.Call[]","name":"calls","type":"tuple[]"}],"stateMutability":"payable","type":"constructor"}],"bytecode":"0x60806040526040516107e03803806107e083398101604081905261002291610339565b60006040516100309061022f565b604051809103906000f08015801561004c573d6000803e3d6000fd5b509050600082516001600160401b0381111561006a5761006a61023c565b6040519080825280602002602001820160405280156100b057816020015b6040805180820190915260008152606060208201528152602001906001900390816100885790505b50905060005b83518110156102025760008482815181106100d3576100d3610466565b6020026020010151905060008383815181106100f1576100f1610466565b60200260200101519050846001600160a01b031663b61d27f683604001518460000151856020015186606001516040518563ffffffff1660e01b815260040161013c939291906104a8565b6000604051808303818588803b15801561015557600080fd5b505af193505050508015610167575060015b6101be573d808015610195576040519150601f19603f3d011682016040523d82523d6000602084013e61019a565b606091505b50808060200190518101906101af91906104d8565b602084015215158252506101f8565b60405162461bcd60e51b815260206004820152600b60248201526a756e726561636861626c6560a81b604482015260640160405180910390fd5b50506001016100b6565b50600081604051602001610216919061052d565b6040516020818303038152906040529050805181602001f35b61023c806105a483390190565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b03811182821017156102745761027461023c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156102a2576102a261023c565b604052919050565b60005b838110156102c55781810151838201526020016102ad565b50506000910152565b600082601f8301126102df57600080fd5b81516001600160401b038111156102f8576102f861023c565b61030b601f8201601f191660200161027a565b81815284602083860101111561032057600080fd5b6103318260208301602087016102aa565b949350505050565b6000602080838503121561034c57600080fd5b82516001600160401b038082111561036357600080fd5b818501915085601f83011261037757600080fd5b8151818111156103895761038961023c565b8060051b61039885820161027a565b91825283810185019185810190898411156103b257600080fd5b86860192505b83831015610459578251858111156103d05760008081fd5b86016080818c03601f19018113156103e85760008081fd5b6103f0610252565b828a01516001600160a01b038116811461040a5760008081fd5b81526040838101518b8301526060808501518284015292840151928984111561043557600091508182fd5b6104438f8d868801016102ce565b90830152508452505091860191908601906103b8565b9998505050505050505050565b634e487b7160e01b600052603260045260246000fd5b600081518084526104948160208601602086016102aa565b601f01601f19169290920160200192915050565b60018060a01b03841681528260208201526060604082015260006104cf606083018461047c565b95945050505050565b600080604083850312156104eb57600080fd5b825180151581146104fb57600080fd5b60208401519092506001600160401b0381111561051757600080fd5b610523858286016102ce565b9150509250929050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561059557888303603f1901855281518051151584528701518784018790526105828785018261047c565b9588019593505090860190600101610554565b50909897505050505050505056fe608060405234801561001057600080fd5b5061021c806100206000396000f3fe60806040526004361061001e5760003560e01c8063b61d27f614610023575b600080fd5b6100366100313660046100e7565b610038565b005b82600003610044575a92505b6000808573ffffffffffffffffffffffffffffffffffffffff163486908686604051610071929190610189565b600060405180830381858888f193505050503d80600081146100af576040519150601f19603f3d011682016040523d82523d6000602084013e6100b4565b606091505b5091509150600082826040516020016100ce929190610199565b6040516020818303038152906040529050805181602001fd5b600080600080606085870312156100fd57600080fd5b843573ffffffffffffffffffffffffffffffffffffffff8116811461012157600080fd5b935060208501359250604085013567ffffffffffffffff8082111561014557600080fd5b818701915087601f83011261015957600080fd5b81358181111561016857600080fd5b88602082850101111561017a57600080fd5b95989497505060200194505050565b8183823760009101908152919050565b821515815260006020604081840152835180604085015260005b818110156101cf578581018301518582016060015282016101b3565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050939250505056fea164736f6c6343000811000a","deployedBytecode":"0x6080604052600080fdfea164736f6c6343000811000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} diff --git a/crates/contracts/artifacts/Roles.json b/crates/contracts/artifacts/Roles.json deleted file mode 100644 index e0e46ba6ac..0000000000 --- a/crates/contracts/artifacts/Roles.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_avatar","type":"address"},{"internalType":"address","name":"_target","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"AlreadyDisabledModule","type":"error"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"AlreadyEnabledModule","type":"error"},{"inputs":[],"name":"ArraysDifferentLength","type":"error"},{"inputs":[],"name":"CalldataOutOfBounds","type":"error"},{"inputs":[{"internalType":"enum PermissionChecker.Status","name":"status","type":"uint8"},{"internalType":"bytes32","name":"info","type":"bytes32"}],"name":"ConditionViolation","type":"error"},{"inputs":[],"name":"FunctionSignatureTooShort","type":"error"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"HashAlreadyConsumed","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"InvalidModule","type":"error"},{"inputs":[],"name":"InvalidPageSize","type":"error"},{"inputs":[],"name":"MalformedMultiEntrypoint","type":"error"},{"inputs":[],"name":"ModuleTransactionFailed","type":"error"},{"inputs":[],"name":"NoMembership","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"SetupModulesAlreadyCalled","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"targetAddress","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"enum ExecutionOptions","name":"options","type":"uint8"}],"name":"AllowFunction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"targetAddress","type":"address"},{"indexed":false,"internalType":"enum ExecutionOptions","name":"options","type":"uint8"}],"name":"AllowTarget","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"},{"indexed":false,"internalType":"bytes32[]","name":"roleKeys","type":"bytes32[]"},{"indexed":false,"internalType":"bool[]","name":"memberOf","type":"bool[]"}],"name":"AssignRoles","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAvatar","type":"address"},{"indexed":true,"internalType":"address","name":"newAvatar","type":"address"}],"name":"AvatarSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"allowanceKey","type":"bytes32"},{"indexed":false,"internalType":"uint128","name":"consumed","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"newBalance","type":"uint128"}],"name":"ConsumeAllowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"DisabledModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"EnabledModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"module","type":"address"}],"name":"ExecutionFromModuleFailure","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"module","type":"address"}],"name":"ExecutionFromModuleSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"","type":"bytes32"}],"name":"HashExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"","type":"bytes32"}],"name":"HashInvalidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"targetAddress","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"RevokeFunction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"targetAddress","type":"address"}],"name":"RevokeTarget","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"initiator","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"avatar","type":"address"},{"indexed":false,"internalType":"address","name":"target","type":"address"}],"name":"RolesModSetup","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"targetAddress","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"components":[{"internalType":"uint8","name":"parent","type":"uint8"},{"internalType":"enum ParameterType","name":"paramType","type":"uint8"},{"internalType":"enum Operator","name":"operator","type":"uint8"},{"internalType":"bytes","name":"compValue","type":"bytes"}],"indexed":false,"internalType":"struct ConditionFlat[]","name":"conditions","type":"tuple[]"},{"indexed":false,"internalType":"enum ExecutionOptions","name":"options","type":"uint8"}],"name":"ScopeFunction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"indexed":false,"internalType":"address","name":"targetAddress","type":"address"}],"name":"ScopeTarget","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"allowanceKey","type":"bytes32"},{"indexed":false,"internalType":"uint128","name":"balance","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"maxRefill","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"refill","type":"uint128"},{"indexed":false,"internalType":"uint64","name":"period","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"SetAllowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"},{"indexed":false,"internalType":"bytes32","name":"defaultRoleKey","type":"bytes32"}],"name":"SetDefaultRole","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"contract ITransactionUnwrapper","name":"adapter","type":"address"}],"name":"SetUnwrapAdapter","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTarget","type":"address"},{"indexed":true,"internalType":"address","name":"newTarget","type":"address"}],"name":"TargetSet","type":"event"},{"inputs":[{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"address","name":"targetAddress","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"},{"internalType":"enum ExecutionOptions","name":"options","type":"uint8"}],"name":"allowFunction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"address","name":"targetAddress","type":"address"},{"internalType":"enum ExecutionOptions","name":"options","type":"uint8"}],"name":"allowTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"allowances","outputs":[{"internalType":"uint128","name":"refill","type":"uint128"},{"internalType":"uint128","name":"maxRefill","type":"uint128"},{"internalType":"uint64","name":"period","type":"uint64"},{"internalType":"uint128","name":"balance","type":"uint128"},{"internalType":"uint64","name":"timestamp","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"module","type":"address"},{"internalType":"bytes32[]","name":"roleKeys","type":"bytes32[]"},{"internalType":"bool[]","name":"memberOf","type":"bool[]"}],"name":"assignRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"avatar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"consumed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"defaultRoles","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"prevModule","type":"address"},{"internalType":"address","name":"module","type":"address"}],"name":"disableModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"enableModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"}],"name":"execTransactionFromModule","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"}],"name":"execTransactionFromModuleReturnData","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"},{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"bool","name":"shouldRevert","type":"bool"}],"name":"execTransactionWithRole","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"},{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"bool","name":"shouldRevert","type":"bool"}],"name":"execTransactionWithRoleReturnData","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"start","type":"address"},{"internalType":"uint256","name":"pageSize","type":"uint256"}],"name":"getModulesPaginated","outputs":[{"internalType":"address[]","name":"array","type":"address[]"},{"internalType":"address","name":"next","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"invalidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"}],"name":"isModuleEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"moduleTxHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"address","name":"targetAddress","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"revokeFunction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"address","name":"targetAddress","type":"address"}],"name":"revokeTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"address","name":"targetAddress","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"},{"components":[{"internalType":"uint8","name":"parent","type":"uint8"},{"internalType":"enum ParameterType","name":"paramType","type":"uint8"},{"internalType":"enum Operator","name":"operator","type":"uint8"},{"internalType":"bytes","name":"compValue","type":"bytes"}],"internalType":"struct ConditionFlat[]","name":"conditions","type":"tuple[]"},{"internalType":"enum ExecutionOptions","name":"options","type":"uint8"}],"name":"scopeFunction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"roleKey","type":"bytes32"},{"internalType":"address","name":"targetAddress","type":"address"}],"name":"scopeTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint128","name":"balance","type":"uint128"},{"internalType":"uint128","name":"maxRefill","type":"uint128"},{"internalType":"uint128","name":"refill","type":"uint128"},{"internalType":"uint64","name":"period","type":"uint64"},{"internalType":"uint64","name":"timestamp","type":"uint64"}],"name":"setAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_avatar","type":"address"}],"name":"setAvatar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"module","type":"address"},{"internalType":"bytes32","name":"roleKey","type":"bytes32"}],"name":"setDefaultRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"}],"name":"setTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"},{"internalType":"contract ITransactionUnwrapper","name":"adapter","type":"address"}],"name":"setTransactionUnwrapper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"initParams","type":"bytes"}],"name":"setUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"target","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"unwrappers","outputs":[{"internalType":"contract ITransactionUnwrapper","name":"","type":"address"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file diff --git a/crates/contracts/artifacts/SolverTrampoline.json b/crates/contracts/artifacts/SolverTrampoline.json deleted file mode 100644 index 436d41bc69..0000000000 --- a/crates/contracts/artifacts/SolverTrampoline.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"inputs":[{"internalType":"contract ISettlement","name":"_settlement","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"authenticator","outputs":[{"internalType":"contract IAuthenticator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"solution","type":"bytes"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"settle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settlement","outputs":[{"internalType":"contract ISettlement","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"solution","type":"bytes"}],"name":"solutionMessage","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]} From 1280f95e1c8cf9084324bd833368bab65b3d586a Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 22 Oct 2025 18:15:25 +0300 Subject: [PATCH 034/117] CoW AMM indexer DB storage (#3684) # Description Currently, on each service restart, CoW AMM indexing starts from the AMM Factory SC's deployment block, since all the indexed events are stored in in-memory cache. This has become problematic on some chains that actively use AMMs, since on each restart, the service has to re-index all the events. As a result, this consumes a lot of RPC resources, and the overall protocol performance drops drastically. On Base, for example, it might take 2-3h. # Changes This PR introduces a persistence layer for the CoW AMM indexing, which effectively stores all the indexed AMMs and the last indexed block, so on the next restart, it can continue from the last indexed block. - [ ] When the registry is initialized, fetch CoW AMMs from the DB to populate the cache. Since we have an indexer per factory, the factory address is stored in the db. - [ ] The `last_indexed_blocks` will now contain information per CoW AMM factory, which is required for initialization of each indexer. If no data is found, use the configured deployment block. - [ ] When another CoW AMM is indexed, it is stored in both in-memory cache and the db. - [ ] On revert, all the CoW AMMs with the affected blocks are removed. ## How to test Existing tests. Updated postgres tests. Staging. --- Cargo.lock | 6 + crates/autopilot/src/run.rs | 7 +- crates/cow-amm/Cargo.toml | 6 + crates/cow-amm/src/amm.rs | 22 +++ crates/cow-amm/src/cache.rs | 159 ++++++++++++++--- crates/cow-amm/src/lib.rs | 13 ++ crates/cow-amm/src/registry.rs | 8 +- crates/database/src/cow_amms.rs | 182 ++++++++++++++++++++ crates/database/src/lib.rs | 2 + database/README.md | 16 ++ database/sql/V093__create_cow_amm_table.sql | 11 ++ 11 files changed, 409 insertions(+), 23 deletions(-) create mode 100644 crates/database/src/cow_amms.rs create mode 100644 database/sql/V093__create_cow_amm_table.sql diff --git a/Cargo.lock b/Cargo.lock index bd8b7ebfb2..ed408a20a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2174,11 +2174,17 @@ dependencies = [ "async-trait", "const-hex", "contracts", + "database", "ethcontract", "ethrpc", + "futures", "hex-literal", "model", + "observe", + "prometheus", + "prometheus-metric-storage", "shared", + "sqlx", "tokio", "tracing", ] diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index ac6fca8e91..c403193393 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -482,7 +482,12 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { let mut cow_amm_registry = cow_amm::Registry::new(archive_node_web3); for config in &args.cow_amm_configs { cow_amm_registry - .add_listener(config.index_start, config.factory, config.helper) + .add_listener( + config.index_start, + config.factory, + config.helper, + db_write.pool.clone(), + ) .await; } diff --git a/crates/cow-amm/Cargo.toml b/crates/cow-amm/Cargo.toml index 787a4a80b3..0e6779e42a 100644 --- a/crates/cow-amm/Cargo.toml +++ b/crates/cow-amm/Cargo.toml @@ -8,10 +8,16 @@ anyhow = { workspace = true } app-data = { workspace = true } async-trait = { workspace = true } contracts = { workspace = true } +database = { workspace = true } ethcontract = { workspace = true } ethrpc = { workspace = true } +futures = { workspace = true } model = { workspace = true } +observe = { workspace = true } +prometheus = { workspace = true } +prometheus-metric-storage = { workspace = true } shared = { workspace = true } +sqlx = { workspace = true } tokio = { workspace = true, features = [] } tracing = { workspace = true } const-hex = { workspace = true } diff --git a/crates/cow-amm/src/amm.rs b/crates/cow-amm/src/amm.rs index ead5f1dfa0..fb88519754 100644 --- a/crates/cow-amm/src/amm.rs +++ b/crates/cow-amm/src/amm.rs @@ -2,6 +2,7 @@ use { anyhow::{Context, Result}, app_data::AppDataHash, contracts::CowAmmLegacyHelper, + database::byte_array::ByteArray, ethcontract::{Address, Bytes, U256, errors::MethodError}, model::{ DomainSeparator, @@ -77,6 +78,27 @@ impl Amm { Ok(template) } + pub fn try_to_db_type( + &self, + block_number: u64, + helper: Address, + tx_hash: ethcontract::H256, + ) -> Result { + Ok(database::cow_amms::CowAmm { + address: ByteArray(self.address.0), + factory_address: ByteArray(helper.0), + tradeable_tokens: self + .tradeable_tokens + .iter() + .cloned() + .map(|addr| ByteArray(addr.0)) + .collect(), + block_number: i64::try_from(block_number) + .with_context(|| format!("block number {block_number} is not i64"))?, + tx_hash: ByteArray(tx_hash.0), + }) + } + /// Converts a successful response of the CowAmmHelper into domain types. /// Can be used for any contract that correctly implements the CoW AMM /// helper interface. diff --git a/crates/cow-amm/src/cache.rs b/crates/cow-amm/src/cache.rs index 44b4fe6b59..f73fd22fec 100644 --- a/crates/cow-amm/src/cache.rs +++ b/crates/cow-amm/src/cache.rs @@ -1,10 +1,13 @@ use { - crate::Amm, + crate::{Amm, Metrics}, + anyhow::Context, contracts::{CowAmmLegacyHelper, cow_amm_legacy_helper::Event as CowAmmEvent}, + database::byte_array::ByteArray, ethcontract::{Address, errors::ExecutionError}, ethrpc::block_stream::RangeInclusive, shared::event_handling::EventStoring, - std::{collections::BTreeMap, sync::Arc}, + sqlx::PgPool, + std::{collections::HashMap, sync::Arc}, tokio::sync::RwLock, }; @@ -12,13 +15,77 @@ use { pub(crate) struct Storage(Arc); impl Storage { - pub(crate) fn new(deployment_block: u64, helper: CowAmmLegacyHelper) -> Self { - Self(Arc::new(Inner { + pub(crate) async fn new( + deployment_block: u64, + helper: CowAmmLegacyHelper, + factory_address: Address, + db: PgPool, + ) -> Self { + let self_ = Self(Arc::new(Inner { cache: Default::default(), + factory_address, // make sure to start 1 block **before** the deployment to get all the events start_of_index: deployment_block - 1, helper, - })) + db, + })); + + if let Err(err) = self_.initialize_from_database().await { + tracing::error!( + ?err, + ?factory_address, + "failed to initialize AMM cache from database" + ); + } + + self_ + } + + async fn initialize_from_database(&self) -> anyhow::Result<()> { + let mut ex = self.0.db.acquire().await?; + let factory_address = ByteArray(self.0.factory_address.0); + let db_amms = { + let _timer = Metrics::get() + .database_queries + .with_label_values(&["cow_amm_fetch_by_helper"]) + .start_timer(); + + database::cow_amms::fetch_by_factory_address(&mut ex, &factory_address).await? + }; + + if db_amms.is_empty() { + return Ok(()); + } + + let amm_process_tasks = db_amms.into_iter().map(|db_amm| async move { + let amm_address = ethcontract::Address::from_slice(&db_amm.address.0); + let amm = Amm::new(amm_address, &self.0.helper).await?; + let block_number = u64::try_from(db_amm.block_number).context(format!( + "db stored cow amm {:?} block number is not u64", + db_amm.address + ))?; + + Ok::<(u64, Arc), anyhow::Error>((block_number, Arc::new(amm))) + }); + let processed_amms = futures::future::try_join_all(amm_process_tasks).await?; + + let count = processed_amms.len(); + let db_amms = processed_amms + .iter() + .map(|(_, amm)| *amm.address()) + .collect::>(); + let mut cache = self.0.cache.write().await; + for (block_number, amm) in processed_amms { + cache.entry(block_number).or_default().push(amm); + } + tracing::info!( + count, + ?factory_address, + ?db_amms, + "initialized AMMs from database" + ); + + Ok(()) } pub(crate) async fn cow_amms(&self) -> Vec> { @@ -41,12 +108,16 @@ struct Inner { /// Store indexed data associated to the indexed events type id. /// That type erasure allows us to index multiple concrete contracts /// in a single Registry to make for a nicer user facing API. - cache: RwLock>>>, + cache: RwLock>>>, /// The earliest block where indexing the contract makes sense. /// The contract did not emit any events before this block. start_of_index: u64, + /// Address of the factory contract that deployed the AMMs. + factory_address: Address, /// Helper contract to query required data from the cow amm. helper: CowAmmLegacyHelper, + /// Database connection to persist CoW AMMs and the last indexed block. + db: PgPool, } #[async_trait::async_trait] @@ -56,17 +127,27 @@ impl EventStoring> for Storage { events: Vec>, range: RangeInclusive, ) -> anyhow::Result<()> { - // Context to drop the write lock before calling `append_events()` { - let cache = &mut *self.0.cache.write().await; + let mut ex = self.0.db.acquire().await?; + let start_block = i64::try_from(*range.start()).context("start block is not i64")?; + let end_block = i64::try_from(*range.end()).context("end block is not i64")?; + let factory_address = ByteArray(self.0.factory_address.0); + database::cow_amms::delete_by_block_range( + &mut ex, + &factory_address, + start_block, + end_block, + ) + .await?; + } - // Remove the Cow AMM events in the given range + { + let cache = &mut *self.0.cache.write().await; for key in *range.start()..=*range.end() { cache.remove(&key); } } - // Apply all the new events self.append_events(events).await } @@ -86,7 +167,9 @@ impl EventStoring> for Storage { let CowAmmEvent::CowammpoolCreated(cow_amm) = event.data; let cow_amm = cow_amm.amm; match Amm::new(cow_amm, &self.0.helper).await { - Ok(amm) => processed_events.push((meta.block_number, Arc::new(amm))), + Ok(amm) => { + processed_events.push((meta.block_number, meta.transaction_hash, Arc::new(amm))) + } Err(err) if matches!(&err.inner, ExecutionError::Web3(_)) => { // Abort completely to later try the entire block range again. // That keeps the cache in a consistent state and avoids indexing @@ -100,8 +183,38 @@ impl EventStoring> for Storage { } }; } + + if !processed_events.is_empty() { + let db_amms = processed_events + .iter() + .filter_map(|(block_number, tx_hash, amm)| { + amm.as_ref() + .try_to_db_type(*block_number, self.0.helper.address(), *tx_hash) + .inspect_err(|err| { + tracing::warn!( + ?err, + ?amm, + ?block_number, + ?tx_hash, + helper = ?self.0.helper.address(), + "failed to convert amm to db domain" + ); + }) + .ok() + }) + .collect::>(); + let _timer = Metrics::get() + .database_queries + .with_label_values(&["cow_amms_upsert_batched"]) + .start_timer(); + + let mut ex = self.0.db.begin().await?; + database::cow_amms::upsert_batched(&mut ex, &db_amms).await?; + } + + // Update cache let cache = &mut *self.0.cache.write().await; - for (block, amm) in processed_events { + for (block, _tx_hash, amm) in processed_events { tracing::info!(cow_amm = ?amm.address(), "indexed new cow amm"); cache.entry(block).or_default().push(amm); } @@ -110,17 +223,21 @@ impl EventStoring> for Storage { } async fn last_event_block(&self) -> anyhow::Result { - let cache = self.0.cache.read().await; - - let last_block = cache - .last_key_value() - .map(|(block, _amms)| *block) - .unwrap_or(self.0.start_of_index); - Ok(last_block) + let mut ex = self.0.db.acquire().await?; + database::last_indexed_blocks::fetch(&mut ex, &self.0.factory_address.to_string()) + .await? + .map(|block| block.try_into().context("last block is not u64")) + .unwrap_or(Ok(self.0.start_of_index)) } - async fn persist_last_indexed_block(&mut self, _new_value: u64) -> anyhow::Result<()> { - // storage is only in-memory so we don't need to persist anything here + async fn persist_last_indexed_block(&mut self, latest_block: u64) -> anyhow::Result<()> { + let mut ex = self.0.db.acquire().await?; + database::last_indexed_blocks::update( + &mut ex, + &self.0.factory_address.to_string(), + i64::try_from(latest_block).context("latest block is not u64")?, + ) + .await?; Ok(()) } } diff --git a/crates/cow-amm/src/lib.rs b/crates/cow-amm/src/lib.rs index 36d9d084ef..048bc0016e 100644 --- a/crates/cow-amm/src/lib.rs +++ b/crates/cow-amm/src/lib.rs @@ -5,3 +5,16 @@ mod maintainers; mod registry; pub use {amm::Amm, contracts::CowAmmLegacyHelper as Helper, registry::Registry}; + +#[derive(prometheus_metric_storage::MetricStorage)] +pub(crate) struct Metrics { + /// How log db queries take. + #[metric(name = "cow_amm_database_queries", labels("type"))] + database_queries: prometheus::HistogramVec, +} + +impl Metrics { + fn get() -> &'static Self { + Metrics::instance(observe::metrics::get_storage_registry()).unwrap() + } +} diff --git a/crates/cow-amm/src/registry.rs b/crates/cow-amm/src/registry.rs index 6b4efc9bef..712dbb6744 100644 --- a/crates/cow-amm/src/registry.rs +++ b/crates/cow-amm/src/registry.rs @@ -7,6 +7,7 @@ use { event_handling::EventHandler, maintenance::{Maintaining, ServiceMaintenance}, }, + sqlx::PgPool, std::sync::Arc, tokio::sync::{Mutex, RwLock}, tracing::instrument, @@ -39,11 +40,16 @@ impl Registry { deployment_block: u64, factory: Address, helper_contract: Address, + db: PgPool, ) { let storage = Storage::new( deployment_block, CowAmmLegacyHelper::at(&self.web3, helper_contract), - ); + factory, + db, + ) + .await; + self.storage.write().await.push(storage.clone()); let indexer = Factory { diff --git a/crates/database/src/cow_amms.rs b/crates/database/src/cow_amms.rs new file mode 100644 index 0000000000..22abb0f10a --- /dev/null +++ b/crates/database/src/cow_amms.rs @@ -0,0 +1,182 @@ +use { + crate::{Address, PgTransaction, TransactionHash}, + sqlx::{Executor, PgConnection, QueryBuilder}, + tracing::instrument, +}; + +/// Represents a CoW AMM stored in the database +#[derive(Debug, Clone, PartialEq, sqlx::FromRow)] +pub struct CowAmm { + pub address: Address, + pub factory_address: Address, + pub tradeable_tokens: Vec
, + pub block_number: i64, + pub tx_hash: TransactionHash, +} + +/// Insert or update multiple CoW AMMs in the database using batch insert +#[instrument(skip_all)] +pub async fn upsert_batched( + ex: &mut PgTransaction<'_>, + cow_amms: &[CowAmm], +) -> Result<(), sqlx::Error> { + if cow_amms.is_empty() { + return Ok(()); + } + + const BATCH_SIZE: usize = 200; + + for chunk in cow_amms.chunks(BATCH_SIZE) { + upsert(ex, chunk).await?; + } + + Ok(()) +} + +/// Insert or update a batch of CoW AMMs in the database +#[instrument(skip_all)] +async fn upsert(ex: &mut PgConnection, cow_amms: &[CowAmm]) -> Result<(), sqlx::Error> { + const QUERY: &str = + "INSERT INTO cow_amms (address, factory_address, tradeable_tokens, block_number, tx_hash) "; + const CONFLICT_CLAUSE: &str = r#" +ON CONFLICT (address) +DO UPDATE SET + factory_address = EXCLUDED.factory_address, + tradeable_tokens = EXCLUDED.tradeable_tokens, + block_number = EXCLUDED.block_number, + tx_hash = EXCLUDED.tx_hash + "#; + + let mut query_builder = QueryBuilder::new(QUERY); + + query_builder.push_values(cow_amms, |mut builder, cow_amm| { + builder + .push_bind(cow_amm.address) + .push_bind(cow_amm.factory_address) + .push_bind(cow_amm.tradeable_tokens.clone()) + .push_bind(cow_amm.block_number) + .push_bind(cow_amm.tx_hash); + }); + query_builder.push(CONFLICT_CLAUSE); + query_builder.build().execute(ex).await?; + + Ok(()) +} + +/// Fetch all CoW AMMs for a specific helper contract +#[instrument(skip_all)] +pub async fn fetch_by_factory_address( + ex: &mut PgConnection, + address: &Address, +) -> Result, sqlx::Error> { + const QUERY: &str = "SELECT * FROM cow_amms WHERE factory_address = $1"; + + let cow_amms = sqlx::query_as(QUERY).bind(address).fetch_all(ex).await?; + + Ok(cow_amms) +} + +/// Delete CoW AMMs within a block range for a specific factory address. +#[instrument(skip_all)] +pub async fn delete_by_block_range( + ex: &mut PgConnection, + factory_address: &Address, + start_block: i64, + end_block: i64, +) -> Result<(), sqlx::Error> { + const QUERY: &str = r#" +DELETE FROM cow_amms +WHERE factory_address = $1 + AND block_number BETWEEN $2 AND $3; + "#; + + ex.execute( + sqlx::query(QUERY) + .bind(factory_address) + .bind(start_block) + .bind(end_block), + ) + .await?; + Ok(()) +} + +#[cfg(test)] +mod tests { + use {super::*, crate::byte_array::ByteArray, sqlx::Connection}; + + #[tokio::test] + #[ignore] + async fn postgres_cow_amm_roundtrip() { + let mut db = PgConnection::connect("postgresql://").await.unwrap(); + let mut db = db.begin().await.unwrap(); + crate::clear_DANGER_(&mut db).await.unwrap(); + + let address = ByteArray([1u8; 20]); + let tx_hash = ByteArray([0xabu8; 32]); + let cow_amm = CowAmm { + address, + factory_address: address, + block_number: 1, + tradeable_tokens: vec![ByteArray([1u8; 20]), ByteArray([2u8; 20])], + tx_hash, + }; + + // Test upsert + upsert(&mut db, std::slice::from_ref(&cow_amm)) + .await + .unwrap(); + + // Test fetch by helper address + let fetched = fetch_by_factory_address(&mut db, &address).await.unwrap(); + assert_eq!(fetched.len(), 1); + assert_eq!(fetched[0], cow_amm); + + // Test batch upsert + let tx_hash2 = ByteArray([0xcdu8; 32]); + let cow_amm2 = CowAmm { + address: ByteArray([43u8; 20]), + factory_address: address, + block_number: 2, + tradeable_tokens: vec![ByteArray([3u8; 20])], + tx_hash: tx_hash2, + }; + upsert_batched(&mut db, std::slice::from_ref(&cow_amm2)) + .await + .unwrap(); + + let fetched = fetch_by_factory_address(&mut db, &address).await.unwrap(); + assert_eq!(fetched.len(), 2); + + // Test delete by block range for a specific factory + delete_by_block_range(&mut db, &address, 1, 1) + .await + .unwrap(); + let fetched = fetch_by_factory_address(&mut db, &address).await.unwrap(); + assert_eq!(fetched.len(), 1); + assert_eq!(fetched[0], cow_amm2); + + // Test that delete only affects the specified factory + let another_factory = ByteArray([2u8; 20]); + let tx_hash3 = ByteArray([0xefu8; 32]); + let cow_amm3 = CowAmm { + address: ByteArray([5u8; 20]), + factory_address: another_factory, + block_number: 1, + tradeable_tokens: vec![ByteArray([4u8; 20])], + tx_hash: tx_hash3, + }; + upsert(&mut db, std::slice::from_ref(&cow_amm3)) + .await + .unwrap(); + + // Delete block 1 for the first factory - should not affect the second factory + delete_by_block_range(&mut db, &address, 1, 1) + .await + .unwrap(); + let fetched = fetch_by_factory_address(&mut db, &another_factory) + .await + .unwrap(); + assert_eq!(fetched.len(), 1); + assert_eq!(fetched[0], cow_amm3); + } +} diff --git a/crates/database/src/lib.rs b/crates/database/src/lib.rs index a84314abd6..8f7f263511 100644 --- a/crates/database/src/lib.rs +++ b/crates/database/src/lib.rs @@ -2,6 +2,7 @@ pub mod app_data; pub mod auction; pub mod auction_prices; pub mod byte_array; +pub mod cow_amms; pub mod ethflow_orders; pub mod events; pub mod fee_policies; @@ -52,6 +53,7 @@ pub type PgTransaction<'a> = sqlx::Transaction<'a, sqlx::Postgres>; pub const TABLES: &[&str] = &[ "app_data", "auctions", + "cow_amms", "ethflow_orders", "ethflow_refunds", "interactions", diff --git a/database/README.md b/database/README.md index 445f5306dd..d62b9bda99 100644 --- a/database/README.md +++ b/database/README.md @@ -516,6 +516,22 @@ Indexes: - jit\_user\_order\_creation\_timestamp: btree(`owner`, `creation_timestamp` DESC) - jit\_event\_id: btree(`block_number`, `log_index`) +### cow\_amms + +Stores information about indexed CoW AMMs that have been discovered through blockchain events. Each row represents a CoW AMM pool with its associated factory contract and tradeable tokens. + + Column | Type | Nullable | Details +--------------------|----------|----------|-------- + address | bytea | not null | Address of the CoW AMM pool contract + factory\_address | bytea | not null | Address of the factory contract associated with this AMM + tradeable\_tokens | bytea[] | not null | Token addresses that can be traded through this AMM + block\_number | bigint | not null | Block number in which the AMM was deployed/finalized + tx\_hash | bytea | not null | Transaction hash in which the AMM was deployed/finalized + +Indexes: +- PRIMARY KEY: btree (`address`) +- cow\_amms\_factory\_block: btree (`factory_address`, `block_number`) + ### Enums #### executiontime diff --git a/database/sql/V093__create_cow_amm_table.sql b/database/sql/V093__create_cow_amm_table.sql new file mode 100644 index 0000000000..780516a863 --- /dev/null +++ b/database/sql/V093__create_cow_amm_table.sql @@ -0,0 +1,11 @@ +-- Create table to store information about indexed CoW AMMs +CREATE TABLE cow_amms ( + address BYTEA NOT NULL PRIMARY KEY, + factory_address BYTEA NOT NULL, + tradeable_tokens BYTEA[] NOT NULL, + block_number BIGINT NOT NULL, + tx_hash BYTEA NOT NULL +); + +-- Index for efficient reorg handling (delete by factory and block range) +CREATE INDEX cow_amms_factory_block ON cow_amms (factory_address, block_number); From f1c6bece698553e378300b5d1e6a07ce7a0a9678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 16:35:19 +0100 Subject: [PATCH 035/117] upgrade strum, remove unused ethabi, update sqlformat (#3802) --- Cargo.lock | 52 +++++++++---------------------- Cargo.toml | 4 +-- crates/orderbook/Cargo.toml | 2 +- crates/orderbook/src/orderbook.rs | 2 +- 4 files changed, 17 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed408a20a2..61efc1f3b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ checksum = "5674914c2cfdb866c21cb0c09d82374ee39a1395cf512e7515f4c014083b3fff" dependencies = [ "alloy-primitives", "num_enum", - "strum 0.27.1", + "strum", ] [[package]] @@ -1135,7 +1135,7 @@ dependencies = [ "serde_with", "shared", "sqlx", - "strum 0.26.2", + "strum", "thiserror 1.0.61", "tokio", "tracing", @@ -2445,7 +2445,7 @@ dependencies = [ "maplit", "serde_json", "sqlx", - "strum 0.26.2", + "strum", "tokio", "tracing", ] @@ -4258,7 +4258,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "strum 0.26.2", + "strum", "testlib", "web3", ] @@ -4716,7 +4716,7 @@ dependencies = [ "serde_with", "shared", "sqlx", - "strum_macros 0.26.4", + "strum", "thiserror 1.0.61", "tokio", "tracing", @@ -6107,7 +6107,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "strum 0.26.2", + "strum", "testlib", "thiserror 1.0.61", "tokio", @@ -6213,7 +6213,7 @@ dependencies = [ "prometheus-metric-storage", "serde_json", "shared", - "strum 0.26.2", + "strum", "testlib", "tokio", "tracing", @@ -6305,11 +6305,10 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ - "itertools 0.12.1", "nom", "unicode_categories", ] @@ -6542,45 +6541,22 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" -dependencies = [ - "strum_macros 0.26.4", -] - -[[package]] -name = "strum" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" dependencies = [ - "strum_macros 0.27.1", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.4" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "rustversion", - "syn 2.0.104", -] - -[[package]] -name = "strum_macros" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "rustversion", "syn 2.0.104", ] diff --git a/Cargo.toml b/Cargo.toml index b56f4340d9..484a7e4f19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.117" serde_with = "3.8.1" sqlx = { version = "0.7", default-features = false, features = ["runtime-tokio", "tls-native-tls", "bigdecimal", "chrono", "postgres", "macros"] } -strum = { version = "0.26.2", features = ["derive"] } +strum = { version = "0.27.2", features = ["derive"] } tempfile = "3.10.1" thiserror = "1.0.61" toml = "0.8.14" @@ -69,7 +69,6 @@ contracts = { path = "crates/contracts" } cow-amm = { path = "crates/cow-amm" } database = { path = "crates/database" } driver = { path = "crates/driver" } -ethabi = "18.0" ethrpc = { path = "crates/ethrpc" } model = { path = "crates/model" } moka = "0.12.10" @@ -92,7 +91,6 @@ shared = { path = "crates/shared" } solver = { path = "crates/solver" } solvers = { path = "crates/solvers" } solvers-dto = { path = "crates/solvers-dto" } -strum_macros = "0.26.4" testlib = { path = "crates/testlib" } time = "0.3.37" tiny-keccak = "2.0.2" diff --git a/crates/orderbook/Cargo.toml b/crates/orderbook/Cargo.toml index 70c62cfa1b..81724c7419 100644 --- a/crates/orderbook/Cargo.toml +++ b/crates/orderbook/Cargo.toml @@ -49,7 +49,7 @@ serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } shared = { workspace = true } -strum_macros = { workspace = true } +strum = { workspace = true } sqlx = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "sync", "time"] } diff --git a/crates/orderbook/src/orderbook.rs b/crates/orderbook/src/orderbook.rs index 86bec4bd6d..4bcfdee76e 100644 --- a/crates/orderbook/src/orderbook.rs +++ b/crates/orderbook/src/orderbook.rs @@ -40,7 +40,7 @@ use { }, }, std::{borrow::Cow, sync::Arc}, - strum_macros::Display, + strum::Display, thiserror::Error, tracing::instrument, }; From fd23234de45cf60fffccdcef10db2b815ca3493c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 16:54:12 +0100 Subject: [PATCH 036/117] Migrate UniswapV3QuoterV2 to alloy (#3801) --- Cargo.lock | 1 + crates/contracts/build.rs | 13 ------- crates/contracts/src/alloy.rs | 15 +++++++ crates/contracts/src/lib.rs | 1 - crates/solvers/Cargo.toml | 1 + crates/solvers/src/boundary/baseline.rs | 8 ++-- .../src/boundary/liquidity/concentrated.rs | 39 ++++++++++++------- crates/solvers/src/domain/solver.rs | 5 ++- 8 files changed, 49 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61efc1f3b7..ea853db5fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6224,6 +6224,7 @@ dependencies = [ name = "solvers" version = "0.1.0" dependencies = [ + "alloy", "anyhow", "axum", "bigdecimal", diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 302fb5fc57..de41b0479d 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -229,19 +229,6 @@ fn main() { .add_network_str(LENS, "0x6ddD32cd941041D8b61df213B9f515A7D288Dc13") // Not available on Gnosis Chain }); - generate_contract_with_config("UniswapV3QuoterV2", |builder| { - // - builder - .add_network_str(MAINNET, "0x61fFE014bA17989E743c5F6cB21bF9697530B21e") - .add_network_str(ARBITRUM_ONE, "0x61fFE014bA17989E743c5F6cB21bF9697530B21e") - .add_network_str(BASE, "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a") - .add_network_str(AVALANCHE, "0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F") - .add_network_str(BNB, "0x78D78E420Da98ad378D7799bE8f4AF69033EB077") - .add_network_str(OPTIMISM, "0x61fFE014bA17989E743c5F6cB21bF9697530B21e") - .add_network_str(POLYGON, "0x61fFE014bA17989E743c5F6cB21bF9697530B21e") - .add_network_str(LENS, "0x1eEA2B790Dc527c5a4cd3d4f3ae8A2DDB65B2af1") - // Not listed on Gnosis and Sepolia chains - }); generate_contract_with_config("WETH9", |builder| { // Note: the WETH address must be consistent with the one used by the ETH-flow // contract diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 81cfa43fb4..9a91794475 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -464,6 +464,21 @@ crate::bindings!( crate::bindings!(IUniswapLikeRouter); crate::bindings!(IUniswapLikePair); crate::bindings!(UniswapV3Pool); +crate::bindings!( + UniswapV3QuoterV2, + crate::deployments! { + // + MAINNET => address!("0x61fFE014bA17989E743c5F6cB21bF9697530B21e"), + ARBITRUM_ONE => address!("0x61fFE014bA17989E743c5F6cB21bF9697530B21e"), + BASE => address!("0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a"), + AVALANCHE => address!("0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F"), + BNB => address!("0x78D78E420Da98ad378D7799bE8f4AF69033EB077"), + OPTIMISM => address!("0x61fFE014bA17989E743c5F6cB21bF9697530B21e"), + POLYGON => address!("0x61fFE014bA17989E743c5F6cB21bF9697530B21e"), + LENS => address!("0x1eEA2B790Dc527c5a4cd3d4f3ae8A2DDB65B2af1"), + // Not listed on Gnosis and Sepolia chains + } +); crate::bindings!( HooksTrampoline, diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index b29800cfd3..fdb19a78cf 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -59,7 +59,6 @@ include_contracts! { GPv2Settlement; IUniswapV3Factory; Permit2; - UniswapV3QuoterV2; UniswapV3SwapRouterV2; WETH9; } diff --git a/crates/solvers/Cargo.toml b/crates/solvers/Cargo.toml index 08239501a5..c50da7e3a4 100644 --- a/crates/solvers/Cargo.toml +++ b/crates/solvers/Cargo.toml @@ -13,6 +13,7 @@ name = "solvers" path = "src/main.rs" [dependencies] +alloy = { workspace = true } axum = { workspace = true } bigdecimal = { workspace = true, features = ["serde"] } chain = { workspace = true } diff --git a/crates/solvers/src/boundary/baseline.rs b/crates/solvers/src/boundary/baseline.rs index 71d6eb0bf9..ce14a95525 100644 --- a/crates/solvers/src/boundary/baseline.rs +++ b/crates/solvers/src/boundary/baseline.rs @@ -5,6 +5,7 @@ use { boundary, domain::{eth, liquidity, order, solver}, }, + contracts::alloy::UniswapV3QuoterV2, ethereum_types::{H160, U256}, model::TokenPair, shared::baseline_solver::{self, BaseTokens, BaselineSolvable}, @@ -25,7 +26,7 @@ impl<'a> Solver<'a> { weth: ð::WethAddress, base_tokens: &HashSet, liquidity: &'a [liquidity::Liquidity], - uni_v3_quoter_v2: Option>, + uni_v3_quoter_v2: Option>, ) -> Self { Self { base_tokens: to_boundary_base_tokens(weth, base_tokens), @@ -157,7 +158,7 @@ impl<'a> Solver<'a> { fn to_boundary_liquidity( liquidity: &[liquidity::Liquidity], - uni_v3_quoter_v2: Option>, + uni_v3_quoter_v2: Option>, ) -> HashMap> { liquidity .iter() @@ -234,6 +235,7 @@ fn to_boundary_liquidity( // liquidity sources that rely on concentrated pools are disabled return onchain_liquidity; }; + let fee = pool.fee.0.try_into().expect("fee < (2^24)"); let token_pair = to_boundary_token_pair(&pool.tokens); onchain_liquidity @@ -247,7 +249,7 @@ fn to_boundary_liquidity( uni_v3_quoter_contract: uni_v3_quoter_v2_arc.clone(), address: liquidity.address, tokens: token_pair, - fee: pool.fee.0, + fee, }, ), }) diff --git a/crates/solvers/src/boundary/liquidity/concentrated.rs b/crates/solvers/src/boundary/liquidity/concentrated.rs index 67c667e99c..34c6640bc8 100644 --- a/crates/solvers/src/boundary/liquidity/concentrated.rs +++ b/crates/solvers/src/boundary/liquidity/concentrated.rs @@ -1,5 +1,10 @@ use { - contracts::ethcontract::{H160, U256}, + alloy::primitives::aliases::U24, + contracts::{ + alloy::UniswapV3QuoterV2::IQuoterV2::QuoteExactInputSingleParams, + ethcontract::{H160, U256}, + }, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::TokenPair, shared::baseline_solver::BaselineSolvable, std::sync::Arc, @@ -7,10 +12,10 @@ use { #[derive(Debug)] pub struct Pool { - pub uni_v3_quoter_contract: Arc, + pub uni_v3_quoter_contract: Arc, pub address: H160, pub tokens: TokenPair, - pub fee: u32, + pub fee: U24, } impl Pool { @@ -32,14 +37,16 @@ impl BaselineSolvable for Pool { } self.uni_v3_quoter_contract - .quote_exact_input_single((in_token, out_token, in_amount, self.fee, 0.into())) + .quoteExactInputSingle(QuoteExactInputSingleParams { + tokenIn: in_token.into_alloy(), + tokenOut: out_token.into_alloy(), + amountIn: in_amount.into_alloy(), + fee: self.fee, + sqrtPriceLimitX96: alloy::primitives::U160::ZERO, + }) .call() .await - .map( - |(amount_out, _sqrt_price_x96_after, _initialized_ticks_crossed, _gas_estimate)| { - amount_out - }, - ) + .map(|result| result.amountOut.into_legacy()) .ok() } @@ -54,14 +61,16 @@ impl BaselineSolvable for Pool { } self.uni_v3_quoter_contract - .quote_exact_output_single((in_token, out_token, out_amount, self.fee, 0.into())) + .quoteExactInputSingle(QuoteExactInputSingleParams { + tokenIn: in_token.into_alloy(), + tokenOut: out_token.into_alloy(), + amountIn: out_amount.into_alloy(), + fee: self.fee, + sqrtPriceLimitX96: alloy::primitives::U160::ZERO, + }) .call() .await - .map( - |(amount_in, _sqrt_price_x96_after, _initialized_ticks_crossed, _gas_estimate)| { - amount_in - }, - ) + .map(|result| result.amountOut.into_legacy()) .ok() } diff --git a/crates/solvers/src/domain/solver.rs b/crates/solvers/src/domain/solver.rs index c34082dbe8..e777a1bca3 100644 --- a/crates/solvers/src/domain/solver.rs +++ b/crates/solvers/src/domain/solver.rs @@ -18,6 +18,7 @@ use { }, infra::metrics, }, + contracts::alloy::InstanceExt, ethereum_types::U256, reqwest::Url, std::{cmp, collections::HashSet, sync::Arc}, @@ -71,7 +72,7 @@ struct Inner { native_token_price_estimation_amount: eth::U256, /// If provided, the solver can rely on Uniswap V3 LPs - uni_v3_quoter_v2: Option>, + uni_v3_quoter_v2: Option>, } impl Solver { @@ -80,7 +81,7 @@ impl Solver { let uni_v3_quoter_v2 = match config.uni_v3_node_url { Some(url) => { let web3 = ethrpc::web3(Default::default(), Default::default(), &url, "baseline"); - contracts::UniswapV3QuoterV2::deployed(&web3) + contracts::alloy::UniswapV3QuoterV2::Instance::deployed(&web3.alloy) .await .map(Arc::new) .inspect_err(|err| { From 858da7531f2e0a1cdb902d031e537a9ab77c618d Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 22 Oct 2025 19:15:01 +0300 Subject: [PATCH 037/117] Fix CoW AMM factory address string representation (#3806) # Description By default, `H160::to_string()` returns something like `0x334ab..dfr`, we have to use a custom formatter. --- crates/cow-amm/src/cache.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cow-amm/src/cache.rs b/crates/cow-amm/src/cache.rs index f73fd22fec..27687a6809 100644 --- a/crates/cow-amm/src/cache.rs +++ b/crates/cow-amm/src/cache.rs @@ -224,7 +224,7 @@ impl EventStoring> for Storage { async fn last_event_block(&self) -> anyhow::Result { let mut ex = self.0.db.acquire().await?; - database::last_indexed_blocks::fetch(&mut ex, &self.0.factory_address.to_string()) + database::last_indexed_blocks::fetch(&mut ex, &format!("{:#x}", self.0.factory_address)) .await? .map(|block| block.try_into().context("last block is not u64")) .unwrap_or(Ok(self.0.start_of_index)) @@ -234,7 +234,7 @@ impl EventStoring> for Storage { let mut ex = self.0.db.acquire().await?; database::last_indexed_blocks::update( &mut ex, - &self.0.factory_address.to_string(), + &format!("{:#x}", self.0.factory_address), i64::try_from(latest_block).context("latest block is not u64")?, ) .await?; From eeafce51f2a8ed9d85b0b960d7e64c42ab1590be Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 22 Oct 2025 19:26:59 +0300 Subject: [PATCH 038/117] Add missing cow amm tx commit (#3807) The `cow_amms` table has never been updated due to the missing tx commit. --- crates/cow-amm/src/cache.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/cow-amm/src/cache.rs b/crates/cow-amm/src/cache.rs index 27687a6809..4942590a2e 100644 --- a/crates/cow-amm/src/cache.rs +++ b/crates/cow-amm/src/cache.rs @@ -210,6 +210,7 @@ impl EventStoring> for Storage { let mut ex = self.0.db.begin().await?; database::cow_amms::upsert_batched(&mut ex, &db_amms).await?; + ex.commit().await?; } // Update cache From c64309416da55eb110bb5d083c9889f18d85e7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 22 Oct 2025 18:02:34 +0100 Subject: [PATCH 039/117] Migrate UniswapV3SwapRouterV2 to alloy (#3803) # Description Migrate UniswapV3SwapRouterV2 to alloy # Changes - [ ] Removes old bindings - [ ] Adds new bindings - [ ] Refactors where applicable ## How to test existing tests --------- Co-authored-by: ilya --- crates/contracts/build.rs | 13 ----- crates/contracts/src/alloy.rs | 15 ++++++ crates/contracts/src/lib.rs | 2 - .../src/boundary/liquidity/uniswap/v3.rs | 14 +++--- crates/driver/src/infra/liquidity/config.rs | 9 ++-- crates/solver/src/interactions/mod.rs | 2 +- crates/solver/src/interactions/uniswap_v3.rs | 44 +++++++---------- crates/solver/src/liquidity/uniswap_v3.rs | 49 ++++++++++++------- 8 files changed, 77 insertions(+), 71 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index de41b0479d..223e04f60b 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -216,19 +216,6 @@ fn main() { }, ) }); - generate_contract_with_config("UniswapV3SwapRouterV2", |builder| { - // - builder - .add_network_str(MAINNET, "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45") - .add_network_str(ARBITRUM_ONE, "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45") - .add_network_str(POLYGON, "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45") - .add_network_str(OPTIMISM, "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45") - .add_network_str(BASE, "0x2626664c2603336E57B271c5C0b26F421741e481") - .add_network_str(AVALANCHE, "0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE") - .add_network_str(BNB, "0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2") - .add_network_str(LENS, "0x6ddD32cd941041D8b61df213B9f515A7D288Dc13") - // Not available on Gnosis Chain - }); generate_contract_with_config("WETH9", |builder| { // Note: the WETH address must be consistent with the one used by the ETH-flow // contract diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 9a91794475..f636b94d4a 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -479,6 +479,21 @@ crate::bindings!( // Not listed on Gnosis and Sepolia chains } ); +crate::bindings!( + UniswapV3SwapRouterV2, + crate::deployments! { + // + ARBITRUM_ONE => address!("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"), + MAINNET => address!("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"), + POLYGON => address!("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"), + OPTIMISM => address!("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"), + BASE => address!("0x2626664c2603336E57B271c5C0b26F421741e481"), + AVALANCHE => address!("0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE"), + BNB => address!("0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"), + LENS => address!("0x6ddD32cd941041D8b61df213B9f515A7D288Dc13"), + // Not available on Gnosis Chain + } +); crate::bindings!( HooksTrampoline, diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index fdb19a78cf..df11a36777 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -59,7 +59,6 @@ include_contracts! { GPv2Settlement; IUniswapV3Factory; Permit2; - UniswapV3SwapRouterV2; WETH9; } @@ -149,7 +148,6 @@ mod tests { BNB, LENS, ] { - assert_has_deployment_address!(UniswapV3SwapRouterV2 for *network); assert_has_deployment_address!(IUniswapV3Factory for *network); } for network in &[MAINNET, ARBITRUM_ONE] { diff --git a/crates/driver/src/boundary/liquidity/uniswap/v3.rs b/crates/driver/src/boundary/liquidity/uniswap/v3.rs index e2ddb20b3b..d8064c14ca 100644 --- a/crates/driver/src/boundary/liquidity/uniswap/v3.rs +++ b/crates/driver/src/boundary/liquidity/uniswap/v3.rs @@ -11,8 +11,11 @@ use { infra::{self, blockchain::Ethereum}, }, anyhow::Context, - contracts::{GPv2Settlement, UniswapV3SwapRouterV2}, - ethrpc::block_stream::BlockRetrieving, + contracts::GPv2Settlement, + ethrpc::{ + alloy::conversions::{IntoAlloy, IntoLegacy}, + block_stream::BlockRetrieving, + }, shared::{ http_solver::model::TokenAmount, interaction::Interaction, @@ -49,7 +52,7 @@ pub fn to_domain(id: liquidity::Id, pool: ConcentratedLiquidity) -> Result anyhow::Result> { let web3 = eth.web3().clone(); - let router = UniswapV3SwapRouterV2::at(&web3, config.router.0); let pool_fetcher = Arc::new( UniswapV3PoolFetcher::new( @@ -149,7 +151,7 @@ async fn init_liquidity( tokio::task::spawn(update_task); Ok(UniswapV3Liquidity::new( - router, + config.router.0.into_alloy(), eth.contracts().settlement().clone(), web3, pool_fetcher, diff --git a/crates/driver/src/infra/liquidity/config.rs b/crates/driver/src/infra/liquidity/config.rs index 732de41bc3..756ed2df68 100644 --- a/crates/driver/src/infra/liquidity/config.rs +++ b/crates/driver/src/infra/liquidity/config.rs @@ -1,8 +1,5 @@ use { - crate::{ - domain::eth::{self, ContractAddress}, - infra::blockchain::contracts::deployment_address, - }, + crate::domain::eth::{self, ContractAddress}, alloy::primitives::Address, chain::Chain, contracts::alloy::BalancerV2Vault, @@ -195,7 +192,9 @@ impl UniswapV3 { max_pools_per_tick_query: usize, ) -> Option { Some(Self { - router: deployment_address(contracts::UniswapV3SwapRouterV2::raw_contract(), chain)?, + router: contracts::alloy::UniswapV3SwapRouterV2::deployment_address(&chain.id())? + .into_legacy() + .into(), max_pools_to_initialize: 100, graph_url: graph_url.clone(), reinit_interval: None, diff --git a/crates/solver/src/interactions/mod.rs b/crates/solver/src/interactions/mod.rs index 9d7c887ccd..288f9932ed 100644 --- a/crates/solver/src/interactions/mod.rs +++ b/crates/solver/src/interactions/mod.rs @@ -10,7 +10,7 @@ pub use { balancer_v2::BalancerSwapGivenOutInteraction, erc20::Erc20ApproveInteraction, uniswap_v2::UniswapInteraction, - uniswap_v3::{ExactOutputSingleParams, UniswapV3Interaction}, + uniswap_v3::UniswapV3Interaction, weth::UnwrapWethInteraction, zeroex::ZeroExInteraction, }; diff --git a/crates/solver/src/interactions/uniswap_v3.rs b/crates/solver/src/interactions/uniswap_v3.rs index bda27d5f26..b97ac2b9a1 100644 --- a/crates/solver/src/interactions/uniswap_v3.rs +++ b/crates/solver/src/interactions/uniswap_v3.rs @@ -1,39 +1,31 @@ use { - contracts::UniswapV3SwapRouterV2, - ethcontract::Bytes, - primitive_types::{H160, U256}, - shared::{ - http_solver::model::TokenAmount, - interaction::{EncodedInteraction, Interaction}, + alloy::{primitives::Address, sol_types::SolCall}, + contracts::alloy::UniswapV3SwapRouterV2::{ + IV3SwapRouter::ExactOutputSingleParams, + UniswapV3SwapRouterV2::exactOutputSingleCall, }, + ethcontract::Bytes, + ethrpc::alloy::conversions::IntoLegacy, + shared::interaction::{EncodedInteraction, Interaction}, }; #[derive(Debug)] pub struct UniswapV3Interaction { - pub router: UniswapV3SwapRouterV2, + pub router: Address, pub params: ExactOutputSingleParams, } -#[derive(Debug)] -pub struct ExactOutputSingleParams { - pub token_amount_in_max: TokenAmount, - pub token_amount_out: TokenAmount, - pub fee: u32, - pub recipient: H160, - pub sqrt_price_limit_x96: U256, -} impl Interaction for UniswapV3Interaction { fn encode(&self) -> EncodedInteraction { - let method = self.router.exact_output_single(( - self.params.token_amount_in_max.token, - self.params.token_amount_out.token, - self.params.fee, - self.params.recipient, - self.params.token_amount_out.amount, - self.params.token_amount_in_max.amount, - self.params.sqrt_price_limit_x96, - )); - let calldata = method.tx.data.expect("no calldata").0; - (self.router.address(), 0.into(), Bytes(calldata)) + ( + self.router.into_legacy(), + 0.into(), + Bytes( + exactOutputSingleCall { + params: self.params.clone(), + } + .abi_encode(), + ), + ) } } diff --git a/crates/solver/src/liquidity/uniswap_v3.rs b/crates/solver/src/liquidity/uniswap_v3.rs index 2513c0df92..f1d66aa82c 100644 --- a/crates/solver/src/liquidity/uniswap_v3.rs +++ b/crates/solver/src/liquidity/uniswap_v3.rs @@ -2,7 +2,6 @@ use { super::{AmmOrderExecution, ConcentratedLiquidity, SettlementHandling}, crate::{ interactions::{ - ExactOutputSingleParams, UniswapV3Interaction, allowances::{AllowanceManager, AllowanceManaging, Allowances, Approval}, }, @@ -10,11 +9,16 @@ use { liquidity_collector::LiquidityCollecting, settlement::SettlementEncoder, }, + alloy::primitives::Address, anyhow::{Context, Result, ensure}, - contracts::{GPv2Settlement, UniswapV3SwapRouterV2}, + contracts::{ + GPv2Settlement, + alloy::UniswapV3SwapRouterV2::IV3SwapRouter::ExactOutputSingleParams, + }, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::TokenPair, num::{CheckedMul, rational::Ratio}, - primitive_types::{H160, U256}, + primitive_types::H160, shared::{ ethrpc::Web3, http_solver::model::TokenAmount, @@ -34,7 +38,7 @@ pub struct UniswapV3Liquidity { settlement_allowances: Box, } pub struct Inner { - pub router: UniswapV3SwapRouterV2, + pub router: Address, gpv2_settlement: GPv2Settlement, // Mapping of how much allowance the router has per token to spend on behalf of the settlement // contract @@ -48,7 +52,7 @@ pub struct UniswapV3SettlementHandler { impl UniswapV3SettlementHandler { pub fn new( - router: UniswapV3SwapRouterV2, + router: Address, gpv2_settlement: GPv2Settlement, allowances: Mutex, fee: Ratio, @@ -79,19 +83,18 @@ fn ratio_to_u32(ratio: Ratio) -> Result { impl UniswapV3Liquidity { pub fn new( - router: UniswapV3SwapRouterV2, + router: Address, gpv2_settlement: GPv2Settlement, web3: Web3, pool_fetcher: Arc, ) -> Self { - let router_address = router.address(); let settlement_allowances = Box::new(AllowanceManager::new(web3, gpv2_settlement.address())); Self { inner: Arc::new(Inner { router, gpv2_settlement, - allowances: Mutex::new(Allowances::empty(router_address)), + allowances: Mutex::new(Allowances::empty(router.into_legacy())), }), pool_fetcher, settlement_allowances, @@ -99,10 +102,10 @@ impl UniswapV3Liquidity { } async fn cache_allowances(&self, tokens: HashSet) -> Result<()> { - let router = self.inner.router.address(); + let router = self.inner.router; let allowances = self .settlement_allowances - .get_allowances(tokens, router) + .get_allowances(tokens, router.into_legacy()) .await?; self.inner @@ -165,16 +168,20 @@ impl UniswapV3SettlementHandler { .expect("Thread holding mutex panicked") .approve_token_or_default(token_amount_in_max.clone()); + let fee = self.fee.try_into().expect("fee < (1 << 24)"); + ( approval, UniswapV3Interaction { - router: self.inner.router.clone(), + router: self.inner.router, params: ExactOutputSingleParams { - token_amount_in_max, - token_amount_out, - fee: self.fee, - recipient: self.inner.gpv2_settlement.address(), - sqrt_price_limit_x96: U256::zero(), + tokenIn: token_amount_in_max.token.into_alloy(), + tokenOut: token_amount_out.token.into_alloy(), + fee, + recipient: self.inner.gpv2_settlement.address().into_alloy(), + amountOut: token_amount_out.amount.into_alloy(), + amountInMaximum: token_amount_in_max.amount.into_alloy(), + sqrtPriceLimitX96: alloy::primitives::U160::ZERO, }, }, ) @@ -203,13 +210,19 @@ impl SettlementHandling for UniswapV3SettlementHandler { #[cfg(test)] mod tests { - use {super::*, contracts::dummy_contract, num::rational::Ratio, std::collections::HashMap}; + use { + super::*, + contracts::dummy_contract, + ethcontract::U256, + num::rational::Ratio, + std::collections::HashMap, + }; impl UniswapV3SettlementHandler { fn new_dummy(allowances: HashMap, fee: u32) -> Self { Self { inner: Arc::new(Inner { - router: dummy_contract!(UniswapV3SwapRouterV2, H160::zero()), + router: Default::default(), gpv2_settlement: dummy_contract!(GPv2Settlement, H160::zero()), allowances: Mutex::new(Allowances::new(H160::zero(), allowances)), }), From 7abfda18c96c4c61c32806b3bc9dc0ddd253fb1e Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Wed, 22 Oct 2025 19:17:19 +0200 Subject: [PATCH 040/117] Migrate `Permit2` to alloy (#3804) # Description Migrates `Permit2` to use `alloy`. # Changes - formatted the ABI file and added some missing whitespace that cause the `sol!` macro to fail - moved `Permit2` into ## How to test Used in solvers repo --- crates/contracts/artifacts/Permit2.json | 667 +++++++++++++++++++++++- crates/contracts/build.rs | 78 --- crates/contracts/src/alloy.rs | 25 + crates/contracts/src/lib.rs | 1 - crates/ethrpc/src/alloy/conversions.rs | 10 + 5 files changed, 701 insertions(+), 80 deletions(-) diff --git a/crates/contracts/artifacts/Permit2.json b/crates/contracts/artifacts/Permit2.json index aba0dd0b07..00537570e6 100644 --- a/crates/contracts/artifacts/Permit2.json +++ b/crates/contracts/artifacts/Permit2.json @@ -1 +1,666 @@ -{"abi":[{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"AllowanceExpired","type":"error"},{"inputs":[],"name":"ExcessiveInvalidation","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxAmount","type":"uint256"}],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidContractSignature","type":"error"},{"inputs":[],"name":"InvalidNonce","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSignatureLength","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[{"internalType":"uint256","name":"signatureDeadline","type":"uint256"}],"name":"SignatureExpired","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint160","name":"amount","type":"uint160"},{"indexed":false,"internalType":"uint48","name":"expiration","type":"uint48"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"spender","type":"address"}],"name":"Lockdown","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint48","name":"newNonce","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"oldNonce","type":"uint48"}],"name":"NonceInvalidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint160","name":"amount","type":"uint160"},{"indexed":false,"internalType":"uint48","name":"expiration","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"nonce","type":"uint48"}],"name":"Permit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"word","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mask","type":"uint256"}],"name":"UnorderedNonceInvalidation","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"uint48","name":"expiration","type":"uint48"},{"internalType":"uint48","name":"nonce","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"uint48","name":"expiration","type":"uint48"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint48","name":"newNonce","type":"uint48"}],"name":"invalidateNonces","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"wordPos","type":"uint256"},{"internalType":"uint256","name":"mask","type":"uint256"}],"name":"invalidateUnorderedNonces","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"internalType":"structIAllowanceTransfer.TokenSpenderPair[]","name":"approvals","type":"tuple[]"}],"name":"lockdown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"nonceBitmap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"uint48","name":"expiration","type":"uint48"},{"internalType":"uint48","name":"nonce","type":"uint48"}],"internalType":"structIAllowanceTransfer.PermitDetails","name":"details","type":"tuple"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"sigDeadline","type":"uint256"}],"internalType":"structIAllowanceTransfer.PermitSingle","name":"permitSingle","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"structISignatureTransfer.TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"structISignatureTransfer.PermitTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"internalType":"structISignatureTransfer.SignatureTransferDetails","name":"transferDetails","type":"tuple"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permitTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"structISignatureTransfer.TokenPermissions[]","name":"permitted","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"structISignatureTransfer.PermitBatchTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"internalType":"structISignatureTransfer.SignatureTransferDetails[]","name":"transferDetails","type":"tuple[]"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"witness","type":"bytes32"},{"internalType":"string","name":"witnessTypeString","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permitWitnessTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint160","name":"amount","type":"uint160"},{"internalType":"address","name":"token","type":"address"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x","deployedBytecode":"0x","devdoc":{"methods":{}},"userdoc":{"methods":{}}} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "AllowanceExpired", + "type": "error" + }, + { + "inputs": [], + "name": "ExcessiveInvalidation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxAmount", + "type": "uint256" + } + ], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidContractSignature", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSignature", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSignatureLength", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSigner", + "type": "error" + }, + { + "inputs": [], + "name": "LengthMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "signatureDeadline", + "type": "uint256" + } + ], + "name": "SignatureExpired", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "expiration", + "type": "uint48" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "Lockdown", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "newNonce", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "oldNonce", + "type": "uint48" + } + ], + "name": "NonceInvalidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "expiration", + "type": "uint48" + }, + { + "indexed": false, + "internalType": "uint48", + "name": "nonce", + "type": "uint48" + } + ], + "name": "Permit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "word", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mask", + "type": "uint256" + } + ], + "name": "UnorderedNonceInvalidation", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "internalType": "uint48", + "name": "expiration", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "nonce", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "internalType": "uint48", + "name": "expiration", + "type": "uint48" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint48", + "name": "newNonce", + "type": "uint48" + } + ], + "name": "invalidateNonces", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "wordPos", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mask", + "type": "uint256" + } + ], + "name": "invalidateUnorderedNonces", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "internalType": "struct IAllowanceTransfer.TokenSpenderPair[]", + "name": "approvals", + "type": "tuple[]" + } + ], + "name": "lockdown", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "nonceBitmap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "internalType": "uint48", + "name": "expiration", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "nonce", + "type": "uint48" + } + ], + "internalType": "struct IAllowanceTransfer.PermitDetails", + "name": "details", + "type": "tuple" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sigDeadline", + "type": "uint256" + } + ], + "internalType": "struct IAllowanceTransfer.PermitSingle", + "name": "permitSingle", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISignatureTransfer.TokenPermissions", + "name": "permitted", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "internalType": "struct ISignatureTransfer.PermitTransferFrom", + "name": "permit", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "requestedAmount", + "type": "uint256" + } + ], + "internalType": "struct ISignatureTransfer.SignatureTransferDetails", + "name": "transferDetails", + "type": "tuple" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "permitTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct ISignatureTransfer.TokenPermissions[]", + "name": "permitted", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "internalType": "struct ISignatureTransfer.PermitBatchTransferFrom", + "name": "permit", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "requestedAmount", + "type": "uint256" + } + ], + "internalType": "struct ISignatureTransfer.SignatureTransferDetails[]", + "name": "transferDetails", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "witness", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "witnessTypeString", + "type": "string" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "permitWitnessTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint160", + "name": "amount", + "type": "uint160" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 223e04f60b..1428004283 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -306,84 +306,6 @@ fn main() { ) }); generate_contract("CowAmmUniswapV2PriceOracle"); - - // Contract for Uniswap's Permit2 contract. - generate_contract_with_config("Permit2", |builder| { - builder - .add_network( - MAINNET, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(15986406)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(27338672)), - }, - ) - .add_network( - SEPOLIA, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(2356287)), - }, - ) - .add_network( - ARBITRUM_ONE, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(38692735)), - }, - ) - .add_network( - BASE, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(1425180)), - }, - ) - .add_network( - AVALANCHE, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(28844415)), - }, - ) - .add_network( - BNB, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(25343783)), - }, - ) - .add_network( - OPTIMISM, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(38854427)), - }, - ) - .add_network( - POLYGON, - Network { - address: addr("0x000000000022D473030F116dDEE9F6B43aC78BA3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(35701901)), - }, - ) - // Not available on Lens - }); } fn generate_contract(name: &str) { diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index f636b94d4a..ca550cabdd 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -586,6 +586,31 @@ crate::bindings!( } ); +// Only used in +crate::bindings!( + Permit2, + crate::deployments! { + // + MAINNET => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 15986406), + // + GNOSIS => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 27338672), + // + SEPOLIA => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 2356287), + // + ARBITRUM_ONE => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 38692735), + // + BASE => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 1425180), + // + AVALANCHE => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 28844415), + // + BNB => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 25343783), + // + OPTIMISM => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 38854427), + // + POLYGON => (address!("0x000000000022D473030F116dDEE9F6B43aC78BA3"), 35701901), + } +); + pub mod cow_amm { crate::bindings!(CowAmmFactoryGetter); } diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index df11a36777..9372aae0b7 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -58,7 +58,6 @@ include_contracts! { GPv2AllowListAuthentication; GPv2Settlement; IUniswapV3Factory; - Permit2; WETH9; } diff --git a/crates/ethrpc/src/alloy/conversions.rs b/crates/ethrpc/src/alloy/conversions.rs index feb2396d0b..ff6d7ebc31 100644 --- a/crates/ethrpc/src/alloy/conversions.rs +++ b/crates/ethrpc/src/alloy/conversions.rs @@ -16,6 +16,16 @@ pub trait IntoAlloy { fn into_alloy(self) -> Self::To; } +impl IntoAlloy for ethcontract::I256 { + type To = alloy::primitives::I256; + + fn into_alloy(self) -> Self::To { + let mut buf = [0u8; 32]; + self.to_little_endian(&mut buf); + alloy::primitives::I256::from_le_bytes(buf) + } +} + impl IntoAlloy for primitive_types::U256 { type To = alloy::primitives::U256; From 7f9fd76435b3ce460d31348f7ec93a8dcb427b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Thu, 23 Oct 2025 10:51:55 +0100 Subject: [PATCH 041/117] Migrate IUniswapV3Factory to alloy (#3805) --- crates/autopilot/src/run.rs | 12 +++---- crates/contracts/build.rs | 16 --------- crates/contracts/src/alloy.rs | 17 ++++++++++ crates/contracts/src/lib.rs | 17 +--------- crates/orderbook/src/run.rs | 11 +++--- .../bad_token/token_owner_finder/liquidity.rs | 34 +++++++++++++------ .../src/bad_token/token_owner_finder/mod.rs | 8 +++-- crates/shared/src/bad_token/trace_call.rs | 13 +++---- 8 files changed, 64 insertions(+), 64 deletions(-) diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index c403193393..b591fc4bf8 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -26,8 +26,8 @@ use { }, chain::Chain, clap::Parser, - contracts::{IUniswapV3Factory, alloy::BalancerV2Vault}, - ethcontract::{BlockNumber, H160, common::DeploymentInformation, errors::DeployError}, + contracts::alloy::{BalancerV2Vault, IUniswapV3Factory, InstanceExt}, + ethcontract::{BlockNumber, H160, common::DeploymentInformation}, ethrpc::{ Web3, alloy::conversions::IntoLegacy, @@ -247,13 +247,11 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { let vault = vault_address.map(|address| BalancerV2Vault::Instance::new(address, web3.alloy.clone())); - let uniswapv3_factory = match IUniswapV3Factory::deployed(&web3) + let uniswapv3_factory = IUniswapV3Factory::Instance::deployed(&web3.alloy) .instrument(info_span!("uniswapv3_deployed")) .await - { - Err(DeployError::NotFound(_)) => None, - other => Some(other.unwrap()), - }; + .inspect_err(|err| tracing::warn!(%err, "error while fetching IUniswapV3Factory instance")) + .ok(); let chain = Chain::try_from(chain_id).expect("incorrect chain ID"); diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 1428004283..7573f5e54c 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -232,22 +232,6 @@ fn main() { .add_network_str(POLYGON, "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270") .add_network_str(LENS, "0x6bDc36E20D267Ff0dd6097799f82e78907105e2F") }); - generate_contract_with_config("IUniswapV3Factory", |builder| { - // - builder - .add_network_str(MAINNET, "0x1F98431c8aD98523631AE4a59f267346ea31F984") - .add_network_str(GOERLI, "0x1F98431c8aD98523631AE4a59f267346ea31F984") - .add_network_str(SEPOLIA, "0x1F98431c8aD98523631AE4a59f267346ea31F984") - .add_network_str(ARBITRUM_ONE, "0x1F98431c8aD98523631AE4a59f267346ea31F984") - .add_network_str(BASE, "0x33128a8fC17869897dcE68Ed026d694621f6FDfD") - .add_network_str(AVALANCHE, "0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD") - .add_network_str(BNB, "0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7") - .add_network_str(OPTIMISM, "0x1F98431c8aD98523631AE4a59f267346ea31F984") - .add_network_str(POLYGON, "0x1F98431c8aD98523631AE4a59f267346ea31F984") - // not official - .add_network_str(LENS, "0xc3A5b857Ba82a2586A45a8B59ECc3AA50Bc3D0e3") - // Not available on Gnosis Chain - }); generate_contract_with_config("CowProtocolToken", |builder| { builder .add_network_str(MAINNET, "0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB") diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index ca550cabdd..0857678dcd 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -494,6 +494,23 @@ crate::bindings!( // Not available on Gnosis Chain } ); +crate::bindings!( + IUniswapV3Factory, + crate::deployments! { + // + MAINNET => address!( "0x1F98431c8aD98523631AE4a59f267346ea31F984"), + SEPOLIA => address!( "0x1F98431c8aD98523631AE4a59f267346ea31F984"), + ARBITRUM_ONE => address!( "0x1F98431c8aD98523631AE4a59f267346ea31F984"), + BASE => address!( "0x33128a8fC17869897dcE68Ed026d694621f6FDfD"), + AVALANCHE => address!( "0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD"), + BNB => address!( "0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7"), + OPTIMISM => address!( "0x1F98431c8aD98523631AE4a59f267346ea31F984"), + POLYGON => address!( "0x1F98431c8aD98523631AE4a59f267346ea31F984"), + // not official + LENS => address!( "0xc3A5b857Ba82a2586A45a8B59ECc3AA50Bc3D0e3"), + // Not available on Gnosis Chain + } +); crate::bindings!( HooksTrampoline, diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 9372aae0b7..7cdc98b57e 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -57,15 +57,12 @@ include_contracts! { ERC20; GPv2AllowListAuthentication; GPv2Settlement; - IUniswapV3Factory; WETH9; } #[cfg(test)] mod tests { - use crate::alloy::networks::{ - ARBITRUM_ONE, AVALANCHE, BASE, BNB, GNOSIS, LENS, MAINNET, OPTIMISM, POLYGON, SEPOLIA, - }; + use crate::alloy::networks::{ARBITRUM_ONE, GNOSIS, MAINNET, SEPOLIA}; use { super::*, ethcontract::{ @@ -137,18 +134,6 @@ mod tests { for network in &[MAINNET, GNOSIS, SEPOLIA] { assert_has_deployment_address!(CowProtocolToken for *network); } - for network in &[ - MAINNET, - ARBITRUM_ONE, - POLYGON, - OPTIMISM, - BASE, - AVALANCHE, - BNB, - LENS, - ] { - assert_has_deployment_address!(IUniswapV3Factory for *network); - } for network in &[MAINNET, ARBITRUM_ONE] { assert!( alloy::BalancerV2WeightedPool2TokensFactory::deployment_address(network).is_some() diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 4c0b5d5d61..4d5818d055 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -14,17 +14,16 @@ use { clap::Parser, contracts::{ GPv2Settlement, - IUniswapV3Factory, WETH9, alloy::{ BalancerV2Vault, ChainalysisOracle, HooksTrampoline, + IUniswapV3Factory, InstanceExt, support::Balances, }, }, - ethcontract::errors::DeployError, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, futures::{FutureExt, StreamExt}, model::{DomainSeparator, order::BUY_ETH_ADDRESS}, @@ -237,10 +236,10 @@ pub async fn run(args: Arguments) { allowed_tokens.push(BUY_ETH_ADDRESS); let unsupported_tokens = args.unsupported_tokens.clone(); - let uniswapv3_factory = match IUniswapV3Factory::deployed(&web3).await { - Err(DeployError::NotFound(_)) => None, - other => Some(other.unwrap()), - }; + let uniswapv3_factory = IUniswapV3Factory::Instance::deployed(&web3.alloy) + .await + .inspect_err(|err| tracing::warn!(%err, "error while fetching IUniswapV3Factory instance")) + .ok(); let finder = token_owner_finder::init( &args.token_owner_finder, diff --git a/crates/shared/src/bad_token/token_owner_finder/liquidity.rs b/crates/shared/src/bad_token/token_owner_finder/liquidity.rs index f9869b3001..85ba7220f8 100644 --- a/crates/shared/src/bad_token/token_owner_finder/liquidity.rs +++ b/crates/shared/src/bad_token/token_owner_finder/liquidity.rs @@ -3,9 +3,10 @@ use { super::TokenOwnerProposing, crate::sources::{uniswap_v2::pair_provider::PairProvider, uniswap_v3_pair_provider}, + alloy::eips::BlockNumberOrTag, anyhow::Result, - contracts::{IUniswapV3Factory, alloy::BalancerV2Vault}, - ethcontract::{BlockNumber, H160}, + contracts::alloy::{BalancerV2Vault, IUniswapV3Factory}, + ethcontract::H160, ethrpc::alloy::conversions::IntoLegacy, model::TokenPair, }; @@ -38,7 +39,7 @@ impl TokenOwnerProposing for BalancerVaultFinder { } pub struct UniswapV3Finder { - pub factory: IUniswapV3Factory, + pub factory: IUniswapV3Factory::Instance, pub base_tokens: Vec, fee_values: Vec, } @@ -55,7 +56,7 @@ pub enum FeeValues { impl UniswapV3Finder { pub async fn new( - factory: IUniswapV3Factory, + factory: IUniswapV3Factory::Instance, base_tokens: Vec, fee_values: FeeValues, ) -> Result { @@ -75,18 +76,25 @@ impl UniswapV3Finder { // Possible fee values as given by // https://github.com/Uniswap/v3-core/blob/9161f9ae4aaa109f7efdff84f1df8d4bc8bfd042/contracts/UniswapV3Factory.sol#L26 - async fn fee_values(factory: &IUniswapV3Factory) -> Result> { + async fn fee_values(factory: &IUniswapV3Factory::Instance) -> Result> { // We expect there to be few of these kind of events (currently there are 4) so // fetching all of them is fine. Alternatively we could index these // events in the database. let events = factory - .events() - .fee_amount_enabled() - .from_block(BlockNumber::Earliest) - .to_block(BlockNumber::Latest) + .FeeAmountEnabled_filter() + .from_block(BlockNumberOrTag::Earliest) + .to_block(BlockNumberOrTag::Latest) .query() .await?; - let fee_values = events.into_iter().map(|event| event.data.fee).collect(); + let fee_values = events + .into_iter() + .map(|(enabled, _)| { + enabled + .fee + .try_into() + .expect("uint24 always fits inside u32") + }) + .collect(); Ok(fee_values) } } @@ -100,7 +108,11 @@ impl TokenOwnerProposing for UniswapV3Finder { .filter_map(|base_token| TokenPair::new(*base_token, token)) .flat_map(|pair| self.fee_values.iter().map(move |fee| (pair, *fee))) .map(|(pair, fee)| { - uniswap_v3_pair_provider::pair_address(&self.factory.address(), &pair, fee) + uniswap_v3_pair_provider::pair_address( + &self.factory.address().into_legacy(), + &pair, + fee, + ) }) .collect()) } diff --git a/crates/shared/src/bad_token/token_owner_finder/mod.rs b/crates/shared/src/bad_token/token_owner_finder/mod.rs index 94182b6277..21cc299313 100644 --- a/crates/shared/src/bad_token/token_owner_finder/mod.rs +++ b/crates/shared/src/bad_token/token_owner_finder/mod.rs @@ -31,7 +31,11 @@ use { }, anyhow::{Context, Result}, chain::Chain, - contracts::{ERC20, IUniswapV3Factory, alloy::BalancerV2Vault, errors::EthcontractErrorType}, + contracts::{ + ERC20, + alloy::{BalancerV2Vault, IUniswapV3Factory}, + errors::EthcontractErrorType, + }, ethcontract::U256, futures::{Stream, StreamExt as _}, primitive_types::H160, @@ -283,7 +287,7 @@ pub async fn init( http_factory: &HttpClientFactory, pair_providers: &[PairProvider], vault: Option<&BalancerV2Vault::Instance>, - uniswapv3_factory: Option<&IUniswapV3Factory>, + uniswapv3_factory: Option<&IUniswapV3Factory::Instance>, base_tokens: &BaseTokens, settlement_contract: H160, ) -> Result> { diff --git a/crates/shared/src/bad_token/trace_call.rs b/crates/shared/src/bad_token/trace_call.rs index 548f511cc5..a83308ce5a 100644 --- a/crates/shared/src/bad_token/trace_call.rs +++ b/crates/shared/src/bad_token/trace_call.rs @@ -378,10 +378,7 @@ mod tests { sources::{BaselineSource, uniswap_v2}, }, chain::Chain, - contracts::{ - IUniswapV3Factory, - alloy::{BalancerV2Vault, InstanceExt}, - }, + contracts::alloy::{BalancerV2Vault, IUniswapV3Factory, InstanceExt}, ethrpc::Web3, hex_literal::hex, std::{env, time::Duration}, @@ -741,7 +738,9 @@ mod tests { )), Arc::new( UniswapV3Finder::new( - IUniswapV3Factory::deployed(&web3).await.unwrap(), + IUniswapV3Factory::Instance::deployed(&web3.alloy) + .await + .unwrap(), base_tokens.to_vec(), FeeValues::Static, ) @@ -779,7 +778,9 @@ mod tests { let web3 = Web3::new_from_env(); let base_tokens = vec![testlib::tokens::WETH]; let settlement = contracts::GPv2Settlement::deployed(&web3).await.unwrap(); - let factory = IUniswapV3Factory::deployed(&web3).await.unwrap(); + let factory = IUniswapV3Factory::Instance::deployed(&web3.alloy) + .await + .unwrap(); let univ3 = Arc::new( UniswapV3Finder::new(factory, base_tokens, FeeValues::Dynamic) .await From 64537fadd14b937da6f59a94ee1e0aae8d787d1d Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Fri, 24 Oct 2025 12:02:57 +0200 Subject: [PATCH 042/117] [TRIVIAL] pin postgres version to 16 (#3814) # Description Our `posgres` version is currently not pinned so it's using `latest`. postgres 18 was released which uses a different directory structure which in turn causes the DB to not work correctly. This causes our CI to fail. # Changes Since we use postgres 16 in the prod infra I pinned it to this version instead of 17 (which was the last working version). ## How to test CI should work again --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index cdc9721cd0..a29d1ac6e6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: '3.1' services: db: - image: postgres + image: postgres:16 restart: always environment: POSTGRES_HOST_AUTH_METHOD: trust From 6fea0dd344f5cdc923d24a036273dbc71ca2af76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Fri, 24 Oct 2025 11:23:17 +0100 Subject: [PATCH 043/117] Enable https for alloy in autopilot and driver (#3809) # Description @fafk was getting an error due to lack of https support from alloy ``` Caused by: 0: unable to get logs for blocks range 24823700-24823711 1: batch call failed: Transport(Custom(reqwest::Error { kind: Request, url: "https://linea-mainnet.g.alchemy.com/v2/", source: hyper_util::client::legacy::Error(Connect, ConnectError("invalid URL, scheme is not http")) })) 2: batch call failed: Transport(Custom(reqwest::Error { kind: Request, url: "https://linea-mainnet.g.alchemy.com/v2/", source: hyper_util::client::legacy::Error(Connect, ConnectError("invalid URL, scheme is not http")) })) ``` This is due to us having the default features turned off, upgrading alloy and adding the default tls feature did the trick # Changes - [ ] Update alloy to 1.0.41 - [ ] Add `reqwest-default-tls` to ethrpc ## How to test Tested in mainnet staging --------- Co-authored-by: Martin Magnus --- Cargo.lock | 124 +++++++++++++++++++++++++-------------- Cargo.toml | 2 +- crates/ethrpc/Cargo.toml | 2 +- 3 files changed, 83 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea853db5fc..e16ebed404 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,9 +91,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17c19591d57add4f0c47922877a48aae1f47074e3433436545f8948353b3bbb" +checksum = "ae62e633fa48b4190af5e841eb05179841bb8b713945103291e2c0867037c0d1" dependencies = [ "alloy-consensus", "alloy-contract", @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0dd3ed764953a6b20458b2b7abbfdc93d20d14b38babe1a70fe631a443a9f1" +checksum = "b9b151e38e42f1586a01369ec52a6934702731d07e8509a7307331b09f6c46dc" dependencies = [ "alloy-eips", "alloy-primitives", @@ -152,9 +152,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9556182afa73cddffa91e64a5aa9508d5e8c912b3a15f26998d2388a824d2c7b" +checksum = "6e2d5e8668ef6215efdb7dcca6f22277b4e483a5650e05f5de22b2350971f4b8" dependencies = [ "alloy-consensus", "alloy-eips", @@ -166,9 +166,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19d7092c96defc3d132ee0d8969ca1b79ef512b5eda5c66e3065266b253adf2" +checksum = "630288cf4f3a34a8c6bc75c03dce1dbd47833138f65f37d53a1661eafc96b83f" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -252,9 +252,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fa99b538ca7006b0c03cfed24ec6d82beda67aac857ef4714be24231d15e6" +checksum = "e5434834adaf64fa20a6fb90877bc1d33214c41b055cc49f82189c98614368cc" dependencies = [ "alloy-eip2124", "alloy-eip2930", @@ -286,9 +286,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91676d242c0ced99c0dd6d0096d7337babe9457cc43407d26aa6367fcf90553" +checksum = "d7c69f6c9c68a1287c9d5ff903d0010726934de0dac10989be37b75a29190d55" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -301,9 +301,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f82150116b30ba92f588b87f08fa97a46a1bd5ffc0d0597efdf0843d36bfda" +checksum = "8eaf2ae05219e73e0979cb2cf55612aafbab191d130f203079805eaf881cca58" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -327,9 +327,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "223612259a080160ce839a4e5df0125ca403a1d5e7206cc911cea54af5d769aa" +checksum = "e58f4f345cef483eab7374f2b6056973c7419ffe8ad35e994b7a7f5d8e0c7ba4" dependencies = [ "alloy-consensus", "alloy-eips", @@ -367,9 +367,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7283b81b6f136100b152e699171bc7ed8184a58802accbc91a7df4ebb944445" +checksum = "de2597751539b1cc8fe4204e5325f9a9ed83fcacfb212018dfcfa7877e76de21" dependencies = [ "alloy-chains", "alloy-consensus", @@ -428,9 +428,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1154b12d470bef59951c62676e106f4ce5de73b987d86b9faa935acebb138ded" +checksum = "edf8eb8be597cfa8c312934d2566ec4516f066d69164f9212d7a148979fdcfd8" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -451,9 +451,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ab76bf97648a1c6ad8fb00f0d594618942b5a9e008afbfb5c8a8fca800d574" +checksum = "339af7336571dd39ae3a15bde08ae6a647e62f75350bd415832640268af92c06" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -463,9 +463,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cc57ee0c1ac9fb14854195fc249494da7416591dc4a4d981ddfd5dd93b9bce" +checksum = "fbde0801a32d21c5f111f037bee7e22874836fba7add34ed4a6919932dd7cf23" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -474,9 +474,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7d47bca1a2a1541e4404aa38b7e262bb4dffd9ac23b4f178729a4ddc5a5caa" +checksum = "361cd87ead4ba7659bda8127902eda92d17fa7ceb18aba1676f7be10f7222487" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8468f1a7f9ee3bae73c24eead0239abea720dbf7779384b9c7e20d51bfb6b0" +checksum = "64600fc6c312b7e0ba76f73a381059af044f4f21f43e07f51f1fa76c868fe302" dependencies = [ "alloy-primitives", "serde", @@ -506,9 +506,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33387c90b0a5021f45a5a77c2ce6c49b8f6980e66a318181468fb24cea771670" +checksum = "5772858492b26f780468ae693405f895d6a27dea6e3eab2c36b6217de47c2647" dependencies = [ "alloy-primitives", "async-trait", @@ -521,9 +521,9 @@ dependencies = [ [[package]] name = "alloy-signer-aws" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bf90f2355769ad93f790b930434b8d3d2948317f3e484de458010409024462" +checksum = "66acf5f8745dd935e94855aada39d83b555112872321d9293748424de144897e" dependencies = [ "alloy-consensus", "alloy-network", @@ -540,9 +540,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55d9e795c85e36dcea08786d2e7ae9b73cb554b6bea6ac4c212def24e1b4d03" +checksum = "f4195b803d0a992d8dbaab2ca1986fc86533d4bc80967c0cce7668b26ad99ef9" dependencies = [ "alloy-consensus", "alloy-network", @@ -632,9 +632,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702002659778d89a94cd4ff2044f6b505460df6c162e2f47d1857573845b0ace" +checksum = "025a940182bddaeb594c26fe3728525ae262d0806fe6a4befdf5d7bc13d54bce" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -656,9 +656,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6bdc0830e5e8f08a4c70a4c791d400a86679c694a3b4b986caf26fad680438" +checksum = "e3b5064d1e1e1aabc918b5954e7fb8154c39e77ec6903a581b973198b26628fa" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -687,9 +687,9 @@ dependencies = [ [[package]] name = "alloy-tx-macros" -version = "1.0.38" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bf39928a5e70c9755d6811a2928131b53ba785ad37c8bf85c90175b5d43b818" +checksum = "f8e52276fdb553d3c11563afad2898f4085165e4093604afe3d78b69afbf408f" dependencies = [ "alloy-primitives", "darling 0.21.3", @@ -3706,6 +3706,22 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.14" @@ -5422,7 +5438,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.29", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -5431,7 +5447,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -5463,19 +5479,23 @@ dependencies = [ "http-body 1.0.0", "http-body-util", "hyper 1.6.0", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", + "tokio-native-tls", "tower 0.5.2", "tower-service", "url", @@ -5695,7 +5715,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -5709,6 +5729,24 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + [[package]] name = "rustls-webpki" version = "0.101.7" diff --git a/Cargo.toml b/Cargo.toml index 484a7e4f19..9c71dbd5de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/*"] [workspace.dependencies] -alloy = { version = "1.0.38", default-features = false } +alloy = { version = "1.0.41", default-features = false } anyhow = "=1.0.76" async-trait = "0.1.80" axum = "0.6" diff --git a/crates/ethrpc/Cargo.toml b/crates/ethrpc/Cargo.toml index a1159ccff8..0bae002003 100644 --- a/crates/ethrpc/Cargo.toml +++ b/crates/ethrpc/Cargo.toml @@ -11,7 +11,7 @@ name = "ethrpc" path = "src/lib.rs" [dependencies] -alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-aws", "signer-local", "eips"] } +alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-aws", "signer-local", "eips", "reqwest-default-tls"] } anyhow = { workspace = true } async-trait = { workspace = true } ethcontract = { workspace = true } From 9175504f8e0f8141197c783ad9cfb6847ebca2f8 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Fri, 24 Oct 2025 15:03:15 +0200 Subject: [PATCH 044/117] Migrate `CowProtocolToken` to alloy (#3808) # Description Migrates `CowProtocolToken` bindings from `ethcontract` to `alloy`. Additionally this pins the `postgres` version to 16 since the release of postgres 18 causes our CI to fail (due to a different folder structure). Because the prod deployment uses 16 it makes the most sense to use in our testing as well. # Changes - [x] removed old bindings - [x] added alloy bindings - [x] fixed resulting type errors - [x] removed tests asserting that we have an address for all networks ## How to test existing e2e tests --- crates/contracts/build.rs | 10 -- crates/contracts/src/alloy.rs | 11 ++ crates/contracts/src/lib.rs | 4 - .../e2e/src/setup/onchain_components/mod.rs | 106 ++++++++++-------- crates/e2e/tests/e2e/hooks.rs | 51 +++++---- crates/e2e/tests/e2e/smart_contract_orders.rs | 4 +- 6 files changed, 102 insertions(+), 84 deletions(-) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 7573f5e54c..06af3d62fe 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -232,16 +232,6 @@ fn main() { .add_network_str(POLYGON, "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270") .add_network_str(LENS, "0x6bDc36E20D267Ff0dd6097799f82e78907105e2F") }); - generate_contract_with_config("CowProtocolToken", |builder| { - builder - .add_network_str(MAINNET, "0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB") - .add_network_str(GOERLI, "0x91056D4A53E1faa1A84306D4deAEc71085394bC8") - .add_network_str(GNOSIS, "0x177127622c4A00F3d409B75571e12cB3c8973d3c") - .add_network_str(SEPOLIA, "0x0625aFB445C3B6B7B929342a04A22599fd5dBB59") - .add_network_str(ARBITRUM_ONE, "0xcb8b5CD20BdCaea9a010aC1F8d835824F5C87A04") - .add_network_str(BASE, "0xc694a91e6b071bF030A18BD3053A7fE09B6DaE69") - // Not available on Lens - }); generate_contract("CowAmm"); generate_contract_with_config("CowAmmConstantProductFactory", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 0857678dcd..d1c5cd1617 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -678,6 +678,17 @@ pub mod test { crate::bindings!(GasHog); // Test Contract for incrementing arbitrary counters. crate::bindings!(Counter); + // Token with support for `permit` (for pre-interaction tests) + crate::bindings!( + CowProtocolToken, + crate::deployments! { + MAINNET => address!("0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB"), + GNOSIS => address!("0x177127622c4A00F3d409B75571e12cB3c8973d3c"), + SEPOLIA => address!("0x0625aFB445C3B6B7B929342a04A22599fd5dBB59"), + ARBITRUM_ONE => address!("0xcb8b5CD20BdCaea9a010aC1F8d835824F5C87A04"), + BASE => address!("0xc694a91e6b071bF030A18BD3053A7fE09B6DaE69"), + } + ); } pub use alloy::providers::DynProvider as Provider; diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 7cdc98b57e..5130e034de 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -53,7 +53,6 @@ include_contracts! { CowAmmConstantProductFactory; CowAmmLegacyHelper; CowAmmUniswapV2PriceOracle; - CowProtocolToken; ERC20; GPv2AllowListAuthentication; GPv2Settlement; @@ -131,9 +130,6 @@ mod tests { alloy::BalancerV2NoProtocolFeeLiquidityBootstrappingPoolFactory::deployment_address(network).is_some() ) } - for network in &[MAINNET, GNOSIS, SEPOLIA] { - assert_has_deployment_address!(CowProtocolToken for *network); - } for network in &[MAINNET, ARBITRUM_ONE] { assert!( alloy::BalancerV2WeightedPool2TokensFactory::deployment_address(network).is_some() diff --git a/crates/e2e/src/setup/onchain_components/mod.rs b/crates/e2e/src/setup/onchain_components/mod.rs index 00ac91e913..b058c3daec 100644 --- a/crates/e2e/src/setup/onchain_components/mod.rs +++ b/crates/e2e/src/setup/onchain_components/mod.rs @@ -3,13 +3,15 @@ use { nodes::forked_node::ForkedNodeApi, setup::{DeployedContracts, deploy::Contracts}, }, - ::alloy::signers::local::PrivateKeySigner, + ::alloy::{ + network::{Ethereum, NetworkWallet}, + signers::local::PrivateKeySigner, + }, app_data::Hook, - contracts::{CowProtocolToken, alloy::ERC20Mintable}, + contracts::alloy::{ERC20Mintable, test::CowProtocolToken}, core::panic, ethcontract::{ Account, - Bytes, H160, PrivateKey, U256, @@ -206,18 +208,29 @@ impl Deref for MintableToken { #[derive(Debug)] pub struct CowToken { - contract: CowProtocolToken, + contract: CowProtocolToken::Instance, holder: Account, } impl CowToken { pub async fn fund(&self, to: H160, amount: U256) { - tx!(self.holder, self.contract.transfer(to, amount)); + self.contract + .transfer(to.into_alloy(), amount.into_alloy()) + .from(self.holder.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); } pub async fn permit(&self, owner: &TestAccount, spender: H160, value: U256) -> Hook { - let domain = self.contract.domain_separator().call().await.unwrap(); - let nonce = self.contract.nonces(owner.address()).call().await.unwrap(); + let domain = self.contract.DOMAIN_SEPARATOR().call().await.unwrap(); + let nonce = self + .contract + .nonces(owner.address().into_alloy()) + .call() + .await + .unwrap() + .into_legacy(); let deadline = U256::max_value(); let struct_hash = { @@ -237,21 +250,25 @@ impl CowToken { let signature = owner.sign_typed_data(&DomainSeparator(domain.0), &struct_hash); let permit = self.contract.permit( - owner.address(), - spender, - value, - deadline, + owner.address().into_alloy(), + spender.into_alloy(), + value.into_alloy(), + deadline.into_alloy(), signature.v, - Bytes(signature.r.0), - Bytes(signature.s.0), + signature.r.0.into(), + signature.s.0.into(), ); - hook_for_transaction(permit.tx).await + Hook { + target: self.contract.address().into_legacy(), + call_data: permit.calldata().to_vec(), + gas_limit: permit.estimate_gas().await.unwrap(), + } } } impl Deref for CowToken { - type Target = CowProtocolToken; + type Target = CowProtocolToken::Instance; fn deref(&self) -> &Self::Target { &self.contract @@ -604,12 +621,17 @@ impl OnchainComponents { .expect("Uniswap V2 pair couldn't mint"); } - pub async fn deploy_cow_token(&self, holder: Account, supply: U256) -> CowToken { - let contract = - CowProtocolToken::builder(&self.web3, holder.address(), holder.address(), supply) - .deploy() - .await - .expect("CowProtocolToken deployment failed"); + pub async fn deploy_cow_token(&self, supply: U256) -> CowToken { + let holder = NetworkWallet::::default_signer_address(&self.web3().wallet); + let holder = Account::Local(holder.into_legacy(), None); + let contract = CowProtocolToken::CowProtocolToken::deploy( + self.web3.alloy.clone(), + holder.address().into_alloy(), + holder.address().into_alloy(), + supply.into_alloy(), + ) + .await + .expect("CowProtocolToken deployment failed"); CowToken { contract, holder } } @@ -619,37 +641,27 @@ impl OnchainComponents { cow_amount: U256, weth_amount: U256, ) -> CowToken { - let holder = Account::Local( - self.web3 - .eth() - .accounts() - .await - .expect("getting accounts failed")[0], - None, - ); - let cow = self.deploy_cow_token(holder.clone(), cow_supply).await; + let cow = self.deploy_cow_token(cow_supply).await; - tx_value!(holder, weth_amount, self.contracts.weth.deposit()); + tx_value!(cow.holder, weth_amount, self.contracts.weth.deposit()); self.contracts .uniswap_v2_factory - .createPair( - cow.address().into_alloy(), - self.contracts.weth.address().into_alloy(), - ) - .from(holder.address().into_alloy()) + .createPair(*cow.address(), self.contracts.weth.address().into_alloy()) + .from(cow.holder.address().into_alloy()) .send_and_watch() .await .unwrap(); + cow.approve( + *self.contracts.uniswap_v2_router.address(), + cow_amount.into_alloy(), + ) + .from(cow.holder.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); tx!( - holder, - cow.approve( - self.contracts.uniswap_v2_router.address().into_legacy(), - cow_amount - ) - ); - tx!( - holder, + cow.holder, self.contracts.weth.approve( self.contracts.uniswap_v2_router.address().into_legacy(), weth_amount @@ -658,16 +670,16 @@ impl OnchainComponents { self.contracts .uniswap_v2_router .addLiquidity( - cow.address().into_alloy(), + *cow.address(), self.contracts.weth.address().into_alloy(), cow_amount.into_alloy(), weth_amount.into_alloy(), ::alloy::primitives::U256::ZERO, ::alloy::primitives::U256::ZERO, - holder.address().into_alloy(), + cow.holder.address().into_alloy(), ::alloy::primitives::U256::MAX, ) - .from(holder.address().into_alloy()) + .from(cow.holder.address().into_alloy()) .send_and_watch() .await .unwrap(); diff --git a/crates/e2e/tests/e2e/hooks.rs b/crates/e2e/tests/e2e/hooks.rs index bee45ccdfb..d778597f7b 100644 --- a/crates/e2e/tests/e2e/hooks.rs +++ b/crates/e2e/tests/e2e/hooks.rs @@ -76,16 +76,17 @@ async fn gas_limit(web3: Web3) { // Fund trader accounts and approve relayer cow.fund(trader.address(), to_wei(5)).await; - tx!( - trader.account(), - cow.approve(onchain.contracts().allowance, to_wei(5)) - ); + cow.approve(onchain.contracts().allowance.into_alloy(), eth(5)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let services = Services::new(&onchain).await; services.start_protocol(solver).await; let order = OrderCreation { - sell_token: cow.address(), + sell_token: cow.address().into_legacy(), sell_amount: to_wei(4), buy_token: onchain.contracts().weth.address(), buy_amount: to_wei(3), @@ -136,12 +137,16 @@ async fn allowance(web3: Web3) { .await; // Setup a malicious interaction for setting approvals to steal funds from // the settlement contract. - let steal_cow = hook_for_transaction( - cow.approve(trader.address(), U256::max_value()) - .from(solver.account().clone()) - .tx, - ) - .await; + let steal_cow = { + let tx = cow + .approve(trader.address().into_alloy(), alloy::primitives::U256::MAX) + .from(solver.address().into_alloy()); + Hook { + target: cow.address().into_legacy(), + call_data: tx.calldata().to_vec(), + gas_limit: tx.estimate_gas().await.unwrap(), + } + }; let steal_weth = hook_for_transaction( onchain .contracts() @@ -156,7 +161,7 @@ async fn allowance(web3: Web3) { services.start_protocol(solver).await; let order = OrderCreation { - sell_token: cow.address(), + sell_token: cow.address().into_legacy(), sell_amount: to_wei(5), buy_token: onchain.contracts().weth.address(), buy_amount: to_wei(3), @@ -183,12 +188,16 @@ async fn allowance(web3: Web3) { services.create_order(&order).await.unwrap(); onchain.mint_block().await; - let balance = cow.balance_of(trader.address()).call().await.unwrap(); - assert_eq!(balance, to_wei(5)); + let balance = cow + .balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap(); + assert_eq!(balance, eth(5)); tracing::info!("Waiting for trade."); let trade_happened = || async { - cow.balance_of(trader.address()) + cow.balanceOf(trader.address().into_alloy()) .call() .await .unwrap() @@ -213,13 +222,13 @@ async fn allowance(web3: Web3) { // Check malicious custom interactions did not work. let allowance = cow .allowance( - onchain.contracts().gp_settlement.address(), - trader.address(), + onchain.contracts().gp_settlement.address().into_alloy(), + trader.address().into_alloy(), ) .call() .await .unwrap(); - assert_eq!(allowance, U256::zero()); + assert_eq!(allowance, alloy::primitives::U256::ZERO); let allowance = onchain .contracts() .weth @@ -237,13 +246,13 @@ async fn allowance(web3: Web3) { // any funds. let allowance = cow .allowance( - (*onchain.contracts().hooks.address()).into_legacy(), - trader.address(), + *onchain.contracts().hooks.address(), + trader.address().into_alloy(), ) .call() .await .unwrap(); - assert_eq!(allowance, U256::max_value()); + assert_eq!(allowance, alloy::primitives::U256::MAX); let allowance = onchain .contracts() .weth diff --git a/crates/e2e/tests/e2e/smart_contract_orders.rs b/crates/e2e/tests/e2e/smart_contract_orders.rs index f803fd8e7d..5d44a5bad3 100644 --- a/crates/e2e/tests/e2e/smart_contract_orders.rs +++ b/crates/e2e/tests/e2e/smart_contract_orders.rs @@ -168,7 +168,7 @@ async fn erc1271_gas_limit(web3: Web3) { cow.fund(trader.address().into_legacy(), to_wei(5)).await; trader .approve( - cow.address().into_alloy(), + *cow.address(), onchain.contracts().allowance.into_alloy(), eth(10), ) @@ -193,7 +193,7 @@ async fn erc1271_gas_limit(web3: Web3) { U256::exp10(6).to_big_endian(&mut signature); let order = OrderCreation { - sell_token: cow.address(), + sell_token: cow.address().into_legacy(), sell_amount: to_wei(4), buy_token: onchain.contracts().weth.address(), buy_amount: to_wei(3), From e65ccc65ac023bb8b9b8d1f7e2d548d770b62dc7 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Fri, 24 Oct 2025 19:01:02 +0200 Subject: [PATCH 045/117] Make ABI files readable (#3815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description I'm still playing with the idea of reducing the ABI files to the subset of types, functions, and events that we actually use in the code base. That should cut down the compile time of the `contracts` crate quite a lot. There are quite a few ABI files that expose >30 functions of which we only use 2 or 3. Since we still generate code for these 27 unused functions this is just a lot of time wasted. (e.g. take a look at [BalancerV2ComposableStablePool.json](https://github.com/cowprotocol/services/compare/format-abi-files?expand=1#diff-76cc4a1d98b9b1a835fe83e09a890ca42ebf19a1f94d73ede5701ae055e88a48)) So after this PR is merged it would be a lot easier to verify what things we actually remove from the ABI files to speed up the compile time (if we ever do that). But even if we decide not to trim the files having them formatted into multiple lines still helps with readability and also makes it easier for text editors to handle these files. # Changes formatted all files with: ```fish for f in *.json if test -L "$f" echo "Skipping symlink: $f" continue end jq . "$f" > "$f.tmp" && mv "$f.tmp" "$f" end ``` ## How to test look at the files, I guess. 😅 --- Justfile | 12 + .../artifacts/AnyoneAuthenticator.json | 32 +- .../contracts/artifacts/BalancerQueries.json | 312 +- .../artifacts/BalancerV2Authorizer.json | 391 +- .../BalancerV2ComposableStablePool.json | 1412 ++- ...BalancerV2ComposableStablePoolFactory.json | 281 +- .../BalancerV2LiquidityBootstrappingPool.json | 1056 +- ...erV2LiquidityBootstrappingPoolFactory.json | 159 +- .../artifacts/BalancerV2StablePool.json | 1056 +- .../BalancerV2StablePoolFactoryV2.json | 212 +- .../contracts/artifacts/BalancerV2Vault.json | 1183 ++- .../artifacts/BalancerV2WeightedPool.json | 904 +- .../BalancerV2WeightedPool2TokensFactory.json | 129 +- .../BalancerV2WeightedPoolFactory.json | 124 +- .../BalancerV2WeightedPoolFactoryV3.json | 271 +- .../artifacts/BalancerV3BatchRouter.json | 2 +- .../artifacts/ChainalysisOracle.json | 191 +- .../contracts/artifacts/CoWSwapEthFlow.json | 503 +- .../artifacts/CoWSwapOnchainOrders.json | 134 +- crates/contracts/artifacts/CowAmm.json | 1501 ++- .../CowAmmConstantProductFactory.json | 1433 ++- .../artifacts/CowAmmLegacyHelper.json | 1084 +- .../artifacts/CowAmmUniswapV2PriceOracle.json | 176 +- .../contracts/artifacts/CowProtocolToken.json | 529 +- crates/contracts/artifacts/ERC20.json | 291 +- crates/contracts/artifacts/ERC20Mintable.json | 350 +- .../contracts/artifacts/FlashLoanRouter.json | 297 +- .../GPv2AllowListAuthentication.json | 296 +- .../contracts/artifacts/GPv2Settlement.json | 691 +- crates/contracts/artifacts/GasHog.json | 60 +- crates/contracts/artifacts/GnosisSafe.json | 1037 +- ...nosisSafeCompatibilityFallbackHandler.json | 329 +- .../contracts/artifacts/GnosisSafeProxy.json | 21 +- .../artifacts/GnosisSafeProxyFactory.json | 167 +- crates/contracts/artifacts/ISwaprPair.json | 740 +- .../contracts/artifacts/IUniswapLikePair.json | 656 +- .../artifacts/IUniswapLikeRouter.json | 956 +- .../artifacts/IUniswapV3Factory.json | 201 +- crates/contracts/artifacts/IZeroex.json | 9057 ++++++++++++++++- crates/contracts/artifacts/Solver.json | 113 +- crates/contracts/artifacts/Spardose.json | 31 +- crates/contracts/artifacts/Swapper.json | 129 +- crates/contracts/artifacts/Trader.json | 101 +- .../contracts/artifacts/UniswapV2Factory.json | 197 +- .../artifacts/UniswapV2Router02.json | 977 +- crates/contracts/artifacts/UniswapV3Pool.json | 991 +- .../artifacts/UniswapV3QuoterV2.json | 270 +- .../artifacts/UniswapV3SwapRouterV2.json | 61 +- crates/contracts/artifacts/WETH9.json | 289 +- 49 files changed, 31346 insertions(+), 49 deletions(-) diff --git a/Justfile b/Justfile index 46a0a62b69..c5a33ac10c 100644 --- a/Justfile +++ b/Justfile @@ -39,3 +39,15 @@ fmt *extra: # Start database for E2E tests start-db: docker compose up -d + +# Properly formats all ABI files that we generate bindings for to make them human readable +format-abi-files: + #!/bin/sh + cd ./crates/contracts/artifacts + for f in *.json; do + if [ -L "$f" ]; then + echo "Skipping symlink: $f" + continue + fi + jq . "$f" > "$f.tmp" && mv "$f.tmp" "$f" + done diff --git a/crates/contracts/artifacts/AnyoneAuthenticator.json b/crates/contracts/artifacts/AnyoneAuthenticator.json index 6924aeb37a..8d4b391d45 100644 --- a/crates/contracts/artifacts/AnyoneAuthenticator.json +++ b/crates/contracts/artifacts/AnyoneAuthenticator.json @@ -1 +1,31 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSolver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50609a8061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806302cc250d14602d575b600080fd5b603e60383660046052565b50600190565b604051901515815260200160405180910390f35b600060208284031215606357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114608657600080fd5b939250505056fea164736f6c6343000811000a","deployedBytecode":"0x6080604052348015600f57600080fd5b506004361060285760003560e01c806302cc250d14602d575b600080fd5b603e60383660046052565b50600190565b604051901515815260200160405180910390f35b600060208284031215606357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114608657600080fd5b939250505056fea164736f6c6343000811000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isSolver", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50609a8061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806302cc250d14602d575b600080fd5b603e60383660046052565b50600190565b604051901515815260200160405180910390f35b600060208284031215606357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114608657600080fd5b939250505056fea164736f6c6343000811000a", + "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c806302cc250d14602d575b600080fd5b603e60383660046052565b50600190565b604051901515815260200160405180910390f35b600060208284031215606357600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114608657600080fd5b939250505056fea164736f6c6343000811000a", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/artifacts/BalancerQueries.json b/crates/contracts/artifacts/BalancerQueries.json index cabb2f8194..abbc175e1a 100644 --- a/crates/contracts/artifacts/BalancerQueries.json +++ b/crates/contracts/artifacts/BalancerQueries.json @@ -1 +1,311 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"components":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"assetInIndex","type":"uint256"},{"internalType":"uint256","name":"assetOutIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IVault.BatchSwapStep[]","name":"swaps","type":"tuple[]"},{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.FundManagement","name":"funds","type":"tuple"}],"name":"queryBatchSwap","outputs":[{"internalType":"int256[]","name":"assetDeltas","type":"int256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"minAmountsOut","type":"uint256[]"},{"internalType":"bytes","name":"userData","type":"bytes"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.ExitPoolRequest","name":"request","type":"tuple"}],"name":"queryExit","outputs":[{"internalType":"uint256","name":"bptIn","type":"uint256"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"maxAmountsIn","type":"uint256[]"},{"internalType":"bytes","name":"userData","type":"bytes"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"}],"internalType":"struct IVault.JoinPoolRequest","name":"request","type":"tuple"}],"name":"queryJoin","outputs":[{"internalType":"uint256","name":"bptOut","type":"uint256"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IAsset","name":"assetIn","type":"address"},{"internalType":"contract IAsset","name":"assetOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IVault.SingleSwap","name":"singleSwap","type":"tuple"},{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.FundManagement","name":"funds","type":"tuple"}],"name":"querySwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "assetInIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetOutIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.BatchSwapStep[]", + "name": "swaps", + "type": "tuple[]" + }, + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + } + ], + "name": "queryBatchSwap", + "outputs": [ + { + "internalType": "int256[]", + "name": "assetDeltas", + "type": "int256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.ExitPoolRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "maxAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.JoinPoolRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IAsset", + "name": "assetIn", + "type": "address" + }, + { + "internalType": "contract IAsset", + "name": "assetOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.SingleSwap", + "name": "singleSwap", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + } + ], + "name": "querySwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2Authorizer.json b/crates/contracts/artifacts/BalancerV2Authorizer.json index 284e1e004d..d5d65e10ab 100644 --- a/crates/contracts/artifacts/BalancerV2Authorizer.json +++ b/crates/contracts/artifacts/BalancerV2Authorizer.json @@ -1 +1,390 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"actionId","type":"bytes32"},{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"canPerform","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"roles","type":"bytes32[]"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"roles","type":"bytes32[]"},{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"grantRolesToMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"roles","type":"bytes32[]"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"roles","type":"bytes32[]"},{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"revokeRolesFromMany","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50604051610e1d380380610e1d8339818101604052602081101561003357600080fd5b5051610040600082610046565b5061013d565b6100508282610054565b5050565b6000828152602081815260409091206100769183906108946100b7821b17901c565b156100505760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60006100c3838361011c565b61011257508154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b03861690811790915585549082528286019093526040902091909155610116565b5060005b92915050565b6001600160a01b031660009081526001919091016020526040902054151590565b610cd18061014c6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c8063988360a31161008c578063a73cb2ab11610066578063a73cb2ab1461044b578063ca15c87314610572578063d547741f1461058f578063fcd7627e146105c8576100df565b8063988360a3146103475780639be2a88414610402578063a217fddf14610443576100df565b806336568abe116100bd57806336568abe146102755780639010d07c146102ae57806391d14854146102fa576100df565b806318b2cde9146100e4578063248a9ca31461020d5780632f2ff15d1461023c575b600080fd5b61020b600480360360408110156100fa57600080fd5b81019060208101813564010000000081111561011557600080fd5b82018360208201111561012757600080fd5b8035906020019184602083028401116401000000008311171561014957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561019957600080fd5b8201836020820111156101ab57600080fd5b803590602001918460208302840111640100000000831117156101cd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610683945050505050565b005b61022a6004803603602081101561022357600080fd5b50356106d8565b60408051918252519081900360200190f35b61020b6004803603604081101561025257600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff166106ed565b61020b6004803603604081101561028b57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610723565b6102d1600480360360408110156102c457600080fd5b5080359060200135610751565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103336004803603604081101561031057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610772565b604080519115158252519081900360200190f35b61020b6004803603604081101561035d57600080fd5b81019060208101813564010000000081111561037857600080fd5b82018360208201111561038a57600080fd5b803590602001918460208302840111640100000000831117156103ac57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050903573ffffffffffffffffffffffffffffffffffffffff16915061078a9050565b6103336004803603606081101561041857600080fd5b5080359073ffffffffffffffffffffffffffffffffffffffff602082013581169160400135166107bb565b61022a6107cf565b61020b6004803603604081101561046157600080fd5b81019060208101813564010000000081111561047c57600080fd5b82018360208201111561048e57600080fd5b803590602001918460208302840111640100000000831117156104b057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561050057600080fd5b82018360208201111561051257600080fd5b8035906020019184602083028401116401000000008311171561053457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506107d4945050505050565b61022a6004803603602081101561058857600080fd5b5035610824565b61020b600480360360408110156105a557600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff1661083b565b61020b600480360360408110156105de57600080fd5b8101906020810181356401000000008111156105f957600080fd5b82018360208201111561060b57600080fd5b8035906020019184602083028401116401000000008311171561062d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050903573ffffffffffffffffffffffffffffffffffffffff1691506108639050565b61068f8251825161091c565b60005b82518110156106d3576106cb8382815181106106aa57fe5b60200260200101518383815181106106be57fe5b602002602001015161083b565b600101610692565b505050565b60009081526020819052604090206002015490565b6000828152602081905260409020600201546107159061070d9033610772565b6101a6610925565b61071f8282610933565b5050565b61074773ffffffffffffffffffffffffffffffffffffffff821633146101a8610925565b61071f8282610999565b600082815260208190526040812061076990836109ff565b90505b92915050565b60008281526020819052604081206107699083610a1b565b60005b82518110156106d3576107b38382815181106107a557fe5b60200260200101518361083b565b60010161078d565b60006107c78484610772565b949350505050565b600081565b6107e08251825161091c565b60005b82518110156106d35761081c8382815181106107fb57fe5b602002602001015183838151811061080f57fe5b60200260200101516106ed565b6001016107e3565b600081815260208190526040812061076c90610a49565b6000828152602081905260409020600201546107479061085b9033610772565b6101a7610925565b60005b82518110156106d35761088c83828151811061087e57fe5b6020026020010151836106ed565b600101610866565b60006108a08383610a1b565b61091457508154600180820184556000848152602080822090930180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86169081179091558554908252828601909352604090209190915561076c565b50600061076c565b61071f81831460675b8161071f5761071f81610a4d565b600082815260208190526040902061094b9082610894565b1561071f57604051339073ffffffffffffffffffffffffffffffffffffffff83169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526020819052604090206109b19082610aba565b1561071f57604051339073ffffffffffffffffffffffffffffffffffffffff83169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b8154600090610a119083106064610925565b6107698383610c61565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001919091016020526040902054151590565b5490565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120548015610c575783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083019190810190600090879083908110610b2257fe5b600091825260209091200154875473ffffffffffffffffffffffffffffffffffffffff90911691508190889085908110610b5857fe5b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055918316815260018981019092526040902090840190558654879080610bc657fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590920190925573ffffffffffffffffffffffffffffffffffffffff8816825260018981019091526040822091909155945061076c9350505050565b600091505061076c565b6000826000018281548110610c7257fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16939250505056fea2646970667358221220dfe715d2cd44c733089f2c396b8ba6a91ca4ec5b907632f366d4d8a9814a53d364736f6c63430007010033","devdoc":{"details":"Basic Authorizer implementation, based on OpenZeppelin's Access Control. Users are allowed to perform actions if they have the role with the same identifier. In this sense, roles are not being truly used as such, since they each map to a single action identifier. This temporary implementation is expected to be replaced soon after launch by a more sophisticated one, able to manage permissions across multiple contracts and to natively handle timelocks.","kind":"dev","methods":{"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}."},"getRoleMember(bytes32,uint256)":{"details":"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information."},"getRoleMemberCount(bytes32)":{"details":"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role."},"grantRoles(bytes32[],address)":{"details":"Grants multiple roles to a single account."},"grantRolesToMany(bytes32[],address[])":{"details":"Grants roles to a list of accounts."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had already been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role."},"revokeRoles(bytes32[],address)":{"details":"Revokes multiple roles from a single account."},"revokeRolesFromMany(bytes32[],address[])":{"details":"Revokes roles from a list of accounts."}},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "actionId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "canPerform", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "roles", + "type": "bytes32[]" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRoles", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "roles", + "type": "bytes32[]" + }, + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + } + ], + "name": "grantRolesToMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "roles", + "type": "bytes32[]" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRoles", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "roles", + "type": "bytes32[]" + }, + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + } + ], + "name": "revokeRolesFromMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610e1d380380610e1d8339818101604052602081101561003357600080fd5b5051610040600082610046565b5061013d565b6100508282610054565b5050565b6000828152602081815260409091206100769183906108946100b7821b17901c565b156100505760405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60006100c3838361011c565b61011257508154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b03861690811790915585549082528286019093526040902091909155610116565b5060005b92915050565b6001600160a01b031660009081526001919091016020526040902054151590565b610cd18061014c6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c8063988360a31161008c578063a73cb2ab11610066578063a73cb2ab1461044b578063ca15c87314610572578063d547741f1461058f578063fcd7627e146105c8576100df565b8063988360a3146103475780639be2a88414610402578063a217fddf14610443576100df565b806336568abe116100bd57806336568abe146102755780639010d07c146102ae57806391d14854146102fa576100df565b806318b2cde9146100e4578063248a9ca31461020d5780632f2ff15d1461023c575b600080fd5b61020b600480360360408110156100fa57600080fd5b81019060208101813564010000000081111561011557600080fd5b82018360208201111561012757600080fd5b8035906020019184602083028401116401000000008311171561014957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561019957600080fd5b8201836020820111156101ab57600080fd5b803590602001918460208302840111640100000000831117156101cd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610683945050505050565b005b61022a6004803603602081101561022357600080fd5b50356106d8565b60408051918252519081900360200190f35b61020b6004803603604081101561025257600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff166106ed565b61020b6004803603604081101561028b57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610723565b6102d1600480360360408110156102c457600080fd5b5080359060200135610751565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103336004803603604081101561031057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610772565b604080519115158252519081900360200190f35b61020b6004803603604081101561035d57600080fd5b81019060208101813564010000000081111561037857600080fd5b82018360208201111561038a57600080fd5b803590602001918460208302840111640100000000831117156103ac57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050903573ffffffffffffffffffffffffffffffffffffffff16915061078a9050565b6103336004803603606081101561041857600080fd5b5080359073ffffffffffffffffffffffffffffffffffffffff602082013581169160400135166107bb565b61022a6107cf565b61020b6004803603604081101561046157600080fd5b81019060208101813564010000000081111561047c57600080fd5b82018360208201111561048e57600080fd5b803590602001918460208302840111640100000000831117156104b057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561050057600080fd5b82018360208201111561051257600080fd5b8035906020019184602083028401116401000000008311171561053457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506107d4945050505050565b61022a6004803603602081101561058857600080fd5b5035610824565b61020b600480360360408110156105a557600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff1661083b565b61020b600480360360408110156105de57600080fd5b8101906020810181356401000000008111156105f957600080fd5b82018360208201111561060b57600080fd5b8035906020019184602083028401116401000000008311171561062d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050903573ffffffffffffffffffffffffffffffffffffffff1691506108639050565b61068f8251825161091c565b60005b82518110156106d3576106cb8382815181106106aa57fe5b60200260200101518383815181106106be57fe5b602002602001015161083b565b600101610692565b505050565b60009081526020819052604090206002015490565b6000828152602081905260409020600201546107159061070d9033610772565b6101a6610925565b61071f8282610933565b5050565b61074773ffffffffffffffffffffffffffffffffffffffff821633146101a8610925565b61071f8282610999565b600082815260208190526040812061076990836109ff565b90505b92915050565b60008281526020819052604081206107699083610a1b565b60005b82518110156106d3576107b38382815181106107a557fe5b60200260200101518361083b565b60010161078d565b60006107c78484610772565b949350505050565b600081565b6107e08251825161091c565b60005b82518110156106d35761081c8382815181106107fb57fe5b602002602001015183838151811061080f57fe5b60200260200101516106ed565b6001016107e3565b600081815260208190526040812061076c90610a49565b6000828152602081905260409020600201546107479061085b9033610772565b6101a7610925565b60005b82518110156106d35761088c83828151811061087e57fe5b6020026020010151836106ed565b600101610866565b60006108a08383610a1b565b61091457508154600180820184556000848152602080822090930180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86169081179091558554908252828601909352604090209190915561076c565b50600061076c565b61071f81831460675b8161071f5761071f81610a4d565b600082815260208190526040902061094b9082610894565b1561071f57604051339073ffffffffffffffffffffffffffffffffffffffff83169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526020819052604090206109b19082610aba565b1561071f57604051339073ffffffffffffffffffffffffffffffffffffffff83169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b8154600090610a119083106064610925565b6107698383610c61565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001919091016020526040902054151590565b5490565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120548015610c575783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083019190810190600090879083908110610b2257fe5b600091825260209091200154875473ffffffffffffffffffffffffffffffffffffffff90911691508190889085908110610b5857fe5b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055918316815260018981019092526040902090840190558654879080610bc657fe5b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590920190925573ffffffffffffffffffffffffffffffffffffffff8816825260018981019091526040822091909155945061076c9350505050565b600091505061076c565b6000826000018281548110610c7257fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16939250505056fea2646970667358221220dfe715d2cd44c733089f2c396b8ba6a91ca4ec5b907632f366d4d8a9814a53d364736f6c63430007010033", + "devdoc": { + "details": "Basic Authorizer implementation, based on OpenZeppelin's Access Control. Users are allowed to perform actions if they have the role with the same identifier. In this sense, roles are not being truly used as such, since they each map to a single action identifier. This temporary implementation is expected to be replaced soon after launch by a more sophisticated one, able to manage permissions across multiple contracts and to natively handle timelocks.", + "kind": "dev", + "methods": { + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "getRoleMember(bytes32,uint256)": { + "details": "Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information." + }, + "getRoleMemberCount(bytes32)": { + "details": "Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role." + }, + "grantRoles(bytes32[],address)": { + "details": "Grants multiple roles to a single account." + }, + "grantRolesToMany(bytes32[],address[])": { + "details": "Grants roles to a list of accounts." + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "renounceRole(bytes32,address)": { + "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`." + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had already been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role." + }, + "revokeRoles(bytes32[],address)": { + "details": "Revokes multiple roles from a single account." + }, + "revokeRolesFromMany(bytes32[],address[])": { + "details": "Revokes roles from a list of accounts." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } +} diff --git a/crates/contracts/artifacts/BalancerV2ComposableStablePool.json b/crates/contracts/artifacts/BalancerV2ComposableStablePool.json index ee06b428c4..9d8717feab 100644 --- a/crates/contracts/artifacts/BalancerV2ComposableStablePool.json +++ b/crates/contracts/artifacts/BalancerV2ComposableStablePool.json @@ -1 +1,1411 @@ -{"abi":[{"inputs":[{"components":[{"internalType":"contract IVault","name":"vault","type":"address"},{"internalType":"contract IProtocolFeePercentagesProvider","name":"protocolFeeProvider","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"contract IRateProvider[]","name":"rateProviders","type":"address[]"},{"internalType":"uint256[]","name":"tokenRateCacheDurations","type":"uint256[]"},{"internalType":"bool[]","name":"exemptFromYieldProtocolFeeFlags","type":"bool[]"},{"internalType":"uint256","name":"amplificationParameter","type":"uint256"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"version","type":"string"}],"internalType":"struct ComposableStablePool.NewPoolParams","name":"params","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"AmpUpdateStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentValue","type":"uint256"}],"name":"AmpUpdateStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"PausedStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"feeType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFeePercentage","type":"uint256"}],"name":"ProtocolFeePercentageCacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"RecoveryModeStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"SwapFeePercentageChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"TokenRateCacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenIndex","type":"uint256"},{"indexed":true,"internalType":"contract IRateProvider","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"cacheDuration","type":"uint256"}],"name":"TokenRateProviderSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableRecoveryMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableRecoveryMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getActualSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAmplificationParameter","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bool","name":"isUpdating","type":"bool"},{"internalType":"uint256","name":"precision","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBptIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastJoinExitData","outputs":[{"internalType":"uint256","name":"lastJoinExitAmplification","type":"uint256"},{"internalType":"uint256","name":"lastPostJoinExitInvariant","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinimumBpt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getNextNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPausedState","outputs":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"pauseWindowEndTime","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodEndTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeType","type":"uint256"}],"name":"getProtocolFeePercentageCache","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolFeesCollector","outputs":[{"internalType":"contract IProtocolFeesCollector","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolSwapFeeDelegation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRateProviders","outputs":[{"internalType":"contract IRateProvider[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getScalingFactors","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSwapFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"getTokenRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"getTokenRateCache","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"oldRate","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"expires","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inRecoveryMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"isTokenExemptFromYieldProtocolFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onExitPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onJoinPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IPoolSwapStructs.SwapRequest","name":"swapRequest","type":"tuple"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"indexIn","type":"uint256"},{"internalType":"uint256","name":"indexOut","type":"uint256"}],"name":"onSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryExit","outputs":[{"internalType":"uint256","name":"bptIn","type":"uint256"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryJoin","outputs":[{"internalType":"uint256","name":"bptOut","type":"uint256"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"bytes","name":"poolConfig","type":"bytes"}],"name":"setAssetManagerPoolConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"setSwapFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setTokenRateCacheDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rawEndValue","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"startAmplificationParameterUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopAmplificationParameterUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateProtocolFeePercentageCache","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"updateTokenRateCache","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "contract IProtocolFeePercentagesProvider", + "name": "protocolFeeProvider", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "contract IRateProvider[]", + "name": "rateProviders", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "tokenRateCacheDurations", + "type": "uint256[]" + }, + { + "internalType": "bool[]", + "name": "exemptFromYieldProtocolFeeFlags", + "type": "bool[]" + }, + { + "internalType": "uint256", + "name": "amplificationParameter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + } + ], + "internalType": "struct ComposableStablePool.NewPoolParams", + "name": "params", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "startValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "AmpUpdateStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "currentValue", + "type": "uint256" + } + ], + "name": "AmpUpdateStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "feeType", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "protocolFeePercentage", + "type": "uint256" + } + ], + "name": "ProtocolFeePercentageCacheUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "RecoveryModeStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "SwapFeePercentageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "name": "TokenRateCacheUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "contract IRateProvider", + "name": "provider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cacheDuration", + "type": "uint256" + } + ], + "name": "TokenRateProviderSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DELEGATE_PROTOCOL_SWAP_FEES_SENTINEL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disableRecoveryMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableRecoveryMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getActualSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAmplificationParameter", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isUpdating", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBptIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastJoinExitData", + "outputs": [ + { + "internalType": "uint256", + "name": "lastJoinExitAmplification", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPostJoinExitInvariant", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinimumBpt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getNextNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeType", + "type": "uint256" + } + ], + "name": "getProtocolFeePercentageCache", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeesCollector", + "outputs": [ + { + "internalType": "contract IProtocolFeesCollector", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolSwapFeeDelegation", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRateProviders", + "outputs": [ + { + "internalType": "contract IRateProvider[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getScalingFactors", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "getTokenRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "getTokenRateCache", + "outputs": [ + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oldRate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expires", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inRecoveryMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "isTokenExemptFromYieldProtocolFee", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onExitPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onJoinPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "swapRequest", + "type": "tuple" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "indexIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "indexOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "poolConfig", + "type": "bytes" + } + ], + "name": "setAssetManagerPoolConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "setSwapFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "setTokenRateCacheDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "rawEndValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "startAmplificationParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stopAmplificationParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateProtocolFeePercentageCache", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "updateTokenRateCache", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2ComposableStablePoolFactory.json b/crates/contracts/artifacts/BalancerV2ComposableStablePoolFactory.json index 9bdac69887..6fb974332f 100644 --- a/crates/contracts/artifacts/BalancerV2ComposableStablePoolFactory.json +++ b/crates/contracts/artifacts/BalancerV2ComposableStablePoolFactory.json @@ -1 +1,280 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"},{"internalType":"contract IProtocolFeePercentagesProvider","name":"protocolFeeProvider","type":"address"},{"internalType":"string","name":"factoryVersion","type":"string"},{"internalType":"string","name":"poolVersion","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"FactoryDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amplificationParameter","type":"uint256"},{"internalType":"contract IRateProvider[]","name":"rateProviders","type":"address[]"},{"internalType":"uint256[]","name":"tokenRateCacheDurations","type":"uint256[]"},{"internalType":"bool[]","name":"exemptFromYieldProtocolFeeFlags","type":"bool[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"create","outputs":[{"internalType":"contract ComposableStablePool","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCodeContracts","outputs":[{"internalType":"address","name":"contractA","type":"address"},{"internalType":"address","name":"contractB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPauseConfiguration","outputs":[{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolFeePercentagesProvider","outputs":[{"internalType":"contract IProtocolFeePercentagesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "contract IProtocolFeePercentagesProvider", + "name": "protocolFeeProvider", + "type": "address" + }, + { + "internalType": "string", + "name": "factoryVersion", + "type": "string" + }, + { + "internalType": "string", + "name": "poolVersion", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [], + "name": "FactoryDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "amplificationParameter", + "type": "uint256" + }, + { + "internalType": "contract IRateProvider[]", + "name": "rateProviders", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "tokenRateCacheDurations", + "type": "uint256[]" + }, + { + "internalType": "bool[]", + "name": "exemptFromYieldProtocolFeeFlags", + "type": "bool[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "contract ComposableStablePool", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCodeContracts", + "outputs": [ + { + "internalType": "address", + "name": "contractA", + "type": "address" + }, + { + "internalType": "address", + "name": "contractB", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPauseConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolVersion", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeePercentagesProvider", + "outputs": [ + { + "internalType": "contract IProtocolFeePercentagesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDisabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolFromFactory", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPool.json b/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPool.json index 5244346d57..677e6612f0 100644 --- a/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPool.json +++ b/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPool.json @@ -1 +1,1055 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"normalizedWeights","type":"uint256[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"swapEnabledOnStart","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"startWeights","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"endWeights","type":"uint256[]"}],"name":"GradualWeightUpdateScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"PausedStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"swapEnabled","type":"bool"}],"name":"SwapEnabledSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"SwapFeePercentageChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGradualWeightUpdateParams","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256[]","name":"endWeights","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInvariant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastInvariant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNormalizedWeights","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPausedState","outputs":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"pauseWindowEndTime","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodEndTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getScalingFactors","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSwapEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSwapFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onExitPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onJoinPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IPoolSwapStructs.SwapRequest","name":"request","type":"tuple"},{"internalType":"uint256","name":"balanceTokenIn","type":"uint256"},{"internalType":"uint256","name":"balanceTokenOut","type":"uint256"}],"name":"onSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryExit","outputs":[{"internalType":"uint256","name":"bptIn","type":"uint256"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryJoin","outputs":[{"internalType":"uint256","name":"bptOut","type":"uint256"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"bytes","name":"poolConfig","type":"bytes"}],"name":"setAssetManagerPoolConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"swapEnabled","type":"bool"}],"name":"setSwapEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"setSwapFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256[]","name":"endWeights","type":"uint256[]"}],"name":"updateWeightsGradually","outputs":[],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "normalizedWeights", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bool", + "name": "swapEnabledOnStart", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "startWeights", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "endWeights", + "type": "uint256[]" + } + ], + "name": "GradualWeightUpdateScheduled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "swapEnabled", + "type": "bool" + } + ], + "name": "SwapEnabledSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "SwapFeePercentageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGradualWeightUpdateParams", + "outputs": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "endWeights", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNormalizedWeights", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getScalingFactors", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onExitPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onJoinPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "request", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "balanceTokenIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceTokenOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "poolConfig", + "type": "bytes" + } + ], + "name": "setAssetManagerPoolConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "swapEnabled", + "type": "bool" + } + ], + "name": "setSwapEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "setSwapFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "endWeights", + "type": "uint256[]" + } + ], + "name": "updateWeightsGradually", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPoolFactory.json b/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPoolFactory.json index 8b779e8109..17eaf625ba 100644 --- a/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPoolFactory.json +++ b/crates/contracts/artifacts/BalancerV2LiquidityBootstrappingPoolFactory.json @@ -1 +1,158 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"weights","type":"uint256[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"swapEnabledOnStart","type":"bool"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCreationCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCodeContracts","outputs":[{"internalType":"address","name":"contractA","type":"address"},{"internalType":"address","name":"contractB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPauseConfiguration","outputs":[{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "weights", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bool", + "name": "swapEnabledOnStart", + "type": "bool" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCodeContracts", + "outputs": [ + { + "internalType": "address", + "name": "contractA", + "type": "address" + }, + { + "internalType": "address", + "name": "contractB", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPauseConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolFromFactory", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2StablePool.json b/crates/contracts/artifacts/BalancerV2StablePool.json index 757a2adffe..65ee2aacc1 100644 --- a/crates/contracts/artifacts/BalancerV2StablePool.json +++ b/crates/contracts/artifacts/BalancerV2StablePool.json @@ -1 +1,1055 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amplificationParameter","type":"uint256"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"AmpUpdateStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentValue","type":"uint256"}],"name":"AmpUpdateStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"PausedStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"SwapFeePercentageChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAmplificationParameter","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bool","name":"isUpdating","type":"bool"},{"internalType":"uint256","name":"precision","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPausedState","outputs":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"pauseWindowEndTime","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodEndTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSwapFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onExitPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onJoinPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IPoolSwapStructs.SwapRequest","name":"swapRequest","type":"tuple"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"indexIn","type":"uint256"},{"internalType":"uint256","name":"indexOut","type":"uint256"}],"name":"onSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IPoolSwapStructs.SwapRequest","name":"request","type":"tuple"},{"internalType":"uint256","name":"balanceTokenIn","type":"uint256"},{"internalType":"uint256","name":"balanceTokenOut","type":"uint256"}],"name":"onSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryExit","outputs":[{"internalType":"uint256","name":"bptIn","type":"uint256"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryJoin","outputs":[{"internalType":"uint256","name":"bptOut","type":"uint256"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"bytes","name":"poolConfig","type":"bytes"}],"name":"setAssetManagerPoolConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"setSwapFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rawEndValue","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"startAmplificationParameterUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopAmplificationParameterUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "amplificationParameter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "startValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "AmpUpdateStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "currentValue", + "type": "uint256" + } + ], + "name": "AmpUpdateStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "SwapFeePercentageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAmplificationParameter", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isUpdating", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onExitPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onJoinPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "swapRequest", + "type": "tuple" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "indexIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "indexOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "request", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "balanceTokenIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceTokenOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "poolConfig", + "type": "bytes" + } + ], + "name": "setAssetManagerPoolConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "setSwapFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "rawEndValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "startAmplificationParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stopAmplificationParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2StablePoolFactoryV2.json b/crates/contracts/artifacts/BalancerV2StablePoolFactoryV2.json index 3a5df62a42..7efac7b724 100644 --- a/crates/contracts/artifacts/BalancerV2StablePoolFactoryV2.json +++ b/crates/contracts/artifacts/BalancerV2StablePoolFactoryV2.json @@ -1 +1,211 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"FactoryDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amplificationParameter","type":"uint256"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCodeContracts","outputs":[{"internalType":"address","name":"contractA","type":"address"},{"internalType":"address","name":"contractB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPauseConfiguration","outputs":[{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [], + "name": "FactoryDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "amplificationParameter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCodeContracts", + "outputs": [ + { + "internalType": "address", + "name": "contractA", + "type": "address" + }, + { + "internalType": "address", + "name": "contractB", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPauseConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDisabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolFromFactory", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2Vault.json b/crates/contracts/artifacts/BalancerV2Vault.json index d1829e4d74..52c06f7fd3 100644 --- a/crates/contracts/artifacts/BalancerV2Vault.json +++ b/crates/contracts/artifacts/BalancerV2Vault.json @@ -1 +1,1182 @@ -{"abi":[{"inputs":[{"internalType":"contract IAuthorizer","name":"authorizer","type":"address"},{"internalType":"contract IWETH","name":"weth","type":"address"},{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IAuthorizer","name":"newAuthorizer","type":"address"}],"name":"AuthorizerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExternalBalanceTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IFlashLoanRecipient","name":"recipient","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"FlashLoan","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"int256","name":"delta","type":"int256"}],"name":"InternalBalanceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"PausedStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"poolId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"liquidityProvider","type":"address"},{"indexed":false,"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"int256[]","name":"deltas","type":"int256[]"},{"indexed":false,"internalType":"uint256[]","name":"protocolFeeAmounts","type":"uint256[]"}],"name":"PoolBalanceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"poolId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"assetManager","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"int256","name":"cashDelta","type":"int256"},{"indexed":false,"internalType":"int256","name":"managedDelta","type":"int256"}],"name":"PoolBalanceManaged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"poolId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"poolAddress","type":"address"},{"indexed":false,"internalType":"enum IVault.PoolSpecialization","name":"specialization","type":"uint8"}],"name":"PoolRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"RelayerApprovalChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"poolId","type":"bytes32"},{"indexed":true,"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"poolId","type":"bytes32"},{"indexed":false,"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"TokensDeregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"poolId","type":"bytes32"},{"indexed":false,"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"assetManagers","type":"address[]"}],"name":"TokensRegistered","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"components":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"assetInIndex","type":"uint256"},{"internalType":"uint256","name":"assetOutIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IVault.BatchSwapStep[]","name":"swaps","type":"tuple[]"},{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.FundManagement","name":"funds","type":"tuple"},{"internalType":"int256[]","name":"limits","type":"int256[]"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"batchSwap","outputs":[{"internalType":"int256[]","name":"assetDeltas","type":"int256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"deregisterTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address payable","name":"recipient","type":"address"},{"components":[{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"minAmountsOut","type":"uint256[]"},{"internalType":"bytes","name":"userData","type":"bytes"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.ExitPoolRequest","name":"request","type":"tuple"}],"name":"exitPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IFlashLoanRecipient","name":"recipient","type":"address"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"flashLoan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"getInternalBalance","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNextNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPausedState","outputs":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"pauseWindowEndTime","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodEndTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"}],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"enum IVault.PoolSpecialization","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"getPoolTokenInfo","outputs":[{"internalType":"uint256","name":"cash","type":"uint256"},{"internalType":"uint256","name":"managed","type":"uint256"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"address","name":"assetManager","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"}],"name":"getPoolTokens","outputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolFeesCollector","outputs":[{"internalType":"contract ProtocolFeesCollector","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"relayer","type":"address"}],"name":"hasApprovedRelayer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"maxAmountsIn","type":"uint256[]"},{"internalType":"bytes","name":"userData","type":"bytes"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"}],"internalType":"struct IVault.JoinPoolRequest","name":"request","type":"tuple"}],"name":"joinPool","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.PoolBalanceOpKind","name":"kind","type":"uint8"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IVault.PoolBalanceOp[]","name":"ops","type":"tuple[]"}],"name":"managePoolBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.UserBalanceOpKind","name":"kind","type":"uint8"},{"internalType":"contract IAsset","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct IVault.UserBalanceOp[]","name":"ops","type":"tuple[]"}],"name":"manageUserBalance","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"components":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"assetInIndex","type":"uint256"},{"internalType":"uint256","name":"assetOutIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IVault.BatchSwapStep[]","name":"swaps","type":"tuple[]"},{"internalType":"contract IAsset[]","name":"assets","type":"address[]"},{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.FundManagement","name":"funds","type":"tuple"}],"name":"queryBatchSwap","outputs":[{"internalType":"int256[]","name":"","type":"int256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum IVault.PoolSpecialization","name":"specialization","type":"uint8"}],"name":"registerPool","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"address[]","name":"assetManagers","type":"address[]"}],"name":"registerTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAuthorizer","name":"newAuthorizer","type":"address"}],"name":"setAuthorizer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"relayer","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setRelayerApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IAsset","name":"assetIn","type":"address"},{"internalType":"contract IAsset","name":"assetOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IVault.SingleSwap","name":"singleSwap","type":"tuple"},{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bool","name":"fromInternalBalance","type":"bool"},{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"bool","name":"toInternalBalance","type":"bool"}],"internalType":"struct IVault.FundManagement","name":"funds","type":"tuple"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swap","outputs":[{"internalType":"uint256","name":"amountCalculated","type":"uint256"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"0x6101806040523480156200001257600080fd5b5060405162006ed638038062006ed6833981016040819052620000359162000253565b8382826040518060400160405280601181526020017010985b185b98d95c88158c8815985d5b1d607a1b81525080604051806040016040528060018152602001603160f81b815250306001600160a01b031660001b89806001600160a01b03166080816001600160a01b031660601b815250505030604051620000b89062000245565b620000c491906200029f565b604051809103906000f080158015620000e1573d6000803e3d6000fd5b5060601b6001600160601b03191660a052600160005560c052815160209283012060e052805191012061010052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61012052620001486276a70083111561019462000181565b6200015c62278d0082111561019562000181565b429091016101408190520161016052620001768162000196565b5050505050620002cc565b8162000192576200019281620001f2565b5050565b6040516001600160a01b038216907f94b979b6831a51293e2641426f97747feed46f17779fed9cd18d1ecefcfe92ef90600090a2600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b610be680620062f083390190565b6000806000806080858703121562000269578384fd5b84516200027681620002b3565b60208601519094506200028981620002b3565b6040860151606090960151949790965092505050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114620002c957600080fd5b50565b60805160601c60a05160601c60c05160e05161010051610120516101405161016051615fc06200033060003980611aed525080611ac952508061289f5250806128e15250806128c05250806110fd5250806113b15250806105285250615fc06000f3fe6080604052600436106101a55760003560e01c8063945bcec9116100e1578063e6c460921161008a578063f84d066e11610064578063f84d066e1461048a578063f94d4668146104aa578063fa6e671d146104d9578063fec90d72146104f9576101d3565b8063e6c4609214610427578063ed24911d14610447578063f6c009271461045c576101d3565b8063b05f8e48116100bb578063b05f8e48146103cf578063b95cac28146103ff578063d2946c2b14610412576101d3565b8063945bcec914610385578063aaabadc514610398578063ad5c4648146103ba576101d3565b806352bbbe291161014e5780637d3aeb96116101285780637d3aeb9614610305578063851c1bb3146103255780638bdb39131461034557806390193b7c14610365576101d3565b806352bbbe29146102b25780635c38449e146102c557806366a9c7d2146102e5576101d3565b80630f5a6efa1161017f5780630f5a6efa1461024157806316c38b3c1461026e5780631c0de0511461028e576101d3565b8063058a628f146101d857806309b2760f146101f85780630e8e3e841461022e576101d3565b366101d3576101d16101b5610526565b6001600160a01b0316336001600160a01b03161461020661054b565b005b600080fd5b3480156101e457600080fd5b506101d16101f3366004615157565b61055d565b34801561020457600080fd5b506102186102133660046156e6565b610581565b6040516102259190615d3e565b60405180910390f35b6101d161023c36600461531e565b610634565b34801561024d57600080fd5b5061026161025c3660046151f5565b610770565b6040516102259190615d08565b34801561027a57600080fd5b506101d161028936600461545c565b610806565b34801561029a57600080fd5b506102a361081f565b60405161022593929190615d26565b6102186102c036600461588f565b610848565b3480156102d157600080fd5b506101d16102e036600461565b565b6109e9565b3480156102f157600080fd5b506101d1610300366004615545565b610e06565b34801561031157600080fd5b506101d1610320366004615516565b610fa5565b34801561033157600080fd5b50610218610340366004615633565b6110f9565b34801561035157600080fd5b506101d16103603660046154ac565b61114b565b34801561037157600080fd5b50610218610380366004615157565b611161565b610261610393366004615786565b61117c565b3480156103a457600080fd5b506103ad6112b0565b6040516102259190615b63565b3480156103c657600080fd5b506103ad6112c4565b3480156103db57600080fd5b506103ef6103ea36600461560f565b6112d3565b6040516102259493929190615eb9565b6101d161040d3660046154ac565b611396565b34801561041e57600080fd5b506103ad6113af565b34801561043357600080fd5b506101d1610442366004615243565b6113d3565b34801561045357600080fd5b506102186114ef565b34801561046857600080fd5b5061047c610477366004615494565b6114f9565b604051610225929190615b9b565b34801561049657600080fd5b506102616104a5366004615702565b611523565b3480156104b657600080fd5b506104ca6104c5366004615494565b611620565b60405161022593929190615cd2565b3480156104e557600080fd5b506101d16104f43660046151ab565b611654565b34801561050557600080fd5b50610519610514366004615173565b6116e6565b6040516102259190615d1b565b7f00000000000000000000000000000000000000000000000000000000000000005b90565b8161055957610559816116fb565b5050565b610565611768565b61056d611781565b610576816117af565b61057e611822565b50565b600061058b611768565b610593611829565b60006105a2338460065461183e565b6000818152600560205260409020549091506105c49060ff16156101f461054b565b60008181526005602052604090819020805460ff1916600190811790915560068054909101905551339082907f3c13bc30b8e878c53fd2a36b679409c073afd75950be43d8858768e956fbc20e9061061d908790615e3a565b60405180910390a3905061062f611822565b919050565b61063c611768565b6000806000805b845181101561075b5760008060008060006106718a878151811061066357fe5b60200260200101518961187d565b9c50939850919650945092509050600185600381111561068d57fe5b14156106a45761069f848383866118f5565b61074a565b866106b6576106b1611829565b600196505b60008560038111156106c457fe5b14156106f5576106d684838386611918565b6106df84611938565b1561069f576106ee8984611945565b985061074a565b61070a61070185611938565b1561020761054b565b600061071585610548565b9050600286600381111561072557fe5b141561073c5761073781848487611957565b610748565b61074881848487611970565b505b505060019093019250610643915050565b50610765836119de565b50505061057e611822565b6060815167ffffffffffffffff8111801561078a57600080fd5b506040519080825280602002602001820160405280156107b4578160200160208202803683370190505b50905060005b82518110156107ff576107e0848483815181106107d357fe5b6020026020010151611a01565b8282815181106107ec57fe5b60209081029190910101526001016107ba565b5092915050565b61080e611768565b610816611781565b61057681611a2c565b600080600061082c611aaa565b159250610837611ac7565b9150610841611aeb565b9050909192565b6000610852611768565b61085a611829565b835161086581611b0f565b610874834211156101fc61054b565b61088760008760800151116101fe61054b565b60006108968760400151611b41565b905060006108a78860600151611b41565b90506108ca816001600160a01b0316836001600160a01b031614156101fd61054b565b6108d2614ce1565b885160808201526020890151819060018111156108eb57fe5b908160018111156108f857fe5b9052506001600160a01b03808416602083015282811660408084019190915260808b0151606084015260a08b01516101008401528951821660c08401528901511660e082015260008061094a83611b66565b9198509250905061098160008c60200151600181111561096657fe5b146109745789831115610979565b898210155b6101fb61054b565b6109998b60400151838c600001518d60200151611c5a565b6109b18b60600151828c604001518d60600151611d38565b6109d36109c18c60400151611938565b6109cc5760006109ce565b825b6119de565b5050505050506109e1611822565b949350505050565b6109f1611768565b6109f9611829565b610a0583518351611e12565b6060835167ffffffffffffffff81118015610a1f57600080fd5b50604051908082528060200260200182016040528015610a49578160200160208202803683370190505b5090506060845167ffffffffffffffff81118015610a6657600080fd5b50604051908082528060200260200182016040528015610a90578160200160208202803683370190505b5090506000805b8651811015610c09576000878281518110610aae57fe5b602002602001015190506000878381518110610ac657fe5b60200260200101519050610b11846001600160a01b0316836001600160a01b03161160006001600160a01b0316846001600160a01b031614610b09576066610b0c565b60685b61054b565b819350816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b409190615b63565b60206040518083038186803b158015610b5857600080fd5b505afa158015610b6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b909190615968565b858481518110610b9c57fe5b602002602001018181525050610bb181611e1f565b868481518110610bbd57fe5b602002602001018181525050610beb81868581518110610bd957fe5b6020026020010151101561021061054b565b610bff6001600160a01b0383168b83611ea6565b5050600101610a97565b506040517ff04f27070000000000000000000000000000000000000000000000000000000081526001600160a01b0388169063f04f270790610c55908990899088908a90600401615c85565b600060405180830381600087803b158015610c6f57600080fd5b505af1158015610c83573d6000803e3d6000fd5b5050505060005b8651811015610df4576000878281518110610ca157fe5b602002602001015190506000848381518110610cb957fe5b602002602001015190506000826001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610cf19190615b63565b60206040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d419190615968565b9050610d528282101561020361054b565b60008282039050610d7b888681518110610d6857fe5b602002602001015182101561025a61054b565b610d858482611f11565b836001600160a01b03168c6001600160a01b03167f0d7d75e01ab95780d3cd1c8ec0dd6c2ce19e3a20427eec8bf53283b6fb8e95f08c8881518110610dc657fe5b602002602001015184604051610ddd929190615e4d565b60405180910390a350505050806001019050610c8a565b50505050610e00611822565b50505050565b610e0e611768565b610e16611829565b82610e2081611f33565b610e2c83518351611e12565b60005b8351811015610eca576000848281518110610e4657fe5b60200260200101519050610e7260006001600160a01b0316826001600160a01b0316141561013561054b565b838281518110610e7e57fe5b6020908102919091018101516000888152600a835260408082206001600160a01b0395861683529093529190912080546001600160a01b03191692909116919091179055600101610e2f565b506000610ed685611f64565b90506002816002811115610ee657fe5b1415610f3457610efc845160021461020c61054b565b610f2f8585600081518110610f0d57fe5b602002602001015186600181518110610f2257fe5b6020026020010151611f7e565b610f5c565b6001816002811115610f4257fe5b1415610f5257610f2f858561202a565b610f5c8585612082565b847ff5847d3f2197b16cdcd2098ec95d0905cd1abdaf415f07bb7cef2bba8ac5dec48585604051610f8e929190615bed565b60405180910390a25050610fa0611822565b505050565b610fad611768565b610fb5611829565b81610fbf81611f33565b6000610fca84611f64565b90506002816002811115610fda57fe5b141561102857610ff0835160021461020c61054b565b611023848460008151811061100157fe5b60200260200101518560018151811061101657fe5b60200260200101516120d7565b611050565b600181600281111561103657fe5b1415611046576110238484612145565b61105084846121ff565b60005b83518110156110b657600a6000868152602001908152602001600020600085838151811061107d57fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002080546001600160a01b0319169055600101611053565b50837f7dcdc6d02ef40c7c1a7046a011b058bd7f988fa14e20a66344f9d4e60657d610846040516110e79190615bda565b60405180910390a25050610559611822565b60007f00000000000000000000000000000000000000000000000000000000000000008260405160200161112e929190615ac2565b604051602081830303815290604052805190602001209050919050565b610e00600185858561115c86612262565b61226e565b6001600160a01b031660009081526002602052604090205490565b6060611186611768565b61118e611829565b835161119981611b0f565b6111a8834211156101fc61054b565b6111b486518551611e12565b6111c08787878b6123f4565b91506000805b87518110156112925760008882815181106111dd57fe5b6020026020010151905060008583815181106111f557fe5b6020026020010151905061122188848151811061120e57fe5b60200260200101518213156101fb61054b565b600081131561126157885160208a015182916112409185918491611c5a565b61124983611938565b1561125b576112588582611945565b94505b50611288565b600081121561128857600081600003905061128683828c604001518d60600151611d38565b505b50506001016111c6565b5061129c816119de565b50506112a6611822565b9695505050505050565b60035461010090046001600160a01b031690565b60006112ce610526565b905090565b600080600080856112e381612683565b6000806112ef89611f64565b905060028160028111156112ff57fe5b14156113165761130f89896126a1565b9150611341565b600181600281111561132457fe5b14156113345761130f898961271b565b61133e8989612789565b91505b61134a826127a1565b9650611355826127b4565b9550611360826127ca565b6000998a52600a60209081526040808c206001600160a01b039b8c168d5290915290992054969995989796909616955050505050565b61139e611829565b610e00600085858561115c86612262565b7f000000000000000000000000000000000000000000000000000000000000000090565b6113db611768565b6113e3611829565b6113eb614d31565b60005b82518110156114e55782818151811061140357fe5b6020026020010151915060008260200151905061141f81612683565b604083015161143961143183836127d0565b61020961054b565b6000828152600a602090815260408083206001600160a01b03858116855292529091205461146c911633146101f661054b565b835160608501516000806114828487878661282c565b91509150846001600160a01b0316336001600160a01b0316877f6edcaf6241105b4c94c2efdbf3a6b12458eb3d07be3a0e81d24b13c44045fe7a85856040516114cc929190615e4d565b60405180910390a45050505050508060010190506113ee565b505061057e611822565b60006112ce61289b565b6000808261150681612683565b61150f84612938565b61151885611f64565b925092505b50915091565b60603330146115f6576000306001600160a01b0316600036604051611549929190615ada565b6000604051808303816000865af19150503d8060008114611586576040519150601f19603f3d011682016040523d82523d6000602084013e61158b565b606091505b50509050806000811461159a57fe5b60046000803e6000516001600160e01b0319167ffa61cc120000000000000000000000000000000000000000000000000000000081146115de573d6000803e3d6000fd5b50602060005260043d0380600460203e602081016000f35b6060611604858585896123f4565b9050602081510263fa61cc126020830352600482036024820181fd5b60608060008361162f81612683565b606061163a8661293e565b9095509050611648816129a0565b95979096509350505050565b61165c611768565b611664611829565b8261166e81611b0f565b6001600160a01b0384811660008181526004602090815260408083209488168084529490915290819020805460ff1916861515179055519091907f46961fdb4502b646d5095fba7600486a8ac05041d55cdf0f16ed677180b5cad8906116d5908690615d1b565b60405180910390a350610fa0611822565b60006116f28383612a4f565b90505b92915050565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b61177a6002600054141561019061054b565b6002600055565b60006117986000356001600160e01b0319166110f9565b905061057e6117a78233612a7d565b61019161054b565b6040516001600160a01b038216907f94b979b6831a51293e2641426f97747feed46f17779fed9cd18d1ecefcfe92ef90600090a2600380546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b6001600055565b61183c611834611aaa565b61019261054b565b565b600069ffffffffffffffffffff8216605084600281111561185b57fe5b901b17606085901b6bffffffffffffffffffffffff19161790505b9392505050565b600080600080600080600088606001519050336001600160a01b0316816001600160a01b0316146118cf57876118ba576118b5611781565b600197505b6118cf6118c78233612a4f565b6101f761054b565b885160208a015160408b01516080909b0151919b909a9992985090965090945092505050565b61190a8361190286611b41565b836000612b20565b50610e008482846000611d38565b61192b8261192586611b41565b83612b76565b610e008482856000611c5a565b6001600160a01b03161590565b60008282016116f2848210158361054b565b6119648385836000612b20565b50610e00828583612b76565b8015610e005761198b6001600160a01b038516848484612ba6565b826001600160a01b0316846001600160a01b03167f540a1a3f28340caec336c81d8d7b3df139ee5cdc1839a4f283d7ebb7eaae2d5c84846040516119d0929190615bc1565b60405180910390a350505050565b6119ed8134101561020461054b565b348190038015610559576105593382612bc7565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205490565b8015611a4c57611a47611a3d611ac7565b421061019361054b565b611a61565b611a61611a57611aeb565b42106101a961054b565b6003805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611a9f908390615d1b565b60405180910390a150565b6000611ab4611aeb565b4211806112ce57505060035460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b336001600160a01b0382161461057e57611b27611781565b611b318133612a4f565b61057e5761057e816101f7612c41565b6000611b4c82611938565b611b5e57611b5982610548565b6116f5565b6116f5610526565b600080600080611b798560800151612938565b90506000611b8a8660800151611f64565b90506002816002811115611b9a57fe5b1415611bb157611baa8683612c75565b9450611bdc565b6001816002811115611bbf57fe5b1415611bcf57611baa8683612d25565b611bd98683612db8565b94505b611bef8660000151876060015187612ff7565b809450819550505085604001516001600160a01b031686602001516001600160a01b031687608001517f2170c741c41531aec20e7c107c24eecfdd15e69c9bb0a8dd37b1840b9e0b207b8787604051611c49929190615e4d565b60405180910390a450509193909250565b82611c6457610e00565b611c6d84611938565b15611cee57611c7f811561020261054b565b611c8e8347101561020461054b565b611c96610526565b6001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015611cd057600080fd5b505af1158015611ce4573d6000803e3d6000fd5b5050505050610e00565b6000611cf985610548565b90508115611d16576000611d108483876001612b20565b90940393505b8315611d3157611d316001600160a01b038216843087612ba6565b5050505050565b82611d4257610e00565b611d4b84611938565b15611ddb57611d5d811561020261054b565b611d65610526565b6001600160a01b0316632e1a7d4d846040518263ffffffff1660e01b8152600401611d909190615d3e565b600060405180830381600087803b158015611daa57600080fd5b505af1158015611dbe573d6000803e3d6000fd5b50611dd6925050506001600160a01b03831684612bc7565b610e00565b6000611de685610548565b90508115611dfe57611df9838286612b76565b611d31565b611d316001600160a01b0382168486611ea6565b610559818314606761054b565b600080611e2a6113af565b6001600160a01b031663d877845c6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6257600080fd5b505afa158015611e76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9a9190615968565b90506118768382613025565b610fa08363a9059cbb60e01b8484604051602401611ec5929190615bc1565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152613072565b801561055957610559611f226113af565b6001600160a01b0384169083611ea6565b611f3c81612683565b61057e611f4882612938565b6001600160a01b0316336001600160a01b0316146101f561054b565b600061ffff605083901c166116f5600382106101f461054b565b611f9f816001600160a01b0316836001600160a01b0316141561020a61054b565b611fbe816001600160a01b0316836001600160a01b031610606661054b565b60008381526009602052604090208054611ffb906001600160a01b0316158015611ff3575060018201546001600160a01b0316155b61020b61054b565b80546001600160a01b039384166001600160a01b03199182161782556001909101805492909316911617905550565b6000828152600860205260408120905b8251811015610e0057600061206b84838151811061205457fe5b60200260200101518461311290919063ffffffff16565b90506120798161020a61054b565b5060010161203a565b6000828152600160205260408120905b8251811015610e005760006120c08483815181106120ac57fe5b602090810291909101015184906000613175565b90506120ce8161020a61054b565b50600101612092565b60008060006120e7868686613222565b9250925092506121116120f9846132e9565b80156121095750612109836132e9565b61020d61054b565b600095865260096020526040862080546001600160a01b031990811682556001909101805490911690559490945550505050565b6000828152600860205260408120905b8251811015610e0057600083828151811061216c57fe5b602002602001015190506121b8612109600760008881526020019081526020016000206000846001600160a01b03166001600160a01b03168152602001908152602001600020546132e9565b60008581526007602090815260408083206001600160a01b038516845290915281208190556121e7848361330b565b90506121f58161020961054b565b5050600101612155565b6000828152600160205260408120905b8251811015610e0057600083828151811061222657fe5b60200260200101519050600061223c8483613412565b905061224a612109826132e9565b6122548483613421565b50505080600101905061220f565b61226a614d5a565b5090565b612276611768565b8361228081612683565b8361228a81611b0f565b61229e836000015151846020015151611e12565b60606122ad84600001516134c3565b905060606122bb8883613552565b905060608060606122d08c8c8c8c8c896135e3565b92509250925060006122e18c611f64565b905060028160028111156122f157fe5b1415612359576123548c8760008151811061230857fe5b60200260200101518660008151811061231d57fe5b60200260200101518960018151811061233257fe5b60200260200101518860018151811061234757fe5b60200260200101516137a8565b612382565b600181600281111561236757fe5b1415612378576123548c87866137e7565b6123828c85613854565b6000808e600181111561239157fe5b1490508b6001600160a01b03168d7fe5ce249087ce04f05a957192435400fd97868dba0e6a4b4c049abf8af80dae78896123cb888661389d565b876040516123db93929190615c4c565b60405180910390a3505050505050505050611d31611822565b6060835167ffffffffffffffff8111801561240e57600080fd5b50604051908082528060200260200182016040528015612438578160200160208202803683370190505b509050612443614d84565b61244b614ce1565b60008060005b89518110156126765789818151811061246657fe5b6020026020010151945060008951866020015110801561248a575089518660400151105b905061249781606461054b565b60006124b98b8860200151815181106124ac57fe5b6020026020010151611b41565b905060006124d08c8960400151815181106124ac57fe5b90506124f3816001600160a01b0316836001600160a01b031614156101fd61054b565b60608801516125435761250b600085116101fe61054b565b60006125188b8484613945565b6001600160a01b0316876001600160a01b031614905061253a816101ff61054b565b50606088018590525b87516080880152868a600181111561255757fe5b9081600181111561256457fe5b9052506001600160a01b0380831660208901528181166040808a01919091526060808b0151908a015260808a01516101008a01528c51821660c08a01528c01511660e08801526000806125b689611b66565b919850925090506125c88c8585613967565b97506125fc6125d683613981565b8c8c60200151815181106125e657fe5b60200260200101516139b190919063ffffffff16565b8b8b602001518151811061260c57fe5b60200260200101818152505061264a61262482613981565b8c8c604001518151811061263457fe5b60200260200101516139e590919063ffffffff16565b8b8b604001518151811061265a57fe5b6020026020010181815250505050505050806001019050612451565b5050505050949350505050565b60008181526005602052604090205461057e9060ff166101f461054b565b60008060008060006126b287613a19565b945094509450945050836001600160a01b0316866001600160a01b031614156126e157829450505050506116f5565b816001600160a01b0316866001600160a01b031614156127065793506116f592505050565b6127116102096116fb565b5050505092915050565b60008281526007602090815260408083206001600160a01b03851684529091528120548161274882613a8f565b80612766575060008581526008602052604090206127669085613aa1565b9050806127815761277685612683565b6127816102096116fb565b509392505050565b60008281526001602052604081206109e18184613412565b6dffffffffffffffffffffffffffff1690565b60701c6dffffffffffffffffffffffffffff1690565b60e01c90565b6000806127dc84611f64565b905060028160028111156127ec57fe5b1415612804576127fc8484613ac2565b9150506116f5565b600181600281111561281257fe5b1415612822576127fc8484613b13565b6127fc8484613b2b565b600080600061283a86611f64565b9050600087600281111561284a57fe5b14156128665761285c86828787613b43565b9250925050612892565b600187600281111561287457fe5b14156128865761285c86828787613bbe565b61285c86828787613c3a565b94509492505050565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612908613c9d565b3060405160200161291d959493929190615df0565b60405160208183030381529060405280519060200120905090565b60601c90565b606080600061294c84611f64565b9050600281600281111561295c57fe5b14156129755761296b84613ca1565b925092505061299b565b600181600281111561298357fe5b14156129925761296b84613dd6565b61296b84613efd565b915091565b60606000825167ffffffffffffffff811180156129bc57600080fd5b506040519080825280602002602001820160405280156129e6578160200160208202803683370190505b5091506000905060005b825181101561151d576000848281518110612a0757fe5b60200260200101519050612a1a81613ff9565b848381518110612a2657fe5b602002602001018181525050612a4483612a3f836127ca565b614014565b9250506001016129f0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b6003546040517f9be2a88400000000000000000000000000000000000000000000000000000000815260009161010090046001600160a01b031690639be2a88490612ad090869086903090600401615d47565b60206040518083038186803b158015612ae857600080fd5b505afa158015612afc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f29190615478565b600080612b2d8686611a01565b9050612b468380612b3e5750848210155b61020161054b565b612b50818561402b565b9150818103612b6c878783612b6487613981565b60000361403a565b5050949350505050565b6000612b828484611a01565b90506000612b908284611945565b9050611d31858583612ba187613981565b61403a565b610e00846323b872dd60e01b858585604051602401611ec593929190615b77565b612bd6814710156101a361054b565b6000826001600160a01b031682604051612bef90610548565b60006040518083038185875af1925050503d8060008114612c2c576040519150601f19603f3d011682016040523d82523d6000602084013e612c31565b606091505b50509050610fa0816101a461054b565b6001600160a01b0382166000908152600260205260409020805460018101909155610fa0612c6f8483614095565b8361054b565b600080600080612c92866080015187602001518860400151613222565b92509250925060008087604001516001600160a01b031688602001516001600160a01b03161015612cc7575083905082612ccd565b50829050835b612cd9888884846141bb565b60408b015160208c01519199509294509092506001600160a01b03918216911610612d0d57612d0881836142d1565b612d17565b612d1782826142d1565b909255509295945050505050565b600080612d3a8460800151856020015161271b565b90506000612d508560800151866040015161271b565b9050612d5e858584846141bb565b6080880180516000908152600760208181526040808420828e01516001600160a01b03908116865290835281852098909855935183529081528282209a830151909516815298909352919096209590955550929392505050565b60808201516000908152600160209081526040822090840151829182918290612de290839061430c565b90506000612dfd88604001518461430c90919063ffffffff16565b9050811580612e0a575080155b15612e2757612e1c8860800151612683565b612e276102096116fb565b60001991820191016000612e3a8461432b565b905060608167ffffffffffffffff81118015612e5557600080fd5b50604051908082528060200260200182016040528015612e7f578160200160208202803683370190505b50600060a08c018190529091505b82811015612eff576000612ea1878361432f565b9050612eac81613ff9565b838381518110612eb857fe5b602002602001018181525050612ed58c60a00151612a3f836127ca565b60a08d015281861415612eea57809850612ef6565b84821415612ef6578097505b50600101612e8d565b506040517f01ec954a0000000000000000000000000000000000000000000000000000000081526001600160a01b038a16906301ec954a90612f4b908d90859089908990600401615e5b565b602060405180830381600087803b158015612f6557600080fd5b505af1158015612f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9d9190615968565b9750600080612fb58c600001518d606001518c612ff7565b9092509050612fc48983614345565b9850612fd08882614376565b9750612fdd87878b61438c565b612fe887868a61438c565b50505050505050505092915050565b6000808085600181111561300757fe5b141561301757508290508161301d565b50819050825b935093915050565b600082820261304984158061304257508385838161303f57fe5b04145b600361054b565b806130585760009150506116f5565b670de0b6b3a76400006000198201046001019150506116f5565b60006060836001600160a01b03168360405161308e9190615aea565b6000604051808303816000865af19150503d80600081146130cb576040519150601f19603f3d011682016040523d82523d6000602084013e6130d0565b606091505b509150915060008214156130e8573d6000803e3d6000fd5b610e0081516000148061310a57508180602001905181019061310a9190615478565b6101a261054b565b600061311e8383613aa1565b61316d57508154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b038616908117909155855490825282860190935260409020919091556116f5565b5060006116f5565b6001600160a01b03821660009081526002840160205260408120548061320257505082546040805180820182526001600160a01b03858116808352602080840187815260008781526001808c018452878220965187546001600160a01b03191696169590951786559051948401949094559482018089559083526002880190945291902091909155611876565b600019016000908152600180860160205260408220018390559050611876565b600080600080600061323487876143a4565b91509150600061324483836143d5565b60008a81526009602090815260408083208484526002019091528120805460018201549197509293509061327783613a8f565b80613286575061328682613a8f565b806132a757506132968c87613ac2565b80156132a757506132a78c86613ac2565b9050806132c2576132b78c612683565b6132c26102096116fb565b6132cc8383614408565b98506132d8838361442d565b975050505050505093509350939050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6001600160a01b03811660009081526001830160205260408120548015613408578354600019808301919081019060009087908390811061334857fe5b60009182526020909120015487546001600160a01b039091169150819088908590811061337157fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600189810190925260409020908401905586548790806133ba57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03881682526001898101909152604082209190915594506116f59350505050565b60009150506116f5565b60006116f28383610209614444565b6001600160a01b0381166000908152600283016020526040812054801561340857835460001990810160008181526001878101602090815260408084209587018452808420865481546001600160a01b03199081166001600160a01b0392831617835588860180549387019390935588548216875260028d018086528488209a909a5588541690975584905593895593871682529390925281205590506116f5565b606080825167ffffffffffffffff811180156134de57600080fd5b50604051908082528060200260200182016040528015613508578160200160208202803683370190505b50905060005b83518110156107ff576135268482815181106124ac57fe5b82828151811061353257fe5b6001600160a01b039092166020928302919091019091015260010161350e565b60608060606135608561293e565b9150915061357082518551611e12565b613580600083511161020f61054b565b60005b82518110156135da576135d285828151811061359b57fe5b60200260200101516001600160a01b03168483815181106135b857fe5b60200260200101516001600160a01b03161461020861054b565b600101613583565b50949350505050565b60608060608060006135f4866129a0565b9150915060006136038b612938565b905060008c600181111561361357fe5b146136b657806001600160a01b03166374f3b0098c8c8c8787613634614481565b8f604001516040518863ffffffff1660e01b815260040161365b9796959493929190615d66565b600060405180830381600087803b15801561367557600080fd5b505af1158015613689573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526136b19190810190615405565b61374f565b806001600160a01b031663d5c096c48c8c8c87876136d2614481565b8f604001516040518863ffffffff1660e01b81526004016136f99796959493929190615d66565b600060405180830381600087803b15801561371357600080fd5b505af1158015613727573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261374f9190810190615405565b80955081965050506137658751865186516144fb565b60008c600181111561377357fe5b1461378a576137858989898888614513565b613797565b6137978a8989888861465a565b955050505096509650969350505050565b60006137b485846143d5565b600087815260096020908152604080832084845260020190915290209091506137dd85846142d1565b9055505050505050565b60005b8251811015610e00578181815181106137ff57fe5b602002602001015160076000868152602001908152602001600020600085848151811061382857fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020556001016137ea565b6000828152600160205260408120905b8251811015610e00576138958184838151811061387d57fe5b60200260200101518461438c9092919063ffffffff16565b600101613864565b6060825167ffffffffffffffff811180156138b757600080fd5b506040519080825280602002602001820160405280156138e1578160200160208202803683370190505b50905060005b83518110156107ff57826139115783818151811061390157fe5b6020026020010151600003613926565b83818151811061391d57fe5b60200260200101515b82828151811061393257fe5b60209081029190910101526001016138e7565b60008084600181111561395457fe5b1461395f57816109e1565b509092915050565b60008084600181111561397657fe5b146107ff57826109e1565b600061226a7f800000000000000000000000000000000000000000000000000000000000000083106101a561054b565b60008282016116f28284128015906139c95750848212155b806139de57506000841280156139de57508482125b600061054b565b60008183036116f28284128015906139fd5750848213155b80613a125750600084128015613a1257508482135b600161054b565b6000818152600960205260408120805460018201546001600160a01b0391821692849290911690829081613a4d86856143d5565b6000818152600284016020526040902080546001820154919950919250613a748282614408565b9650613a80828261442d565b94505050505091939590929450565b6000613a9a826132e9565b1592915050565b6001600160a01b031660009081526001919091016020526040902054151590565b600082815260096020526040812080546001600160a01b0384811691161480613afa575060018101546001600160a01b038481169116145b80156109e1575050506001600160a01b03161515919050565b60008281526008602052604081206109e18184613aa1565b60008281526001602052604081206109e181846147d0565b6000806002856002811115613b5457fe5b1415613b6a57613b658685856147f1565b613b94565b6001856002811115613b7857fe5b1415613b8957613b658685856147ff565b613b9486858561480d565b8215613bae57613bae6001600160a01b0385163385611ea6565b5050600081900394909350915050565b6000806002856002811115613bcf57fe5b1415613be557613be086858561481b565b613c0f565b6001856002811115613bf357fe5b1415613c0457613be0868585614829565b613c0f868585614837565b8215613c2a57613c2a6001600160a01b038516333086612ba6565b5090946000869003945092505050565b6000806002856002811115613c4b57fe5b1415613c6357613c5c868585614845565b9050613c90565b6001856002811115613c7157fe5b1415613c8257613c5c868585614855565b613c8d868585614865565b90505b6000915094509492505050565b4690565b606080600080600080613cb387613a19565b92975090955093509150506001600160a01b0384161580613cdb57506001600160a01b038216155b15613d04575050604080516000808252602082019081528183019092529450925061299b915050565b60408051600280825260608201835290916020830190803683370190505095508386600081518110613d3257fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508186600181518110613d6057fe5b6001600160a01b03929092166020928302919091018201526040805160028082526060820183529092909190830190803683370190505094508285600081518110613da757fe5b6020026020010181815250508085600181518110613dc157fe5b60200260200101818152505050505050915091565b60008181526008602052604090206060908190613df28161432b565b67ffffffffffffffff81118015613e0857600080fd5b50604051908082528060200260200182016040528015613e32578160200160208202803683370190505b509250825167ffffffffffffffff81118015613e4d57600080fd5b50604051908082528060200260200182016040528015613e77578160200160208202803683370190505b50915060005b8351811015613ef6576000613e928383614875565b905080858381518110613ea157fe5b6001600160a01b03928316602091820292909201810191909152600088815260078252604080822093851682529290915220548451859084908110613ee257fe5b602090810291909101015250600101613e7d565b5050915091565b60008181526001602052604090206060908190613f198161432b565b67ffffffffffffffff81118015613f2f57600080fd5b50604051908082528060200260200182016040528015613f59578160200160208202803683370190505b509250825167ffffffffffffffff81118015613f7457600080fd5b50604051908082528060200260200182016040528015613f9e578160200160208202803683370190505b50915060005b8351811015613ef657613fb782826148a2565b858381518110613fc357fe5b60200260200101858481518110613fd657fe5b60209081029190910101919091526001600160a01b039091169052600101613fa4565b6000614004826127b4565b61400d836127a1565b0192915050565b60008183101561402457816116f2565b5090919050565b600081831061402457816116f2565b6001600160a01b038085166000818152600b602090815260408083209488168084529490915290819020859055517f18e1ea4139e68413d7d08aa752e71568e36b2c5bf940893314c2c5b01eaa0c42906119d0908590615d3e565b6000806140a06148c6565b9050428110156140b45760009150506116f5565b60006140be6148d2565b9050806140d0576000925050506116f5565b6000816140db6149e3565b80516020918201206040516140f7939233918a91899101615dc4565b604051602081830303815290604052805190602001209050600061411a82614a32565b90506000806000614129614a4e565b9250925092506000600185858585604051600081526020016040526040516141549493929190615e1c565b6020604051602081039080840390855afa158015614176573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906141ac57508a6001600160a01b0316816001600160a01b0316145b9b9a5050505050505050505050565b6000806000806141ca86613ff9565b905060006141d786613ff9565b90506141ee6141e5886127ca565b612a3f886127ca565b60a08a01526040517f9d2c110c0000000000000000000000000000000000000000000000000000000081526001600160a01b03891690639d2c110c9061423c908c9086908690600401615e94565b602060405180830381600087803b15801561425657600080fd5b505af115801561426a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061428e9190615968565b92506000806142a68b600001518c6060015187612ff7565b90925090506142b58983614345565b96506142c18882614376565b9550505050509450945094915050565b6000806142e96142e0856127ca565b612a3f856127ca565b90506109e16142f7856127a1565b614300856127a1565b8363ffffffff16614a75565b6001600160a01b03166000908152600291909101602052604090205490565b5490565b6000908152600191820160205260409020015490565b60008061435b83614355866127a1565b90611945565b90506000614368856127b4565b9050436112a6838383614a83565b60008061435b83614386866127a1565b90614abc565b60009182526001928301602052604090912090910155565b600080826001600160a01b0316846001600160a01b0316106143c75782846143ca565b83835b915091509250929050565b600082826040516020016143ea929190615b06565b60405160208183030381529060405280519060200120905092915050565b60006116f2614416846127a1565b61441f846127a1565b614428866127ca565b614a83565b60006116f261443b846127b4565b61441f846127b4565b6001600160a01b038216600090815260028401602052604081205461446b8115158461054b565b614478856001830361432f565b95945050505050565b600061448b6113af565b6001600160a01b03166355c676286040518163ffffffff1660e01b815260040160206040518083038186803b1580156144c357600080fd5b505afa1580156144d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ce9190615968565b610fa0828414801561450c57508183145b606761054b565b6060835167ffffffffffffffff8111801561452d57600080fd5b50604051908082528060200260200182016040528015614557578160200160208202803683370190505b50905060005b85515181101561465057600084828151811061457557fe5b602002602001015190506145a58760200151838151811061459257fe5b60200260200101518210156101f961054b565b6000876000015183815181106145b757fe5b602002602001015190506145d181838b8b60600151611d38565b60008584815181106145df57fe5b602002602001015190506145fb6145f583611b41565b82611f11565b61462a6146088483611945565b89868151811061461457fe5b602002602001015161437690919063ffffffff16565b85858151811061463657fe5b60200260200101818152505050505080600101905061455d565b5095945050505050565b60606000845167ffffffffffffffff8111801561467657600080fd5b506040519080825280602002602001820160405280156146a0578160200160208202803683370190505b50915060005b8651518110156147c65760008582815181106146be57fe5b602002602001015190506146ee886020015183815181106146db57fe5b60200260200101518211156101fa61054b565b60008860000151838151811061470057fe5b6020026020010151905061471a81838c8c60600151611c5a565b61472381611938565b15614735576147328483611945565b93505b600086848151811061474357fe5b602002602001015190506147596145f583611b41565b80831015614778576147738382038a868151811061461457fe5b6147a0565b6147a08184038a868151811061478a57fe5b602002602001015161434590919063ffffffff16565b8685815181106147ac57fe5b6020026020010181815250505050508060010190506146a6565b50614650816119de565b6001600160a01b031660009081526002919091016020526040902054151590565b610e008383614ad284614b0d565b610e008383614ad284614bb8565b610e008383614ad284614c13565b610e008383614c6284614b0d565b610e008383614c6284614bb8565b610e008383614c6284614c13565b60006109e18484614c8385614b0d565b60006109e18484614c8385614bb8565b60006109e18484614c8385614c13565b600082600001828154811061488657fe5b6000918252602090912001546001600160a01b03169392505050565b600090815260019182016020526040902080549101546001600160a01b0390911691565b60006112ce6000614c9d565b6000803560e01c8063b95cac28811461491a57638bdb39138114614942576352bbbe29811461496a5763945bcec981146149925763fa6e671d81146149ba57600092506149de565b7f3f7b71252bd19113ff48c19c6e004a9bcfcca320a0d74d58e85877cbd7dcae5892506149de565b7f8bbc57f66ea936902f50a71ce12b92c43f3c5340bb40c27c4e90ab84eeae335392506149de565b7fe192dcbc143b1e244ad73b813fd3c097b832ad260a157340b4e5e5beda067abe92506149de565b7f9bfc43a4d98313c6766986ffd7c916c7481566d9f224c6819af0a53388aced3a92506149de565b7fa3f865aa351e51cfeb40f5178d1564bb629fe9030b83caf6361d1baaf5b90b5a92505b505090565b60606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505082519293505050608010156105485760803603815290565b6000614a3c61289b565b8260405160200161112e929190615b2d565b6000806000614a5d6020614c9d565b9250614a696040614c9d565b91506108416060614c9d565b60e01b60709190911b010190565b6000838301614ab1858210801590614aa957506e01000000000000000000000000000082105b61020e61054b565b614478858585614a75565b6000614acc83831115600161054b565b50900390565b600080614ae283614386866127a1565b90506000614af384614355876127b4565b90506000614b00866127ca565b90506112a6838383614a83565b6000806000806000614b1e89613a19565b9450509350935093506000836001600160a01b0316896001600160a01b03161415614b69576000614b5384898b63ffffffff16565b9050614b5f8185614ca7565b9093509050614b8b565b6000614b7983898b63ffffffff16565b9050614b858184614ca7565b90925090505b614b9583836142d1565b8555614ba18383614cc3565b600190950194909455509192505050949350505050565b600080614bc5868661271b565b90506000614bd782858763ffffffff16565b60008881526007602090815260408083206001600160a01b038b16845290915290208190559050614c088183614ca7565b979650505050505050565b600084815260016020526040812081614c2c8287613412565b90506000614c3e82868863ffffffff16565b9050614c4b838883613175565b50614c568183614ca7565b98975050505050505050565b600080614c7283614355866127a1565b90506000614af384614386876127b4565b600080614c8f846127a1565b905043614478828583614a83565b3601607f19013590565b6000614cb2826127b4565b614cbb846127b4565b039392505050565b60006116f2614cd1846127b4565b614cda846127b4565b6000614a75565b60408051610120810190915280600081526000602082018190526040820181905260608083018290526080830182905260a0830182905260c0830182905260e08301919091526101009091015290565b604080516080810190915280600081526000602082018190526040820181905260609091015290565b60405180608001604052806060815260200160608152602001606081526020016000151581525090565b6040518060a0016040528060008019168152602001600081526020016000815260200160008152602001606081525090565b80356116f581615f5a565b600082601f830112614dd1578081fd5b8135614de4614ddf82615f04565b615edd565b818152915060208083019084810181840286018201871015614e0557600080fd5b60005b84811015614e2d578135614e1b81615f5a565b84529282019290820190600101614e08565b505050505092915050565b600082601f830112614e48578081fd5b8135614e56614ddf82615f04565b818152915060208083019084810160005b84811015614e2d578135870160a080601f19838c03011215614e8857600080fd5b614e9181615edd565b85830135815260408084013587830152606080850135828401526080915081850135818401525082840135925067ffffffffffffffff831115614ed357600080fd5b614ee18c8885870101614fc0565b90820152865250509282019290820190600101614e67565b600082601f830112614f09578081fd5b8135614f17614ddf82615f04565b818152915060208083019084810181840286018201871015614f3857600080fd5b60005b84811015614e2d57813584529282019290820190600101614f3b565b600082601f830112614f67578081fd5b8151614f75614ddf82615f04565b818152915060208083019084810181840286018201871015614f9657600080fd5b60005b84811015614e2d57815184529282019290820190600101614f99565b80356116f581615f6f565b600082601f830112614fd0578081fd5b813567ffffffffffffffff811115614fe6578182fd5b614ff9601f8201601f1916602001615edd565b915080825283602082850101111561501057600080fd5b8060208401602084013760009082016020015292915050565b80356116f581615f7d565b8035600281106116f557600080fd5b8035600481106116f557600080fd5b600060808284031215615063578081fd5b61506d6080615edd565b9050813567ffffffffffffffff8082111561508757600080fd5b61509385838601614dc1565b835260208401359150808211156150a957600080fd5b6150b585838601614ef9565b602084015260408401359150808211156150ce57600080fd5b506150db84828501614fc0565b6040830152506150ee8360608401614fb5565b606082015292915050565b60006080828403121561510a578081fd5b6151146080615edd565b9050813561512181615f5a565b8152602082013561513181615f6f565b6020820152604082013561514481615f5a565b604082015260608201356150ee81615f6f565b600060208284031215615168578081fd5b81356116f281615f5a565b60008060408385031215615185578081fd5b823561519081615f5a565b915060208301356151a081615f5a565b809150509250929050565b6000806000606084860312156151bf578081fd5b83356151ca81615f5a565b925060208401356151da81615f5a565b915060408401356151ea81615f6f565b809150509250925092565b60008060408385031215615207578182fd5b823561521281615f5a565b9150602083013567ffffffffffffffff81111561522d578182fd5b61523985828601614dc1565b9150509250929050565b60006020808385031215615255578182fd5b823567ffffffffffffffff81111561526b578283fd5b8301601f8101851361527b578283fd5b8035615289614ddf82615f04565b818152838101908385016080808502860187018a10156152a7578788fd5b8795505b848610156153105780828b0312156152c1578788fd5b6152ca81615edd565b6152d48b84615029565b8152878301358882015260406152ec8c828601614db6565b908201526060838101359082015284526001959095019492860192908101906152ab565b509098975050505050505050565b60006020808385031215615330578182fd5b823567ffffffffffffffff811115615346578283fd5b8301601f81018513615356578283fd5b8035615364614ddf82615f04565b8181528381019083850160a0808502860187018a1015615382578788fd5b8795505b848610156153105780828b03121561539c578788fd5b6153a581615edd565b6153af8b84615043565b81526153bd8b898501614db6565b818901526040838101359082015260606153d98c828601614db6565b9082015260806153eb8c858301614db6565b908201528452600195909501949286019290810190615386565b60008060408385031215615417578182fd5b825167ffffffffffffffff8082111561542e578384fd5b61543a86838701614f57565b9350602085015191508082111561544f578283fd5b5061523985828601614f57565b60006020828403121561546d578081fd5b81356116f281615f6f565b600060208284031215615489578081fd5b81516116f281615f6f565b6000602082840312156154a5578081fd5b5035919050565b600080600080608085870312156154c1578182fd5b8435935060208501356154d381615f5a565b925060408501356154e381615f5a565b9150606085013567ffffffffffffffff8111156154fe578182fd5b61550a87828801615052565b91505092959194509250565b60008060408385031215615528578182fd5b82359150602083013567ffffffffffffffff81111561522d578182fd5b600080600060608486031215615559578081fd5b8335925060208085013567ffffffffffffffff80821115615578578384fd5b61558488838901614dc1565b94506040870135915080821115615599578384fd5b508501601f810187136155aa578283fd5b80356155b8614ddf82615f04565b81815283810190838501858402850186018b10156155d4578687fd5b8694505b838510156155ff5780356155eb81615f5a565b8352600194909401939185019185016155d8565b5080955050505050509250925092565b60008060408385031215615621578182fd5b8235915060208301356151a081615f5a565b600060208284031215615644578081fd5b81356001600160e01b0319811681146116f2578182fd5b60008060008060808587031215615670578182fd5b843561567b81615f5a565b9350602085013567ffffffffffffffff80821115615697578384fd5b6156a388838901614dc1565b945060408701359150808211156156b8578384fd5b6156c488838901614ef9565b935060608701359150808211156156d9578283fd5b5061550a87828801614fc0565b6000602082840312156156f7578081fd5b81356116f281615f7d565b60008060008060e08587031215615717578182fd5b6157218686615034565b9350602085013567ffffffffffffffff8082111561573d578384fd5b61574988838901614e38565b9450604087013591508082111561575e578384fd5b5061576b87828801614dc1565b92505061577b86606087016150f9565b905092959194509250565b600080600080600080610120878903121561579f578384fd5b6157a98888615034565b955060208088013567ffffffffffffffff808211156157c6578687fd5b6157d28b838c01614e38565b975060408a01359150808211156157e7578687fd5b6157f38b838c01614dc1565b96506158028b60608c016150f9565b955060e08a0135915080821115615817578485fd5b508801601f81018a13615828578384fd5b8035615836614ddf82615f04565b81815283810190838501858402850186018e1015615852578788fd5b8794505b83851015615874578035835260019490940193918501918501615856565b50809650505050505061010087013590509295509295509295565b60008060008060e085870312156158a4578182fd5b843567ffffffffffffffff808211156158bb578384fd5b9086019060c082890312156158ce578384fd5b6158d860c0615edd565b823581526158e98960208501615034565b602082015260408301356158fc81615f5a565b604082015261590e8960608501614db6565b60608201526080830135608082015260a08301358281111561592e578586fd5b61593a8a828601614fc0565b60a08301525080965050505061595386602087016150f9565b939693955050505060a08201359160c0013590565b600060208284031215615979578081fd5b5051919050565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156159c55781516001600160a01b0316875295820195908201906001016159a0565b509495945050505050565b6000815180845260208085019450808401835b838110156159c5578151875295820195908201906001016159e3565b60008151808452615a17816020860160208601615f24565b601f01601f19169290920160200192915050565b6000610120825160028110615a3c57fe5b808552506020830151615a526020860182615980565b506040830151615a656040860182615980565b50606083015160608501526080830151608085015260a083015160a085015260c0830151615a9660c0860182615980565b5060e0830151615aa960e0860182615980565b506101008084015182828701526112a6838701826159ff565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b60008251615afc818460208701615f24565b9190910192915050565b6bffffffffffffffffffffffff19606093841b811682529190921b16601482015260280190565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b038316815260408101615bb483615f50565b8260208301529392505050565b6001600160a01b03929092168252602082015260400190565b6000602082526116f2602083018461598d565b600060408252615c00604083018561598d565b828103602084810191909152845180835285820192820190845b81811015615c3f5784516001600160a01b031683529383019391830191600101615c1a565b5090979650505050505050565b600060608252615c5f606083018661598d565b8281036020840152615c7181866159d0565b905082810360408401526112a681856159d0565b600060808252615c98608083018761598d565b8281036020840152615caa81876159d0565b90508281036040840152615cbe81866159d0565b90508281036060840152614c0881856159ff565b600060608252615ce5606083018661598d565b8281036020840152615cf781866159d0565b915050826040830152949350505050565b6000602082526116f260208301846159d0565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b60008882526001600160a01b03808916602084015280881660408401525060e06060830152615d9860e08301876159d0565b8560808401528460a084015282810360c0840152615db681856159ff565b9a9950505050505050505050565b94855260208501939093526001600160a01b039190911660408401526060830152608082015260a00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b60208101615e4783615f50565b91905290565b918252602082015260400190565b600060808252615e6e6080830187615a2b565b8281036020840152615e8081876159d0565b604084019590955250506060015292915050565b600060608252615ea76060830186615a2b565b60208301949094525060400152919050565b938452602084019290925260408301526001600160a01b0316606082015260800190565b60405181810167ffffffffffffffff81118282101715615efc57600080fd5b604052919050565b600067ffffffffffffffff821115615f1a578081fd5b5060209081020190565b60005b83811015615f3f578181015183820152602001615f27565b83811115610e005750506000910152565b6003811061057e57fe5b6001600160a01b038116811461057e57600080fd5b801515811461057e57600080fd5b6003811061057e57600080fdfea2646970667358221220201e4f926e390fed8dd5318c58846af735c2bebc61b80693ae936a5fe76dcf1464736f6c6343000701003360c060405234801561001057600080fd5b50604051610be6380380610be683398101604081905261002f9161004d565b30608052600160005560601b6001600160601b03191660a05261007b565b60006020828403121561005e578081fd5b81516001600160a01b0381168114610074578182fd5b9392505050565b60805160a05160601c610b406100a66000398061041352806105495250806102a75250610b406000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063851c1bb311610076578063d877845c1161005b578063d877845c14610129578063e42abf3514610131578063fbfa77cf14610151576100a3565b8063851c1bb314610101578063aaabadc514610114576100a3565b806338e9922e146100a857806355c67628146100bd5780636b6b9f69146100db5780636daefab6146100ee575b600080fd5b6100bb6100b636600461099c565b610159565b005b6100c56101b8565b6040516100d29190610aa6565b60405180910390f35b6100bb6100e936600461099c565b6101be565b6100bb6100fc3660046107d1565b610211565b6100c561010f366004610924565b6102a3565b61011c6102f5565b6040516100d29190610a35565b6100c5610304565b61014461013f366004610852565b61030a565b6040516100d29190610a62565b61011c610411565b610161610435565b6101786706f05b59d3b2000082111561025861047e565b60018190556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906101ad908390610aa6565b60405180910390a150565b60015490565b6101c6610435565b6101dc662386f26fc1000082111561025961047e565b60028190556040517f5a0b7386237e7f07fa741efc64e59c9387d2cccafec760efed4d53387f20e19a906101ad908390610aa6565b610219610490565b610221610435565b61022b84836104a9565b60005b8481101561029357600086868381811061024457fe5b90506020020160208101906102599190610980565b9050600085858481811061026957fe5b6020029190910135915061028990506001600160a01b03831685836104b6565b505060010161022e565b5061029c61053e565b5050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016102d89291906109cc565b604051602081830303815290604052805190602001209050919050565b60006102ff610545565b905090565b60025490565b6060815167ffffffffffffffff8111801561032457600080fd5b5060405190808252806020026020018201604052801561034e578160200160208202803683370190505b50905060005b825181101561040b5782818151811061036957fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161039c9190610a35565b60206040518083038186803b1580156103b457600080fd5b505afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec91906109b4565b8282815181106103f857fe5b6020908102919091010152600101610354565b50919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006104646000357fffffffff00000000000000000000000000000000000000000000000000000000166102a3565b905061047b61047382336105d8565b61019161047e565b50565b8161048c5761048c8161066a565b5050565b6104a26002600054141561019061047e565b6002600055565b61048c818314606761047e565b6105398363a9059cbb60e01b84846040516024016104d5929190610a49565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526106d7565b505050565b6001600055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156105a057600080fd5b505afa1580156105b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ff9190610964565b60006105e2610545565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b815260040161061193929190610aaf565b60206040518083038186803b15801561062957600080fd5b505afa15801561063d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066191906108fd565b90505b92915050565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b60006060836001600160a01b0316836040516106f391906109fc565b6000604051808303816000865af19150503d8060008114610730576040519150601f19603f3d011682016040523d82523d6000602084013e610735565b606091505b5091509150600082141561074d573d6000803e3d6000fd5b61077781516000148061076f57508180602001905181019061076f91906108fd565b6101a261047e565b50505050565b60008083601f84011261078e578182fd5b50813567ffffffffffffffff8111156107a5578182fd5b60208301915083602080830285010111156107bf57600080fd5b9250929050565b803561066481610af5565b6000806000806000606086880312156107e8578081fd5b853567ffffffffffffffff808211156107ff578283fd5b61080b89838a0161077d565b90975095506020880135915080821115610823578283fd5b506108308882890161077d565b909450925050604086013561084481610af5565b809150509295509295909350565b60006020808385031215610864578182fd5b823567ffffffffffffffff8082111561087b578384fd5b818501915085601f83011261088e578384fd5b81358181111561089c578485fd5b83810291506108ac848301610ace565b8181528481019084860184860187018a10156108c6578788fd5b8795505b838610156108f0576108dc8a826107c6565b8352600195909501949186019186016108ca565b5098975050505050505050565b60006020828403121561090e578081fd5b8151801515811461091d578182fd5b9392505050565b600060208284031215610935578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461091d578182fd5b600060208284031215610975578081fd5b815161091d81610af5565b600060208284031215610991578081fd5b813561091d81610af5565b6000602082840312156109ad578081fd5b5035919050565b6000602082840312156109c5578081fd5b5051919050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b60008251815b81811015610a1c5760208186018101518583015201610a02565b81811115610a2a5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015610a9a57835183529284019291840191600101610a7e565b50909695505050505050565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b60405181810167ffffffffffffffff81118282101715610aed57600080fd5b604052919050565b6001600160a01b038116811461047b57600080fdfea2646970667358221220be72bdf8e7a3c38606c5f954fbe2d77798347aaa1cfb76fe77ec2f6c245d24bc64736f6c63430007010033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IAuthorizer", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "contract IWETH", + "name": "weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IAuthorizer", + "name": "newAuthorizer", + "type": "address" + } + ], + "name": "AuthorizerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ExternalBalanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IFlashLoanRecipient", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "delta", + "type": "int256" + } + ], + "name": "InternalBalanceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "liquidityProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "int256[]", + "name": "deltas", + "type": "int256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "protocolFeeAmounts", + "type": "uint256[]" + } + ], + "name": "PoolBalanceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "assetManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "cashDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "managedDelta", + "type": "int256" + } + ], + "name": "PoolBalanceManaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "poolAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum IVault.PoolSpecialization", + "name": "specialization", + "type": "uint8" + } + ], + "name": "PoolRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "RelayerApprovalChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "TokensDeregistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "assetManagers", + "type": "address[]" + } + ], + "name": "TokensRegistered", + "type": "event" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [ + { + "internalType": "contract IWETH", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "assetInIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetOutIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.BatchSwapStep[]", + "name": "swaps", + "type": "tuple[]" + }, + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + }, + { + "internalType": "int256[]", + "name": "limits", + "type": "int256[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "batchSwap", + "outputs": [ + { + "internalType": "int256[]", + "name": "assetDeltas", + "type": "int256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "deregisterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.ExitPoolRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "exitPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlashLoanRecipient", + "name": "recipient", + "type": "address" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "getInternalBalance", + "outputs": [ + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getNextNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + } + ], + "name": "getPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum IVault.PoolSpecialization", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "getPoolTokenInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "cash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "managed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "assetManager", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + } + ], + "name": "getPoolTokens", + "outputs": [ + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeesCollector", + "outputs": [ + { + "internalType": "contract ProtocolFeesCollector", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "name": "hasApprovedRelayer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "maxAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.JoinPoolRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "joinPool", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.PoolBalanceOpKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IVault.PoolBalanceOp[]", + "name": "ops", + "type": "tuple[]" + } + ], + "name": "managePoolBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.UserBalanceOpKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IAsset", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + } + ], + "internalType": "struct IVault.UserBalanceOp[]", + "name": "ops", + "type": "tuple[]" + } + ], + "name": "manageUserBalance", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "assetInIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetOutIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.BatchSwapStep[]", + "name": "swaps", + "type": "tuple[]" + }, + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + } + ], + "name": "queryBatchSwap", + "outputs": [ + { + "internalType": "int256[]", + "name": "", + "type": "int256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IVault.PoolSpecialization", + "name": "specialization", + "type": "uint8" + } + ], + "name": "registerPool", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "assetManagers", + "type": "address[]" + } + ], + "name": "registerTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAuthorizer", + "name": "newAuthorizer", + "type": "address" + } + ], + "name": "setAuthorizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setRelayerApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IAsset", + "name": "assetIn", + "type": "address" + }, + { + "internalType": "contract IAsset", + "name": "assetOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.SingleSwap", + "name": "singleSwap", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "amountCalculated", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x6101806040523480156200001257600080fd5b5060405162006ed638038062006ed6833981016040819052620000359162000253565b8382826040518060400160405280601181526020017010985b185b98d95c88158c8815985d5b1d607a1b81525080604051806040016040528060018152602001603160f81b815250306001600160a01b031660001b89806001600160a01b03166080816001600160a01b031660601b815250505030604051620000b89062000245565b620000c491906200029f565b604051809103906000f080158015620000e1573d6000803e3d6000fd5b5060601b6001600160601b03191660a052600160005560c052815160209283012060e052805191012061010052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61012052620001486276a70083111561019462000181565b6200015c62278d0082111561019562000181565b429091016101408190520161016052620001768162000196565b5050505050620002cc565b8162000192576200019281620001f2565b5050565b6040516001600160a01b038216907f94b979b6831a51293e2641426f97747feed46f17779fed9cd18d1ecefcfe92ef90600090a2600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b610be680620062f083390190565b6000806000806080858703121562000269578384fd5b84516200027681620002b3565b60208601519094506200028981620002b3565b6040860151606090960151949790965092505050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114620002c957600080fd5b50565b60805160601c60a05160601c60c05160e05161010051610120516101405161016051615fc06200033060003980611aed525080611ac952508061289f5250806128e15250806128c05250806110fd5250806113b15250806105285250615fc06000f3fe6080604052600436106101a55760003560e01c8063945bcec9116100e1578063e6c460921161008a578063f84d066e11610064578063f84d066e1461048a578063f94d4668146104aa578063fa6e671d146104d9578063fec90d72146104f9576101d3565b8063e6c4609214610427578063ed24911d14610447578063f6c009271461045c576101d3565b8063b05f8e48116100bb578063b05f8e48146103cf578063b95cac28146103ff578063d2946c2b14610412576101d3565b8063945bcec914610385578063aaabadc514610398578063ad5c4648146103ba576101d3565b806352bbbe291161014e5780637d3aeb96116101285780637d3aeb9614610305578063851c1bb3146103255780638bdb39131461034557806390193b7c14610365576101d3565b806352bbbe29146102b25780635c38449e146102c557806366a9c7d2146102e5576101d3565b80630f5a6efa1161017f5780630f5a6efa1461024157806316c38b3c1461026e5780631c0de0511461028e576101d3565b8063058a628f146101d857806309b2760f146101f85780630e8e3e841461022e576101d3565b366101d3576101d16101b5610526565b6001600160a01b0316336001600160a01b03161461020661054b565b005b600080fd5b3480156101e457600080fd5b506101d16101f3366004615157565b61055d565b34801561020457600080fd5b506102186102133660046156e6565b610581565b6040516102259190615d3e565b60405180910390f35b6101d161023c36600461531e565b610634565b34801561024d57600080fd5b5061026161025c3660046151f5565b610770565b6040516102259190615d08565b34801561027a57600080fd5b506101d161028936600461545c565b610806565b34801561029a57600080fd5b506102a361081f565b60405161022593929190615d26565b6102186102c036600461588f565b610848565b3480156102d157600080fd5b506101d16102e036600461565b565b6109e9565b3480156102f157600080fd5b506101d1610300366004615545565b610e06565b34801561031157600080fd5b506101d1610320366004615516565b610fa5565b34801561033157600080fd5b50610218610340366004615633565b6110f9565b34801561035157600080fd5b506101d16103603660046154ac565b61114b565b34801561037157600080fd5b50610218610380366004615157565b611161565b610261610393366004615786565b61117c565b3480156103a457600080fd5b506103ad6112b0565b6040516102259190615b63565b3480156103c657600080fd5b506103ad6112c4565b3480156103db57600080fd5b506103ef6103ea36600461560f565b6112d3565b6040516102259493929190615eb9565b6101d161040d3660046154ac565b611396565b34801561041e57600080fd5b506103ad6113af565b34801561043357600080fd5b506101d1610442366004615243565b6113d3565b34801561045357600080fd5b506102186114ef565b34801561046857600080fd5b5061047c610477366004615494565b6114f9565b604051610225929190615b9b565b34801561049657600080fd5b506102616104a5366004615702565b611523565b3480156104b657600080fd5b506104ca6104c5366004615494565b611620565b60405161022593929190615cd2565b3480156104e557600080fd5b506101d16104f43660046151ab565b611654565b34801561050557600080fd5b50610519610514366004615173565b6116e6565b6040516102259190615d1b565b7f00000000000000000000000000000000000000000000000000000000000000005b90565b8161055957610559816116fb565b5050565b610565611768565b61056d611781565b610576816117af565b61057e611822565b50565b600061058b611768565b610593611829565b60006105a2338460065461183e565b6000818152600560205260409020549091506105c49060ff16156101f461054b565b60008181526005602052604090819020805460ff1916600190811790915560068054909101905551339082907f3c13bc30b8e878c53fd2a36b679409c073afd75950be43d8858768e956fbc20e9061061d908790615e3a565b60405180910390a3905061062f611822565b919050565b61063c611768565b6000806000805b845181101561075b5760008060008060006106718a878151811061066357fe5b60200260200101518961187d565b9c50939850919650945092509050600185600381111561068d57fe5b14156106a45761069f848383866118f5565b61074a565b866106b6576106b1611829565b600196505b60008560038111156106c457fe5b14156106f5576106d684838386611918565b6106df84611938565b1561069f576106ee8984611945565b985061074a565b61070a61070185611938565b1561020761054b565b600061071585610548565b9050600286600381111561072557fe5b141561073c5761073781848487611957565b610748565b61074881848487611970565b505b505060019093019250610643915050565b50610765836119de565b50505061057e611822565b6060815167ffffffffffffffff8111801561078a57600080fd5b506040519080825280602002602001820160405280156107b4578160200160208202803683370190505b50905060005b82518110156107ff576107e0848483815181106107d357fe5b6020026020010151611a01565b8282815181106107ec57fe5b60209081029190910101526001016107ba565b5092915050565b61080e611768565b610816611781565b61057681611a2c565b600080600061082c611aaa565b159250610837611ac7565b9150610841611aeb565b9050909192565b6000610852611768565b61085a611829565b835161086581611b0f565b610874834211156101fc61054b565b61088760008760800151116101fe61054b565b60006108968760400151611b41565b905060006108a78860600151611b41565b90506108ca816001600160a01b0316836001600160a01b031614156101fd61054b565b6108d2614ce1565b885160808201526020890151819060018111156108eb57fe5b908160018111156108f857fe5b9052506001600160a01b03808416602083015282811660408084019190915260808b0151606084015260a08b01516101008401528951821660c08401528901511660e082015260008061094a83611b66565b9198509250905061098160008c60200151600181111561096657fe5b146109745789831115610979565b898210155b6101fb61054b565b6109998b60400151838c600001518d60200151611c5a565b6109b18b60600151828c604001518d60600151611d38565b6109d36109c18c60400151611938565b6109cc5760006109ce565b825b6119de565b5050505050506109e1611822565b949350505050565b6109f1611768565b6109f9611829565b610a0583518351611e12565b6060835167ffffffffffffffff81118015610a1f57600080fd5b50604051908082528060200260200182016040528015610a49578160200160208202803683370190505b5090506060845167ffffffffffffffff81118015610a6657600080fd5b50604051908082528060200260200182016040528015610a90578160200160208202803683370190505b5090506000805b8651811015610c09576000878281518110610aae57fe5b602002602001015190506000878381518110610ac657fe5b60200260200101519050610b11846001600160a01b0316836001600160a01b03161160006001600160a01b0316846001600160a01b031614610b09576066610b0c565b60685b61054b565b819350816001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610b409190615b63565b60206040518083038186803b158015610b5857600080fd5b505afa158015610b6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b909190615968565b858481518110610b9c57fe5b602002602001018181525050610bb181611e1f565b868481518110610bbd57fe5b602002602001018181525050610beb81868581518110610bd957fe5b6020026020010151101561021061054b565b610bff6001600160a01b0383168b83611ea6565b5050600101610a97565b506040517ff04f27070000000000000000000000000000000000000000000000000000000081526001600160a01b0388169063f04f270790610c55908990899088908a90600401615c85565b600060405180830381600087803b158015610c6f57600080fd5b505af1158015610c83573d6000803e3d6000fd5b5050505060005b8651811015610df4576000878281518110610ca157fe5b602002602001015190506000848381518110610cb957fe5b602002602001015190506000826001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610cf19190615b63565b60206040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d419190615968565b9050610d528282101561020361054b565b60008282039050610d7b888681518110610d6857fe5b602002602001015182101561025a61054b565b610d858482611f11565b836001600160a01b03168c6001600160a01b03167f0d7d75e01ab95780d3cd1c8ec0dd6c2ce19e3a20427eec8bf53283b6fb8e95f08c8881518110610dc657fe5b602002602001015184604051610ddd929190615e4d565b60405180910390a350505050806001019050610c8a565b50505050610e00611822565b50505050565b610e0e611768565b610e16611829565b82610e2081611f33565b610e2c83518351611e12565b60005b8351811015610eca576000848281518110610e4657fe5b60200260200101519050610e7260006001600160a01b0316826001600160a01b0316141561013561054b565b838281518110610e7e57fe5b6020908102919091018101516000888152600a835260408082206001600160a01b0395861683529093529190912080546001600160a01b03191692909116919091179055600101610e2f565b506000610ed685611f64565b90506002816002811115610ee657fe5b1415610f3457610efc845160021461020c61054b565b610f2f8585600081518110610f0d57fe5b602002602001015186600181518110610f2257fe5b6020026020010151611f7e565b610f5c565b6001816002811115610f4257fe5b1415610f5257610f2f858561202a565b610f5c8585612082565b847ff5847d3f2197b16cdcd2098ec95d0905cd1abdaf415f07bb7cef2bba8ac5dec48585604051610f8e929190615bed565b60405180910390a25050610fa0611822565b505050565b610fad611768565b610fb5611829565b81610fbf81611f33565b6000610fca84611f64565b90506002816002811115610fda57fe5b141561102857610ff0835160021461020c61054b565b611023848460008151811061100157fe5b60200260200101518560018151811061101657fe5b60200260200101516120d7565b611050565b600181600281111561103657fe5b1415611046576110238484612145565b61105084846121ff565b60005b83518110156110b657600a6000868152602001908152602001600020600085838151811061107d57fe5b6020908102919091018101516001600160a01b0316825281019190915260400160002080546001600160a01b0319169055600101611053565b50837f7dcdc6d02ef40c7c1a7046a011b058bd7f988fa14e20a66344f9d4e60657d610846040516110e79190615bda565b60405180910390a25050610559611822565b60007f00000000000000000000000000000000000000000000000000000000000000008260405160200161112e929190615ac2565b604051602081830303815290604052805190602001209050919050565b610e00600185858561115c86612262565b61226e565b6001600160a01b031660009081526002602052604090205490565b6060611186611768565b61118e611829565b835161119981611b0f565b6111a8834211156101fc61054b565b6111b486518551611e12565b6111c08787878b6123f4565b91506000805b87518110156112925760008882815181106111dd57fe5b6020026020010151905060008583815181106111f557fe5b6020026020010151905061122188848151811061120e57fe5b60200260200101518213156101fb61054b565b600081131561126157885160208a015182916112409185918491611c5a565b61124983611938565b1561125b576112588582611945565b94505b50611288565b600081121561128857600081600003905061128683828c604001518d60600151611d38565b505b50506001016111c6565b5061129c816119de565b50506112a6611822565b9695505050505050565b60035461010090046001600160a01b031690565b60006112ce610526565b905090565b600080600080856112e381612683565b6000806112ef89611f64565b905060028160028111156112ff57fe5b14156113165761130f89896126a1565b9150611341565b600181600281111561132457fe5b14156113345761130f898961271b565b61133e8989612789565b91505b61134a826127a1565b9650611355826127b4565b9550611360826127ca565b6000998a52600a60209081526040808c206001600160a01b039b8c168d5290915290992054969995989796909616955050505050565b61139e611829565b610e00600085858561115c86612262565b7f000000000000000000000000000000000000000000000000000000000000000090565b6113db611768565b6113e3611829565b6113eb614d31565b60005b82518110156114e55782818151811061140357fe5b6020026020010151915060008260200151905061141f81612683565b604083015161143961143183836127d0565b61020961054b565b6000828152600a602090815260408083206001600160a01b03858116855292529091205461146c911633146101f661054b565b835160608501516000806114828487878661282c565b91509150846001600160a01b0316336001600160a01b0316877f6edcaf6241105b4c94c2efdbf3a6b12458eb3d07be3a0e81d24b13c44045fe7a85856040516114cc929190615e4d565b60405180910390a45050505050508060010190506113ee565b505061057e611822565b60006112ce61289b565b6000808261150681612683565b61150f84612938565b61151885611f64565b925092505b50915091565b60603330146115f6576000306001600160a01b0316600036604051611549929190615ada565b6000604051808303816000865af19150503d8060008114611586576040519150601f19603f3d011682016040523d82523d6000602084013e61158b565b606091505b50509050806000811461159a57fe5b60046000803e6000516001600160e01b0319167ffa61cc120000000000000000000000000000000000000000000000000000000081146115de573d6000803e3d6000fd5b50602060005260043d0380600460203e602081016000f35b6060611604858585896123f4565b9050602081510263fa61cc126020830352600482036024820181fd5b60608060008361162f81612683565b606061163a8661293e565b9095509050611648816129a0565b95979096509350505050565b61165c611768565b611664611829565b8261166e81611b0f565b6001600160a01b0384811660008181526004602090815260408083209488168084529490915290819020805460ff1916861515179055519091907f46961fdb4502b646d5095fba7600486a8ac05041d55cdf0f16ed677180b5cad8906116d5908690615d1b565b60405180910390a350610fa0611822565b60006116f28383612a4f565b90505b92915050565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b61177a6002600054141561019061054b565b6002600055565b60006117986000356001600160e01b0319166110f9565b905061057e6117a78233612a7d565b61019161054b565b6040516001600160a01b038216907f94b979b6831a51293e2641426f97747feed46f17779fed9cd18d1ecefcfe92ef90600090a2600380546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b6001600055565b61183c611834611aaa565b61019261054b565b565b600069ffffffffffffffffffff8216605084600281111561185b57fe5b901b17606085901b6bffffffffffffffffffffffff19161790505b9392505050565b600080600080600080600088606001519050336001600160a01b0316816001600160a01b0316146118cf57876118ba576118b5611781565b600197505b6118cf6118c78233612a4f565b6101f761054b565b885160208a015160408b01516080909b0151919b909a9992985090965090945092505050565b61190a8361190286611b41565b836000612b20565b50610e008482846000611d38565b61192b8261192586611b41565b83612b76565b610e008482856000611c5a565b6001600160a01b03161590565b60008282016116f2848210158361054b565b6119648385836000612b20565b50610e00828583612b76565b8015610e005761198b6001600160a01b038516848484612ba6565b826001600160a01b0316846001600160a01b03167f540a1a3f28340caec336c81d8d7b3df139ee5cdc1839a4f283d7ebb7eaae2d5c84846040516119d0929190615bc1565b60405180910390a350505050565b6119ed8134101561020461054b565b348190038015610559576105593382612bc7565b6001600160a01b039182166000908152600b6020908152604080832093909416825291909152205490565b8015611a4c57611a47611a3d611ac7565b421061019361054b565b611a61565b611a61611a57611aeb565b42106101a961054b565b6003805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611a9f908390615d1b565b60405180910390a150565b6000611ab4611aeb565b4211806112ce57505060035460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b336001600160a01b0382161461057e57611b27611781565b611b318133612a4f565b61057e5761057e816101f7612c41565b6000611b4c82611938565b611b5e57611b5982610548565b6116f5565b6116f5610526565b600080600080611b798560800151612938565b90506000611b8a8660800151611f64565b90506002816002811115611b9a57fe5b1415611bb157611baa8683612c75565b9450611bdc565b6001816002811115611bbf57fe5b1415611bcf57611baa8683612d25565b611bd98683612db8565b94505b611bef8660000151876060015187612ff7565b809450819550505085604001516001600160a01b031686602001516001600160a01b031687608001517f2170c741c41531aec20e7c107c24eecfdd15e69c9bb0a8dd37b1840b9e0b207b8787604051611c49929190615e4d565b60405180910390a450509193909250565b82611c6457610e00565b611c6d84611938565b15611cee57611c7f811561020261054b565b611c8e8347101561020461054b565b611c96610526565b6001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015611cd057600080fd5b505af1158015611ce4573d6000803e3d6000fd5b5050505050610e00565b6000611cf985610548565b90508115611d16576000611d108483876001612b20565b90940393505b8315611d3157611d316001600160a01b038216843087612ba6565b5050505050565b82611d4257610e00565b611d4b84611938565b15611ddb57611d5d811561020261054b565b611d65610526565b6001600160a01b0316632e1a7d4d846040518263ffffffff1660e01b8152600401611d909190615d3e565b600060405180830381600087803b158015611daa57600080fd5b505af1158015611dbe573d6000803e3d6000fd5b50611dd6925050506001600160a01b03831684612bc7565b610e00565b6000611de685610548565b90508115611dfe57611df9838286612b76565b611d31565b611d316001600160a01b0382168486611ea6565b610559818314606761054b565b600080611e2a6113af565b6001600160a01b031663d877845c6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6257600080fd5b505afa158015611e76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9a9190615968565b90506118768382613025565b610fa08363a9059cbb60e01b8484604051602401611ec5929190615bc1565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b031990931692909217909152613072565b801561055957610559611f226113af565b6001600160a01b0384169083611ea6565b611f3c81612683565b61057e611f4882612938565b6001600160a01b0316336001600160a01b0316146101f561054b565b600061ffff605083901c166116f5600382106101f461054b565b611f9f816001600160a01b0316836001600160a01b0316141561020a61054b565b611fbe816001600160a01b0316836001600160a01b031610606661054b565b60008381526009602052604090208054611ffb906001600160a01b0316158015611ff3575060018201546001600160a01b0316155b61020b61054b565b80546001600160a01b039384166001600160a01b03199182161782556001909101805492909316911617905550565b6000828152600860205260408120905b8251811015610e0057600061206b84838151811061205457fe5b60200260200101518461311290919063ffffffff16565b90506120798161020a61054b565b5060010161203a565b6000828152600160205260408120905b8251811015610e005760006120c08483815181106120ac57fe5b602090810291909101015184906000613175565b90506120ce8161020a61054b565b50600101612092565b60008060006120e7868686613222565b9250925092506121116120f9846132e9565b80156121095750612109836132e9565b61020d61054b565b600095865260096020526040862080546001600160a01b031990811682556001909101805490911690559490945550505050565b6000828152600860205260408120905b8251811015610e0057600083828151811061216c57fe5b602002602001015190506121b8612109600760008881526020019081526020016000206000846001600160a01b03166001600160a01b03168152602001908152602001600020546132e9565b60008581526007602090815260408083206001600160a01b038516845290915281208190556121e7848361330b565b90506121f58161020961054b565b5050600101612155565b6000828152600160205260408120905b8251811015610e0057600083828151811061222657fe5b60200260200101519050600061223c8483613412565b905061224a612109826132e9565b6122548483613421565b50505080600101905061220f565b61226a614d5a565b5090565b612276611768565b8361228081612683565b8361228a81611b0f565b61229e836000015151846020015151611e12565b60606122ad84600001516134c3565b905060606122bb8883613552565b905060608060606122d08c8c8c8c8c896135e3565b92509250925060006122e18c611f64565b905060028160028111156122f157fe5b1415612359576123548c8760008151811061230857fe5b60200260200101518660008151811061231d57fe5b60200260200101518960018151811061233257fe5b60200260200101518860018151811061234757fe5b60200260200101516137a8565b612382565b600181600281111561236757fe5b1415612378576123548c87866137e7565b6123828c85613854565b6000808e600181111561239157fe5b1490508b6001600160a01b03168d7fe5ce249087ce04f05a957192435400fd97868dba0e6a4b4c049abf8af80dae78896123cb888661389d565b876040516123db93929190615c4c565b60405180910390a3505050505050505050611d31611822565b6060835167ffffffffffffffff8111801561240e57600080fd5b50604051908082528060200260200182016040528015612438578160200160208202803683370190505b509050612443614d84565b61244b614ce1565b60008060005b89518110156126765789818151811061246657fe5b6020026020010151945060008951866020015110801561248a575089518660400151105b905061249781606461054b565b60006124b98b8860200151815181106124ac57fe5b6020026020010151611b41565b905060006124d08c8960400151815181106124ac57fe5b90506124f3816001600160a01b0316836001600160a01b031614156101fd61054b565b60608801516125435761250b600085116101fe61054b565b60006125188b8484613945565b6001600160a01b0316876001600160a01b031614905061253a816101ff61054b565b50606088018590525b87516080880152868a600181111561255757fe5b9081600181111561256457fe5b9052506001600160a01b0380831660208901528181166040808a01919091526060808b0151908a015260808a01516101008a01528c51821660c08a01528c01511660e08801526000806125b689611b66565b919850925090506125c88c8585613967565b97506125fc6125d683613981565b8c8c60200151815181106125e657fe5b60200260200101516139b190919063ffffffff16565b8b8b602001518151811061260c57fe5b60200260200101818152505061264a61262482613981565b8c8c604001518151811061263457fe5b60200260200101516139e590919063ffffffff16565b8b8b604001518151811061265a57fe5b6020026020010181815250505050505050806001019050612451565b5050505050949350505050565b60008181526005602052604090205461057e9060ff166101f461054b565b60008060008060006126b287613a19565b945094509450945050836001600160a01b0316866001600160a01b031614156126e157829450505050506116f5565b816001600160a01b0316866001600160a01b031614156127065793506116f592505050565b6127116102096116fb565b5050505092915050565b60008281526007602090815260408083206001600160a01b03851684529091528120548161274882613a8f565b80612766575060008581526008602052604090206127669085613aa1565b9050806127815761277685612683565b6127816102096116fb565b509392505050565b60008281526001602052604081206109e18184613412565b6dffffffffffffffffffffffffffff1690565b60701c6dffffffffffffffffffffffffffff1690565b60e01c90565b6000806127dc84611f64565b905060028160028111156127ec57fe5b1415612804576127fc8484613ac2565b9150506116f5565b600181600281111561281257fe5b1415612822576127fc8484613b13565b6127fc8484613b2b565b600080600061283a86611f64565b9050600087600281111561284a57fe5b14156128665761285c86828787613b43565b9250925050612892565b600187600281111561287457fe5b14156128865761285c86828787613bbe565b61285c86828787613c3a565b94509492505050565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612908613c9d565b3060405160200161291d959493929190615df0565b60405160208183030381529060405280519060200120905090565b60601c90565b606080600061294c84611f64565b9050600281600281111561295c57fe5b14156129755761296b84613ca1565b925092505061299b565b600181600281111561298357fe5b14156129925761296b84613dd6565b61296b84613efd565b915091565b60606000825167ffffffffffffffff811180156129bc57600080fd5b506040519080825280602002602001820160405280156129e6578160200160208202803683370190505b5091506000905060005b825181101561151d576000848281518110612a0757fe5b60200260200101519050612a1a81613ff9565b848381518110612a2657fe5b602002602001018181525050612a4483612a3f836127ca565b614014565b9250506001016129f0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b6003546040517f9be2a88400000000000000000000000000000000000000000000000000000000815260009161010090046001600160a01b031690639be2a88490612ad090869086903090600401615d47565b60206040518083038186803b158015612ae857600080fd5b505afa158015612afc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f29190615478565b600080612b2d8686611a01565b9050612b468380612b3e5750848210155b61020161054b565b612b50818561402b565b9150818103612b6c878783612b6487613981565b60000361403a565b5050949350505050565b6000612b828484611a01565b90506000612b908284611945565b9050611d31858583612ba187613981565b61403a565b610e00846323b872dd60e01b858585604051602401611ec593929190615b77565b612bd6814710156101a361054b565b6000826001600160a01b031682604051612bef90610548565b60006040518083038185875af1925050503d8060008114612c2c576040519150601f19603f3d011682016040523d82523d6000602084013e612c31565b606091505b50509050610fa0816101a461054b565b6001600160a01b0382166000908152600260205260409020805460018101909155610fa0612c6f8483614095565b8361054b565b600080600080612c92866080015187602001518860400151613222565b92509250925060008087604001516001600160a01b031688602001516001600160a01b03161015612cc7575083905082612ccd565b50829050835b612cd9888884846141bb565b60408b015160208c01519199509294509092506001600160a01b03918216911610612d0d57612d0881836142d1565b612d17565b612d1782826142d1565b909255509295945050505050565b600080612d3a8460800151856020015161271b565b90506000612d508560800151866040015161271b565b9050612d5e858584846141bb565b6080880180516000908152600760208181526040808420828e01516001600160a01b03908116865290835281852098909855935183529081528282209a830151909516815298909352919096209590955550929392505050565b60808201516000908152600160209081526040822090840151829182918290612de290839061430c565b90506000612dfd88604001518461430c90919063ffffffff16565b9050811580612e0a575080155b15612e2757612e1c8860800151612683565b612e276102096116fb565b60001991820191016000612e3a8461432b565b905060608167ffffffffffffffff81118015612e5557600080fd5b50604051908082528060200260200182016040528015612e7f578160200160208202803683370190505b50600060a08c018190529091505b82811015612eff576000612ea1878361432f565b9050612eac81613ff9565b838381518110612eb857fe5b602002602001018181525050612ed58c60a00151612a3f836127ca565b60a08d015281861415612eea57809850612ef6565b84821415612ef6578097505b50600101612e8d565b506040517f01ec954a0000000000000000000000000000000000000000000000000000000081526001600160a01b038a16906301ec954a90612f4b908d90859089908990600401615e5b565b602060405180830381600087803b158015612f6557600080fd5b505af1158015612f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9d9190615968565b9750600080612fb58c600001518d606001518c612ff7565b9092509050612fc48983614345565b9850612fd08882614376565b9750612fdd87878b61438c565b612fe887868a61438c565b50505050505050505092915050565b6000808085600181111561300757fe5b141561301757508290508161301d565b50819050825b935093915050565b600082820261304984158061304257508385838161303f57fe5b04145b600361054b565b806130585760009150506116f5565b670de0b6b3a76400006000198201046001019150506116f5565b60006060836001600160a01b03168360405161308e9190615aea565b6000604051808303816000865af19150503d80600081146130cb576040519150601f19603f3d011682016040523d82523d6000602084013e6130d0565b606091505b509150915060008214156130e8573d6000803e3d6000fd5b610e0081516000148061310a57508180602001905181019061310a9190615478565b6101a261054b565b600061311e8383613aa1565b61316d57508154600180820184556000848152602080822090930180546001600160a01b0319166001600160a01b038616908117909155855490825282860190935260409020919091556116f5565b5060006116f5565b6001600160a01b03821660009081526002840160205260408120548061320257505082546040805180820182526001600160a01b03858116808352602080840187815260008781526001808c018452878220965187546001600160a01b03191696169590951786559051948401949094559482018089559083526002880190945291902091909155611876565b600019016000908152600180860160205260408220018390559050611876565b600080600080600061323487876143a4565b91509150600061324483836143d5565b60008a81526009602090815260408083208484526002019091528120805460018201549197509293509061327783613a8f565b80613286575061328682613a8f565b806132a757506132968c87613ac2565b80156132a757506132a78c86613ac2565b9050806132c2576132b78c612683565b6132c26102096116fb565b6132cc8383614408565b98506132d8838361442d565b975050505050505093509350939050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6001600160a01b03811660009081526001830160205260408120548015613408578354600019808301919081019060009087908390811061334857fe5b60009182526020909120015487546001600160a01b039091169150819088908590811061337157fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600189810190925260409020908401905586548790806133ba57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03881682526001898101909152604082209190915594506116f59350505050565b60009150506116f5565b60006116f28383610209614444565b6001600160a01b0381166000908152600283016020526040812054801561340857835460001990810160008181526001878101602090815260408084209587018452808420865481546001600160a01b03199081166001600160a01b0392831617835588860180549387019390935588548216875260028d018086528488209a909a5588541690975584905593895593871682529390925281205590506116f5565b606080825167ffffffffffffffff811180156134de57600080fd5b50604051908082528060200260200182016040528015613508578160200160208202803683370190505b50905060005b83518110156107ff576135268482815181106124ac57fe5b82828151811061353257fe5b6001600160a01b039092166020928302919091019091015260010161350e565b60608060606135608561293e565b9150915061357082518551611e12565b613580600083511161020f61054b565b60005b82518110156135da576135d285828151811061359b57fe5b60200260200101516001600160a01b03168483815181106135b857fe5b60200260200101516001600160a01b03161461020861054b565b600101613583565b50949350505050565b60608060608060006135f4866129a0565b9150915060006136038b612938565b905060008c600181111561361357fe5b146136b657806001600160a01b03166374f3b0098c8c8c8787613634614481565b8f604001516040518863ffffffff1660e01b815260040161365b9796959493929190615d66565b600060405180830381600087803b15801561367557600080fd5b505af1158015613689573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526136b19190810190615405565b61374f565b806001600160a01b031663d5c096c48c8c8c87876136d2614481565b8f604001516040518863ffffffff1660e01b81526004016136f99796959493929190615d66565b600060405180830381600087803b15801561371357600080fd5b505af1158015613727573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261374f9190810190615405565b80955081965050506137658751865186516144fb565b60008c600181111561377357fe5b1461378a576137858989898888614513565b613797565b6137978a8989888861465a565b955050505096509650969350505050565b60006137b485846143d5565b600087815260096020908152604080832084845260020190915290209091506137dd85846142d1565b9055505050505050565b60005b8251811015610e00578181815181106137ff57fe5b602002602001015160076000868152602001908152602001600020600085848151811061382857fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020556001016137ea565b6000828152600160205260408120905b8251811015610e00576138958184838151811061387d57fe5b60200260200101518461438c9092919063ffffffff16565b600101613864565b6060825167ffffffffffffffff811180156138b757600080fd5b506040519080825280602002602001820160405280156138e1578160200160208202803683370190505b50905060005b83518110156107ff57826139115783818151811061390157fe5b6020026020010151600003613926565b83818151811061391d57fe5b60200260200101515b82828151811061393257fe5b60209081029190910101526001016138e7565b60008084600181111561395457fe5b1461395f57816109e1565b509092915050565b60008084600181111561397657fe5b146107ff57826109e1565b600061226a7f800000000000000000000000000000000000000000000000000000000000000083106101a561054b565b60008282016116f28284128015906139c95750848212155b806139de57506000841280156139de57508482125b600061054b565b60008183036116f28284128015906139fd5750848213155b80613a125750600084128015613a1257508482135b600161054b565b6000818152600960205260408120805460018201546001600160a01b0391821692849290911690829081613a4d86856143d5565b6000818152600284016020526040902080546001820154919950919250613a748282614408565b9650613a80828261442d565b94505050505091939590929450565b6000613a9a826132e9565b1592915050565b6001600160a01b031660009081526001919091016020526040902054151590565b600082815260096020526040812080546001600160a01b0384811691161480613afa575060018101546001600160a01b038481169116145b80156109e1575050506001600160a01b03161515919050565b60008281526008602052604081206109e18184613aa1565b60008281526001602052604081206109e181846147d0565b6000806002856002811115613b5457fe5b1415613b6a57613b658685856147f1565b613b94565b6001856002811115613b7857fe5b1415613b8957613b658685856147ff565b613b9486858561480d565b8215613bae57613bae6001600160a01b0385163385611ea6565b5050600081900394909350915050565b6000806002856002811115613bcf57fe5b1415613be557613be086858561481b565b613c0f565b6001856002811115613bf357fe5b1415613c0457613be0868585614829565b613c0f868585614837565b8215613c2a57613c2a6001600160a01b038516333086612ba6565b5090946000869003945092505050565b6000806002856002811115613c4b57fe5b1415613c6357613c5c868585614845565b9050613c90565b6001856002811115613c7157fe5b1415613c8257613c5c868585614855565b613c8d868585614865565b90505b6000915094509492505050565b4690565b606080600080600080613cb387613a19565b92975090955093509150506001600160a01b0384161580613cdb57506001600160a01b038216155b15613d04575050604080516000808252602082019081528183019092529450925061299b915050565b60408051600280825260608201835290916020830190803683370190505095508386600081518110613d3257fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508186600181518110613d6057fe5b6001600160a01b03929092166020928302919091018201526040805160028082526060820183529092909190830190803683370190505094508285600081518110613da757fe5b6020026020010181815250508085600181518110613dc157fe5b60200260200101818152505050505050915091565b60008181526008602052604090206060908190613df28161432b565b67ffffffffffffffff81118015613e0857600080fd5b50604051908082528060200260200182016040528015613e32578160200160208202803683370190505b509250825167ffffffffffffffff81118015613e4d57600080fd5b50604051908082528060200260200182016040528015613e77578160200160208202803683370190505b50915060005b8351811015613ef6576000613e928383614875565b905080858381518110613ea157fe5b6001600160a01b03928316602091820292909201810191909152600088815260078252604080822093851682529290915220548451859084908110613ee257fe5b602090810291909101015250600101613e7d565b5050915091565b60008181526001602052604090206060908190613f198161432b565b67ffffffffffffffff81118015613f2f57600080fd5b50604051908082528060200260200182016040528015613f59578160200160208202803683370190505b509250825167ffffffffffffffff81118015613f7457600080fd5b50604051908082528060200260200182016040528015613f9e578160200160208202803683370190505b50915060005b8351811015613ef657613fb782826148a2565b858381518110613fc357fe5b60200260200101858481518110613fd657fe5b60209081029190910101919091526001600160a01b039091169052600101613fa4565b6000614004826127b4565b61400d836127a1565b0192915050565b60008183101561402457816116f2565b5090919050565b600081831061402457816116f2565b6001600160a01b038085166000818152600b602090815260408083209488168084529490915290819020859055517f18e1ea4139e68413d7d08aa752e71568e36b2c5bf940893314c2c5b01eaa0c42906119d0908590615d3e565b6000806140a06148c6565b9050428110156140b45760009150506116f5565b60006140be6148d2565b9050806140d0576000925050506116f5565b6000816140db6149e3565b80516020918201206040516140f7939233918a91899101615dc4565b604051602081830303815290604052805190602001209050600061411a82614a32565b90506000806000614129614a4e565b9250925092506000600185858585604051600081526020016040526040516141549493929190615e1c565b6020604051602081039080840390855afa158015614176573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906141ac57508a6001600160a01b0316816001600160a01b0316145b9b9a5050505050505050505050565b6000806000806141ca86613ff9565b905060006141d786613ff9565b90506141ee6141e5886127ca565b612a3f886127ca565b60a08a01526040517f9d2c110c0000000000000000000000000000000000000000000000000000000081526001600160a01b03891690639d2c110c9061423c908c9086908690600401615e94565b602060405180830381600087803b15801561425657600080fd5b505af115801561426a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061428e9190615968565b92506000806142a68b600001518c6060015187612ff7565b90925090506142b58983614345565b96506142c18882614376565b9550505050509450945094915050565b6000806142e96142e0856127ca565b612a3f856127ca565b90506109e16142f7856127a1565b614300856127a1565b8363ffffffff16614a75565b6001600160a01b03166000908152600291909101602052604090205490565b5490565b6000908152600191820160205260409020015490565b60008061435b83614355866127a1565b90611945565b90506000614368856127b4565b9050436112a6838383614a83565b60008061435b83614386866127a1565b90614abc565b60009182526001928301602052604090912090910155565b600080826001600160a01b0316846001600160a01b0316106143c75782846143ca565b83835b915091509250929050565b600082826040516020016143ea929190615b06565b60405160208183030381529060405280519060200120905092915050565b60006116f2614416846127a1565b61441f846127a1565b614428866127ca565b614a83565b60006116f261443b846127b4565b61441f846127b4565b6001600160a01b038216600090815260028401602052604081205461446b8115158461054b565b614478856001830361432f565b95945050505050565b600061448b6113af565b6001600160a01b03166355c676286040518163ffffffff1660e01b815260040160206040518083038186803b1580156144c357600080fd5b505afa1580156144d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ce9190615968565b610fa0828414801561450c57508183145b606761054b565b6060835167ffffffffffffffff8111801561452d57600080fd5b50604051908082528060200260200182016040528015614557578160200160208202803683370190505b50905060005b85515181101561465057600084828151811061457557fe5b602002602001015190506145a58760200151838151811061459257fe5b60200260200101518210156101f961054b565b6000876000015183815181106145b757fe5b602002602001015190506145d181838b8b60600151611d38565b60008584815181106145df57fe5b602002602001015190506145fb6145f583611b41565b82611f11565b61462a6146088483611945565b89868151811061461457fe5b602002602001015161437690919063ffffffff16565b85858151811061463657fe5b60200260200101818152505050505080600101905061455d565b5095945050505050565b60606000845167ffffffffffffffff8111801561467657600080fd5b506040519080825280602002602001820160405280156146a0578160200160208202803683370190505b50915060005b8651518110156147c65760008582815181106146be57fe5b602002602001015190506146ee886020015183815181106146db57fe5b60200260200101518211156101fa61054b565b60008860000151838151811061470057fe5b6020026020010151905061471a81838c8c60600151611c5a565b61472381611938565b15614735576147328483611945565b93505b600086848151811061474357fe5b602002602001015190506147596145f583611b41565b80831015614778576147738382038a868151811061461457fe5b6147a0565b6147a08184038a868151811061478a57fe5b602002602001015161434590919063ffffffff16565b8685815181106147ac57fe5b6020026020010181815250505050508060010190506146a6565b50614650816119de565b6001600160a01b031660009081526002919091016020526040902054151590565b610e008383614ad284614b0d565b610e008383614ad284614bb8565b610e008383614ad284614c13565b610e008383614c6284614b0d565b610e008383614c6284614bb8565b610e008383614c6284614c13565b60006109e18484614c8385614b0d565b60006109e18484614c8385614bb8565b60006109e18484614c8385614c13565b600082600001828154811061488657fe5b6000918252602090912001546001600160a01b03169392505050565b600090815260019182016020526040902080549101546001600160a01b0390911691565b60006112ce6000614c9d565b6000803560e01c8063b95cac28811461491a57638bdb39138114614942576352bbbe29811461496a5763945bcec981146149925763fa6e671d81146149ba57600092506149de565b7f3f7b71252bd19113ff48c19c6e004a9bcfcca320a0d74d58e85877cbd7dcae5892506149de565b7f8bbc57f66ea936902f50a71ce12b92c43f3c5340bb40c27c4e90ab84eeae335392506149de565b7fe192dcbc143b1e244ad73b813fd3c097b832ad260a157340b4e5e5beda067abe92506149de565b7f9bfc43a4d98313c6766986ffd7c916c7481566d9f224c6819af0a53388aced3a92506149de565b7fa3f865aa351e51cfeb40f5178d1564bb629fe9030b83caf6361d1baaf5b90b5a92505b505090565b60606000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505082519293505050608010156105485760803603815290565b6000614a3c61289b565b8260405160200161112e929190615b2d565b6000806000614a5d6020614c9d565b9250614a696040614c9d565b91506108416060614c9d565b60e01b60709190911b010190565b6000838301614ab1858210801590614aa957506e01000000000000000000000000000082105b61020e61054b565b614478858585614a75565b6000614acc83831115600161054b565b50900390565b600080614ae283614386866127a1565b90506000614af384614355876127b4565b90506000614b00866127ca565b90506112a6838383614a83565b6000806000806000614b1e89613a19565b9450509350935093506000836001600160a01b0316896001600160a01b03161415614b69576000614b5384898b63ffffffff16565b9050614b5f8185614ca7565b9093509050614b8b565b6000614b7983898b63ffffffff16565b9050614b858184614ca7565b90925090505b614b9583836142d1565b8555614ba18383614cc3565b600190950194909455509192505050949350505050565b600080614bc5868661271b565b90506000614bd782858763ffffffff16565b60008881526007602090815260408083206001600160a01b038b16845290915290208190559050614c088183614ca7565b979650505050505050565b600084815260016020526040812081614c2c8287613412565b90506000614c3e82868863ffffffff16565b9050614c4b838883613175565b50614c568183614ca7565b98975050505050505050565b600080614c7283614355866127a1565b90506000614af384614386876127b4565b600080614c8f846127a1565b905043614478828583614a83565b3601607f19013590565b6000614cb2826127b4565b614cbb846127b4565b039392505050565b60006116f2614cd1846127b4565b614cda846127b4565b6000614a75565b60408051610120810190915280600081526000602082018190526040820181905260608083018290526080830182905260a0830182905260c0830182905260e08301919091526101009091015290565b604080516080810190915280600081526000602082018190526040820181905260609091015290565b60405180608001604052806060815260200160608152602001606081526020016000151581525090565b6040518060a0016040528060008019168152602001600081526020016000815260200160008152602001606081525090565b80356116f581615f5a565b600082601f830112614dd1578081fd5b8135614de4614ddf82615f04565b615edd565b818152915060208083019084810181840286018201871015614e0557600080fd5b60005b84811015614e2d578135614e1b81615f5a565b84529282019290820190600101614e08565b505050505092915050565b600082601f830112614e48578081fd5b8135614e56614ddf82615f04565b818152915060208083019084810160005b84811015614e2d578135870160a080601f19838c03011215614e8857600080fd5b614e9181615edd565b85830135815260408084013587830152606080850135828401526080915081850135818401525082840135925067ffffffffffffffff831115614ed357600080fd5b614ee18c8885870101614fc0565b90820152865250509282019290820190600101614e67565b600082601f830112614f09578081fd5b8135614f17614ddf82615f04565b818152915060208083019084810181840286018201871015614f3857600080fd5b60005b84811015614e2d57813584529282019290820190600101614f3b565b600082601f830112614f67578081fd5b8151614f75614ddf82615f04565b818152915060208083019084810181840286018201871015614f9657600080fd5b60005b84811015614e2d57815184529282019290820190600101614f99565b80356116f581615f6f565b600082601f830112614fd0578081fd5b813567ffffffffffffffff811115614fe6578182fd5b614ff9601f8201601f1916602001615edd565b915080825283602082850101111561501057600080fd5b8060208401602084013760009082016020015292915050565b80356116f581615f7d565b8035600281106116f557600080fd5b8035600481106116f557600080fd5b600060808284031215615063578081fd5b61506d6080615edd565b9050813567ffffffffffffffff8082111561508757600080fd5b61509385838601614dc1565b835260208401359150808211156150a957600080fd5b6150b585838601614ef9565b602084015260408401359150808211156150ce57600080fd5b506150db84828501614fc0565b6040830152506150ee8360608401614fb5565b606082015292915050565b60006080828403121561510a578081fd5b6151146080615edd565b9050813561512181615f5a565b8152602082013561513181615f6f565b6020820152604082013561514481615f5a565b604082015260608201356150ee81615f6f565b600060208284031215615168578081fd5b81356116f281615f5a565b60008060408385031215615185578081fd5b823561519081615f5a565b915060208301356151a081615f5a565b809150509250929050565b6000806000606084860312156151bf578081fd5b83356151ca81615f5a565b925060208401356151da81615f5a565b915060408401356151ea81615f6f565b809150509250925092565b60008060408385031215615207578182fd5b823561521281615f5a565b9150602083013567ffffffffffffffff81111561522d578182fd5b61523985828601614dc1565b9150509250929050565b60006020808385031215615255578182fd5b823567ffffffffffffffff81111561526b578283fd5b8301601f8101851361527b578283fd5b8035615289614ddf82615f04565b818152838101908385016080808502860187018a10156152a7578788fd5b8795505b848610156153105780828b0312156152c1578788fd5b6152ca81615edd565b6152d48b84615029565b8152878301358882015260406152ec8c828601614db6565b908201526060838101359082015284526001959095019492860192908101906152ab565b509098975050505050505050565b60006020808385031215615330578182fd5b823567ffffffffffffffff811115615346578283fd5b8301601f81018513615356578283fd5b8035615364614ddf82615f04565b8181528381019083850160a0808502860187018a1015615382578788fd5b8795505b848610156153105780828b03121561539c578788fd5b6153a581615edd565b6153af8b84615043565b81526153bd8b898501614db6565b818901526040838101359082015260606153d98c828601614db6565b9082015260806153eb8c858301614db6565b908201528452600195909501949286019290810190615386565b60008060408385031215615417578182fd5b825167ffffffffffffffff8082111561542e578384fd5b61543a86838701614f57565b9350602085015191508082111561544f578283fd5b5061523985828601614f57565b60006020828403121561546d578081fd5b81356116f281615f6f565b600060208284031215615489578081fd5b81516116f281615f6f565b6000602082840312156154a5578081fd5b5035919050565b600080600080608085870312156154c1578182fd5b8435935060208501356154d381615f5a565b925060408501356154e381615f5a565b9150606085013567ffffffffffffffff8111156154fe578182fd5b61550a87828801615052565b91505092959194509250565b60008060408385031215615528578182fd5b82359150602083013567ffffffffffffffff81111561522d578182fd5b600080600060608486031215615559578081fd5b8335925060208085013567ffffffffffffffff80821115615578578384fd5b61558488838901614dc1565b94506040870135915080821115615599578384fd5b508501601f810187136155aa578283fd5b80356155b8614ddf82615f04565b81815283810190838501858402850186018b10156155d4578687fd5b8694505b838510156155ff5780356155eb81615f5a565b8352600194909401939185019185016155d8565b5080955050505050509250925092565b60008060408385031215615621578182fd5b8235915060208301356151a081615f5a565b600060208284031215615644578081fd5b81356001600160e01b0319811681146116f2578182fd5b60008060008060808587031215615670578182fd5b843561567b81615f5a565b9350602085013567ffffffffffffffff80821115615697578384fd5b6156a388838901614dc1565b945060408701359150808211156156b8578384fd5b6156c488838901614ef9565b935060608701359150808211156156d9578283fd5b5061550a87828801614fc0565b6000602082840312156156f7578081fd5b81356116f281615f7d565b60008060008060e08587031215615717578182fd5b6157218686615034565b9350602085013567ffffffffffffffff8082111561573d578384fd5b61574988838901614e38565b9450604087013591508082111561575e578384fd5b5061576b87828801614dc1565b92505061577b86606087016150f9565b905092959194509250565b600080600080600080610120878903121561579f578384fd5b6157a98888615034565b955060208088013567ffffffffffffffff808211156157c6578687fd5b6157d28b838c01614e38565b975060408a01359150808211156157e7578687fd5b6157f38b838c01614dc1565b96506158028b60608c016150f9565b955060e08a0135915080821115615817578485fd5b508801601f81018a13615828578384fd5b8035615836614ddf82615f04565b81815283810190838501858402850186018e1015615852578788fd5b8794505b83851015615874578035835260019490940193918501918501615856565b50809650505050505061010087013590509295509295509295565b60008060008060e085870312156158a4578182fd5b843567ffffffffffffffff808211156158bb578384fd5b9086019060c082890312156158ce578384fd5b6158d860c0615edd565b823581526158e98960208501615034565b602082015260408301356158fc81615f5a565b604082015261590e8960608501614db6565b60608201526080830135608082015260a08301358281111561592e578586fd5b61593a8a828601614fc0565b60a08301525080965050505061595386602087016150f9565b939693955050505060a08201359160c0013590565b600060208284031215615979578081fd5b5051919050565b6001600160a01b03169052565b6000815180845260208085019450808401835b838110156159c55781516001600160a01b0316875295820195908201906001016159a0565b509495945050505050565b6000815180845260208085019450808401835b838110156159c5578151875295820195908201906001016159e3565b60008151808452615a17816020860160208601615f24565b601f01601f19169290920160200192915050565b6000610120825160028110615a3c57fe5b808552506020830151615a526020860182615980565b506040830151615a656040860182615980565b50606083015160608501526080830151608085015260a083015160a085015260c0830151615a9660c0860182615980565b5060e0830151615aa960e0860182615980565b506101008084015182828701526112a6838701826159ff565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b60008251615afc818460208701615f24565b9190910192915050565b6bffffffffffffffffffffffff19606093841b811682529190921b16601482015260280190565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b038316815260408101615bb483615f50565b8260208301529392505050565b6001600160a01b03929092168252602082015260400190565b6000602082526116f2602083018461598d565b600060408252615c00604083018561598d565b828103602084810191909152845180835285820192820190845b81811015615c3f5784516001600160a01b031683529383019391830191600101615c1a565b5090979650505050505050565b600060608252615c5f606083018661598d565b8281036020840152615c7181866159d0565b905082810360408401526112a681856159d0565b600060808252615c98608083018761598d565b8281036020840152615caa81876159d0565b90508281036040840152615cbe81866159d0565b90508281036060840152614c0881856159ff565b600060608252615ce5606083018661598d565b8281036020840152615cf781866159d0565b915050826040830152949350505050565b6000602082526116f260208301846159d0565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b60008882526001600160a01b03808916602084015280881660408401525060e06060830152615d9860e08301876159d0565b8560808401528460a084015282810360c0840152615db681856159ff565b9a9950505050505050505050565b94855260208501939093526001600160a01b039190911660408401526060830152608082015260a00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b60208101615e4783615f50565b91905290565b918252602082015260400190565b600060808252615e6e6080830187615a2b565b8281036020840152615e8081876159d0565b604084019590955250506060015292915050565b600060608252615ea76060830186615a2b565b60208301949094525060400152919050565b938452602084019290925260408301526001600160a01b0316606082015260800190565b60405181810167ffffffffffffffff81118282101715615efc57600080fd5b604052919050565b600067ffffffffffffffff821115615f1a578081fd5b5060209081020190565b60005b83811015615f3f578181015183820152602001615f27565b83811115610e005750506000910152565b6003811061057e57fe5b6001600160a01b038116811461057e57600080fd5b801515811461057e57600080fd5b6003811061057e57600080fdfea2646970667358221220201e4f926e390fed8dd5318c58846af735c2bebc61b80693ae936a5fe76dcf1464736f6c6343000701003360c060405234801561001057600080fd5b50604051610be6380380610be683398101604081905261002f9161004d565b30608052600160005560601b6001600160601b03191660a05261007b565b60006020828403121561005e578081fd5b81516001600160a01b0381168114610074578182fd5b9392505050565b60805160a05160601c610b406100a66000398061041352806105495250806102a75250610b406000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063851c1bb311610076578063d877845c1161005b578063d877845c14610129578063e42abf3514610131578063fbfa77cf14610151576100a3565b8063851c1bb314610101578063aaabadc514610114576100a3565b806338e9922e146100a857806355c67628146100bd5780636b6b9f69146100db5780636daefab6146100ee575b600080fd5b6100bb6100b636600461099c565b610159565b005b6100c56101b8565b6040516100d29190610aa6565b60405180910390f35b6100bb6100e936600461099c565b6101be565b6100bb6100fc3660046107d1565b610211565b6100c561010f366004610924565b6102a3565b61011c6102f5565b6040516100d29190610a35565b6100c5610304565b61014461013f366004610852565b61030a565b6040516100d29190610a62565b61011c610411565b610161610435565b6101786706f05b59d3b2000082111561025861047e565b60018190556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906101ad908390610aa6565b60405180910390a150565b60015490565b6101c6610435565b6101dc662386f26fc1000082111561025961047e565b60028190556040517f5a0b7386237e7f07fa741efc64e59c9387d2cccafec760efed4d53387f20e19a906101ad908390610aa6565b610219610490565b610221610435565b61022b84836104a9565b60005b8481101561029357600086868381811061024457fe5b90506020020160208101906102599190610980565b9050600085858481811061026957fe5b6020029190910135915061028990506001600160a01b03831685836104b6565b505060010161022e565b5061029c61053e565b5050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016102d89291906109cc565b604051602081830303815290604052805190602001209050919050565b60006102ff610545565b905090565b60025490565b6060815167ffffffffffffffff8111801561032457600080fd5b5060405190808252806020026020018201604052801561034e578160200160208202803683370190505b50905060005b825181101561040b5782818151811061036957fe5b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161039c9190610a35565b60206040518083038186803b1580156103b457600080fd5b505afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec91906109b4565b8282815181106103f857fe5b6020908102919091010152600101610354565b50919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006104646000357fffffffff00000000000000000000000000000000000000000000000000000000166102a3565b905061047b61047382336105d8565b61019161047e565b50565b8161048c5761048c8161066a565b5050565b6104a26002600054141561019061047e565b6002600055565b61048c818314606761047e565b6105398363a9059cbb60e01b84846040516024016104d5929190610a49565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526106d7565b505050565b6001600055565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156105a057600080fd5b505afa1580156105b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ff9190610964565b60006105e2610545565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b815260040161061193929190610aaf565b60206040518083038186803b15801561062957600080fd5b505afa15801561063d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066191906108fd565b90505b92915050565b7f08c379a0000000000000000000000000000000000000000000000000000000006000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b60006060836001600160a01b0316836040516106f391906109fc565b6000604051808303816000865af19150503d8060008114610730576040519150601f19603f3d011682016040523d82523d6000602084013e610735565b606091505b5091509150600082141561074d573d6000803e3d6000fd5b61077781516000148061076f57508180602001905181019061076f91906108fd565b6101a261047e565b50505050565b60008083601f84011261078e578182fd5b50813567ffffffffffffffff8111156107a5578182fd5b60208301915083602080830285010111156107bf57600080fd5b9250929050565b803561066481610af5565b6000806000806000606086880312156107e8578081fd5b853567ffffffffffffffff808211156107ff578283fd5b61080b89838a0161077d565b90975095506020880135915080821115610823578283fd5b506108308882890161077d565b909450925050604086013561084481610af5565b809150509295509295909350565b60006020808385031215610864578182fd5b823567ffffffffffffffff8082111561087b578384fd5b818501915085601f83011261088e578384fd5b81358181111561089c578485fd5b83810291506108ac848301610ace565b8181528481019084860184860187018a10156108c6578788fd5b8795505b838610156108f0576108dc8a826107c6565b8352600195909501949186019186016108ca565b5098975050505050505050565b60006020828403121561090e578081fd5b8151801515811461091d578182fd5b9392505050565b600060208284031215610935578081fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461091d578182fd5b600060208284031215610975578081fd5b815161091d81610af5565b600060208284031215610991578081fd5b813561091d81610af5565b6000602082840312156109ad578081fd5b5035919050565b6000602082840312156109c5578081fd5b5051919050565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260240190565b60008251815b81811015610a1c5760208186018101518583015201610a02565b81811115610a2a5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015610a9a57835183529284019291840191600101610a7e565b50909695505050505050565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b60405181810167ffffffffffffffff81118282101715610aed57600080fd5b604052919050565b6001600160a01b038116811461047b57600080fdfea2646970667358221220be72bdf8e7a3c38606c5f954fbe2d77798347aaa1cfb76fe77ec2f6c245d24bc64736f6c63430007010033" +} diff --git a/crates/contracts/artifacts/BalancerV2WeightedPool.json b/crates/contracts/artifacts/BalancerV2WeightedPool.json index b651bfec00..e421358d76 100644 --- a/crates/contracts/artifacts/BalancerV2WeightedPool.json +++ b/crates/contracts/artifacts/BalancerV2WeightedPool.json @@ -1 +1,903 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"normalizedWeights","type":"uint256[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"PausedStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"SwapFeePercentageChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"decreaseApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInvariant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastInvariant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNormalizedWeights","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPausedState","outputs":[{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"uint256","name":"pauseWindowEndTime","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodEndTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSwapFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increaseApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onExitPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"onJoinPool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum IVault.SwapKind","name":"kind","type":"uint8"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IPoolSwapStructs.SwapRequest","name":"request","type":"tuple"},{"internalType":"uint256","name":"balanceTokenIn","type":"uint256"},{"internalType":"uint256","name":"balanceTokenOut","type":"uint256"}],"name":"onSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryExit","outputs":[{"internalType":"uint256","name":"bptIn","type":"uint256"},{"internalType":"uint256[]","name":"amountsOut","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"uint256","name":"lastChangeBlock","type":"uint256"},{"internalType":"uint256","name":"protocolSwapFeePercentage","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"name":"queryJoin","outputs":[{"internalType":"uint256","name":"bptOut","type":"uint256"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"}],"name":"setSwapFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "normalizedWeights", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "SwapFeePercentageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNormalizedWeights", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onExitPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onJoinPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "request", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "balanceTokenIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceTokenOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "setSwapFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV2WeightedPool2TokensFactory.json b/crates/contracts/artifacts/BalancerV2WeightedPool2TokensFactory.json index d765f8d5f0..2e16f6340f 100644 --- a/crates/contracts/artifacts/BalancerV2WeightedPool2TokensFactory.json +++ b/crates/contracts/artifacts/BalancerV2WeightedPool2TokensFactory.json @@ -1 +1,128 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"weights","type":"uint256[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"bool","name":"oracleEnabled","type":"bool"},{"internalType":"address","name":"owner","type":"address"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPauseConfiguration","outputs":[{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"bytecode":"0x60c060405234801561001057600080fd5b50604051615fe1380380615fe183398101604081905261002f9161004d565b60601b6001600160601b0319166080526276a700420160a05261007b565b60006020828403121561005e578081fd5b81516001600160a01b0381168114610074578182fd5b9392505050565b60805160601c60a051615f3b6100a660003980610221528061024b5250806102a75250615f3b6000f3fe60806040523480156200001157600080fd5b5060043610620000525760003560e01c80631596019b14620000575780632da47c4014620000865780636634b75314620000a05780638d928af814620000c6575b600080fd5b6200006e6200006836600462000548565b620000d0565b6040516200007d91906200068f565b60405180910390f35b620000906200021b565b6040516200007d929190620007a2565b620000b7620000b136600462000522565b62000287565b6040516200007d9190620006a3565b6200006e620002a5565b6000806000620000df6200021b565b91509150620000ed62000315565b60405180610180016040528062000103620002a5565b6001600160a01b031681526020018c81526020018b81526020018a6000815181106200012b57fe5b60200260200101516001600160a01b031681526020018a6001815181106200014f57fe5b60200260200101516001600160a01b03168152602001896000815181106200017357fe5b60200260200101518152602001896001815181106200018e57fe5b602002602001015181526020018881526020018481526020018381526020018715158152602001866001600160a01b03168152509050600081604051620001d5906200039c565b620001e19190620006ae565b604051809103906000f080158015620001fe573d6000803e3d6000fd5b5090506200020c81620002c9565b9b9a5050505050505050505050565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156200027957807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915062000282565b60009250600091505b509091565b6001600160a01b031660009081526020819052604090205460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a250565b60405180610180016040528060006001600160a01b03168152602001606081526020016060815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160006001600160a01b031681525090565b6156f3806200081383390190565b8035620003b781620007f9565b92915050565b600082601f830112620003ce578081fd5b8135620003e5620003df82620007d8565b620007b0565b8181529150602080830190848101818402860182018710156200040757600080fd5b60005b84811015620004335781356200042081620007f9565b845292820192908201906001016200040a565b505050505092915050565b600082601f8301126200044f578081fd5b813562000460620003df82620007d8565b8181529150602080830190848101818402860182018710156200048257600080fd5b60005b84811015620004335781358452928201929082019060010162000485565b80358015158114620003b757600080fd5b600082601f830112620004c5578081fd5b813567ffffffffffffffff811115620004dc578182fd5b620004f1601f8201601f1916602001620007b0565b91508082528360208285010111156200050957600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121562000534578081fd5b81356200054181620007f9565b9392505050565b600080600080600080600060e0888a03121562000563578283fd5b873567ffffffffffffffff808211156200057b578485fd5b620005898b838c01620004b4565b985060208a01359150808211156200059f578485fd5b620005ad8b838c01620004b4565b975060408a0135915080821115620005c3578485fd5b620005d18b838c01620003bd565b965060608a0135915080821115620005e7578485fd5b50620005f68a828b016200043e565b945050608088013592506200060f8960a08a01620004a3565b9150620006208960c08a01620003aa565b905092959891949750929550565b6001600160a01b03169052565b15159052565b60008151808452815b8181101562000668576020818501810151868301820152016200064a565b818111156200067a5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b600060208252620006c46020830184516200062e565b6020830151610180806040850152620006e26101a085018362000641565b91506040850151601f1985840301606086015262000701838262000641565b92505060608501516200071860808601826200062e565b5060808501516200072d60a08601826200062e565b5060a085015160c085015260c085015160e085015260e085015161010081818701528087015191505061012081818701528087015191505061014081818701528087015191505061016062000785818701836200063b565b860151905062000798858301826200062e565b5090949350505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715620007d057600080fd5b604052919050565b600067ffffffffffffffff821115620007ef578081fd5b5060209081020190565b6001600160a01b03811681146200080f57600080fd5b5056fe6102a06040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120523480156200003757600080fd5b50604051620056f3380380620056f38339810160408190526200005a916200080c565b61010081810151610120830151602080850151604080870151815180830190925260018252603160f81b8285019081526101608901513360805260601b6001600160601b03191660a052835194840194852060c052915190912060e0527f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f909552805193949293909291620000f391600391906200069f565b508051620001099060049060208401906200069f565b50620001219150506276a7008311156101946200040a565b6200013562278d008211156101956200040a565b4290910161014081815291016101605281015162000153906200041f565b60e081015162000163906200047b565b80516040516309b2760f60e01b81526000916001600160a01b0316906309b2760f90620001969060029060040162000a12565b602060405180830381600087803b158015620001b157600080fd5b505af1158015620001c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ec9190620007f3565b6040805160028082526060808301845293945090916020830190803683370190505090508260600151816000815181106200022357fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508260800151816001815181106200025657fe5b6001600160a01b0392831660209182029290920101528351166366a9c7d283836002604051908082528060200260200182016040528015620002a2578160200160208202803683370190505b506040518463ffffffff1660e01b8152600401620002c39392919062000976565b600060405180830381600087803b158015620002de57600080fd5b505af1158015620002f3573d6000803e3d6000fd5b505084516001600160601b0319606091821b8116610180526101a08690528187018051831b82166101c052608088015190921b166101e052516200033a92509050620004f9565b6102605260808301516200034e90620004f9565b6102805260a08301516200036f90662386f26fc10000111561012e6200040a565b62000391662386f26fc100008460c00151101561012e6200040a60201b60201c565b6000620003b58460c001518560a001516200059b60201b620011c61790919060201c565b9050620003cf670de0b6b3a764000082146101346200040a565b60a0840180516102005260c085018051610220525190511015620003f5576001620003f8565b60005b60ff16610240525062000a6392505050565b816200041b576200041b81620005b8565b5050565b6200043b816008546200060b60201b620011d81790919060201c565b6008556040517f3e350b41e86a8e10f804ade6d35340d620be35569cc75ac943e8bb14ab80ead190620004709083906200096b565b60405180910390a150565b6200049064e8d4a5100082101560cb6200040a565b620004a867016345785d8a000082111560ca6200040a565b620004c4816008546200062a60201b620011e61790919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906200047090839062000a27565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200053657600080fd5b505afa1580156200054b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000571919062000948565b60ff1690506000620005906012836200064960201b620011f41760201c565b600a0a949350505050565b6000828201620005af84821015836200040a565b90505b92915050565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b6000620005af826055856200066160201b6200120a179092919060201c565b6000620005af826056856200068a60201b62001231179092919060201c565b60006200065b8383111560016200040a565b50900390565b60006001821b1984168284620006795760006200067c565b60015b60ff16901b17949350505050565b6001600160401b03811b1992909216911b1790565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620006e257805160ff191683800117855562000712565b8280016001018555821562000712579182015b8281111562000712578251825591602001919060010190620006f5565b506200072092915062000724565b5090565b5b8082111562000720576000815560010162000725565b80516001600160a01b0381168114620005b257600080fd5b80518015158114620005b257600080fd5b600082601f83011262000775578081fd5b81516001600160401b038111156200078b578182fd5b6020620007a1601f8301601f1916820162000a30565b92508183528481838601011115620007b857600080fd5b60005b82811015620007d8578481018201518482018301528101620007bb565b82811115620007ea5760008284860101525b50505092915050565b60006020828403121562000805578081fd5b5051919050565b6000602082840312156200081e578081fd5b81516001600160401b038082111562000835578283fd5b81840191506101808083870312156200084c578384fd5b620008578162000a30565b90506200086586846200073b565b815260208301518281111562000879578485fd5b620008878782860162000764565b6020830152506040830151828111156200089f578485fd5b620008ad8782860162000764565b604083015250620008c286606085016200073b565b6060820152620008d686608085016200073b565b608082015260a0838101519082015260c0808401519082015260e08084015190820152610100808401519082015261012080840151908201526101409150620009228683850162000753565b82820152610160915062000939868385016200073b565b91810191909152949350505050565b6000602082840312156200095a578081fd5b815160ff81168114620005af578182fd5b901515815260200190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015620009c257620009af855162000a57565b835293830193918301916001016200099a565b505084810360408601528551808252908201925081860190845b8181101562000a0457620009f1835162000a57565b85529383019391830191600101620009dc565b509298975050505050505050565b602081016003831062000a2157fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000a4f57600080fd5b604052919050565b6001600160a01b031690565b60805160a05160601c60c05160e051610100516101205161014051610160516101805160601c6101a0516101c05160601c6101e05160601c6102005161022051610240516102605161028051614bb862000b3b60003980611d12525080611d395250806129e25280612a165280612a52525080611d665280611e02525080611d8d5280611de05280611e3052505080610c6a525080610808525080610bb852508061139d525080611379525080610f205250806116a55250806116e75250806116c6525080610b94525080610b1f5250614bb86000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c806374f3b0091161013b578063aaabadc5116100b8578063d5c096c41161007c578063d5c096c4146104e1578063d73dd623146104f4578063dd62ed3e14610507578063f89f27ed1461051a578063ffd088eb1461052257610248565b8063aaabadc5146104a3578063b10be739146104ab578063b48b5b40146104be578063c0ff1a15146104c6578063d505accf146104ce57610248565b80638d928af8116100ff5780638d928af81461046557806395d89b411461046d5780639b02cdde146104755780639d2c110c1461047d578063a9059cbb1461049057610248565b806374f3b009146103f65780637ecebe0014610417578063851c1bb31461042a57806387ec68171461043d578063893d20e81461045057610248565b806338e9922e116101c957806360d1507c1161018d57806360d1507c1461038257806366188463146103a8578063679aefce146103bb5780636b843239146103c357806370a08231146103e357610248565b806338e9922e1461032457806338fff2d0146103375780634a6b0b151461033f57806355c67628146103595780636028bfd41461036157610248565b80631dccd830116102105780631dccd830146102cc57806323b872dd146102ec578063292c914a146102ff578063313ce567146103075780633644e5151461031c57610248565b806306fdde031461024d578063095ea7b31461026b57806316c38b3c1461028b57806318160ddd146102a05780631c0de051146102b5575b600080fd5b61025561052a565b6040516102629190614a93565b60405180910390f35b61027e61027936600461423b565b6105c0565b6040516102629190614970565b61029e6102993660046144a9565b6105d7565b005b6102a86105eb565b6040516102629190614993565b6102bd6105f1565b6040516102629392919061497b565b6102df6102da3660046143ef565b61061a565b6040516102629190614938565b61027e6102fa366004614186565b610722565b61029e6107a5565b61030f6107d9565b6040516102629190614aff565b6102a86107de565b61029e61033236600461484b565b6107ed565b6102a8610806565b61034761082a565b60405161026296959493929190614a69565b6102a8610885565b61037461036f3660046144e1565b610892565b604051610262929190614ae6565b61039561039036600461484b565b6108c3565b6040516102629796959493929190614a39565b61027e6103b636600461423b565b61090c565b6102a8610966565b6103d66103d1366004614331565b61098b565b60405161026291906148f4565b6102a86103f1366004614132565b610a3c565b6104096104043660046144e1565b610a5b565b60405161026292919061494b565b6102a8610425366004614132565b610b00565b6102a86104383660046145dd565b610b1b565b61037461044b3660046144e1565b610b6d565b610458610b92565b60405161026291906148e0565b610458610bb6565b610255610bda565b6102a8610c3b565b6102a861048b366004614750565b610c41565b61027e61049e36600461423b565b610df0565b610458610dfd565b6102a86104b9366004614734565b610e07565b6102a8610e29565b6102a8610e2f565b61029e6104dc3660046141c6565b610eeb565b6104096104ef3660046144e1565b611034565b61027e61050236600461423b565b611154565b6102a861051536600461414e565b61118a565b6102df6111b5565b6102a86111bf565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b60006105cd338484611246565b5060015b92915050565b6105df6112ae565b6105e8816112dc565b50565b60025490565b60008060006105fe61135a565b159250610609611377565b915061061361139b565b9050909192565b606081516001600160401b038111801561063357600080fd5b5060405190808252806020026020018201604052801561065d578160200160208202803683370190505b509050600061066d6008546113bf565b9050610677613ffe565b60005b845181101561071a5784818151811061068f57fe5b602002602001015191506106ad82602001516000141561013c6113cc565b60006106c883600001518585602001518660400151016113de565b905060006106df84600001518686604001516113de565b90506106f98460200151838303816106f357fe5b05611524565b86848151811061070557fe5b6020908102919091010152505060010161067a565b505050919050565b6001600160a01b038316600081815260016020908152604080832033808552925282205491926107609114806107585750838210155b6101976113cc565b61076b858585611537565b336001600160a01b0386161480159061078657506000198114155b15610798576107988533858403611246565b60019150505b9392505050565b6107ad611606565b6107b56112ae565b6107bf6001611619565b60006107c96105eb565b11156107d7576107d7611659565b565b601290565b60006107e86116a1565b905090565b6107f56112ae565b6107fd611606565b6105e88161173e565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008060008060008060006008549050610843816117a7565b965061084e816117b3565b9550610859816117c0565b9450610864816113bf565b935061086f816117cd565b925061087a816117da565b915050909192939495565b60006107e86008546117da565b600060606108a2865160026117e7565b6108b7898989898989896117f46118ae61192c565b97509795505050505050565b60008060008060008060006108de610400891061013b6113cc565b60006108e989611a4b565b90506108f481611a5d565b959f949e50929c50909a509850965090945092505050565b3360009081526001602090815260408083206001600160a01b03861684529091528120548083106109485761094333856000611246565b61095c565b61095c338561095784876111f4565b611246565b5060019392505050565b60006107e86109736105eb565b61098561097e610e2f565b6002611ac0565b90611ae4565b606081516001600160401b03811180156109a457600080fd5b506040519080825280602002602001820160405280156109ce578160200160208202803683370190505b50905060006109de6008546113bf565b90506109e8614020565b60005b845181101561071a57848181518110610a0057fe5b60200260200101519150610a1d82600001518484602001516113de565b848281518110610a2957fe5b60209081029190910101526001016109eb565b6001600160a01b0381166000908152602081905260409020545b919050565b60608088610a85610a6a610bb6565b6001600160a01b0316336001600160a01b03161460cd6113cc565b610a9a610a90610806565b82146101f46113cc565b610aa387611b35565b6000606080610ab78d8d8d8d8d8d8d6117f4565b925092509250610ac78c84611b97565b610ad0826118ae565b610ad9816118ae565b610ae161135a565b15610aee57610aee611659565b909c909b509950505050505050505050565b6001600160a01b031660009081526005602052604090205490565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610b5092919061489d565b604051602081830303815290604052805190602001209050919050565b60006060610b7d865160026117e7565b6108b789898989898989611c2a611cab61192c565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105b65780601f1061058b576101008083540402835291602001916105b6565b60095490565b6000610c4b611606565b8360800151610c5b610a6a610bb6565b610c66610a90610806565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b03161490506000610cae82611d09565b90506000610cbc8315611d09565b90506000610cc984611d5d565b90506000610cd78515611d5d565b9050610ce38985611db1565b9850610cef8884611db1565b9750610d188a60a0015186610d045789610d06565b8a5b87610d11578b610d13565b8a5b611dbd565b60008a516001811115610d2757fe5b1415610d95576000610d45610d3a610885565b60608d015190611ec3565b9050610d67610d61828d606001516111f490919063ffffffff16565b86611db1565b60608c01526000610d7b8c8c8c8787611f07565b9050610d878186611f26565b985050505050505050610de8565b610da38a6060015184611db1565b60608b01526000610db78b8b8b8686611f32565b9050610dc38186611f45565b9050610ddf610dd8610dd3610885565b611f51565b8290611f77565b97505050505050505b509392505050565b60006105cd338484611537565b60006107e8611fb9565b600080610e1e83610e196008546113bf565b612033565b905061079e81611524565b61040090565b60006060610e3b610bb6565b6001600160a01b031663f94d4668610e51610806565b6040518263ffffffff1660e01b8152600401610e6d9190614993565b60006040518083038186803b158015610e8557600080fd5b505afa158015610e99573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ec19190810190614266565b50915050610ece81611b35565b6060610ed861206a565b9050610ee481836120d8565b9250505090565b610ef98442111560d16113cc565b6001600160a01b0387166000908152600560209081526040808320549051909291610f50917f0000000000000000000000000000000000000000000000000000000000000000918c918c918c9188918d91016149bb565b6040516020818303038152906040528051906020012090506000610f738261214a565b9050600060018288888860405160008152602001604052604051610f9a9493929190614a1b565b6020604051602081039080840390855afa158015610fbc573d6000803e3d6000fd5b5050604051601f1901519150610ffe90506001600160a01b03821615801590610ff657508b6001600160a01b0316826001600160a01b0316145b6101f86113cc565b6001600160a01b038b1660009081526005602052604090206001850190556110278b8b8b611246565b5050505050505050505050565b60608088611043610a6a610bb6565b61104e610a90610806565b611056611606565b60006110606105eb565b6110d0576110708b8b8b88612166565b94509050611085620f424082101560cc6113cc565b6110936000620f42406121ef565b6110a289620f424083036121ef565b6110ab84611cab565b604080516002808252606082018352909160208301908036833701905050925061113e565b6110d988611b35565b61110c87896000815181106110ea57fe5b60200260200101518a6001815181106110ff57fe5b6020026020010151611dbd565b61111b8b8b8b8b8b8b8b611c2a565b9095509350905061112c89826121ef565b61113584611cab565b61113e836118ae565b611146611659565b505097509795505050505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105cd91859061095790866111c6565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606107e861206a565b6201de2090565b600082820161079e84821015836113cc565b600061079e8383605561120a565b600061079e83836056611231565b60006112048383111560016113cc565b50900390565b60006001821b1984168284611220576000611223565b60015b60ff16901b17949350505050565b6001600160401b03811b1992909216911b1790565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906112a1908590614993565b60405180910390a3505050565b60006112c56000356001600160e01b031916610b1b565b90506105e86112d48233612285565b6101916113cc565b80156112fc576112f76112ed611377565b42106101936113cc565b611311565b61131161130761139b565b42106101a96113cc565b6006805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be649061134f908390614970565b60405180910390a150565b600061136461139b565b4211806107e857505060065460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006105d182604b612375565b816113da576113da8161237d565b5050565b60006113ef824210156101386113cc565b4282900360006113fe85611a4b565b9050600061140b826123d0565b905061141c600082116101396113cc565b8281116114485780830380611431848a6123dc565b0261143c848a612420565b0194505050505061079e565b600061145387612464565b9050600061146082611a4b565b9050600061146d826123d0565b905061147e600082116101396113cc565b61148d8682111561013a6113cc565b505060008061149c8684612471565b9150915060006114ab836123d0565b6114b4836123d0565b039050801561150c5760006114c9848d612420565b6114d3848e612420565b03905060006114e1856123d0565b8903905082818302816114f057fe5b056114fb868f612420565b01995050505050505050505061079e565b611516838c612420565b97505050505050505061079e565b60006105d1655af3107a40008302612524565b6001600160a01b03831660009081526020819052604090205461155f828210156101966113cc565b6115766001600160a01b03841615156101996113cc565b6001600160a01b038085166000908152602081905260408082208585039055918516815220546115a690836111c6565b6001600160a01b0380851660008181526020819052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115f8908690614993565b60405180910390a350505050565b6107d761161161135a565b6101926113cc565b60085461162690826111d8565b6008556040517f3e350b41e86a8e10f804ade6d35340d620be35569cc75ac943e8bb14ab80ead19061134f908390614970565b600854611665816117cd565b156105e85761167f611678600954612901565b8290612945565b905061169b61169461168f6105eb565b612901565b8290612952565b60085550565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061170e612960565b306040516020016117239594939291906149ef565b60405160208183030381529060405280519060200120905090565b61175164e8d4a5100082101560cb6113cc565b61176767016345785d8a000082111560ca6113cc565b60085461177490826111e6565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc9061134f908390614993565b60006105d18282612964565b60006105d1826016612964565b60006105d182602c61298b565b60006105d1826055612995565b60006105d182605661299f565b6113da81831460676113cc565b6000606080606061180361206a565b905061180d61135a565b156118555761182387896000815181106110ea57fe5b600061182f828a6120d8565b90506118408983600954848b6129ac565b925061184f89846111f4612a90565b50611876565b60408051600280825260608201835290916020830190803683370190505091505b611881888287612b22565b909450925061189388846111f4612a90565b61189d81896120d8565b600955509750975097945050505050565b6118d5816000815181106118be57fe5b60200260200101516118d06001611d09565b612b8f565b816000815181106118e257fe5b602002602001018181525050611910816001815181106118fe57fe5b60200260200101516118d06000611d09565b8160018151811061191d57fe5b60200260200101818152505050565b3330146119ea576000306001600160a01b03166000366040516119509291906148b5565b6000604051808303816000865af19150503d806000811461198d576040519150601f19603f3d011682016040523d82523d6000602084013e611992565b606091505b5050905080600081146119a157fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b81146119cc573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b6119f386611b35565b60006060611a0a8b8b8b8b8b8b8b8b63ffffffff16565b5091509150611a1c818463ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b505050505050505050565b60009081526007602052604090205490565b6000806000806000806000611a7188612baf565b9650611a7c88612bbc565b9550611a8788612bc9565b9450611a9288612bd6565b9350611a9d88612be3565b9250611aa888612bf0565b9150611ab3886123d0565b9050919395979092949650565b600082820261079e841580611add575083858381611ada57fe5b04145b60036113cc565b6000611af382151560046113cc565b82611b00575060006105d1565b670de0b6b3a764000083810290611b2390858381611b1a57fe5b041460056113cc565b828181611b2c57fe5b049150506105d1565b611b5c81600081518110611b4557fe5b6020026020010151611b576001611d09565b611ac0565b81600081518110611b6957fe5b60200260200101818152505061191081600181518110611b8557fe5b6020026020010151611b576000611d09565b6001600160a01b038216600090815260208190526040902054611bbf828210156101966113cc565b6001600160a01b03831660009081526020819052604090208282039055600254611be990836111f4565b6002556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112a1908690614993565b60006060806060611c3961206a565b90506000611c47828a6120d8565b90506060611c5a8a84600954858c6129ac565b9050611c698a826111f4612a90565b60006060611c788c868b612bfd565b91509150611c898c826111c6612a90565b611c93858d6120d8565b600955909e909d50909b509950505050505050505050565b611cd281600081518110611cbb57fe5b6020026020010151611ccd6001611d09565b612c57565b81600081518110611cdf57fe5b60200260200101818152505061191081600181518110611cfb57fe5b6020026020010151611ccd60005b600081611d36577f00000000000000000000000000000000000000000000000000000000000000006105d1565b507f0000000000000000000000000000000000000000000000000000000000000000919050565b600081611d8a577f00000000000000000000000000000000000000000000000000000000000000006105d1565b507f0000000000000000000000000000000000000000000000000000000000000000919050565b600061079e8383611ac0565b600854611dc9816117cd565b8015611dd457508343115b15611ebd576000611e277f0000000000000000000000000000000000000000000000000000000000000000857f000000000000000000000000000000000000000000000000000000000000000086612c8a565b90506000611e5e7f000000000000000000000000000000000000000000000000000000000000000086611e59866117b3565b612cbf565b90506000611e6b846113bf565b90506000611e78856117c0565b90506000611e9182848787611e8c8b6117a7565b612cdb565b9050808314611a4057611ea48682612d32565b9550611eb08642612d40565b6008819055955050505050505b50505050565b6000828202611edd841580611add575083858381611ada57fe5b80611eec5760009150506105d1565b670de0b6b3a764000060001982015b046001019150506105d1565b6000611f1a858486858a60600151612d4e565b90505b95945050505050565b600061079e8383612b8f565b6000611f1a858486858a60600151612dc9565b600061079e8383612c57565b6000670de0b6b3a76400008210611f695760006105d1565b50670de0b6b3a76400000390565b6000611f8682151560046113cc565b82611f93575060006105d1565b670de0b6b3a764000083810290611fad90858381611b1a57fe5b826001820381611efb57fe5b6000611fc3610bb6565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611ffb57600080fd5b505afa15801561200f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e89190614605565b60008061203f83611a4b565b9050612058600061204f836123d0565b116101396113cc565b61206281856123dc565b949350505050565b6040805160028082526060808301845292839291906020830190803683370190505090506120986001611d5d565b816000815181106120a557fe5b6020026020010181815250506120bb6000611d5d565b816001815181106120c857fe5b6020908102919091010152905090565b670de0b6b3a764000060005b835181101561213a576121306121298583815181106120ff57fe5b602002602001015185848151811061211357fe5b6020026020010151612e3f90919063ffffffff16565b8390612e8e565b91506001016120e4565b506105d1600082116101376113cc565b60006121546116a1565b82604051602001610b509291906148c5565b60006060600061217584612eba565b9050612190600082600281111561218857fe5b1460ce6113cc565b606061219b85612ed0565b90506121a9815160026117e7565b6121b281611b35565b60606121bc61206a565b905060006121ca82846120d8565b905060006121d9826002611ac0565b6009929092555099919850909650505050505050565b6001600160a01b03821660009081526020819052604090205461221290826111c6565b6001600160a01b03831660009081526020819052604090205560025461223890826111c6565b6002556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612279908590614993565b60405180910390a35050565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b6122a4610b92565b6001600160a01b0316141580156122bf57506122bf83612ee6565b156122e7576122cc610b92565b6001600160a01b0316336001600160a01b03161490506105d1565b6122ef611fb9565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b815260040161231e9392919061499c565b60206040518083038186803b15801561233657600080fd5b505afa15801561234a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236e91906144c5565b90506105d1565b1c6103ff1690565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b60006105d1828261298b565b6000808260028111156123eb57fe5b14156123fa5761236e83612baf565b600182600281111561240857fe5b14156124175761236e83612bc9565b61236e83612be3565b60008082600281111561242f57fe5b141561243e5761236e83612bbc565b600182600281111561244c57fe5b141561245b5761236e83612bd6565b61236e83612bf0565b60006105d1826001612f00565b600080806103ff8180805b8385116124e857600285850104612493818a612f00565b935061249e84611a4b565b92506124a9836123d0565b9150898210156124be578060010195506124e2565b898211156124d1576001810394506124e2565b82839750975050505050505061251d565b5061247c565b888110612506576125006124fb84612f11565b611a4b565b82612513565b816125136124fb85612464565b9650965050505050505b9250929050565b6000612553680238fd42c5cf03ffff19831215801561254c575068070c1cc73b00c800008313155b60096113cc565b60008212156125865761256882600003612524565b6a0c097ce7bc90715b34b9f160241b8161257e57fe5b059050610a56565b60006806f05b59d3b200000083126125c657506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec6302628270000000006125fc565b6803782dace9d900000083126125f857506803782dace9d8ffffff19909101906b1425982cf597cd205cef73806125fc565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac62000000841261264c5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412612688576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b1880000084126126c257682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c40000084126126fc576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac6200000841261273557680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d63100000841261276e5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b188000084126127a7576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c4000084126127e05768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b60008061290d83612f1e565b9050655af3107a40006000821361292c57652d79883d20008203612936565b652d79883d200082015b8161293d57fe5b059392505050565b600061079e838383612f7a565b600061079e83836016612f7a565b4690565b600082821c623fffff16621fffff811361297e5780612062565b623fffff19179392505050565b1c637fffffff1690565b1c60019081161490565b1c6001600160401b031690565b604080516002808252606080830184529283929190602083019080368337019050509050826129dc579050611f1d565b612a4f877f000000000000000000000000000000000000000000000000000000000000000081518110612a0b57fe5b6020026020010151877f000000000000000000000000000000000000000000000000000000000000000081518110612a3f57fe5b6020026020010151878787612f91565b817f000000000000000000000000000000000000000000000000000000000000000081518110612a7b57fe5b60209081029190910101529695505050505050565b612ac683600081518110612aa057fe5b602002602001015183600081518110612ab557fe5b60200260200101518363ffffffff16565b83600081518110612ad357fe5b602002602001018181525050612b0483600181518110612aef57fe5b602002602001015183600181518110612ab557fe5b83600181518110612b1157fe5b602002602001018181525050505050565b600060606000612b3184612eba565b90506000816002811115612b4157fe5b1415612b5c57612b52868686613009565b9250925050612b87565b6001816002811115612b6a57fe5b1415612b7a57612b5286856130b9565b612b528686866130eb565b505b935093915050565b6000612b9e82151560046113cc565b818381612ba757fe5b049392505050565b60006105d18260ea612964565b60006105d18260b5613157565b60006105d182609f612964565b60006105d182606a613157565b60006105d1826054612964565b60006105d182601f613157565b600060606000612c0c84612eba565b90506001816002811115612c1c57fe5b1415612c2d57612b5286868661318a565b6002816002811115612c3b57fe5b1415612c4c57612b528686866131e0565b612b8561013661237d565b6000612c6682151560046113cc565b82612c73575060006105d1565b816001840381612c7f57fe5b0460010190506105d1565b600080612caa612c9a8486611f77565b612ca48789611f77565b90611f77565b9050612cb581612901565b9695505050505050565b600080612ccf61168f8587611f77565b92909203949350505050565b600080612cf785858542612cee8b611a4b565b93929190613263565b9050607842889003101580612d0c5786612d15565b612d1587612464565b600081815260076020526040902092909255509695505050505050565b600061079e8383604b6132b5565b600061079e8383602c6132c5565b6000612d70612d6587670429d069189e0000612e8e565b8311156101306113cc565b6000612d7c87846111c6565b90506000612d8a8883611f77565b90506000612d988887611ae4565b90506000612da683836132d7565b9050612dbb612db482611f51565b8990612e8e565b9a9950505050505050505050565b6000612deb612de085670429d069189e0000612e8e565b8311156101316113cc565b6000612e01612dfa86856111f4565b8690611f77565b90506000612e0f8588611f77565b90506000612e1d83836132d7565b90506000612e3382670de0b6b3a76400006111f4565b9050612dbb8a82611ec3565b600080612e4c8484613303565b90506000612e66612e5f83612710611ec3565b60016111c6565b905080821015612e7b576000925050506105d1565b612e8582826111f4565b925050506105d1565b6000828202612ea8841580611add575083858381611ada57fe5b670de0b6b3a764000090049392505050565b6000818060200190518101906105d19190614621565b60608180602001905181019061079e91906146e6565b6000612ef8631c74c91760e11b610b1b565b909114919050565b60006104008383015b069392505050565b60006105d1826001613404565b6000612f2e6000831360646113cc565b670c7d713b49da000082138015612f4c5750670f43fc2c04ee000082125b15612f6a57670de0b6b3a7640000612f6383613413565b8161257e57fe5b612f7382613531565b9050610a56565b623fffff828116821b90821b198416179392505050565b6000838311612fa257506000611f1d565b6000612fae8585611f77565b90506000612fc4670de0b6b3a764000088611ae4565b9050612fd8826709b6e64a8ec600006138d0565b91506000612fe683836132d7565b90506000612ffd612ff683611f51565b8b90612e8e565b9050612dbb8187612e8e565b60006060613015611606565b600080613021856138e7565b915091506130336002821060646113cc565b604080516002808252606080830184529260208301908036833701905050905061309488838151811061306257fe5b602002602001015188848151811061307657fe5b6020026020010151856130876105eb565b61308f610885565b613909565b8183815181106130a057fe5b6020908102919091010152919791965090945050505050565b6000606060006130c8846139c0565b905060606130de86836130d96105eb565b6139d6565b9196919550909350505050565b600060606130f7611606565b6060600061310485613a87565b91509150613114825160026117e7565b61311d82611b35565b600061313a88888561312d6105eb565b613135610885565b613a9f565b905061314a8282111560cf6113cc565b9791965090945050505050565b600082821c661fffffffffffff16660fffffffffffff81136131795780612062565b661fffffffffffff19179392505050565b6000606080600061319a85613a87565b915091506131aa825160026117e7565b6131b382611b35565b60006131d08888856131c36105eb565b6131cb610885565b613cca565b905061314a8282101560d06113cc565b600060606000806131f0856138e7565b915091506132026002821060646113cc565b604080516002808252606080830184529260208301908036833701905050905061309488838151811061323157fe5b602002602001015188848151811061324557fe5b6020026020010151856132566105eb565b61325e610885565b613eda565b60008061326f876123d0565b83039050600081870261328189612bbc565b01905060008287026132928a612bd6565b01905060008387026132a38b612bf0565b019050612dbb89848a858b868c613f7c565b6103ff811b1992909216911b1790565b637fffffff811b1992909216911b1790565b6000806132e48484613303565b905060006132f7612e5f83612710611ec3565b9050611f1d82826111c6565b6000816133195750670de0b6b3a76400006105d1565b82613326575060006105d1565b613337600160ff1b841060066113cc565b8261335d770bce5086492111aea88f4bb1ca6bcf584181ea8059f76532841060076113cc565b826000670c7d713b49da00008313801561337e5750670f43fc2c04ee000083125b156133b557600061338e84613413565b9050670de0b6b3a764000080820784020583670de0b6b3a7640000830502019150506133c3565b816133bf84613531565b0290505b670de0b6b3a764000090056133fb680238fd42c5cf03ffff1982128015906133f4575068070c1cc73b00c800008213155b60086113cc565b612cb581612524565b60006104008284038101612f09565b670de0b6b3a7640000026000806a0c097ce7bc90715b34b9f160241b808401906ec097ce7bc90715b34b9f0fffffffff198501028161344e57fe5b05905060006a0c097ce7bc90715b34b9f160241b82800205905081806a0c097ce7bc90715b34b9f160241b81840205915060038205016a0c097ce7bc90715b34b9f160241b82840205915060058205016a0c097ce7bc90715b34b9f160241b82840205915060078205016a0c097ce7bc90715b34b9f160241b82840205915060098205016a0c097ce7bc90715b34b9f160241b828402059150600b8205016a0c097ce7bc90715b34b9f160241b828402059150600d8205016a0c097ce7bc90715b34b9f160241b828402059150600f826002919005919091010295945050505050565b6000670de0b6b3a764000082121561356d57613563826a0c097ce7bc90715b34b9f160241b8161355d57fe5b05613531565b6000039050610a56565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c000000000000083126135be57770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e00000083126135f6576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff0084000831261363e576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a7008312613679576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf85083126136b057693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e283126136e757690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d03831261371c5768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb41746121110831261374757680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d831261377c576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f177578893793783126137b1576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b28660383126137e5576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac8312613819576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d63100000808603028161383c57fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000818310156138e0578161079e565b5090919050565b600080828060200190518101906138fe91906146b0565b909590945092505050565b60008061391a84612ca481886111f4565b90506139336709b6e64a8ec600008210156101326113cc565b600061395161394a670de0b6b3a764000089611ae4565b83906132d7565b9050600061396861396183611f51565b8a90612e8e565b9050600061397589611f51565b905060006139838383611ec3565b9050600061399184836111f4565b90506139b06139a96139a28a611f51565b8490612e8e565b82906111c6565b9c9b505050505050505050505050565b60008180602001905181019061079e9190614683565b606060006139e48484611ae4565b9050606085516001600160401b03811180156139ff57600080fd5b50604051908082528060200260200182016040528015613a29578160200160208202803683370190505b50905060005b8651811015613a7d57613a5e83888381518110613a4857fe5b6020026020010151612e8e90919063ffffffff16565b828281518110613a6a57fe5b6020908102919091010152600101613a2f565b5095945050505050565b60606000828060200190518101906138fe919061463d565b6000606084516001600160401b0381118015613aba57600080fd5b50604051908082528060200260200182016040528015613ae4578160200160208202803683370190505b5090506000805b8851811015613ba957613b44898281518110613b0357fe5b6020026020010151612ca4898481518110613b1a57fe5b60200260200101518c8581518110613b2e57fe5b60200260200101516111f490919063ffffffff16565b838281518110613b5057fe5b602002602001018181525050613b9f613b98898381518110613b6e57fe5b6020026020010151858481518110613b8257fe5b6020026020010151611ec390919063ffffffff16565b83906111c6565b9150600101613aeb565b50670de0b6b3a764000060005b8951811015613ca9576000848281518110613bcd57fe5b6020026020010151841115613c2b576000613bf6613bea86611f51565b8d8581518110613a4857fe5b90506000613c0a828c8681518110613b2e57fe5b9050613c22613b98613c1b8b611f51565b8390611f77565b92505050613c42565b888281518110613c3757fe5b602002602001015190505b6000613c6b8c8481518110613c5357fe5b6020026020010151610985848f8781518110613b2e57fe5b9050613c9d613c968c8581518110613c7f57fe5b602002602001015183612e3f90919063ffffffff16565b8590612e8e565b93505050600101613bb6565b50613cbd613cb682611f51565b8790611ec3565b9998505050505050505050565b6000606084516001600160401b0381118015613ce557600080fd5b50604051908082528060200260200182016040528015613d0f578160200160208202803683370190505b5090506000805b8851811015613db757613d6f898281518110613d2e57fe5b6020026020010151610985898481518110613d4557fe5b60200260200101518c8581518110613d5957fe5b60200260200101516111c690919063ffffffff16565b838281518110613d7b57fe5b602002602001018181525050613dad613b98898381518110613d9957fe5b6020026020010151858481518110613a4857fe5b9150600101613d16565b50670de0b6b3a764000060005b8951811015613e9857600083858381518110613ddc57fe5b60200260200101511115613e38576000613e01613bea86670de0b6b3a76400006111f4565b90506000613e15828c8681518110613b2e57fe5b9050613e2f613b98612129670de0b6b3a76400008c6111f4565b92505050613e4f565b888281518110613e4457fe5b602002602001015190505b6000613e788c8481518110613e6057fe5b6020026020010151610985848f8781518110613d5957fe5b9050613e8c613c968c8581518110613c7f57fe5b93505050600101613dc4565b50670de0b6b3a76400008110613ece57613ec4613ebd82670de0b6b3a76400006111f4565b8790612e8e565b9350505050611f1d565b60009350505050611f1d565b600080613eeb84612ca481886111c6565b9050613f046729a2241af62c00008211156101336113cc565b6000613f1b61394a670de0b6b3a764000089611f77565b90506000613f3b613f3483670de0b6b3a76400006111f4565b8a90611ec3565b90506000613f4889611f51565b90506000613f568383611ec3565b90506000613f6484836111f4565b90506139b06139a9613f758a611f51565b8490611f77565b6000613f888282613fdc565b613f9384601f613fe0565b613f9e866054613ff1565b613fa988606a613fe0565b613fb48a609f613ff1565b613fbf8c60b5613fe0565b613fca8e60ea613ff1565b17171717171798975050505050505050565b1b90565b661fffffffffffff91909116901b90565b623fffff91909116901b90565b6040805160608101909152806000815260200160008152602001600081525090565b604080518082019091526000808252602082015290565b80356105d181614b52565b600082601f830112614052578081fd5b815161406561406082614b33565b614b0d565b81815291506020808301908481018184028601820187101561408657600080fd5b60005b848110156140a557815184529282019290820190600101614089565b505050505092915050565b600082601f8301126140c0578081fd5b81356001600160401b038111156140d5578182fd5b6140e8601f8201601f1916602001614b0d565b91508082528360208285010111156140ff57600080fd5b8060208401602084013760009082016020015292915050565b8035600281106105d157600080fd5b80356105d181614b75565b600060208284031215614143578081fd5b813561079e81614b52565b60008060408385031215614160578081fd5b823561416b81614b52565b9150602083013561417b81614b52565b809150509250929050565b60008060006060848603121561419a578081fd5b83356141a581614b52565b925060208401356141b581614b52565b929592945050506040919091013590565b600080600080600080600060e0888a0312156141e0578485fd5b87356141eb81614b52565b965060208801356141fb81614b52565b95506040880135945060608801359350608088013560ff8116811461421e578384fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561424d578182fd5b823561425881614b52565b946020939093013593505050565b60008060006060848603121561427a578081fd5b83516001600160401b0380821115614290578283fd5b818601915086601f8301126142a3578283fd5b81516142b161406082614b33565b80828252602080830192508086018b8283870289010111156142d1578788fd5b8796505b848710156142fc5780516142e881614b52565b8452600196909601959281019281016142d5565b508901519097509350505080821115614313578283fd5b5061432086828701614042565b925050604084015190509250925092565b60006020808385031215614343578182fd5b82356001600160401b03811115614358578283fd5b8301601f81018513614368578283fd5b803561437661406082614b33565b818152838101908385016040808502860187018a1015614394578788fd5b8795505b848610156143e15780828b0312156143ae578788fd5b6143b781614b0d565b6143c18b84614127565b815282880135888201528452600195909501949286019290810190614398565b509098975050505050505050565b60006020808385031215614401578182fd5b82356001600160401b03811115614416578283fd5b8301601f81018513614426578283fd5b803561443461406082614b33565b818152838101908385016060808502860187018a1015614452578788fd5b8795505b848610156143e15780828b03121561446c578788fd5b61447581614b0d565b61447f8b84614127565b81528288013588820152604080840135908201528452600195909501949286019290810190614456565b6000602082840312156144ba578081fd5b813561079e81614b67565b6000602082840312156144d6578081fd5b815161079e81614b67565b600080600080600080600060e0888a0312156144fb578081fd5b8735965060208089013561450e81614b52565b9650604089013561451e81614b52565b955060608901356001600160401b0380821115614539578384fd5b818b0191508b601f83011261454c578384fd5b813561455a61406082614b33565b8082825285820191508585018f878886028801011115614578578788fd5b8795505b8386101561459a57803583526001959095019491860191860161457c565b509850505060808b0135955060a08b0135945060c08b01359250808311156145c0578384fd5b50506145ce8a828b016140b0565b91505092959891949750929550565b6000602082840312156145ee578081fd5b81356001600160e01b03198116811461079e578182fd5b600060208284031215614616578081fd5b815161079e81614b52565b600060208284031215614632578081fd5b815161079e81614b75565b600080600060608486031215614651578081fd5b835161465c81614b75565b60208501519093506001600160401b03811115614677578182fd5b61432086828701614042565b60008060408385031215614695578182fd5b82516146a081614b75565b6020939093015192949293505050565b6000806000606084860312156146c4578081fd5b83516146cf81614b75565b602085015160409095015190969495509392505050565b600080604083850312156146f8578182fd5b825161470381614b75565b60208401519092506001600160401b0381111561471e578182fd5b61472a85828601614042565b9150509250929050565b600060208284031215614745578081fd5b813561079e81614b75565b600080600060608486031215614764578081fd5b83356001600160401b038082111561477a578283fd5b8186019150610120808389031215614790578384fd5b61479981614b0d565b90506147a58884614118565b81526147b48860208501614037565b60208201526147c68860408501614037565b6040820152606083013560608201526080830135608082015260a083013560a08201526147f68860c08501614037565b60c08201526148088860e08501614037565b60e08201526101008084013583811115614820578586fd5b61482c8a8287016140b0565b9183019190915250976020870135975060409096013595945050505050565b60006020828403121561485c578081fd5b5035919050565b6000815180845260208085019450808401835b8381101561489257815187529582019590820190600101614876565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561492c57835183529284019291840191600101614910565b50909695505050505050565b60006020825261079e6020830184614863565b60006040825261495e6040830185614863565b8281036020840152611f1d8185614863565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b968752602087019590955260408601939093526060850191909152608084015260a083015260c082015260e00190565b9586526020860194909452604085019290925260608401521515608083015260a082015260c00190565b6000602080835283518082850152825b81811015614abf57858101830151858201604001528201614aa3565b81811115614ad05783604083870101525b50601f01601f1916929092016040019392505050565b6000838252604060208301526120626040830184614863565b60ff91909116815260200190565b6040518181016001600160401b0381118282101715614b2b57600080fd5b604052919050565b60006001600160401b03821115614b48578081fd5b5060209081020190565b6001600160a01b03811681146105e857600080fd5b80151581146105e857600080fd5b600381106105e857600080fdfea26469706673582212201dbf8d364d926088a19c5f3f5d0ca0ab72cf3eda8f3f78dda45ab2619de4b6d664736f6c63430007010033a264697066735822122062c63a2c3089490a939fe9f20e0e99ef310f04a393c33a92c66f45a3b2cea18064736f6c63430007010033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "weights", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "oracleEnabled", + "type": "bool" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getPauseConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolFromFactory", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60c060405234801561001057600080fd5b50604051615fe1380380615fe183398101604081905261002f9161004d565b60601b6001600160601b0319166080526276a700420160a05261007b565b60006020828403121561005e578081fd5b81516001600160a01b0381168114610074578182fd5b9392505050565b60805160601c60a051615f3b6100a660003980610221528061024b5250806102a75250615f3b6000f3fe60806040523480156200001157600080fd5b5060043610620000525760003560e01c80631596019b14620000575780632da47c4014620000865780636634b75314620000a05780638d928af814620000c6575b600080fd5b6200006e6200006836600462000548565b620000d0565b6040516200007d91906200068f565b60405180910390f35b620000906200021b565b6040516200007d929190620007a2565b620000b7620000b136600462000522565b62000287565b6040516200007d9190620006a3565b6200006e620002a5565b6000806000620000df6200021b565b91509150620000ed62000315565b60405180610180016040528062000103620002a5565b6001600160a01b031681526020018c81526020018b81526020018a6000815181106200012b57fe5b60200260200101516001600160a01b031681526020018a6001815181106200014f57fe5b60200260200101516001600160a01b03168152602001896000815181106200017357fe5b60200260200101518152602001896001815181106200018e57fe5b602002602001015181526020018881526020018481526020018381526020018715158152602001866001600160a01b03168152509050600081604051620001d5906200039c565b620001e19190620006ae565b604051809103906000f080158015620001fe573d6000803e3d6000fd5b5090506200020c81620002c9565b9b9a5050505050505050505050565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156200027957807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915062000282565b60009250600091505b509091565b6001600160a01b031660009081526020819052604090205460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a250565b60405180610180016040528060006001600160a01b03168152602001606081526020016060815260200160006001600160a01b0316815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160006001600160a01b031681525090565b6156f3806200081383390190565b8035620003b781620007f9565b92915050565b600082601f830112620003ce578081fd5b8135620003e5620003df82620007d8565b620007b0565b8181529150602080830190848101818402860182018710156200040757600080fd5b60005b84811015620004335781356200042081620007f9565b845292820192908201906001016200040a565b505050505092915050565b600082601f8301126200044f578081fd5b813562000460620003df82620007d8565b8181529150602080830190848101818402860182018710156200048257600080fd5b60005b84811015620004335781358452928201929082019060010162000485565b80358015158114620003b757600080fd5b600082601f830112620004c5578081fd5b813567ffffffffffffffff811115620004dc578182fd5b620004f1601f8201601f1916602001620007b0565b91508082528360208285010111156200050957600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121562000534578081fd5b81356200054181620007f9565b9392505050565b600080600080600080600060e0888a03121562000563578283fd5b873567ffffffffffffffff808211156200057b578485fd5b620005898b838c01620004b4565b985060208a01359150808211156200059f578485fd5b620005ad8b838c01620004b4565b975060408a0135915080821115620005c3578485fd5b620005d18b838c01620003bd565b965060608a0135915080821115620005e7578485fd5b50620005f68a828b016200043e565b945050608088013592506200060f8960a08a01620004a3565b9150620006208960c08a01620003aa565b905092959891949750929550565b6001600160a01b03169052565b15159052565b60008151808452815b8181101562000668576020818501810151868301820152016200064a565b818111156200067a5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b600060208252620006c46020830184516200062e565b6020830151610180806040850152620006e26101a085018362000641565b91506040850151601f1985840301606086015262000701838262000641565b92505060608501516200071860808601826200062e565b5060808501516200072d60a08601826200062e565b5060a085015160c085015260c085015160e085015260e085015161010081818701528087015191505061012081818701528087015191505061014081818701528087015191505061016062000785818701836200063b565b860151905062000798858301826200062e565b5090949350505050565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715620007d057600080fd5b604052919050565b600067ffffffffffffffff821115620007ef578081fd5b5060209081020190565b6001600160a01b03811681146200080f57600080fd5b5056fe6102a06040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120523480156200003757600080fd5b50604051620056f3380380620056f38339810160408190526200005a916200080c565b61010081810151610120830151602080850151604080870151815180830190925260018252603160f81b8285019081526101608901513360805260601b6001600160601b03191660a052835194840194852060c052915190912060e0527f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f909552805193949293909291620000f391600391906200069f565b508051620001099060049060208401906200069f565b50620001219150506276a7008311156101946200040a565b6200013562278d008211156101956200040a565b4290910161014081815291016101605281015162000153906200041f565b60e081015162000163906200047b565b80516040516309b2760f60e01b81526000916001600160a01b0316906309b2760f90620001969060029060040162000a12565b602060405180830381600087803b158015620001b157600080fd5b505af1158015620001c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ec9190620007f3565b6040805160028082526060808301845293945090916020830190803683370190505090508260600151816000815181106200022357fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508260800151816001815181106200025657fe5b6001600160a01b0392831660209182029290920101528351166366a9c7d283836002604051908082528060200260200182016040528015620002a2578160200160208202803683370190505b506040518463ffffffff1660e01b8152600401620002c39392919062000976565b600060405180830381600087803b158015620002de57600080fd5b505af1158015620002f3573d6000803e3d6000fd5b505084516001600160601b0319606091821b8116610180526101a08690528187018051831b82166101c052608088015190921b166101e052516200033a92509050620004f9565b6102605260808301516200034e90620004f9565b6102805260a08301516200036f90662386f26fc10000111561012e6200040a565b62000391662386f26fc100008460c00151101561012e6200040a60201b60201c565b6000620003b58460c001518560a001516200059b60201b620011c61790919060201c565b9050620003cf670de0b6b3a764000082146101346200040a565b60a0840180516102005260c085018051610220525190511015620003f5576001620003f8565b60005b60ff16610240525062000a6392505050565b816200041b576200041b81620005b8565b5050565b6200043b816008546200060b60201b620011d81790919060201c565b6008556040517f3e350b41e86a8e10f804ade6d35340d620be35569cc75ac943e8bb14ab80ead190620004709083906200096b565b60405180910390a150565b6200049064e8d4a5100082101560cb6200040a565b620004a867016345785d8a000082111560ca6200040a565b620004c4816008546200062a60201b620011e61790919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc906200047090839062000a27565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200053657600080fd5b505afa1580156200054b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000571919062000948565b60ff1690506000620005906012836200064960201b620011f41760201c565b600a0a949350505050565b6000828201620005af84821015836200040a565b90505b92915050565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b6000620005af826055856200066160201b6200120a179092919060201c565b6000620005af826056856200068a60201b62001231179092919060201c565b60006200065b8383111560016200040a565b50900390565b60006001821b1984168284620006795760006200067c565b60015b60ff16901b17949350505050565b6001600160401b03811b1992909216911b1790565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620006e257805160ff191683800117855562000712565b8280016001018555821562000712579182015b8281111562000712578251825591602001919060010190620006f5565b506200072092915062000724565b5090565b5b8082111562000720576000815560010162000725565b80516001600160a01b0381168114620005b257600080fd5b80518015158114620005b257600080fd5b600082601f83011262000775578081fd5b81516001600160401b038111156200078b578182fd5b6020620007a1601f8301601f1916820162000a30565b92508183528481838601011115620007b857600080fd5b60005b82811015620007d8578481018201518482018301528101620007bb565b82811115620007ea5760008284860101525b50505092915050565b60006020828403121562000805578081fd5b5051919050565b6000602082840312156200081e578081fd5b81516001600160401b038082111562000835578283fd5b81840191506101808083870312156200084c578384fd5b620008578162000a30565b90506200086586846200073b565b815260208301518281111562000879578485fd5b620008878782860162000764565b6020830152506040830151828111156200089f578485fd5b620008ad8782860162000764565b604083015250620008c286606085016200073b565b6060820152620008d686608085016200073b565b608082015260a0838101519082015260c0808401519082015260e08084015190820152610100808401519082015261012080840151908201526101409150620009228683850162000753565b82820152610160915062000939868385016200073b565b91810191909152949350505050565b6000602082840312156200095a578081fd5b815160ff81168114620005af578182fd5b901515815260200190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015620009c257620009af855162000a57565b835293830193918301916001016200099a565b505084810360408601528551808252908201925081860190845b8181101562000a0457620009f1835162000a57565b85529383019391830191600101620009dc565b509298975050505050505050565b602081016003831062000a2157fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000a4f57600080fd5b604052919050565b6001600160a01b031690565b60805160a05160601c60c05160e051610100516101205161014051610160516101805160601c6101a0516101c05160601c6101e05160601c6102005161022051610240516102605161028051614bb862000b3b60003980611d12525080611d395250806129e25280612a165280612a52525080611d665280611e02525080611d8d5280611de05280611e3052505080610c6a525080610808525080610bb852508061139d525080611379525080610f205250806116a55250806116e75250806116c6525080610b94525080610b1f5250614bb86000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c806374f3b0091161013b578063aaabadc5116100b8578063d5c096c41161007c578063d5c096c4146104e1578063d73dd623146104f4578063dd62ed3e14610507578063f89f27ed1461051a578063ffd088eb1461052257610248565b8063aaabadc5146104a3578063b10be739146104ab578063b48b5b40146104be578063c0ff1a15146104c6578063d505accf146104ce57610248565b80638d928af8116100ff5780638d928af81461046557806395d89b411461046d5780639b02cdde146104755780639d2c110c1461047d578063a9059cbb1461049057610248565b806374f3b009146103f65780637ecebe0014610417578063851c1bb31461042a57806387ec68171461043d578063893d20e81461045057610248565b806338e9922e116101c957806360d1507c1161018d57806360d1507c1461038257806366188463146103a8578063679aefce146103bb5780636b843239146103c357806370a08231146103e357610248565b806338e9922e1461032457806338fff2d0146103375780634a6b0b151461033f57806355c67628146103595780636028bfd41461036157610248565b80631dccd830116102105780631dccd830146102cc57806323b872dd146102ec578063292c914a146102ff578063313ce567146103075780633644e5151461031c57610248565b806306fdde031461024d578063095ea7b31461026b57806316c38b3c1461028b57806318160ddd146102a05780631c0de051146102b5575b600080fd5b61025561052a565b6040516102629190614a93565b60405180910390f35b61027e61027936600461423b565b6105c0565b6040516102629190614970565b61029e6102993660046144a9565b6105d7565b005b6102a86105eb565b6040516102629190614993565b6102bd6105f1565b6040516102629392919061497b565b6102df6102da3660046143ef565b61061a565b6040516102629190614938565b61027e6102fa366004614186565b610722565b61029e6107a5565b61030f6107d9565b6040516102629190614aff565b6102a86107de565b61029e61033236600461484b565b6107ed565b6102a8610806565b61034761082a565b60405161026296959493929190614a69565b6102a8610885565b61037461036f3660046144e1565b610892565b604051610262929190614ae6565b61039561039036600461484b565b6108c3565b6040516102629796959493929190614a39565b61027e6103b636600461423b565b61090c565b6102a8610966565b6103d66103d1366004614331565b61098b565b60405161026291906148f4565b6102a86103f1366004614132565b610a3c565b6104096104043660046144e1565b610a5b565b60405161026292919061494b565b6102a8610425366004614132565b610b00565b6102a86104383660046145dd565b610b1b565b61037461044b3660046144e1565b610b6d565b610458610b92565b60405161026291906148e0565b610458610bb6565b610255610bda565b6102a8610c3b565b6102a861048b366004614750565b610c41565b61027e61049e36600461423b565b610df0565b610458610dfd565b6102a86104b9366004614734565b610e07565b6102a8610e29565b6102a8610e2f565b61029e6104dc3660046141c6565b610eeb565b6104096104ef3660046144e1565b611034565b61027e61050236600461423b565b611154565b6102a861051536600461414e565b61118a565b6102df6111b5565b6102a86111bf565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b60006105cd338484611246565b5060015b92915050565b6105df6112ae565b6105e8816112dc565b50565b60025490565b60008060006105fe61135a565b159250610609611377565b915061061361139b565b9050909192565b606081516001600160401b038111801561063357600080fd5b5060405190808252806020026020018201604052801561065d578160200160208202803683370190505b509050600061066d6008546113bf565b9050610677613ffe565b60005b845181101561071a5784818151811061068f57fe5b602002602001015191506106ad82602001516000141561013c6113cc565b60006106c883600001518585602001518660400151016113de565b905060006106df84600001518686604001516113de565b90506106f98460200151838303816106f357fe5b05611524565b86848151811061070557fe5b6020908102919091010152505060010161067a565b505050919050565b6001600160a01b038316600081815260016020908152604080832033808552925282205491926107609114806107585750838210155b6101976113cc565b61076b858585611537565b336001600160a01b0386161480159061078657506000198114155b15610798576107988533858403611246565b60019150505b9392505050565b6107ad611606565b6107b56112ae565b6107bf6001611619565b60006107c96105eb565b11156107d7576107d7611659565b565b601290565b60006107e86116a1565b905090565b6107f56112ae565b6107fd611606565b6105e88161173e565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008060008060008060006008549050610843816117a7565b965061084e816117b3565b9550610859816117c0565b9450610864816113bf565b935061086f816117cd565b925061087a816117da565b915050909192939495565b60006107e86008546117da565b600060606108a2865160026117e7565b6108b7898989898989896117f46118ae61192c565b97509795505050505050565b60008060008060008060006108de610400891061013b6113cc565b60006108e989611a4b565b90506108f481611a5d565b959f949e50929c50909a509850965090945092505050565b3360009081526001602090815260408083206001600160a01b03861684529091528120548083106109485761094333856000611246565b61095c565b61095c338561095784876111f4565b611246565b5060019392505050565b60006107e86109736105eb565b61098561097e610e2f565b6002611ac0565b90611ae4565b606081516001600160401b03811180156109a457600080fd5b506040519080825280602002602001820160405280156109ce578160200160208202803683370190505b50905060006109de6008546113bf565b90506109e8614020565b60005b845181101561071a57848181518110610a0057fe5b60200260200101519150610a1d82600001518484602001516113de565b848281518110610a2957fe5b60209081029190910101526001016109eb565b6001600160a01b0381166000908152602081905260409020545b919050565b60608088610a85610a6a610bb6565b6001600160a01b0316336001600160a01b03161460cd6113cc565b610a9a610a90610806565b82146101f46113cc565b610aa387611b35565b6000606080610ab78d8d8d8d8d8d8d6117f4565b925092509250610ac78c84611b97565b610ad0826118ae565b610ad9816118ae565b610ae161135a565b15610aee57610aee611659565b909c909b509950505050505050505050565b6001600160a01b031660009081526005602052604090205490565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610b5092919061489d565b604051602081830303815290604052805190602001209050919050565b60006060610b7d865160026117e7565b6108b789898989898989611c2a611cab61192c565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105b65780601f1061058b576101008083540402835291602001916105b6565b60095490565b6000610c4b611606565b8360800151610c5b610a6a610bb6565b610c66610a90610806565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031686602001516001600160a01b03161490506000610cae82611d09565b90506000610cbc8315611d09565b90506000610cc984611d5d565b90506000610cd78515611d5d565b9050610ce38985611db1565b9850610cef8884611db1565b9750610d188a60a0015186610d045789610d06565b8a5b87610d11578b610d13565b8a5b611dbd565b60008a516001811115610d2757fe5b1415610d95576000610d45610d3a610885565b60608d015190611ec3565b9050610d67610d61828d606001516111f490919063ffffffff16565b86611db1565b60608c01526000610d7b8c8c8c8787611f07565b9050610d878186611f26565b985050505050505050610de8565b610da38a6060015184611db1565b60608b01526000610db78b8b8b8686611f32565b9050610dc38186611f45565b9050610ddf610dd8610dd3610885565b611f51565b8290611f77565b97505050505050505b509392505050565b60006105cd338484611537565b60006107e8611fb9565b600080610e1e83610e196008546113bf565b612033565b905061079e81611524565b61040090565b60006060610e3b610bb6565b6001600160a01b031663f94d4668610e51610806565b6040518263ffffffff1660e01b8152600401610e6d9190614993565b60006040518083038186803b158015610e8557600080fd5b505afa158015610e99573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ec19190810190614266565b50915050610ece81611b35565b6060610ed861206a565b9050610ee481836120d8565b9250505090565b610ef98442111560d16113cc565b6001600160a01b0387166000908152600560209081526040808320549051909291610f50917f0000000000000000000000000000000000000000000000000000000000000000918c918c918c9188918d91016149bb565b6040516020818303038152906040528051906020012090506000610f738261214a565b9050600060018288888860405160008152602001604052604051610f9a9493929190614a1b565b6020604051602081039080840390855afa158015610fbc573d6000803e3d6000fd5b5050604051601f1901519150610ffe90506001600160a01b03821615801590610ff657508b6001600160a01b0316826001600160a01b0316145b6101f86113cc565b6001600160a01b038b1660009081526005602052604090206001850190556110278b8b8b611246565b5050505050505050505050565b60608088611043610a6a610bb6565b61104e610a90610806565b611056611606565b60006110606105eb565b6110d0576110708b8b8b88612166565b94509050611085620f424082101560cc6113cc565b6110936000620f42406121ef565b6110a289620f424083036121ef565b6110ab84611cab565b604080516002808252606082018352909160208301908036833701905050925061113e565b6110d988611b35565b61110c87896000815181106110ea57fe5b60200260200101518a6001815181106110ff57fe5b6020026020010151611dbd565b61111b8b8b8b8b8b8b8b611c2a565b9095509350905061112c89826121ef565b61113584611cab565b61113e836118ae565b611146611659565b505097509795505050505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105cd91859061095790866111c6565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606107e861206a565b6201de2090565b600082820161079e84821015836113cc565b600061079e8383605561120a565b600061079e83836056611231565b60006112048383111560016113cc565b50900390565b60006001821b1984168284611220576000611223565b60015b60ff16901b17949350505050565b6001600160401b03811b1992909216911b1790565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906112a1908590614993565b60405180910390a3505050565b60006112c56000356001600160e01b031916610b1b565b90506105e86112d48233612285565b6101916113cc565b80156112fc576112f76112ed611377565b42106101936113cc565b611311565b61131161130761139b565b42106101a96113cc565b6006805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be649061134f908390614970565b60405180910390a150565b600061136461139b565b4211806107e857505060065460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006105d182604b612375565b816113da576113da8161237d565b5050565b60006113ef824210156101386113cc565b4282900360006113fe85611a4b565b9050600061140b826123d0565b905061141c600082116101396113cc565b8281116114485780830380611431848a6123dc565b0261143c848a612420565b0194505050505061079e565b600061145387612464565b9050600061146082611a4b565b9050600061146d826123d0565b905061147e600082116101396113cc565b61148d8682111561013a6113cc565b505060008061149c8684612471565b9150915060006114ab836123d0565b6114b4836123d0565b039050801561150c5760006114c9848d612420565b6114d3848e612420565b03905060006114e1856123d0565b8903905082818302816114f057fe5b056114fb868f612420565b01995050505050505050505061079e565b611516838c612420565b97505050505050505061079e565b60006105d1655af3107a40008302612524565b6001600160a01b03831660009081526020819052604090205461155f828210156101966113cc565b6115766001600160a01b03841615156101996113cc565b6001600160a01b038085166000908152602081905260408082208585039055918516815220546115a690836111c6565b6001600160a01b0380851660008181526020819052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115f8908690614993565b60405180910390a350505050565b6107d761161161135a565b6101926113cc565b60085461162690826111d8565b6008556040517f3e350b41e86a8e10f804ade6d35340d620be35569cc75ac943e8bb14ab80ead19061134f908390614970565b600854611665816117cd565b156105e85761167f611678600954612901565b8290612945565b905061169b61169461168f6105eb565b612901565b8290612952565b60085550565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061170e612960565b306040516020016117239594939291906149ef565b60405160208183030381529060405280519060200120905090565b61175164e8d4a5100082101560cb6113cc565b61176767016345785d8a000082111560ca6113cc565b60085461177490826111e6565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc9061134f908390614993565b60006105d18282612964565b60006105d1826016612964565b60006105d182602c61298b565b60006105d1826055612995565b60006105d182605661299f565b6113da81831460676113cc565b6000606080606061180361206a565b905061180d61135a565b156118555761182387896000815181106110ea57fe5b600061182f828a6120d8565b90506118408983600954848b6129ac565b925061184f89846111f4612a90565b50611876565b60408051600280825260608201835290916020830190803683370190505091505b611881888287612b22565b909450925061189388846111f4612a90565b61189d81896120d8565b600955509750975097945050505050565b6118d5816000815181106118be57fe5b60200260200101516118d06001611d09565b612b8f565b816000815181106118e257fe5b602002602001018181525050611910816001815181106118fe57fe5b60200260200101516118d06000611d09565b8160018151811061191d57fe5b60200260200101818152505050565b3330146119ea576000306001600160a01b03166000366040516119509291906148b5565b6000604051808303816000865af19150503d806000811461198d576040519150601f19603f3d011682016040523d82523d6000602084013e611992565b606091505b5050905080600081146119a157fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b81146119cc573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b6119f386611b35565b60006060611a0a8b8b8b8b8b8b8b8b63ffffffff16565b5091509150611a1c818463ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b505050505050505050565b60009081526007602052604090205490565b6000806000806000806000611a7188612baf565b9650611a7c88612bbc565b9550611a8788612bc9565b9450611a9288612bd6565b9350611a9d88612be3565b9250611aa888612bf0565b9150611ab3886123d0565b9050919395979092949650565b600082820261079e841580611add575083858381611ada57fe5b04145b60036113cc565b6000611af382151560046113cc565b82611b00575060006105d1565b670de0b6b3a764000083810290611b2390858381611b1a57fe5b041460056113cc565b828181611b2c57fe5b049150506105d1565b611b5c81600081518110611b4557fe5b6020026020010151611b576001611d09565b611ac0565b81600081518110611b6957fe5b60200260200101818152505061191081600181518110611b8557fe5b6020026020010151611b576000611d09565b6001600160a01b038216600090815260208190526040902054611bbf828210156101966113cc565b6001600160a01b03831660009081526020819052604090208282039055600254611be990836111f4565b6002556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112a1908690614993565b60006060806060611c3961206a565b90506000611c47828a6120d8565b90506060611c5a8a84600954858c6129ac565b9050611c698a826111f4612a90565b60006060611c788c868b612bfd565b91509150611c898c826111c6612a90565b611c93858d6120d8565b600955909e909d50909b509950505050505050505050565b611cd281600081518110611cbb57fe5b6020026020010151611ccd6001611d09565b612c57565b81600081518110611cdf57fe5b60200260200101818152505061191081600181518110611cfb57fe5b6020026020010151611ccd60005b600081611d36577f00000000000000000000000000000000000000000000000000000000000000006105d1565b507f0000000000000000000000000000000000000000000000000000000000000000919050565b600081611d8a577f00000000000000000000000000000000000000000000000000000000000000006105d1565b507f0000000000000000000000000000000000000000000000000000000000000000919050565b600061079e8383611ac0565b600854611dc9816117cd565b8015611dd457508343115b15611ebd576000611e277f0000000000000000000000000000000000000000000000000000000000000000857f000000000000000000000000000000000000000000000000000000000000000086612c8a565b90506000611e5e7f000000000000000000000000000000000000000000000000000000000000000086611e59866117b3565b612cbf565b90506000611e6b846113bf565b90506000611e78856117c0565b90506000611e9182848787611e8c8b6117a7565b612cdb565b9050808314611a4057611ea48682612d32565b9550611eb08642612d40565b6008819055955050505050505b50505050565b6000828202611edd841580611add575083858381611ada57fe5b80611eec5760009150506105d1565b670de0b6b3a764000060001982015b046001019150506105d1565b6000611f1a858486858a60600151612d4e565b90505b95945050505050565b600061079e8383612b8f565b6000611f1a858486858a60600151612dc9565b600061079e8383612c57565b6000670de0b6b3a76400008210611f695760006105d1565b50670de0b6b3a76400000390565b6000611f8682151560046113cc565b82611f93575060006105d1565b670de0b6b3a764000083810290611fad90858381611b1a57fe5b826001820381611efb57fe5b6000611fc3610bb6565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611ffb57600080fd5b505afa15801561200f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e89190614605565b60008061203f83611a4b565b9050612058600061204f836123d0565b116101396113cc565b61206281856123dc565b949350505050565b6040805160028082526060808301845292839291906020830190803683370190505090506120986001611d5d565b816000815181106120a557fe5b6020026020010181815250506120bb6000611d5d565b816001815181106120c857fe5b6020908102919091010152905090565b670de0b6b3a764000060005b835181101561213a576121306121298583815181106120ff57fe5b602002602001015185848151811061211357fe5b6020026020010151612e3f90919063ffffffff16565b8390612e8e565b91506001016120e4565b506105d1600082116101376113cc565b60006121546116a1565b82604051602001610b509291906148c5565b60006060600061217584612eba565b9050612190600082600281111561218857fe5b1460ce6113cc565b606061219b85612ed0565b90506121a9815160026117e7565b6121b281611b35565b60606121bc61206a565b905060006121ca82846120d8565b905060006121d9826002611ac0565b6009929092555099919850909650505050505050565b6001600160a01b03821660009081526020819052604090205461221290826111c6565b6001600160a01b03831660009081526020819052604090205560025461223890826111c6565b6002556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612279908590614993565b60405180910390a35050565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b6122a4610b92565b6001600160a01b0316141580156122bf57506122bf83612ee6565b156122e7576122cc610b92565b6001600160a01b0316336001600160a01b03161490506105d1565b6122ef611fb9565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b815260040161231e9392919061499c565b60206040518083038186803b15801561233657600080fd5b505afa15801561234a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236e91906144c5565b90506105d1565b1c6103ff1690565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b60006105d1828261298b565b6000808260028111156123eb57fe5b14156123fa5761236e83612baf565b600182600281111561240857fe5b14156124175761236e83612bc9565b61236e83612be3565b60008082600281111561242f57fe5b141561243e5761236e83612bbc565b600182600281111561244c57fe5b141561245b5761236e83612bd6565b61236e83612bf0565b60006105d1826001612f00565b600080806103ff8180805b8385116124e857600285850104612493818a612f00565b935061249e84611a4b565b92506124a9836123d0565b9150898210156124be578060010195506124e2565b898211156124d1576001810394506124e2565b82839750975050505050505061251d565b5061247c565b888110612506576125006124fb84612f11565b611a4b565b82612513565b816125136124fb85612464565b9650965050505050505b9250929050565b6000612553680238fd42c5cf03ffff19831215801561254c575068070c1cc73b00c800008313155b60096113cc565b60008212156125865761256882600003612524565b6a0c097ce7bc90715b34b9f160241b8161257e57fe5b059050610a56565b60006806f05b59d3b200000083126125c657506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec6302628270000000006125fc565b6803782dace9d900000083126125f857506803782dace9d8ffffff19909101906b1425982cf597cd205cef73806125fc565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac62000000841261264c5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412612688576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b1880000084126126c257682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c40000084126126fc576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac6200000841261273557680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d63100000841261276e5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b188000084126127a7576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c4000084126127e05768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b60008061290d83612f1e565b9050655af3107a40006000821361292c57652d79883d20008203612936565b652d79883d200082015b8161293d57fe5b059392505050565b600061079e838383612f7a565b600061079e83836016612f7a565b4690565b600082821c623fffff16621fffff811361297e5780612062565b623fffff19179392505050565b1c637fffffff1690565b1c60019081161490565b1c6001600160401b031690565b604080516002808252606080830184529283929190602083019080368337019050509050826129dc579050611f1d565b612a4f877f000000000000000000000000000000000000000000000000000000000000000081518110612a0b57fe5b6020026020010151877f000000000000000000000000000000000000000000000000000000000000000081518110612a3f57fe5b6020026020010151878787612f91565b817f000000000000000000000000000000000000000000000000000000000000000081518110612a7b57fe5b60209081029190910101529695505050505050565b612ac683600081518110612aa057fe5b602002602001015183600081518110612ab557fe5b60200260200101518363ffffffff16565b83600081518110612ad357fe5b602002602001018181525050612b0483600181518110612aef57fe5b602002602001015183600181518110612ab557fe5b83600181518110612b1157fe5b602002602001018181525050505050565b600060606000612b3184612eba565b90506000816002811115612b4157fe5b1415612b5c57612b52868686613009565b9250925050612b87565b6001816002811115612b6a57fe5b1415612b7a57612b5286856130b9565b612b528686866130eb565b505b935093915050565b6000612b9e82151560046113cc565b818381612ba757fe5b049392505050565b60006105d18260ea612964565b60006105d18260b5613157565b60006105d182609f612964565b60006105d182606a613157565b60006105d1826054612964565b60006105d182601f613157565b600060606000612c0c84612eba565b90506001816002811115612c1c57fe5b1415612c2d57612b5286868661318a565b6002816002811115612c3b57fe5b1415612c4c57612b528686866131e0565b612b8561013661237d565b6000612c6682151560046113cc565b82612c73575060006105d1565b816001840381612c7f57fe5b0460010190506105d1565b600080612caa612c9a8486611f77565b612ca48789611f77565b90611f77565b9050612cb581612901565b9695505050505050565b600080612ccf61168f8587611f77565b92909203949350505050565b600080612cf785858542612cee8b611a4b565b93929190613263565b9050607842889003101580612d0c5786612d15565b612d1587612464565b600081815260076020526040902092909255509695505050505050565b600061079e8383604b6132b5565b600061079e8383602c6132c5565b6000612d70612d6587670429d069189e0000612e8e565b8311156101306113cc565b6000612d7c87846111c6565b90506000612d8a8883611f77565b90506000612d988887611ae4565b90506000612da683836132d7565b9050612dbb612db482611f51565b8990612e8e565b9a9950505050505050505050565b6000612deb612de085670429d069189e0000612e8e565b8311156101316113cc565b6000612e01612dfa86856111f4565b8690611f77565b90506000612e0f8588611f77565b90506000612e1d83836132d7565b90506000612e3382670de0b6b3a76400006111f4565b9050612dbb8a82611ec3565b600080612e4c8484613303565b90506000612e66612e5f83612710611ec3565b60016111c6565b905080821015612e7b576000925050506105d1565b612e8582826111f4565b925050506105d1565b6000828202612ea8841580611add575083858381611ada57fe5b670de0b6b3a764000090049392505050565b6000818060200190518101906105d19190614621565b60608180602001905181019061079e91906146e6565b6000612ef8631c74c91760e11b610b1b565b909114919050565b60006104008383015b069392505050565b60006105d1826001613404565b6000612f2e6000831360646113cc565b670c7d713b49da000082138015612f4c5750670f43fc2c04ee000082125b15612f6a57670de0b6b3a7640000612f6383613413565b8161257e57fe5b612f7382613531565b9050610a56565b623fffff828116821b90821b198416179392505050565b6000838311612fa257506000611f1d565b6000612fae8585611f77565b90506000612fc4670de0b6b3a764000088611ae4565b9050612fd8826709b6e64a8ec600006138d0565b91506000612fe683836132d7565b90506000612ffd612ff683611f51565b8b90612e8e565b9050612dbb8187612e8e565b60006060613015611606565b600080613021856138e7565b915091506130336002821060646113cc565b604080516002808252606080830184529260208301908036833701905050905061309488838151811061306257fe5b602002602001015188848151811061307657fe5b6020026020010151856130876105eb565b61308f610885565b613909565b8183815181106130a057fe5b6020908102919091010152919791965090945050505050565b6000606060006130c8846139c0565b905060606130de86836130d96105eb565b6139d6565b9196919550909350505050565b600060606130f7611606565b6060600061310485613a87565b91509150613114825160026117e7565b61311d82611b35565b600061313a88888561312d6105eb565b613135610885565b613a9f565b905061314a8282111560cf6113cc565b9791965090945050505050565b600082821c661fffffffffffff16660fffffffffffff81136131795780612062565b661fffffffffffff19179392505050565b6000606080600061319a85613a87565b915091506131aa825160026117e7565b6131b382611b35565b60006131d08888856131c36105eb565b6131cb610885565b613cca565b905061314a8282101560d06113cc565b600060606000806131f0856138e7565b915091506132026002821060646113cc565b604080516002808252606080830184529260208301908036833701905050905061309488838151811061323157fe5b602002602001015188848151811061324557fe5b6020026020010151856132566105eb565b61325e610885565b613eda565b60008061326f876123d0565b83039050600081870261328189612bbc565b01905060008287026132928a612bd6565b01905060008387026132a38b612bf0565b019050612dbb89848a858b868c613f7c565b6103ff811b1992909216911b1790565b637fffffff811b1992909216911b1790565b6000806132e48484613303565b905060006132f7612e5f83612710611ec3565b9050611f1d82826111c6565b6000816133195750670de0b6b3a76400006105d1565b82613326575060006105d1565b613337600160ff1b841060066113cc565b8261335d770bce5086492111aea88f4bb1ca6bcf584181ea8059f76532841060076113cc565b826000670c7d713b49da00008313801561337e5750670f43fc2c04ee000083125b156133b557600061338e84613413565b9050670de0b6b3a764000080820784020583670de0b6b3a7640000830502019150506133c3565b816133bf84613531565b0290505b670de0b6b3a764000090056133fb680238fd42c5cf03ffff1982128015906133f4575068070c1cc73b00c800008213155b60086113cc565b612cb581612524565b60006104008284038101612f09565b670de0b6b3a7640000026000806a0c097ce7bc90715b34b9f160241b808401906ec097ce7bc90715b34b9f0fffffffff198501028161344e57fe5b05905060006a0c097ce7bc90715b34b9f160241b82800205905081806a0c097ce7bc90715b34b9f160241b81840205915060038205016a0c097ce7bc90715b34b9f160241b82840205915060058205016a0c097ce7bc90715b34b9f160241b82840205915060078205016a0c097ce7bc90715b34b9f160241b82840205915060098205016a0c097ce7bc90715b34b9f160241b828402059150600b8205016a0c097ce7bc90715b34b9f160241b828402059150600d8205016a0c097ce7bc90715b34b9f160241b828402059150600f826002919005919091010295945050505050565b6000670de0b6b3a764000082121561356d57613563826a0c097ce7bc90715b34b9f160241b8161355d57fe5b05613531565b6000039050610a56565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c000000000000083126135be57770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e00000083126135f6576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff0084000831261363e576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a7008312613679576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf85083126136b057693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e283126136e757690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d03831261371c5768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb41746121110831261374757680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d831261377c576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f177578893793783126137b1576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b28660383126137e5576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac8312613819576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d63100000808603028161383c57fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000818310156138e0578161079e565b5090919050565b600080828060200190518101906138fe91906146b0565b909590945092505050565b60008061391a84612ca481886111f4565b90506139336709b6e64a8ec600008210156101326113cc565b600061395161394a670de0b6b3a764000089611ae4565b83906132d7565b9050600061396861396183611f51565b8a90612e8e565b9050600061397589611f51565b905060006139838383611ec3565b9050600061399184836111f4565b90506139b06139a96139a28a611f51565b8490612e8e565b82906111c6565b9c9b505050505050505050505050565b60008180602001905181019061079e9190614683565b606060006139e48484611ae4565b9050606085516001600160401b03811180156139ff57600080fd5b50604051908082528060200260200182016040528015613a29578160200160208202803683370190505b50905060005b8651811015613a7d57613a5e83888381518110613a4857fe5b6020026020010151612e8e90919063ffffffff16565b828281518110613a6a57fe5b6020908102919091010152600101613a2f565b5095945050505050565b60606000828060200190518101906138fe919061463d565b6000606084516001600160401b0381118015613aba57600080fd5b50604051908082528060200260200182016040528015613ae4578160200160208202803683370190505b5090506000805b8851811015613ba957613b44898281518110613b0357fe5b6020026020010151612ca4898481518110613b1a57fe5b60200260200101518c8581518110613b2e57fe5b60200260200101516111f490919063ffffffff16565b838281518110613b5057fe5b602002602001018181525050613b9f613b98898381518110613b6e57fe5b6020026020010151858481518110613b8257fe5b6020026020010151611ec390919063ffffffff16565b83906111c6565b9150600101613aeb565b50670de0b6b3a764000060005b8951811015613ca9576000848281518110613bcd57fe5b6020026020010151841115613c2b576000613bf6613bea86611f51565b8d8581518110613a4857fe5b90506000613c0a828c8681518110613b2e57fe5b9050613c22613b98613c1b8b611f51565b8390611f77565b92505050613c42565b888281518110613c3757fe5b602002602001015190505b6000613c6b8c8481518110613c5357fe5b6020026020010151610985848f8781518110613b2e57fe5b9050613c9d613c968c8581518110613c7f57fe5b602002602001015183612e3f90919063ffffffff16565b8590612e8e565b93505050600101613bb6565b50613cbd613cb682611f51565b8790611ec3565b9998505050505050505050565b6000606084516001600160401b0381118015613ce557600080fd5b50604051908082528060200260200182016040528015613d0f578160200160208202803683370190505b5090506000805b8851811015613db757613d6f898281518110613d2e57fe5b6020026020010151610985898481518110613d4557fe5b60200260200101518c8581518110613d5957fe5b60200260200101516111c690919063ffffffff16565b838281518110613d7b57fe5b602002602001018181525050613dad613b98898381518110613d9957fe5b6020026020010151858481518110613a4857fe5b9150600101613d16565b50670de0b6b3a764000060005b8951811015613e9857600083858381518110613ddc57fe5b60200260200101511115613e38576000613e01613bea86670de0b6b3a76400006111f4565b90506000613e15828c8681518110613b2e57fe5b9050613e2f613b98612129670de0b6b3a76400008c6111f4565b92505050613e4f565b888281518110613e4457fe5b602002602001015190505b6000613e788c8481518110613e6057fe5b6020026020010151610985848f8781518110613d5957fe5b9050613e8c613c968c8581518110613c7f57fe5b93505050600101613dc4565b50670de0b6b3a76400008110613ece57613ec4613ebd82670de0b6b3a76400006111f4565b8790612e8e565b9350505050611f1d565b60009350505050611f1d565b600080613eeb84612ca481886111c6565b9050613f046729a2241af62c00008211156101336113cc565b6000613f1b61394a670de0b6b3a764000089611f77565b90506000613f3b613f3483670de0b6b3a76400006111f4565b8a90611ec3565b90506000613f4889611f51565b90506000613f568383611ec3565b90506000613f6484836111f4565b90506139b06139a9613f758a611f51565b8490611f77565b6000613f888282613fdc565b613f9384601f613fe0565b613f9e866054613ff1565b613fa988606a613fe0565b613fb48a609f613ff1565b613fbf8c60b5613fe0565b613fca8e60ea613ff1565b17171717171798975050505050505050565b1b90565b661fffffffffffff91909116901b90565b623fffff91909116901b90565b6040805160608101909152806000815260200160008152602001600081525090565b604080518082019091526000808252602082015290565b80356105d181614b52565b600082601f830112614052578081fd5b815161406561406082614b33565b614b0d565b81815291506020808301908481018184028601820187101561408657600080fd5b60005b848110156140a557815184529282019290820190600101614089565b505050505092915050565b600082601f8301126140c0578081fd5b81356001600160401b038111156140d5578182fd5b6140e8601f8201601f1916602001614b0d565b91508082528360208285010111156140ff57600080fd5b8060208401602084013760009082016020015292915050565b8035600281106105d157600080fd5b80356105d181614b75565b600060208284031215614143578081fd5b813561079e81614b52565b60008060408385031215614160578081fd5b823561416b81614b52565b9150602083013561417b81614b52565b809150509250929050565b60008060006060848603121561419a578081fd5b83356141a581614b52565b925060208401356141b581614b52565b929592945050506040919091013590565b600080600080600080600060e0888a0312156141e0578485fd5b87356141eb81614b52565b965060208801356141fb81614b52565b95506040880135945060608801359350608088013560ff8116811461421e578384fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561424d578182fd5b823561425881614b52565b946020939093013593505050565b60008060006060848603121561427a578081fd5b83516001600160401b0380821115614290578283fd5b818601915086601f8301126142a3578283fd5b81516142b161406082614b33565b80828252602080830192508086018b8283870289010111156142d1578788fd5b8796505b848710156142fc5780516142e881614b52565b8452600196909601959281019281016142d5565b508901519097509350505080821115614313578283fd5b5061432086828701614042565b925050604084015190509250925092565b60006020808385031215614343578182fd5b82356001600160401b03811115614358578283fd5b8301601f81018513614368578283fd5b803561437661406082614b33565b818152838101908385016040808502860187018a1015614394578788fd5b8795505b848610156143e15780828b0312156143ae578788fd5b6143b781614b0d565b6143c18b84614127565b815282880135888201528452600195909501949286019290810190614398565b509098975050505050505050565b60006020808385031215614401578182fd5b82356001600160401b03811115614416578283fd5b8301601f81018513614426578283fd5b803561443461406082614b33565b818152838101908385016060808502860187018a1015614452578788fd5b8795505b848610156143e15780828b03121561446c578788fd5b61447581614b0d565b61447f8b84614127565b81528288013588820152604080840135908201528452600195909501949286019290810190614456565b6000602082840312156144ba578081fd5b813561079e81614b67565b6000602082840312156144d6578081fd5b815161079e81614b67565b600080600080600080600060e0888a0312156144fb578081fd5b8735965060208089013561450e81614b52565b9650604089013561451e81614b52565b955060608901356001600160401b0380821115614539578384fd5b818b0191508b601f83011261454c578384fd5b813561455a61406082614b33565b8082825285820191508585018f878886028801011115614578578788fd5b8795505b8386101561459a57803583526001959095019491860191860161457c565b509850505060808b0135955060a08b0135945060c08b01359250808311156145c0578384fd5b50506145ce8a828b016140b0565b91505092959891949750929550565b6000602082840312156145ee578081fd5b81356001600160e01b03198116811461079e578182fd5b600060208284031215614616578081fd5b815161079e81614b52565b600060208284031215614632578081fd5b815161079e81614b75565b600080600060608486031215614651578081fd5b835161465c81614b75565b60208501519093506001600160401b03811115614677578182fd5b61432086828701614042565b60008060408385031215614695578182fd5b82516146a081614b75565b6020939093015192949293505050565b6000806000606084860312156146c4578081fd5b83516146cf81614b75565b602085015160409095015190969495509392505050565b600080604083850312156146f8578182fd5b825161470381614b75565b60208401519092506001600160401b0381111561471e578182fd5b61472a85828601614042565b9150509250929050565b600060208284031215614745578081fd5b813561079e81614b75565b600080600060608486031215614764578081fd5b83356001600160401b038082111561477a578283fd5b8186019150610120808389031215614790578384fd5b61479981614b0d565b90506147a58884614118565b81526147b48860208501614037565b60208201526147c68860408501614037565b6040820152606083013560608201526080830135608082015260a083013560a08201526147f68860c08501614037565b60c08201526148088860e08501614037565b60e08201526101008084013583811115614820578586fd5b61482c8a8287016140b0565b9183019190915250976020870135975060409096013595945050505050565b60006020828403121561485c578081fd5b5035919050565b6000815180845260208085019450808401835b8381101561489257815187529582019590820190600101614876565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b8181101561492c57835183529284019291840191600101614910565b50909695505050505050565b60006020825261079e6020830184614863565b60006040825261495e6040830185614863565b8281036020840152611f1d8185614863565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b968752602087019590955260408601939093526060850191909152608084015260a083015260c082015260e00190565b9586526020860194909452604085019290925260608401521515608083015260a082015260c00190565b6000602080835283518082850152825b81811015614abf57858101830151858201604001528201614aa3565b81811115614ad05783604083870101525b50601f01601f1916929092016040019392505050565b6000838252604060208301526120626040830184614863565b60ff91909116815260200190565b6040518181016001600160401b0381118282101715614b2b57600080fd5b604052919050565b60006001600160401b03821115614b48578081fd5b5060209081020190565b6001600160a01b03811681146105e857600080fd5b80151581146105e857600080fd5b600381106105e857600080fdfea26469706673582212201dbf8d364d926088a19c5f3f5d0ca0ab72cf3eda8f3f78dda45ab2619de4b6d664736f6c63430007010033a264697066735822122062c63a2c3089490a939fe9f20e0e99ef310f04a393c33a92c66f45a3b2cea18064736f6c63430007010033" +} diff --git a/crates/contracts/artifacts/BalancerV2WeightedPoolFactory.json b/crates/contracts/artifacts/BalancerV2WeightedPoolFactory.json index f324899ea1..2b3a393535 100644 --- a/crates/contracts/artifacts/BalancerV2WeightedPoolFactory.json +++ b/crates/contracts/artifacts/BalancerV2WeightedPoolFactory.json @@ -1 +1,123 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"weights","type":"uint256[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPauseConfiguration","outputs":[{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"bytecode":"0x60c060405234801561001057600080fd5b5060405161604138038061604183398101604081905261002f9161004d565b60601b6001600160601b0319166080526276a700420160a05261007b565b60006020828403121561005e578081fd5b81516001600160a01b0381168114610074578182fd5b9392505050565b60805160601c60a051615f9c6100a56000398060d6528061010052508061015c5250615f9c6000f3fe60806040523480156200001157600080fd5b5060043610620000525760003560e01c80632da47c4014620000575780636634b753146200007a5780638d928af814620000a0578063fbce039314620000b9575b600080fd5b62000061620000d0565b6040516200007192919062000634565b60405180910390f35b620000916200008b366004620003c0565b6200013c565b60405162000071919062000562565b620000aa6200015a565b6040516200007191906200054e565b620000aa620000ca366004620003e6565b6200017e565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156200012e57807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915062000137565b60009250600091505b509091565b6001600160a01b031660009081526020819052604090205460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008060006200018d620000d0565b9150915060006200019d6200015a565b8a8a8a8a8a88888c604051620001b3906200024b565b620001c7999897969594939291906200056d565b604051809103906000f080158015620001e4573d6000803e3d6000fd5b509050620001f281620001ff565b9998505050505050505050565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a250565b6158b680620006b183390190565b8035620002668162000697565b92915050565b600082601f8301126200027d578081fd5b8135620002946200028e826200066a565b62000642565b818152915060208083019084810181840286018201871015620002b657600080fd5b60005b84811015620002e2578135620002cf8162000697565b84529282019290820190600101620002b9565b505050505092915050565b600082601f830112620002fe578081fd5b81356200030f6200028e826200066a565b8181529150602080830190848101818402860182018710156200033157600080fd5b60005b84811015620002e25781358452928201929082019060010162000334565b600082601f83011262000363578081fd5b813567ffffffffffffffff8111156200037a578182fd5b6200038f601f8201601f191660200162000642565b9150808252836020828501011115620003a757600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215620003d2578081fd5b8135620003df8162000697565b9392505050565b60008060008060008060c08789031215620003ff578182fd5b863567ffffffffffffffff8082111562000417578384fd5b620004258a838b0162000352565b975060208901359150808211156200043b578384fd5b620004498a838b0162000352565b965060408901359150808211156200045f578384fd5b6200046d8a838b016200026c565b9550606089013591508082111562000483578384fd5b506200049289828a01620002ed565b93505060808701359150620004ab8860a0890162000259565b90509295509295509295565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015620004f557815187529582019590820190600101620004d7565b509495945050505050565b60008151808452815b81811015620005275760208185018101518683018201520162000509565b81811115620005395782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b60006101206001600160a01b038c16835260208181850152620005938285018d62000500565b91508382036040850152620005a9828c62000500565b84810360608601528a51808252828c01935090820190845b81811015620005e957620005d685516200068b565b83529383019391830191600101620005c1565b50508481036080860152620005ff818b620004c4565b93505050508560a08301528460c08301528360e083015262000626610100830184620004b7565b9a9950505050505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff811182821017156200066257600080fd5b604052919050565b600067ffffffffffffffff82111562000681578081fd5b5060209081020190565b6001600160a01b031690565b6001600160a01b0381168114620006ad57600080fd5b5056fe6105006040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120523480156200003757600080fd5b50604051620058b6380380620058b68339810160408190526200005a9162000cf2565b88888888878787878785516002146200007557600162000078565b60025b6040805180820190915260018152603160f81b6020808301918252336080526001600160601b0319606087901b1660a0528b51908c0190812060c0529151902060e0527f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6101005289518a918a918a918a918a918a918a91849184918a918a9162000107916003919062000abb565b5080516200011d90600490602084019062000abb565b50620001359150506276a70083111561019462000865565b6200014962278d0082111561019562000865565b42909101610140819052016101605284516200016b906002111560c862000865565b6200018360088651111560c96200086560201b60201c565b62000199856200087a60201b62000d571760201c565b620001a48462000886565b6040516309b2760f60e01b81526000906001600160a01b038b16906309b2760f90620001d5908c9060040162000eab565b602060405180830381600087803b158015620001f057600080fd5b505af115801562000205573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022b919062000cd9565b9050896001600160a01b03166366a9c7d2828889516001600160401b03811180156200025657600080fd5b5060405190808252806020026020018201604052801562000281578160200160208202803683370190505b506040518463ffffffff1660e01b8152600401620002a29392919062000e0f565b600060405180830381600087803b158015620002bd57600080fd5b505af1158015620002d2573d6000803e3d6000fd5b5050506001600160601b031960608c901b1661018052506101a081905285516101c0528551620003045760006200031b565b856000815181106200031257fe5b60200260200101515b60601b6001600160601b0319166101e05285516001106200033e57600062000355565b856001815181106200034c57fe5b60200260200101515b60601b6001600160601b031916610200528551600210620003785760006200038f565b856002815181106200038657fe5b60200260200101515b60601b6001600160601b031916610220528551600310620003b2576000620003c9565b85600381518110620003c057fe5b60200260200101515b60601b6001600160601b031916610240528551600410620003ec57600062000403565b85600481518110620003fa57fe5b60200260200101515b60601b6001600160601b031916610260528551600510620004265760006200043d565b856005815181106200043457fe5b60200260200101515b60601b6001600160601b0319166102805285516006106200046057600062000477565b856006815181106200046e57fe5b60200260200101515b60601b6001600160601b0319166102a05285516007106200049a576000620004b1565b85600781518110620004a857fe5b60200260200101515b60601b6001600160601b0319166102c0528551620004d1576000620004f7565b620004f786600081518110620004e357fe5b6020026020010151620008f560201b60201c565b6102e05285516001106200050d5760006200051f565b6200051f86600181518110620004e357fe5b6103005285516002106200053557600062000547565b6200054786600281518110620004e357fe5b6103205285516003106200055d5760006200056f565b6200056f86600381518110620004e357fe5b6103405285516004106200058557600062000597565b6200059786600481518110620004e357fe5b610360528551600510620005ad576000620005bf565b620005bf86600581518110620004e357fe5b610380528551600610620005d5576000620005e7565b620005e786600681518110620004e357fe5b6103a0528551600710620005fd5760006200060f565b6200060f86600781518110620004e357fe5b6103c08181525050505050505050505050505050505050505050600086519050620006478187516200099760201b62000d651760201c565b6000806000805b848160ff161015620006cd5760008a8260ff16815181106200066c57fe5b6020026020010151905062000694662386f26fc1000082101561012e6200086560201b60201c565b620006ae8186620009a660201b62000d721790919060201c565b945082811115620006c3578160ff1693508092505b506001016200064e565b50620006e6670de0b6b3a7640000841461013462000865565b6103e08290528851620006fb57600062000712565b886000815181106200070957fe5b60200260200101515b610400528851600110620007285760006200073f565b886001815181106200073657fe5b60200260200101515b610420528851600210620007555760006200076c565b886002815181106200076357fe5b60200260200101515b6104405288516003106200078257600062000799565b886003815181106200079057fe5b60200260200101515b610460528851600410620007af576000620007c6565b88600481518110620007bd57fe5b60200260200101515b610480528851600510620007dc576000620007f3565b88600581518110620007ea57fe5b60200260200101515b6104a05288516006106200080957600062000820565b886006815181106200081757fe5b60200260200101515b6104c0528851600710620008365760006200084d565b886007815181106200084457fe5b60200260200101515b6104e0525062000f329b505050505050505050505050565b8162000876576200087681620009c3565b5050565b80620008768162000a16565b6200089b64e8d4a5100082101560cb62000865565b620008b367016345785d8a000082111560ca62000865565b60078190556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90620008ea90839062000ec0565b60405180910390a150565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200093257600080fd5b505afa15801562000947573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200096d919062000dec565b60ff16905060006200098c60128362000aa360201b62000d841760201c565b600a0a949350505050565b62000876828214606762000865565b6000828201620009ba848210158362000865565b90505b92915050565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b60028151101562000a275762000aa0565b60008160008151811062000a3757fe5b602002602001015190506000600190505b825181101562000a9d57600083828151811062000a6157fe5b6020026020010151905062000a92816001600160a01b0316846001600160a01b03161060656200086560201b60201c565b915060010162000a48565b50505b50565b600062000ab583831115600162000865565b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000afe57805160ff191683800117855562000b2e565b8280016001018555821562000b2e579182015b8281111562000b2e57825182559160200191906001019062000b11565b5062000b3c92915062000b40565b5090565b5b8082111562000b3c576000815560010162000b41565b8051620009bd8162000f1c565b600082601f83011262000b75578081fd5b815162000b8c62000b868262000ef0565b62000ec9565b81815291506020808301908481018184028601820187101562000bae57600080fd5b60005b8481101562000bda57815162000bc78162000f1c565b8452928201929082019060010162000bb1565b505050505092915050565b600082601f83011262000bf6578081fd5b815162000c0762000b868262000ef0565b81815291506020808301908481018184028601820187101562000c2957600080fd5b60005b8481101562000bda5781518452928201929082019060010162000c2c565b600082601f83011262000c5b578081fd5b81516001600160401b0381111562000c71578182fd5b602062000c87601f8301601f1916820162000ec9565b9250818352848183860101111562000c9e57600080fd5b60005b8281101562000cbe57848101820151848201830152810162000ca1565b8281111562000cd05760008284860101525b50505092915050565b60006020828403121562000ceb578081fd5b5051919050565b60008060008060008060008060006101208a8c03121562000d11578485fd5b62000d1d8b8b62000b57565b60208b01519099506001600160401b038082111562000d3a578687fd5b62000d488d838e0162000c4a565b995060408c015191508082111562000d5e578687fd5b62000d6c8d838e0162000c4a565b985060608c015191508082111562000d82578687fd5b62000d908d838e0162000b64565b975060808c015191508082111562000da6578687fd5b5062000db58c828d0162000be5565b95505060a08a0151935060c08a0151925060e08a0151915062000ddd8b6101008c0162000b57565b90509295985092959850929598565b60006020828403121562000dfe578081fd5b815160ff81168114620009ba578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000e5b5762000e48855162000f10565b8352938301939183019160010162000e33565b505084810360408601528551808252908201925081860190845b8181101562000e9d5762000e8a835162000f10565b8552938301939183019160010162000e75565b509298975050505050505050565b602081016003831062000eba57fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000ee857600080fd5b604052919050565b60006001600160401b0382111562000f06578081fd5b5060209081020190565b6001600160a01b031690565b6001600160a01b038116811462000aa057600080fd5b60805160a05160601c60c05160e051610100516101205161014051610160516101805160601c6101a0516101c0516101e05160601c6102005160601c6102205160601c6102405160601c6102605160601c6102805160601c6102a05160601c6102c05160601c6102e05161030051610320516103405161036051610380516103a0516103c0516103e05161040051610420516104405161046051610480516104a0516104c0516104e05161476e6200114860003980611ec55280612857525080611e8252806127f6525080611e3f5280612795525080611dfc5280612734525080611db952806126d3525080611d765280612672525080611d335280612611525080611cf052806125b05250806122d0528061230452806123405250806116285280611b1e5250806115e55280611abd5250806115a25280611a5c52508061155f52806119fb52508061151c528061199a5250806114d9528061193952508061149652806118d85250806114455280611877525080611ae3528061281c525080611a8252806127bb525080611a21528061275a5250806119c052806126f952508061195f52806126985250806118fe528061263752508061189d52806125d652508061183c52806125755250806111025250806105d7525080610835525080610ef1525080610ecd525080610ab5525080610ff452508061103652508061101552508061081152508061079b525061476e6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80637ecebe001161010f578063a9059cbb116100a2578063d5c096c411610071578063d5c096c4146103e6578063d73dd623146103f9578063dd62ed3e1461040c578063f89f27ed1461041f576101f0565b8063a9059cbb146103b0578063aaabadc5146103c3578063c0ff1a15146103cb578063d505accf146103d3576101f0565b80638d928af8116100de5780638d928af81461038557806395d89b411461038d5780639b02cdde146103955780639d2c110c1461039d576101f0565b80637ecebe0014610337578063851c1bb31461034a57806387ec68171461035d578063893d20e814610370576101f0565b806338e9922e11610187578063661884631161015657806366188463146102e8578063679aefce146102fb57806370a082311461030357806374f3b00914610316576101f0565b806338e9922e146102a457806338fff2d0146102b757806355c67628146102bf5780636028bfd4146102c7576101f0565b80631c0de051116101c35780631c0de0511461025d57806323b872dd14610274578063313ce567146102875780633644e5151461029c576101f0565b806306fdde03146101f5578063095ea7b31461021357806316c38b3c1461023357806318160ddd14610248575b600080fd5b6101fd610434565b60405161020a9190614647565b60405180910390f35b61022661022136600461401c565b6104cb565b60405161020a919061457e565b610246610241366004614113565b6104e2565b005b6102506104f6565b60405161020a91906145a1565b6102656104fc565b60405161020a93929190614589565b610226610282366004613f67565b610525565b61028f6105a8565b60405161020a91906146b3565b6102506105ad565b6102466102b236600461449d565b6105bc565b6102506105d5565b6102506105f9565b6102da6102d536600461414b565b6105ff565b60405161020a92919061469a565b6102266102f636600461401c565b610636565b610250610690565b610250610311366004613f13565b6106bb565b61032961032436600461414b565b6106da565b60405161020a929190614559565b610250610345366004613f13565b61077c565b610250610358366004614248565b610797565b6102da61036b36600461414b565b6107e9565b61037861080f565b60405161020a9190614532565b610378610833565b6101fd610857565b6102506108b8565b6102506103ab3660046143a1565b6108be565b6102266103be36600461401c565b6109a5565b6103786109b2565b6102506109bc565b6102466103e1366004613fa7565b610a80565b6103296103f436600461414b565b610bc9565b61022661040736600461401c565b610cec565b61025061041a366004613f2f565b610d22565b610427610d4d565b60405161020a9190614546565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104c05780601f10610495576101008083540402835291602001916104c0565b820191906000526020600020905b8154815290600101906020018083116104a357829003601f168201915b505050505090505b90565b60006104d8338484610d9a565b5060015b92915050565b6104ea610e02565b6104f381610e30565b50565b60025490565b6000806000610509610eae565b159250610514610ecb565b915061051e610eef565b9050909192565b6001600160a01b0383166000818152600160209081526040808320338085529252822054919261056391148061055b5750838210155b610197610f13565b61056e858585610f21565b336001600160a01b0386161480159061058957506000198114155b1561059b5761059b8533858403610d9a565b60019150505b9392505050565b601290565b60006105b7610ff0565b905090565b6105c4610e02565b6105cc61108d565b6104f3816110a2565b7f000000000000000000000000000000000000000000000000000000000000000090565b60075490565b600060606106158651610610611100565b610d65565b61062a898989898989896111246111ec611252565b97509795505050505050565b3360009081526001602090815260408083206001600160a01b03861684529091528120548083106106725761066d33856000610d9a565b610686565b61068633856106818487610d84565b610d9a565b5060019392505050565b60006105b761069d6104f6565b6106b56106a86109bc565b6106b0611100565b611374565b90611398565b6001600160a01b0381166000908152602081905260409020545b919050565b606080886107046106e9610833565b6001600160a01b0316336001600160a01b03161460cd610f13565b61071961070f6105d5565b82146101f4610f13565b60606107236113e9565b905061072f8882611666565b60006060806107438e8e8e8e8e8e8e611124565b9250925092506107538d846116c7565b61075d82856111ec565b61076781856111ec565b909550935050505b5097509795505050505050565b6001600160a01b031660009081526005602052604090205490565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016107cc9291906144ef565b604051602081830303815290604052805190602001209050919050565b600060606107fa8651610610611100565b61062a8989898989898961175a6117d7611252565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104c05780601f10610495576101008083540402835291602001916104c0565b60085490565b6000806108ce8560200151611838565b905060006108df8660400151611838565b90506000865160018111156108f057fe5b1415610956576109038660600151611b4d565b60608701526109128583611b71565b945061091e8482611b71565b935061092e866060015183611b71565b60608701526000610940878787611b7d565b905061094c8183611bb8565b93505050506105a1565b6109608583611b71565b945061096c8482611b71565b935061097c866060015182611b71565b6060870152600061098e878787611bc4565b905061099a8184611bf7565b905061094c81611c03565b60006104d8338484610f21565b60006105b7611c1a565b600060606109c8610833565b6001600160a01b031663f94d46686109de6105d5565b6040518263ffffffff1660e01b81526004016109fa91906145a1565b60006040518083038186803b158015610a1257600080fd5b505afa158015610a26573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a4e9190810190614047565b50915050610a6381610a5e6113e9565b611666565b6060610a6d611c94565b9050610a798183611ef1565b9250505090565b610a8e8442111560d1610f13565b6001600160a01b0387166000908152600560209081526040808320549051909291610ae5917f0000000000000000000000000000000000000000000000000000000000000000918c918c918c9188918d91016145c9565b6040516020818303038152906040528051906020012090506000610b0882611f63565b9050600060018288888860405160008152602001604052604051610b2f9493929190614629565b6020604051602081039080840390855afa158015610b51573d6000803e3d6000fd5b5050604051601f1901519150610b9390506001600160a01b03821615801590610b8b57508b6001600160a01b0316826001600160a01b0316145b6101f8610f13565b6001600160a01b038b166000908152600560205260409020600185019055610bbc8b8b8b610d9a565b5050505050505050505050565b60608088610bd86106e9610833565b610be361070f6105d5565b6060610bed6113e9565b9050610bf76104f6565b610c9d5760006060610c0b8d8d8d8a611f7f565b91509150610c20620f424083101560cc610f13565b610c2e6000620f424061201a565b610c3d8b620f4240840361201a565b610c4781846117d7565b80610c50611100565b67ffffffffffffffff81118015610c6657600080fd5b50604051908082528060200260200182016040528015610c90578160200160208202803683370190505b509550955050505061076f565b610ca78882611666565b6000606080610cbb8e8e8e8e8e8e8e61175a565b925092509250610ccb8c8461201a565b610cd582856117d7565b610cdf81856111ec565b909550935061076f915050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104d89185906106819086610d72565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606105b7611c94565b80610d61816120b0565b5050565b610d618183146067610f13565b60008282016105a18482101583610f13565b6000610d94838311156001610f13565b50900390565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610df59085906145a1565b60405180910390a3505050565b6000610e196000356001600160e01b031916610797565b90506104f3610e288233612129565b610191610f13565b8015610e5057610e4b610e41610ecb565b4210610193610f13565b610e65565b610e65610e5b610eef565b42106101a9610f13565b6006805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490610ea390839061457e565b60405180910390a150565b6000610eb8610eef565b4211806105b757505060065460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b81610d6157610d6181612219565b6001600160a01b038316600090815260208190526040902054610f4982821015610196610f13565b610f606001600160a01b0384161515610199610f13565b6001600160a01b03808516600090815260208190526040808220858503905591851681522054610f909083610d72565b6001600160a01b0380851660008181526020819052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610fe29086906145a1565b60405180910390a350505050565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061105d61226c565b306040516020016110729594939291906145fd565b60405160208183030381529060405280519060200120905090565b6110a0611098610eae565b610192610f13565b565b6110b564e8d4a5100082101560cb610f13565b6110cb67016345785d8a000082111560ca610f13565b60078190556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90610ea39083906145a1565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006060806060611133611c94565b905061113d610eae565b1561117457600061114e828a611ef1565b905061115f8983600854848b612270565b925061116e8984610d84612380565b506111c0565b61117c611100565b67ffffffffffffffff8111801561119257600080fd5b506040519080825280602002602001820160405280156111bc578160200160208202803683370190505b5091505b6111cb8882876123eb565b90945092506111db888483612458565b600855509750975097945050505050565b60005b6111f7611100565b81101561124d5761122e83828151811061120d57fe5b602002602001015183838151811061122157fe5b6020026020010151612471565b83828151811061123a57fe5b60209081029190910101526001016111ef565b505050565b333014611310576000306001600160a01b0316600036604051611276929190614507565b6000604051808303816000865af19150503d80600081146112b3576040519150601f19603f3d011682016040523d82523d6000602084013e6112b8565b606091505b5050905080600081146112c757fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b81146112f2573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b606061131a6113e9565b90506113268782611666565b6000606061133d8c8c8c8c8c8c8c8c63ffffffff16565b509150915061135081848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b60008282026105a184158061139157508385838161138e57fe5b04145b6003610f13565b60006113a78215156004610f13565b826113b4575060006104dc565b670de0b6b3a7640000838102906113d7908583816113ce57fe5b04146005610f13565b8281816113e057fe5b049150506104dc565b606060006113f5611100565b905060608167ffffffffffffffff8111801561141057600080fd5b5060405190808252806020026020018201604052801561143a578160200160208202803683370190505b5090508115611482577f00000000000000000000000000000000000000000000000000000000000000008160008151811061147157fe5b60200260200101818152505061148b565b91506104c89050565b6001821115611482577f0000000000000000000000000000000000000000000000000000000000000000816001815181106114c257fe5b6020026020010181815250506002821115611482577f00000000000000000000000000000000000000000000000000000000000000008160028151811061150557fe5b6020026020010181815250506003821115611482577f00000000000000000000000000000000000000000000000000000000000000008160038151811061154857fe5b6020026020010181815250506004821115611482577f00000000000000000000000000000000000000000000000000000000000000008160048151811061158b57fe5b6020026020010181815250506005821115611482577f0000000000000000000000000000000000000000000000000000000000000000816005815181106115ce57fe5b6020026020010181815250506006821115611482577f00000000000000000000000000000000000000000000000000000000000000008160068151811061161157fe5b6020026020010181815250506007821115611482577f00000000000000000000000000000000000000000000000000000000000000008160078151811061165457fe5b60200260200101818152505091505090565b60005b611671611100565b81101561124d576116a883828151811061168757fe5b602002602001015183838151811061169b57fe5b6020026020010151611374565b8382815181106116b457fe5b6020908102919091010152600101611669565b6001600160a01b0382166000908152602081905260409020546116ef82821015610196610f13565b6001600160a01b038316600090815260208190526040902082820390556002546117199083610d84565b6002556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610df59086906145a1565b600060608061176761108d565b6060611771611c94565b9050600061177f828a611ef1565b905060606117928a84600854858c612270565b90506117a18a82610d84612380565b600060606117b08c868b612491565b915091506117bf8c82876124eb565b600855909e909d50909b509950505050505050505050565b60005b6117e2611100565b81101561124d576118198382815181106117f857fe5b602002602001015183838151811061180c57fe5b60200260200101516124fa565b83828151811061182557fe5b60209081029190910101526001016117da565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561189b57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156118fc57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561195d57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156119be57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611a1f57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611a8057507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611ae157507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611b4257507f00000000000000000000000000000000000000000000000000000000000000006106d5565b6106d5610135612219565b600080611b656007548461252d90919063ffffffff16565b90506105a18382610d84565b60006105a18383611374565b6000611b8761108d565b611bb083611b988660200151612571565b84611ba68860400151612571565b886060015161287b565b949350505050565b60006105a18383612471565b6000611bce61108d565b611bb083611bdf8660200151612571565b84611bed8860400151612571565b88606001516128f6565b60006105a183836124fa565b60006104dc611c1360075461296c565b8390612992565b6000611c24610833565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611c5c57600080fd5b505afa158015611c70573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b79190614270565b60606000611ca0611100565b905060608167ffffffffffffffff81118015611cbb57600080fd5b50604051908082528060200260200182016040528015611ce5578160200160208202803683370190505b5090508115611482577f000000000000000000000000000000000000000000000000000000000000000081600081518110611d1c57fe5b6020026020010181815250506001821115611482577f000000000000000000000000000000000000000000000000000000000000000081600181518110611d5f57fe5b6020026020010181815250506002821115611482577f000000000000000000000000000000000000000000000000000000000000000081600281518110611da257fe5b6020026020010181815250506003821115611482577f000000000000000000000000000000000000000000000000000000000000000081600381518110611de557fe5b6020026020010181815250506004821115611482577f000000000000000000000000000000000000000000000000000000000000000081600481518110611e2857fe5b6020026020010181815250506005821115611482577f000000000000000000000000000000000000000000000000000000000000000081600581518110611e6b57fe5b6020026020010181815250506006821115611482577f000000000000000000000000000000000000000000000000000000000000000081600681518110611eae57fe5b6020026020010181815250506007821115611482577f00000000000000000000000000000000000000000000000000000000000000008160078151811061165457fe5b670de0b6b3a764000060005b8351811015611f5357611f49611f42858381518110611f1857fe5b6020026020010151858481518110611f2c57fe5b60200260200101516129d490919063ffffffff16565b8390612a23565b9150600101611efd565b506104dc60008211610137610f13565b6000611f6d610ff0565b826040516020016107cc929190614517565b60006060611f8b61108d565b6000611f9684612a4f565b9050611fb16000826002811115611fa957fe5b1460ce610f13565b6060611fbc85612a65565b9050611fd0611fc9611100565b8251610d65565b611fdc81610a5e6113e9565b6060611fe6611c94565b90506000611ff48284611ef1565b90506000612004826106b0611100565b6008929092555099919850909650505050505050565b6001600160a01b03821660009081526020819052604090205461203d9082610d72565b6001600160a01b0383166000908152602081905260409020556002546120639082610d72565b6002556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906120a49085906145a1565b60405180910390a35050565b6002815110156120bf576104f3565b6000816000815181106120ce57fe5b602002602001015190506000600190505b825181101561124d5760008382815181106120f657fe5b6020026020010151905061211f816001600160a01b0316846001600160a01b0316106065610f13565b91506001016120df565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b61214861080f565b6001600160a01b031614158015612163575061216383612a7b565b1561218b5761217061080f565b6001600160a01b0316336001600160a01b03161490506104dc565b612193611c1a565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016121c2939291906145aa565b60206040518083038186803b1580156121da57600080fd5b505afa1580156121ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612212919061412f565b90506104dc565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b4690565b60608061227b611100565b67ffffffffffffffff8111801561229157600080fd5b506040519080825280602002602001820160405280156122bb578160200160208202803683370190505b509050826122ca579050612377565b61233d877f0000000000000000000000000000000000000000000000000000000000000000815181106122f957fe5b6020026020010151877f00000000000000000000000000000000000000000000000000000000000000008151811061232d57fe5b6020026020010151878787612a95565b817f00000000000000000000000000000000000000000000000000000000000000008151811061236957fe5b602090810291909101015290505b95945050505050565b60005b61238b611100565b8110156123e5576123c68482815181106123a157fe5b60200260200101518483815181106123b557fe5b60200260200101518463ffffffff16565b8482815181106123d257fe5b6020908102919091010152600101612383565b50505050565b6000606060006123fa84612a4f565b9050600081600281111561240a57fe5b14156124255761241b868686612b0d565b9250925050612450565b600181600281111561243357fe5b14156124435761241b8685612beb565b61241b868686612c1d565b505b935093915050565b60006124678484610d84612380565b611bb08285611ef1565b60006124808215156004610f13565b81838161248957fe5b049392505050565b6000606060006124a084612a4f565b905060018160028111156124b057fe5b14156124c15761241b868686612c88565b60028160028111156124cf57fe5b14156124e05761241b868686612ce2565b61244e610136612219565b60006124678484610d72612380565b60006125098215156004610f13565b82612516575060006104dc565b81600184038161252257fe5b0460010190506104dc565b600082820261254784158061139157508385838161138e57fe5b806125565760009150506104dc565b670de0b6b3a764000060001982015b046001019150506104dc565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125d457507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561263557507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561269657507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156126f757507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561275857507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156127b957507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561281a57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611b4257507f00000000000000000000000000000000000000000000000000000000000000006106d5565b600061289d61289287670429d069189e0000612a23565b831115610130610f13565b60006128a98784610d72565b905060006128b78883612992565b905060006128c58887611398565b905060006128d38383612d8a565b90506128e86128e18261296c565b8990612a23565b9a9950505050505050505050565b600061291861290d85670429d069189e0000612a23565b831115610131610f13565b600061292e6129278685610d84565b8690612992565b9050600061293c8588612992565b9050600061294a8383612d8a565b9050600061296082670de0b6b3a7640000610d84565b90506128e88a8261252d565b6000670de0b6b3a764000082106129845760006104dc565b50670de0b6b3a76400000390565b60006129a18215156004610f13565b826129ae575060006104dc565b670de0b6b3a7640000838102906129c8908583816113ce57fe5b82600182038161256557fe5b6000806129e18484612db6565b905060006129fb6129f48361271061252d565b6001610d72565b905080821015612a10576000925050506104dc565b612a1a8282610d84565b925050506104dc565b6000828202612a3d84158061139157508385838161138e57fe5b670de0b6b3a764000090049392505050565b6000818060200190518101906104dc919061428c565b6060818060200190518101906105a19190614352565b6000612a8d631c74c91760e11b610797565b909114919050565b6000838311612aa657506000612377565b6000612ab28585612992565b90506000612ac8670de0b6b3a764000088611398565b9050612adc826709b6e64a8ec60000612ec1565b91506000612aea8383612d8a565b90506000612b01612afa8361296c565b8b90612a23565b90506128e88187612a23565b60006060612b1961108d565b600080612b2585612ed8565b91509150612b3d612b34611100565b82106064610f13565b6060612b47611100565b67ffffffffffffffff81118015612b5d57600080fd5b50604051908082528060200260200182016040528015612b87578160200160208202803683370190505b509050612bc6888381518110612b9957fe5b6020026020010151888481518110612bad57fe5b602002602001015185612bbe6104f6565b600754612efa565b818381518110612bd257fe5b6020908102919091010152919791965090945050505050565b600060606000612bfa84612fb7565b90506060612c108683612c0b6104f6565b612fcd565b9196919550909350505050565b60006060612c2961108d565b60606000612c368561307f565b91509150612c478251610610611100565b612c5382610a5e6113e9565b6000612c6b888885612c636104f6565b600754613097565b9050612c7b8282111560cf610f13565b9791965090945050505050565b60006060806000612c988561307f565b91509150612cae612ca7611100565b8351610d65565b612cba82610a5e6113e9565b6000612cd2888885612cca6104f6565b6007546132bc565b9050612c7b8282101560d0610f13565b60006060600080612cf285612ed8565b91509150612d01612b34611100565b6060612d0b611100565b67ffffffffffffffff81118015612d2157600080fd5b50604051908082528060200260200182016040528015612d4b578160200160208202803683370190505b509050612bc6888381518110612d5d57fe5b6020026020010151888481518110612d7157fe5b602002602001015185612d826104f6565b6007546134cd565b600080612d978484612db6565b90506000612daa6129f48361271061252d565b90506123778282610d72565b600081612dcc5750670de0b6b3a76400006104dc565b82612dd9575060006104dc565b612dea600160ff1b84106006610f13565b82612e10770bce5086492111aea88f4bb1ca6bcf584181ea8059f7653284106007610f13565b826000670c7d713b49da000083138015612e315750670f43fc2c04ee000083125b15612e68576000612e418461356f565b9050670de0b6b3a764000080820784020583670de0b6b3a764000083050201915050612e76565b81612e7284613696565b0290505b670de0b6b3a76400009005612eae680238fd42c5cf03ffff198212801590612ea7575068070c1cc73b00c800008213155b6008610f13565b612eb781613a44565b9695505050505050565b600081831015612ed157816105a1565b5090919050565b60008082806020019051810190612eef919061431c565b909590945092505050565b600080612f1184612f0b8188610d84565b90612992565b9050612f2a6709b6e64a8ec60000821015610132610f13565b6000612f48612f41670de0b6b3a764000089611398565b8390612d8a565b90506000612f5f612f588361296c565b8a90612a23565b90506000612f6c8961296c565b90506000612f7a838361252d565b90506000612f888483610d84565b9050612fa7612fa0612f998a61296c565b8490612a23565b8290610d72565b9c9b505050505050505050505050565b6000818060200190518101906105a191906142ef565b60606000612fdb8484611398565b90506060855167ffffffffffffffff81118015612ff757600080fd5b50604051908082528060200260200182016040528015613021578160200160208202803683370190505b50905060005b8651811015613075576130568388838151811061304057fe5b6020026020010151612a2390919063ffffffff16565b82828151811061306257fe5b6020908102919091010152600101613027565b5095945050505050565b6060600082806020019051810190612eef91906142a8565b60006060845167ffffffffffffffff811180156130b357600080fd5b506040519080825280602002602001820160405280156130dd578160200160208202803683370190505b5090506000805b88518110156131a25761313d8982815181106130fc57fe5b6020026020010151612f0b89848151811061311357fe5b60200260200101518c858151811061312757fe5b6020026020010151610d8490919063ffffffff16565b83828151811061314957fe5b60200260200101818152505061319861319189838151811061316757fe5b602002602001015185848151811061317b57fe5b602002602001015161252d90919063ffffffff16565b8390610d72565b91506001016130e4565b50670de0b6b3a764000060005b895181101561329b5760008482815181106131c657fe5b602002602001015184111561321d5760006131ef6131e38661296c565b8d858151811061304057fe5b90506000613203828c868151811061312757fe5b9050613214613191611c138b61296c565b92505050613234565b88828151811061322957fe5b602002602001015190505b600061325d8c848151811061324557fe5b60200260200101516106b5848f878151811061312757fe5b905061328f6132888c858151811061327157fe5b6020026020010151836129d490919063ffffffff16565b8590612a23565b935050506001016131af565b506132af6132a88261296c565b879061252d565b9998505050505050505050565b60006060845167ffffffffffffffff811180156132d857600080fd5b50604051908082528060200260200182016040528015613302578160200160208202803683370190505b5090506000805b88518110156133aa5761336289828151811061332157fe5b60200260200101516106b589848151811061333857fe5b60200260200101518c858151811061334c57fe5b6020026020010151610d7290919063ffffffff16565b83828151811061336e57fe5b6020026020010181815250506133a061319189838151811061338c57fe5b602002602001015185848151811061304057fe5b9150600101613309565b50670de0b6b3a764000060005b895181101561348b576000838583815181106133cf57fe5b6020026020010151111561342b5760006133f46131e386670de0b6b3a7640000610d84565b90506000613408828c868151811061312757fe5b9050613422613191611f42670de0b6b3a76400008c610d84565b92505050613442565b88828151811061343757fe5b602002602001015190505b600061346b8c848151811061345357fe5b60200260200101516106b5848f878151811061334c57fe5b905061347f6132888c858151811061327157fe5b935050506001016133b7565b50670de0b6b3a764000081106134c1576134b76134b082670de0b6b3a7640000610d84565b8790612a23565b9350505050612377565b60009350505050612377565b6000806134de84612f0b8188610d72565b90506134f76729a2241af62c0000821115610133610f13565b600061350e612f41670de0b6b3a764000089612992565b9050600061352e61352783670de0b6b3a7640000610d84565b8a9061252d565b9050600061353b8961296c565b90506000613549838361252d565b905060006135578483610d84565b9050612fa7612fa06135688a61296c565b8490612992565b670de0b6b3a7640000026000806ec097ce7bc90715b34b9f1000000000808401906ec097ce7bc90715b34b9f0fffffffff19850102816135ab57fe5b05905060006ec097ce7bc90715b34b9f100000000082800205905081806ec097ce7bc90715b34b9f100000000081840205915060038205016ec097ce7bc90715b34b9f100000000082840205915060058205016ec097ce7bc90715b34b9f100000000082840205915060078205016ec097ce7bc90715b34b9f100000000082840205915060098205016ec097ce7bc90715b34b9f1000000000828402059150600b8205016ec097ce7bc90715b34b9f1000000000828402059150600d8205016ec097ce7bc90715b34b9f1000000000828402059150600f826002919005919091010295945050505050565b60006136a6600083136064610f13565b670de0b6b3a76400008212156136e1576136d7826ec097ce7bc90715b34b9f1000000000816136d157fe5b05613696565b60000390506106d5565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c0000000000000831261373257770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e000000831261376a576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff008400083126137b2576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a70083126137ed576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf850831261382457693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e2831261385b57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d0383126138905768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb4174612111083126138bb57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d83126138f0576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312613925576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b2866038312613959576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac831261398d576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d6310000080860302816139b057fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000613a73680238fd42c5cf03ffff198312158015613a6c575068070c1cc73b00c800008313155b6009610f13565b6000821215613aa757613a8882600003613a44565b6ec097ce7bc90715b34b9f100000000081613a9f57fe5b0590506106d5565b60006806f05b59d3b20000008312613ae757506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec630262827000000000613b1d565b6803782dace9d90000008312613b1957506803782dace9d8ffffff19909101906b1425982cf597cd205cef7380613b1d565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac620000008412613b6d5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412613ba9576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412613be357682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412613c1d576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412613c5657680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412613c8f5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412613cc8576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412613d015768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b80356104dc81614708565b600082601f830112613e3d578081fd5b8151613e50613e4b826146e8565b6146c1565b818152915060208083019084810181840286018201871015613e7157600080fd5b60005b84811015613e9057815184529282019290820190600101613e74565b505050505092915050565b600082601f830112613eab578081fd5b813567ffffffffffffffff811115613ec1578182fd5b613ed4601f8201601f19166020016146c1565b9150808252836020828501011115613eeb57600080fd5b8060208401602084013760009082016020015292915050565b8035600281106104dc57600080fd5b600060208284031215613f24578081fd5b81356105a181614708565b60008060408385031215613f41578081fd5b8235613f4c81614708565b91506020830135613f5c81614708565b809150509250929050565b600080600060608486031215613f7b578081fd5b8335613f8681614708565b92506020840135613f9681614708565b929592945050506040919091013590565b600080600080600080600060e0888a031215613fc1578283fd5b8735613fcc81614708565b96506020880135613fdc81614708565b95506040880135945060608801359350608088013560ff81168114613fff578384fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561402e578182fd5b823561403981614708565b946020939093013593505050565b60008060006060848603121561405b578081fd5b835167ffffffffffffffff80821115614072578283fd5b818601915086601f830112614085578283fd5b8151614093613e4b826146e8565b80828252602080830192508086018b8283870289010111156140b3578788fd5b8796505b848710156140de5780516140ca81614708565b8452600196909601959281019281016140b7565b5089015190975093505050808211156140f5578283fd5b5061410286828701613e2d565b925050604084015190509250925092565b600060208284031215614124578081fd5b81356105a18161471d565b600060208284031215614140578081fd5b81516105a18161471d565b600080600080600080600060e0888a031215614165578081fd5b8735965060208089013561417881614708565b9650604089013561418881614708565b9550606089013567ffffffffffffffff808211156141a4578384fd5b818b0191508b601f8301126141b7578384fd5b81356141c5613e4b826146e8565b8082825285820191508585018f8788860288010111156141e3578788fd5b8795505b838610156142055780358352600195909501949186019186016141e7565b509850505060808b0135955060a08b0135945060c08b013592508083111561422b578384fd5b50506142398a828b01613e9b565b91505092959891949750929550565b600060208284031215614259578081fd5b81356001600160e01b0319811681146105a1578182fd5b600060208284031215614281578081fd5b81516105a181614708565b60006020828403121561429d578081fd5b81516105a18161472b565b6000806000606084860312156142bc578081fd5b83516142c78161472b565b602085015190935067ffffffffffffffff8111156142e3578182fd5b61410286828701613e2d565b60008060408385031215614301578182fd5b825161430c8161472b565b6020939093015192949293505050565b600080600060608486031215614330578081fd5b835161433b8161472b565b602085015160409095015190969495509392505050565b60008060408385031215614364578182fd5b825161436f8161472b565b602084015190925067ffffffffffffffff81111561438b578182fd5b61439785828601613e2d565b9150509250929050565b6000806000606084860312156143b5578081fd5b833567ffffffffffffffff808211156143cc578283fd5b81860191506101208083890312156143e2578384fd5b6143eb816146c1565b90506143f78884613f04565b81526144068860208501613e22565b60208201526144188860408501613e22565b6040820152606083013560608201526080830135608082015260a083013560a08201526144488860c08501613e22565b60c082015261445a8860e08501613e22565b60e08201526101008084013583811115614472578586fd5b61447e8a828701613e9b565b9183019190915250976020870135975060409096013595945050505050565b6000602082840312156144ae578081fd5b5035919050565b6000815180845260208085019450808401835b838110156144e4578151875295820195908201906001016144c8565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6000602082526105a160208301846144b5565b60006040825261456c60408301856144b5565b828103602084015261237781856144b5565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b8181101561467357858101830151858201604001528201614657565b818111156146845783604083870101525b50601f01601f1916929092016040019392505050565b600083825260406020830152611bb060408301846144b5565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156146e057600080fd5b604052919050565b600067ffffffffffffffff8211156146fe578081fd5b5060209081020190565b6001600160a01b03811681146104f357600080fd5b80151581146104f357600080fd5b600381106104f357600080fdfea2646970667358221220a2c3b62e0bc50507598395387e1557612d7ad59e817ddae4d5279907402fedb464736f6c63430007010033a26469706673582212201bcb3a953b00c5c4dcf4d3cf74f047f69d25320298f41e6f635cb029516f583764736f6c63430007010033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "weights", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getPauseConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolFromFactory", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60c060405234801561001057600080fd5b5060405161604138038061604183398101604081905261002f9161004d565b60601b6001600160601b0319166080526276a700420160a05261007b565b60006020828403121561005e578081fd5b81516001600160a01b0381168114610074578182fd5b9392505050565b60805160601c60a051615f9c6100a56000398060d6528061010052508061015c5250615f9c6000f3fe60806040523480156200001157600080fd5b5060043610620000525760003560e01c80632da47c4014620000575780636634b753146200007a5780638d928af814620000a0578063fbce039314620000b9575b600080fd5b62000061620000d0565b6040516200007192919062000634565b60405180910390f35b620000916200008b366004620003c0565b6200013c565b60405162000071919062000562565b620000aa6200015a565b6040516200007191906200054e565b620000aa620000ca366004620003e6565b6200017e565b600080427f00000000000000000000000000000000000000000000000000000000000000008110156200012e57807f000000000000000000000000000000000000000000000000000000000000000003925062278d00915062000137565b60009250600091505b509091565b6001600160a01b031660009081526020819052604090205460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000090565b60008060006200018d620000d0565b9150915060006200019d6200015a565b8a8a8a8a8a88888c604051620001b3906200024b565b620001c7999897969594939291906200056d565b604051809103906000f080158015620001e4573d6000803e3d6000fd5b509050620001f281620001ff565b9998505050505050505050565b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f83a48fbcfc991335314e74d0496aab6a1987e992ddc85dddbcc4d6dd6ef2e9fc9190a250565b6158b680620006b183390190565b8035620002668162000697565b92915050565b600082601f8301126200027d578081fd5b8135620002946200028e826200066a565b62000642565b818152915060208083019084810181840286018201871015620002b657600080fd5b60005b84811015620002e2578135620002cf8162000697565b84529282019290820190600101620002b9565b505050505092915050565b600082601f830112620002fe578081fd5b81356200030f6200028e826200066a565b8181529150602080830190848101818402860182018710156200033157600080fd5b60005b84811015620002e25781358452928201929082019060010162000334565b600082601f83011262000363578081fd5b813567ffffffffffffffff8111156200037a578182fd5b6200038f601f8201601f191660200162000642565b9150808252836020828501011115620003a757600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215620003d2578081fd5b8135620003df8162000697565b9392505050565b60008060008060008060c08789031215620003ff578182fd5b863567ffffffffffffffff8082111562000417578384fd5b620004258a838b0162000352565b975060208901359150808211156200043b578384fd5b620004498a838b0162000352565b965060408901359150808211156200045f578384fd5b6200046d8a838b016200026c565b9550606089013591508082111562000483578384fd5b506200049289828a01620002ed565b93505060808701359150620004ab8860a0890162000259565b90509295509295509295565b6001600160a01b03169052565b6000815180845260208085019450808401835b83811015620004f557815187529582019590820190600101620004d7565b509495945050505050565b60008151808452815b81811015620005275760208185018101518683018201520162000509565b81811115620005395782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b60006101206001600160a01b038c16835260208181850152620005938285018d62000500565b91508382036040850152620005a9828c62000500565b84810360608601528a51808252828c01935090820190845b81811015620005e957620005d685516200068b565b83529383019391830191600101620005c1565b50508481036080860152620005ff818b620004c4565b93505050508560a08301528460c08301528360e083015262000626610100830184620004b7565b9a9950505050505050505050565b918252602082015260400190565b60405181810167ffffffffffffffff811182821017156200066257600080fd5b604052919050565b600067ffffffffffffffff82111562000681578081fd5b5060209081020190565b6001600160a01b031690565b6001600160a01b0381168114620006ad57600080fd5b5056fe6105006040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120523480156200003757600080fd5b50604051620058b6380380620058b68339810160408190526200005a9162000cf2565b88888888878787878785516002146200007557600162000078565b60025b6040805180820190915260018152603160f81b6020808301918252336080526001600160601b0319606087901b1660a0528b51908c0190812060c0529151902060e0527f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6101005289518a918a918a918a918a918a918a91849184918a918a9162000107916003919062000abb565b5080516200011d90600490602084019062000abb565b50620001359150506276a70083111561019462000865565b6200014962278d0082111561019562000865565b42909101610140819052016101605284516200016b906002111560c862000865565b6200018360088651111560c96200086560201b60201c565b62000199856200087a60201b62000d571760201c565b620001a48462000886565b6040516309b2760f60e01b81526000906001600160a01b038b16906309b2760f90620001d5908c9060040162000eab565b602060405180830381600087803b158015620001f057600080fd5b505af115801562000205573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200022b919062000cd9565b9050896001600160a01b03166366a9c7d2828889516001600160401b03811180156200025657600080fd5b5060405190808252806020026020018201604052801562000281578160200160208202803683370190505b506040518463ffffffff1660e01b8152600401620002a29392919062000e0f565b600060405180830381600087803b158015620002bd57600080fd5b505af1158015620002d2573d6000803e3d6000fd5b5050506001600160601b031960608c901b1661018052506101a081905285516101c0528551620003045760006200031b565b856000815181106200031257fe5b60200260200101515b60601b6001600160601b0319166101e05285516001106200033e57600062000355565b856001815181106200034c57fe5b60200260200101515b60601b6001600160601b031916610200528551600210620003785760006200038f565b856002815181106200038657fe5b60200260200101515b60601b6001600160601b031916610220528551600310620003b2576000620003c9565b85600381518110620003c057fe5b60200260200101515b60601b6001600160601b031916610240528551600410620003ec57600062000403565b85600481518110620003fa57fe5b60200260200101515b60601b6001600160601b031916610260528551600510620004265760006200043d565b856005815181106200043457fe5b60200260200101515b60601b6001600160601b0319166102805285516006106200046057600062000477565b856006815181106200046e57fe5b60200260200101515b60601b6001600160601b0319166102a05285516007106200049a576000620004b1565b85600781518110620004a857fe5b60200260200101515b60601b6001600160601b0319166102c0528551620004d1576000620004f7565b620004f786600081518110620004e357fe5b6020026020010151620008f560201b60201c565b6102e05285516001106200050d5760006200051f565b6200051f86600181518110620004e357fe5b6103005285516002106200053557600062000547565b6200054786600281518110620004e357fe5b6103205285516003106200055d5760006200056f565b6200056f86600381518110620004e357fe5b6103405285516004106200058557600062000597565b6200059786600481518110620004e357fe5b610360528551600510620005ad576000620005bf565b620005bf86600581518110620004e357fe5b610380528551600610620005d5576000620005e7565b620005e786600681518110620004e357fe5b6103a0528551600710620005fd5760006200060f565b6200060f86600781518110620004e357fe5b6103c08181525050505050505050505050505050505050505050600086519050620006478187516200099760201b62000d651760201c565b6000806000805b848160ff161015620006cd5760008a8260ff16815181106200066c57fe5b6020026020010151905062000694662386f26fc1000082101561012e6200086560201b60201c565b620006ae8186620009a660201b62000d721790919060201c565b945082811115620006c3578160ff1693508092505b506001016200064e565b50620006e6670de0b6b3a7640000841461013462000865565b6103e08290528851620006fb57600062000712565b886000815181106200070957fe5b60200260200101515b610400528851600110620007285760006200073f565b886001815181106200073657fe5b60200260200101515b610420528851600210620007555760006200076c565b886002815181106200076357fe5b60200260200101515b6104405288516003106200078257600062000799565b886003815181106200079057fe5b60200260200101515b610460528851600410620007af576000620007c6565b88600481518110620007bd57fe5b60200260200101515b610480528851600510620007dc576000620007f3565b88600581518110620007ea57fe5b60200260200101515b6104a05288516006106200080957600062000820565b886006815181106200081757fe5b60200260200101515b6104c0528851600710620008365760006200084d565b886007815181106200084457fe5b60200260200101515b6104e0525062000f329b505050505050505050505050565b8162000876576200087681620009c3565b5050565b80620008768162000a16565b6200089b64e8d4a5100082101560cb62000865565b620008b367016345785d8a000082111560ca62000865565b60078190556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90620008ea90839062000ec0565b60405180910390a150565b600080826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200093257600080fd5b505afa15801562000947573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200096d919062000dec565b60ff16905060006200098c60128362000aa360201b62000d841760201c565b600a0a949350505050565b62000876828214606762000865565b6000828201620009ba848210158362000865565b90505b92915050565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b60028151101562000a275762000aa0565b60008160008151811062000a3757fe5b602002602001015190506000600190505b825181101562000a9d57600083828151811062000a6157fe5b6020026020010151905062000a92816001600160a01b0316846001600160a01b03161060656200086560201b60201c565b915060010162000a48565b50505b50565b600062000ab583831115600162000865565b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000afe57805160ff191683800117855562000b2e565b8280016001018555821562000b2e579182015b8281111562000b2e57825182559160200191906001019062000b11565b5062000b3c92915062000b40565b5090565b5b8082111562000b3c576000815560010162000b41565b8051620009bd8162000f1c565b600082601f83011262000b75578081fd5b815162000b8c62000b868262000ef0565b62000ec9565b81815291506020808301908481018184028601820187101562000bae57600080fd5b60005b8481101562000bda57815162000bc78162000f1c565b8452928201929082019060010162000bb1565b505050505092915050565b600082601f83011262000bf6578081fd5b815162000c0762000b868262000ef0565b81815291506020808301908481018184028601820187101562000c2957600080fd5b60005b8481101562000bda5781518452928201929082019060010162000c2c565b600082601f83011262000c5b578081fd5b81516001600160401b0381111562000c71578182fd5b602062000c87601f8301601f1916820162000ec9565b9250818352848183860101111562000c9e57600080fd5b60005b8281101562000cbe57848101820151848201830152810162000ca1565b8281111562000cd05760008284860101525b50505092915050565b60006020828403121562000ceb578081fd5b5051919050565b60008060008060008060008060006101208a8c03121562000d11578485fd5b62000d1d8b8b62000b57565b60208b01519099506001600160401b038082111562000d3a578687fd5b62000d488d838e0162000c4a565b995060408c015191508082111562000d5e578687fd5b62000d6c8d838e0162000c4a565b985060608c015191508082111562000d82578687fd5b62000d908d838e0162000b64565b975060808c015191508082111562000da6578687fd5b5062000db58c828d0162000be5565b95505060a08a0151935060c08a0151925060e08a0151915062000ddd8b6101008c0162000b57565b90509295985092959850929598565b60006020828403121562000dfe578081fd5b815160ff81168114620009ba578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b8181101562000e5b5762000e48855162000f10565b8352938301939183019160010162000e33565b505084810360408601528551808252908201925081860190845b8181101562000e9d5762000e8a835162000f10565b8552938301939183019160010162000e75565b509298975050505050505050565b602081016003831062000eba57fe5b91905290565b90815260200190565b6040518181016001600160401b038111828210171562000ee857600080fd5b604052919050565b60006001600160401b0382111562000f06578081fd5b5060209081020190565b6001600160a01b031690565b6001600160a01b038116811462000aa057600080fd5b60805160a05160601c60c05160e051610100516101205161014051610160516101805160601c6101a0516101c0516101e05160601c6102005160601c6102205160601c6102405160601c6102605160601c6102805160601c6102a05160601c6102c05160601c6102e05161030051610320516103405161036051610380516103a0516103c0516103e05161040051610420516104405161046051610480516104a0516104c0516104e05161476e6200114860003980611ec55280612857525080611e8252806127f6525080611e3f5280612795525080611dfc5280612734525080611db952806126d3525080611d765280612672525080611d335280612611525080611cf052806125b05250806122d0528061230452806123405250806116285280611b1e5250806115e55280611abd5250806115a25280611a5c52508061155f52806119fb52508061151c528061199a5250806114d9528061193952508061149652806118d85250806114455280611877525080611ae3528061281c525080611a8252806127bb525080611a21528061275a5250806119c052806126f952508061195f52806126985250806118fe528061263752508061189d52806125d652508061183c52806125755250806111025250806105d7525080610835525080610ef1525080610ecd525080610ab5525080610ff452508061103652508061101552508061081152508061079b525061476e6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80637ecebe001161010f578063a9059cbb116100a2578063d5c096c411610071578063d5c096c4146103e6578063d73dd623146103f9578063dd62ed3e1461040c578063f89f27ed1461041f576101f0565b8063a9059cbb146103b0578063aaabadc5146103c3578063c0ff1a15146103cb578063d505accf146103d3576101f0565b80638d928af8116100de5780638d928af81461038557806395d89b411461038d5780639b02cdde146103955780639d2c110c1461039d576101f0565b80637ecebe0014610337578063851c1bb31461034a57806387ec68171461035d578063893d20e814610370576101f0565b806338e9922e11610187578063661884631161015657806366188463146102e8578063679aefce146102fb57806370a082311461030357806374f3b00914610316576101f0565b806338e9922e146102a457806338fff2d0146102b757806355c67628146102bf5780636028bfd4146102c7576101f0565b80631c0de051116101c35780631c0de0511461025d57806323b872dd14610274578063313ce567146102875780633644e5151461029c576101f0565b806306fdde03146101f5578063095ea7b31461021357806316c38b3c1461023357806318160ddd14610248575b600080fd5b6101fd610434565b60405161020a9190614647565b60405180910390f35b61022661022136600461401c565b6104cb565b60405161020a919061457e565b610246610241366004614113565b6104e2565b005b6102506104f6565b60405161020a91906145a1565b6102656104fc565b60405161020a93929190614589565b610226610282366004613f67565b610525565b61028f6105a8565b60405161020a91906146b3565b6102506105ad565b6102466102b236600461449d565b6105bc565b6102506105d5565b6102506105f9565b6102da6102d536600461414b565b6105ff565b60405161020a92919061469a565b6102266102f636600461401c565b610636565b610250610690565b610250610311366004613f13565b6106bb565b61032961032436600461414b565b6106da565b60405161020a929190614559565b610250610345366004613f13565b61077c565b610250610358366004614248565b610797565b6102da61036b36600461414b565b6107e9565b61037861080f565b60405161020a9190614532565b610378610833565b6101fd610857565b6102506108b8565b6102506103ab3660046143a1565b6108be565b6102266103be36600461401c565b6109a5565b6103786109b2565b6102506109bc565b6102466103e1366004613fa7565b610a80565b6103296103f436600461414b565b610bc9565b61022661040736600461401c565b610cec565b61025061041a366004613f2f565b610d22565b610427610d4d565b60405161020a9190614546565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104c05780601f10610495576101008083540402835291602001916104c0565b820191906000526020600020905b8154815290600101906020018083116104a357829003601f168201915b505050505090505b90565b60006104d8338484610d9a565b5060015b92915050565b6104ea610e02565b6104f381610e30565b50565b60025490565b6000806000610509610eae565b159250610514610ecb565b915061051e610eef565b9050909192565b6001600160a01b0383166000818152600160209081526040808320338085529252822054919261056391148061055b5750838210155b610197610f13565b61056e858585610f21565b336001600160a01b0386161480159061058957506000198114155b1561059b5761059b8533858403610d9a565b60019150505b9392505050565b601290565b60006105b7610ff0565b905090565b6105c4610e02565b6105cc61108d565b6104f3816110a2565b7f000000000000000000000000000000000000000000000000000000000000000090565b60075490565b600060606106158651610610611100565b610d65565b61062a898989898989896111246111ec611252565b97509795505050505050565b3360009081526001602090815260408083206001600160a01b03861684529091528120548083106106725761066d33856000610d9a565b610686565b61068633856106818487610d84565b610d9a565b5060019392505050565b60006105b761069d6104f6565b6106b56106a86109bc565b6106b0611100565b611374565b90611398565b6001600160a01b0381166000908152602081905260409020545b919050565b606080886107046106e9610833565b6001600160a01b0316336001600160a01b03161460cd610f13565b61071961070f6105d5565b82146101f4610f13565b60606107236113e9565b905061072f8882611666565b60006060806107438e8e8e8e8e8e8e611124565b9250925092506107538d846116c7565b61075d82856111ec565b61076781856111ec565b909550935050505b5097509795505050505050565b6001600160a01b031660009081526005602052604090205490565b60007f0000000000000000000000000000000000000000000000000000000000000000826040516020016107cc9291906144ef565b604051602081830303815290604052805190602001209050919050565b600060606107fa8651610610611100565b61062a8989898989898961175a6117d7611252565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104c05780601f10610495576101008083540402835291602001916104c0565b60085490565b6000806108ce8560200151611838565b905060006108df8660400151611838565b90506000865160018111156108f057fe5b1415610956576109038660600151611b4d565b60608701526109128583611b71565b945061091e8482611b71565b935061092e866060015183611b71565b60608701526000610940878787611b7d565b905061094c8183611bb8565b93505050506105a1565b6109608583611b71565b945061096c8482611b71565b935061097c866060015182611b71565b6060870152600061098e878787611bc4565b905061099a8184611bf7565b905061094c81611c03565b60006104d8338484610f21565b60006105b7611c1a565b600060606109c8610833565b6001600160a01b031663f94d46686109de6105d5565b6040518263ffffffff1660e01b81526004016109fa91906145a1565b60006040518083038186803b158015610a1257600080fd5b505afa158015610a26573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a4e9190810190614047565b50915050610a6381610a5e6113e9565b611666565b6060610a6d611c94565b9050610a798183611ef1565b9250505090565b610a8e8442111560d1610f13565b6001600160a01b0387166000908152600560209081526040808320549051909291610ae5917f0000000000000000000000000000000000000000000000000000000000000000918c918c918c9188918d91016145c9565b6040516020818303038152906040528051906020012090506000610b0882611f63565b9050600060018288888860405160008152602001604052604051610b2f9493929190614629565b6020604051602081039080840390855afa158015610b51573d6000803e3d6000fd5b5050604051601f1901519150610b9390506001600160a01b03821615801590610b8b57508b6001600160a01b0316826001600160a01b0316145b6101f8610f13565b6001600160a01b038b166000908152600560205260409020600185019055610bbc8b8b8b610d9a565b5050505050505050505050565b60608088610bd86106e9610833565b610be361070f6105d5565b6060610bed6113e9565b9050610bf76104f6565b610c9d5760006060610c0b8d8d8d8a611f7f565b91509150610c20620f424083101560cc610f13565b610c2e6000620f424061201a565b610c3d8b620f4240840361201a565b610c4781846117d7565b80610c50611100565b67ffffffffffffffff81118015610c6657600080fd5b50604051908082528060200260200182016040528015610c90578160200160208202803683370190505b509550955050505061076f565b610ca78882611666565b6000606080610cbb8e8e8e8e8e8e8e61175a565b925092509250610ccb8c8461201a565b610cd582856117d7565b610cdf81856111ec565b909550935061076f915050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104d89185906106819086610d72565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606105b7611c94565b80610d61816120b0565b5050565b610d618183146067610f13565b60008282016105a18482101583610f13565b6000610d94838311156001610f13565b50900390565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610df59085906145a1565b60405180910390a3505050565b6000610e196000356001600160e01b031916610797565b90506104f3610e288233612129565b610191610f13565b8015610e5057610e4b610e41610ecb565b4210610193610f13565b610e65565b610e65610e5b610eef565b42106101a9610f13565b6006805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490610ea390839061457e565b60405180910390a150565b6000610eb8610eef565b4211806105b757505060065460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b81610d6157610d6181612219565b6001600160a01b038316600090815260208190526040902054610f4982821015610196610f13565b610f606001600160a01b0384161515610199610f13565b6001600160a01b03808516600090815260208190526040808220858503905591851681522054610f909083610d72565b6001600160a01b0380851660008181526020819052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610fe29086906145a1565b60405180910390a350505050565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061105d61226c565b306040516020016110729594939291906145fd565b60405160208183030381529060405280519060200120905090565b6110a0611098610eae565b610192610f13565b565b6110b564e8d4a5100082101560cb610f13565b6110cb67016345785d8a000082111560ca610f13565b60078190556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90610ea39083906145a1565b7f000000000000000000000000000000000000000000000000000000000000000090565b60006060806060611133611c94565b905061113d610eae565b1561117457600061114e828a611ef1565b905061115f8983600854848b612270565b925061116e8984610d84612380565b506111c0565b61117c611100565b67ffffffffffffffff8111801561119257600080fd5b506040519080825280602002602001820160405280156111bc578160200160208202803683370190505b5091505b6111cb8882876123eb565b90945092506111db888483612458565b600855509750975097945050505050565b60005b6111f7611100565b81101561124d5761122e83828151811061120d57fe5b602002602001015183838151811061122157fe5b6020026020010151612471565b83828151811061123a57fe5b60209081029190910101526001016111ef565b505050565b333014611310576000306001600160a01b0316600036604051611276929190614507565b6000604051808303816000865af19150503d80600081146112b3576040519150601f19603f3d011682016040523d82523d6000602084013e6112b8565b606091505b5050905080600081146112c757fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b81146112f2573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b606061131a6113e9565b90506113268782611666565b6000606061133d8c8c8c8c8c8c8c8c63ffffffff16565b509150915061135081848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b60008282026105a184158061139157508385838161138e57fe5b04145b6003610f13565b60006113a78215156004610f13565b826113b4575060006104dc565b670de0b6b3a7640000838102906113d7908583816113ce57fe5b04146005610f13565b8281816113e057fe5b049150506104dc565b606060006113f5611100565b905060608167ffffffffffffffff8111801561141057600080fd5b5060405190808252806020026020018201604052801561143a578160200160208202803683370190505b5090508115611482577f00000000000000000000000000000000000000000000000000000000000000008160008151811061147157fe5b60200260200101818152505061148b565b91506104c89050565b6001821115611482577f0000000000000000000000000000000000000000000000000000000000000000816001815181106114c257fe5b6020026020010181815250506002821115611482577f00000000000000000000000000000000000000000000000000000000000000008160028151811061150557fe5b6020026020010181815250506003821115611482577f00000000000000000000000000000000000000000000000000000000000000008160038151811061154857fe5b6020026020010181815250506004821115611482577f00000000000000000000000000000000000000000000000000000000000000008160048151811061158b57fe5b6020026020010181815250506005821115611482577f0000000000000000000000000000000000000000000000000000000000000000816005815181106115ce57fe5b6020026020010181815250506006821115611482577f00000000000000000000000000000000000000000000000000000000000000008160068151811061161157fe5b6020026020010181815250506007821115611482577f00000000000000000000000000000000000000000000000000000000000000008160078151811061165457fe5b60200260200101818152505091505090565b60005b611671611100565b81101561124d576116a883828151811061168757fe5b602002602001015183838151811061169b57fe5b6020026020010151611374565b8382815181106116b457fe5b6020908102919091010152600101611669565b6001600160a01b0382166000908152602081905260409020546116ef82821015610196610f13565b6001600160a01b038316600090815260208190526040902082820390556002546117199083610d84565b6002556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610df59086906145a1565b600060608061176761108d565b6060611771611c94565b9050600061177f828a611ef1565b905060606117928a84600854858c612270565b90506117a18a82610d84612380565b600060606117b08c868b612491565b915091506117bf8c82876124eb565b600855909e909d50909b509950505050505050505050565b60005b6117e2611100565b81101561124d576118198382815181106117f857fe5b602002602001015183838151811061180c57fe5b60200260200101516124fa565b83828151811061182557fe5b60209081029190910101526001016117da565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561189b57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156118fc57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561195d57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156119be57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611a1f57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611a8057507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611ae157507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611b4257507f00000000000000000000000000000000000000000000000000000000000000006106d5565b6106d5610135612219565b600080611b656007548461252d90919063ffffffff16565b90506105a18382610d84565b60006105a18383611374565b6000611b8761108d565b611bb083611b988660200151612571565b84611ba68860400151612571565b886060015161287b565b949350505050565b60006105a18383612471565b6000611bce61108d565b611bb083611bdf8660200151612571565b84611bed8860400151612571565b88606001516128f6565b60006105a183836124fa565b60006104dc611c1360075461296c565b8390612992565b6000611c24610833565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b158015611c5c57600080fd5b505afa158015611c70573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b79190614270565b60606000611ca0611100565b905060608167ffffffffffffffff81118015611cbb57600080fd5b50604051908082528060200260200182016040528015611ce5578160200160208202803683370190505b5090508115611482577f000000000000000000000000000000000000000000000000000000000000000081600081518110611d1c57fe5b6020026020010181815250506001821115611482577f000000000000000000000000000000000000000000000000000000000000000081600181518110611d5f57fe5b6020026020010181815250506002821115611482577f000000000000000000000000000000000000000000000000000000000000000081600281518110611da257fe5b6020026020010181815250506003821115611482577f000000000000000000000000000000000000000000000000000000000000000081600381518110611de557fe5b6020026020010181815250506004821115611482577f000000000000000000000000000000000000000000000000000000000000000081600481518110611e2857fe5b6020026020010181815250506005821115611482577f000000000000000000000000000000000000000000000000000000000000000081600581518110611e6b57fe5b6020026020010181815250506006821115611482577f000000000000000000000000000000000000000000000000000000000000000081600681518110611eae57fe5b6020026020010181815250506007821115611482577f00000000000000000000000000000000000000000000000000000000000000008160078151811061165457fe5b670de0b6b3a764000060005b8351811015611f5357611f49611f42858381518110611f1857fe5b6020026020010151858481518110611f2c57fe5b60200260200101516129d490919063ffffffff16565b8390612a23565b9150600101611efd565b506104dc60008211610137610f13565b6000611f6d610ff0565b826040516020016107cc929190614517565b60006060611f8b61108d565b6000611f9684612a4f565b9050611fb16000826002811115611fa957fe5b1460ce610f13565b6060611fbc85612a65565b9050611fd0611fc9611100565b8251610d65565b611fdc81610a5e6113e9565b6060611fe6611c94565b90506000611ff48284611ef1565b90506000612004826106b0611100565b6008929092555099919850909650505050505050565b6001600160a01b03821660009081526020819052604090205461203d9082610d72565b6001600160a01b0383166000908152602081905260409020556002546120639082610d72565b6002556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906120a49085906145a1565b60405180910390a35050565b6002815110156120bf576104f3565b6000816000815181106120ce57fe5b602002602001015190506000600190505b825181101561124d5760008382815181106120f657fe5b6020026020010151905061211f816001600160a01b0316846001600160a01b0316106065610f13565b91506001016120df565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b61214861080f565b6001600160a01b031614158015612163575061216383612a7b565b1561218b5761217061080f565b6001600160a01b0316336001600160a01b03161490506104dc565b612193611c1a565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b81526004016121c2939291906145aa565b60206040518083038186803b1580156121da57600080fd5b505afa1580156121ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612212919061412f565b90506104dc565b62461bcd60e51b6000908152602060045260076024526642414c23000030600a808404818106603090810160081b95839006959095019082900491820690940160101b939093010160c81b604452606490fd5b4690565b60608061227b611100565b67ffffffffffffffff8111801561229157600080fd5b506040519080825280602002602001820160405280156122bb578160200160208202803683370190505b509050826122ca579050612377565b61233d877f0000000000000000000000000000000000000000000000000000000000000000815181106122f957fe5b6020026020010151877f00000000000000000000000000000000000000000000000000000000000000008151811061232d57fe5b6020026020010151878787612a95565b817f00000000000000000000000000000000000000000000000000000000000000008151811061236957fe5b602090810291909101015290505b95945050505050565b60005b61238b611100565b8110156123e5576123c68482815181106123a157fe5b60200260200101518483815181106123b557fe5b60200260200101518463ffffffff16565b8482815181106123d257fe5b6020908102919091010152600101612383565b50505050565b6000606060006123fa84612a4f565b9050600081600281111561240a57fe5b14156124255761241b868686612b0d565b9250925050612450565b600181600281111561243357fe5b14156124435761241b8685612beb565b61241b868686612c1d565b505b935093915050565b60006124678484610d84612380565b611bb08285611ef1565b60006124808215156004610f13565b81838161248957fe5b049392505050565b6000606060006124a084612a4f565b905060018160028111156124b057fe5b14156124c15761241b868686612c88565b60028160028111156124cf57fe5b14156124e05761241b868686612ce2565b61244e610136612219565b60006124678484610d72612380565b60006125098215156004610f13565b82612516575060006104dc565b81600184038161252257fe5b0460010190506104dc565b600082820261254784158061139157508385838161138e57fe5b806125565760009150506104dc565b670de0b6b3a764000060001982015b046001019150506104dc565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125d457507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561263557507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561269657507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156126f757507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561275857507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156127b957507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561281a57507f00000000000000000000000000000000000000000000000000000000000000006106d5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415611b4257507f00000000000000000000000000000000000000000000000000000000000000006106d5565b600061289d61289287670429d069189e0000612a23565b831115610130610f13565b60006128a98784610d72565b905060006128b78883612992565b905060006128c58887611398565b905060006128d38383612d8a565b90506128e86128e18261296c565b8990612a23565b9a9950505050505050505050565b600061291861290d85670429d069189e0000612a23565b831115610131610f13565b600061292e6129278685610d84565b8690612992565b9050600061293c8588612992565b9050600061294a8383612d8a565b9050600061296082670de0b6b3a7640000610d84565b90506128e88a8261252d565b6000670de0b6b3a764000082106129845760006104dc565b50670de0b6b3a76400000390565b60006129a18215156004610f13565b826129ae575060006104dc565b670de0b6b3a7640000838102906129c8908583816113ce57fe5b82600182038161256557fe5b6000806129e18484612db6565b905060006129fb6129f48361271061252d565b6001610d72565b905080821015612a10576000925050506104dc565b612a1a8282610d84565b925050506104dc565b6000828202612a3d84158061139157508385838161138e57fe5b670de0b6b3a764000090049392505050565b6000818060200190518101906104dc919061428c565b6060818060200190518101906105a19190614352565b6000612a8d631c74c91760e11b610797565b909114919050565b6000838311612aa657506000612377565b6000612ab28585612992565b90506000612ac8670de0b6b3a764000088611398565b9050612adc826709b6e64a8ec60000612ec1565b91506000612aea8383612d8a565b90506000612b01612afa8361296c565b8b90612a23565b90506128e88187612a23565b60006060612b1961108d565b600080612b2585612ed8565b91509150612b3d612b34611100565b82106064610f13565b6060612b47611100565b67ffffffffffffffff81118015612b5d57600080fd5b50604051908082528060200260200182016040528015612b87578160200160208202803683370190505b509050612bc6888381518110612b9957fe5b6020026020010151888481518110612bad57fe5b602002602001015185612bbe6104f6565b600754612efa565b818381518110612bd257fe5b6020908102919091010152919791965090945050505050565b600060606000612bfa84612fb7565b90506060612c108683612c0b6104f6565b612fcd565b9196919550909350505050565b60006060612c2961108d565b60606000612c368561307f565b91509150612c478251610610611100565b612c5382610a5e6113e9565b6000612c6b888885612c636104f6565b600754613097565b9050612c7b8282111560cf610f13565b9791965090945050505050565b60006060806000612c988561307f565b91509150612cae612ca7611100565b8351610d65565b612cba82610a5e6113e9565b6000612cd2888885612cca6104f6565b6007546132bc565b9050612c7b8282101560d0610f13565b60006060600080612cf285612ed8565b91509150612d01612b34611100565b6060612d0b611100565b67ffffffffffffffff81118015612d2157600080fd5b50604051908082528060200260200182016040528015612d4b578160200160208202803683370190505b509050612bc6888381518110612d5d57fe5b6020026020010151888481518110612d7157fe5b602002602001015185612d826104f6565b6007546134cd565b600080612d978484612db6565b90506000612daa6129f48361271061252d565b90506123778282610d72565b600081612dcc5750670de0b6b3a76400006104dc565b82612dd9575060006104dc565b612dea600160ff1b84106006610f13565b82612e10770bce5086492111aea88f4bb1ca6bcf584181ea8059f7653284106007610f13565b826000670c7d713b49da000083138015612e315750670f43fc2c04ee000083125b15612e68576000612e418461356f565b9050670de0b6b3a764000080820784020583670de0b6b3a764000083050201915050612e76565b81612e7284613696565b0290505b670de0b6b3a76400009005612eae680238fd42c5cf03ffff198212801590612ea7575068070c1cc73b00c800008213155b6008610f13565b612eb781613a44565b9695505050505050565b600081831015612ed157816105a1565b5090919050565b60008082806020019051810190612eef919061431c565b909590945092505050565b600080612f1184612f0b8188610d84565b90612992565b9050612f2a6709b6e64a8ec60000821015610132610f13565b6000612f48612f41670de0b6b3a764000089611398565b8390612d8a565b90506000612f5f612f588361296c565b8a90612a23565b90506000612f6c8961296c565b90506000612f7a838361252d565b90506000612f888483610d84565b9050612fa7612fa0612f998a61296c565b8490612a23565b8290610d72565b9c9b505050505050505050505050565b6000818060200190518101906105a191906142ef565b60606000612fdb8484611398565b90506060855167ffffffffffffffff81118015612ff757600080fd5b50604051908082528060200260200182016040528015613021578160200160208202803683370190505b50905060005b8651811015613075576130568388838151811061304057fe5b6020026020010151612a2390919063ffffffff16565b82828151811061306257fe5b6020908102919091010152600101613027565b5095945050505050565b6060600082806020019051810190612eef91906142a8565b60006060845167ffffffffffffffff811180156130b357600080fd5b506040519080825280602002602001820160405280156130dd578160200160208202803683370190505b5090506000805b88518110156131a25761313d8982815181106130fc57fe5b6020026020010151612f0b89848151811061311357fe5b60200260200101518c858151811061312757fe5b6020026020010151610d8490919063ffffffff16565b83828151811061314957fe5b60200260200101818152505061319861319189838151811061316757fe5b602002602001015185848151811061317b57fe5b602002602001015161252d90919063ffffffff16565b8390610d72565b91506001016130e4565b50670de0b6b3a764000060005b895181101561329b5760008482815181106131c657fe5b602002602001015184111561321d5760006131ef6131e38661296c565b8d858151811061304057fe5b90506000613203828c868151811061312757fe5b9050613214613191611c138b61296c565b92505050613234565b88828151811061322957fe5b602002602001015190505b600061325d8c848151811061324557fe5b60200260200101516106b5848f878151811061312757fe5b905061328f6132888c858151811061327157fe5b6020026020010151836129d490919063ffffffff16565b8590612a23565b935050506001016131af565b506132af6132a88261296c565b879061252d565b9998505050505050505050565b60006060845167ffffffffffffffff811180156132d857600080fd5b50604051908082528060200260200182016040528015613302578160200160208202803683370190505b5090506000805b88518110156133aa5761336289828151811061332157fe5b60200260200101516106b589848151811061333857fe5b60200260200101518c858151811061334c57fe5b6020026020010151610d7290919063ffffffff16565b83828151811061336e57fe5b6020026020010181815250506133a061319189838151811061338c57fe5b602002602001015185848151811061304057fe5b9150600101613309565b50670de0b6b3a764000060005b895181101561348b576000838583815181106133cf57fe5b6020026020010151111561342b5760006133f46131e386670de0b6b3a7640000610d84565b90506000613408828c868151811061312757fe5b9050613422613191611f42670de0b6b3a76400008c610d84565b92505050613442565b88828151811061343757fe5b602002602001015190505b600061346b8c848151811061345357fe5b60200260200101516106b5848f878151811061334c57fe5b905061347f6132888c858151811061327157fe5b935050506001016133b7565b50670de0b6b3a764000081106134c1576134b76134b082670de0b6b3a7640000610d84565b8790612a23565b9350505050612377565b60009350505050612377565b6000806134de84612f0b8188610d72565b90506134f76729a2241af62c0000821115610133610f13565b600061350e612f41670de0b6b3a764000089612992565b9050600061352e61352783670de0b6b3a7640000610d84565b8a9061252d565b9050600061353b8961296c565b90506000613549838361252d565b905060006135578483610d84565b9050612fa7612fa06135688a61296c565b8490612992565b670de0b6b3a7640000026000806ec097ce7bc90715b34b9f1000000000808401906ec097ce7bc90715b34b9f0fffffffff19850102816135ab57fe5b05905060006ec097ce7bc90715b34b9f100000000082800205905081806ec097ce7bc90715b34b9f100000000081840205915060038205016ec097ce7bc90715b34b9f100000000082840205915060058205016ec097ce7bc90715b34b9f100000000082840205915060078205016ec097ce7bc90715b34b9f100000000082840205915060098205016ec097ce7bc90715b34b9f1000000000828402059150600b8205016ec097ce7bc90715b34b9f1000000000828402059150600d8205016ec097ce7bc90715b34b9f1000000000828402059150600f826002919005919091010295945050505050565b60006136a6600083136064610f13565b670de0b6b3a76400008212156136e1576136d7826ec097ce7bc90715b34b9f1000000000816136d157fe5b05613696565b60000390506106d5565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c0000000000000831261373257770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e000000831261376a576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff008400083126137b2576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a70083126137ed576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf850831261382457693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e2831261385b57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d0383126138905768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb4174612111083126138bb57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d83126138f0576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312613925576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b2866038312613959576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac831261398d576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d6310000080860302816139b057fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000613a73680238fd42c5cf03ffff198312158015613a6c575068070c1cc73b00c800008313155b6009610f13565b6000821215613aa757613a8882600003613a44565b6ec097ce7bc90715b34b9f100000000081613a9f57fe5b0590506106d5565b60006806f05b59d3b20000008312613ae757506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec630262827000000000613b1d565b6803782dace9d90000008312613b1957506803782dace9d8ffffff19909101906b1425982cf597cd205cef7380613b1d565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac620000008412613b6d5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412613ba9576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412613be357682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412613c1d576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412613c5657680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412613c8f5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412613cc8576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412613d015768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b80356104dc81614708565b600082601f830112613e3d578081fd5b8151613e50613e4b826146e8565b6146c1565b818152915060208083019084810181840286018201871015613e7157600080fd5b60005b84811015613e9057815184529282019290820190600101613e74565b505050505092915050565b600082601f830112613eab578081fd5b813567ffffffffffffffff811115613ec1578182fd5b613ed4601f8201601f19166020016146c1565b9150808252836020828501011115613eeb57600080fd5b8060208401602084013760009082016020015292915050565b8035600281106104dc57600080fd5b600060208284031215613f24578081fd5b81356105a181614708565b60008060408385031215613f41578081fd5b8235613f4c81614708565b91506020830135613f5c81614708565b809150509250929050565b600080600060608486031215613f7b578081fd5b8335613f8681614708565b92506020840135613f9681614708565b929592945050506040919091013590565b600080600080600080600060e0888a031215613fc1578283fd5b8735613fcc81614708565b96506020880135613fdc81614708565b95506040880135945060608801359350608088013560ff81168114613fff578384fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561402e578182fd5b823561403981614708565b946020939093013593505050565b60008060006060848603121561405b578081fd5b835167ffffffffffffffff80821115614072578283fd5b818601915086601f830112614085578283fd5b8151614093613e4b826146e8565b80828252602080830192508086018b8283870289010111156140b3578788fd5b8796505b848710156140de5780516140ca81614708565b8452600196909601959281019281016140b7565b5089015190975093505050808211156140f5578283fd5b5061410286828701613e2d565b925050604084015190509250925092565b600060208284031215614124578081fd5b81356105a18161471d565b600060208284031215614140578081fd5b81516105a18161471d565b600080600080600080600060e0888a031215614165578081fd5b8735965060208089013561417881614708565b9650604089013561418881614708565b9550606089013567ffffffffffffffff808211156141a4578384fd5b818b0191508b601f8301126141b7578384fd5b81356141c5613e4b826146e8565b8082825285820191508585018f8788860288010111156141e3578788fd5b8795505b838610156142055780358352600195909501949186019186016141e7565b509850505060808b0135955060a08b0135945060c08b013592508083111561422b578384fd5b50506142398a828b01613e9b565b91505092959891949750929550565b600060208284031215614259578081fd5b81356001600160e01b0319811681146105a1578182fd5b600060208284031215614281578081fd5b81516105a181614708565b60006020828403121561429d578081fd5b81516105a18161472b565b6000806000606084860312156142bc578081fd5b83516142c78161472b565b602085015190935067ffffffffffffffff8111156142e3578182fd5b61410286828701613e2d565b60008060408385031215614301578182fd5b825161430c8161472b565b6020939093015192949293505050565b600080600060608486031215614330578081fd5b835161433b8161472b565b602085015160409095015190969495509392505050565b60008060408385031215614364578182fd5b825161436f8161472b565b602084015190925067ffffffffffffffff81111561438b578182fd5b61439785828601613e2d565b9150509250929050565b6000806000606084860312156143b5578081fd5b833567ffffffffffffffff808211156143cc578283fd5b81860191506101208083890312156143e2578384fd5b6143eb816146c1565b90506143f78884613f04565b81526144068860208501613e22565b60208201526144188860408501613e22565b6040820152606083013560608201526080830135608082015260a083013560a08201526144488860c08501613e22565b60c082015261445a8860e08501613e22565b60e08201526101008084013583811115614472578586fd5b61447e8a828701613e9b565b9183019190915250976020870135975060409096013595945050505050565b6000602082840312156144ae578081fd5b5035919050565b6000815180845260208085019450808401835b838110156144e4578151875295820195908201906001016144c8565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6000602082526105a160208301846144b5565b60006040825261456c60408301856144b5565b828103602084015261237781856144b5565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b8181101561467357858101830151858201604001528201614657565b818111156146845783604083870101525b50601f01601f1916929092016040019392505050565b600083825260406020830152611bb060408301846144b5565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156146e057600080fd5b604052919050565b600067ffffffffffffffff8211156146fe578081fd5b5060209081020190565b6001600160a01b03811681146104f357600080fd5b80151581146104f357600080fd5b600381106104f357600080fdfea2646970667358221220a2c3b62e0bc50507598395387e1557612d7ad59e817ddae4d5279907402fedb464736f6c63430007010033a26469706673582212201bcb3a953b00c5c4dcf4d3cf74f047f69d25320298f41e6f635cb029516f583764736f6c63430007010033" +} diff --git a/crates/contracts/artifacts/BalancerV2WeightedPoolFactoryV3.json b/crates/contracts/artifacts/BalancerV2WeightedPoolFactoryV3.json index 170bff914d..17bfe6a1b4 100644 --- a/crates/contracts/artifacts/BalancerV2WeightedPoolFactoryV3.json +++ b/crates/contracts/artifacts/BalancerV2WeightedPoolFactoryV3.json @@ -1 +1,270 @@ -{"abi":[{"inputs":[{"internalType":"contract IVault","name":"vault","type":"address"},{"internalType":"contract IProtocolFeePercentagesProvider","name":"protocolFeeProvider","type":"address"},{"internalType":"string","name":"factoryVersion","type":"string"},{"internalType":"string","name":"poolVersion","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"FactoryDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"normalizedWeights","type":"uint256[]"},{"internalType":"contract IRateProvider[]","name":"rateProviders","type":"address[]"},{"internalType":"uint256","name":"swapFeePercentage","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getActionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuthorizer","outputs":[{"internalType":"contract IAuthorizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationCodeContracts","outputs":[{"internalType":"address","name":"contractA","type":"address"},{"internalType":"address","name":"contractB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPauseConfiguration","outputs":[{"internalType":"uint256","name":"pauseWindowDuration","type":"uint256"},{"internalType":"uint256","name":"bufferPeriodDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolFeePercentagesProvider","outputs":[{"internalType":"contract IProtocolFeePercentagesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"isPoolFromFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "contract IProtocolFeePercentagesProvider", + "name": "protocolFeeProvider", + "type": "address" + }, + { + "internalType": "string", + "name": "factoryVersion", + "type": "string" + }, + { + "internalType": "string", + "name": "poolVersion", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [], + "name": "FactoryDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "normalizedWeights", + "type": "uint256[]" + }, + { + "internalType": "contract IRateProvider[]", + "name": "rateProviders", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "create", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCreationCodeContracts", + "outputs": [ + { + "internalType": "address", + "name": "contractA", + "type": "address" + }, + { + "internalType": "address", + "name": "contractB", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPauseConfiguration", + "outputs": [ + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolVersion", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeePercentagesProvider", + "outputs": [ + { + "internalType": "contract IProtocolFeePercentagesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDisabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolFromFactory", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/BalancerV3BatchRouter.json b/crates/contracts/artifacts/BalancerV3BatchRouter.json index e4bdcf113d..645cf4e136 100644 --- a/crates/contracts/artifacts/BalancerV3BatchRouter.json +++ b/crates/contracts/artifacts/BalancerV3BatchRouter.json @@ -995,4 +995,4 @@ "deployedBytecode": "0x60806040526004361015610072575b3615610018575f80fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361004a57005b7f0540ddf6000000000000000000000000000000000000000000000000000000005f5260045ffd5b5f3560e01c806308a465f614610e9d57806319c6989f1461084e578063286f580d146107b75780632950286e146106cc57806354fd4d501461058f5780635a3c3987146105665780635e01eb5a146105215780638a12a08c146104c65780638eb1b65e146103bf578063945ed33f14610344578063ac9650d8146103005763e3b5dff40361000e57346102fc576060806003193601126102fc5767ffffffffffffffff6004358181116102fc5761012d9036906004016112c4565b6101356111a1565b6044359283116102fc57610150610158933690600401610fcd565b9390916128b9565b905f5b835181101561017c57805f8761017360019488611691565b5101520161015b565b506101f06101fe610239946101b65f94886040519361019a8561111a565b30855260208501525f1960408501528660608501523691611381565b60808201526040519283917f8a12a08c0000000000000000000000000000000000000000000000000000000060208401526024830161143e565b03601f198101835282611152565b604051809481927fedfa3568000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39261028e915f916102cf575b50602080825183010191016115d4565b909391926102a7575b60405193849384610f2f565b0390f35b5f7f00000000000000000000000000000000000000000000000000000000000000005d610297565b6102eb91503d805f833e6102e38183611152565b81019061154d565b8461027e565b6040513d5f823e3d90fd5b5f80fd5b60206003193601126102fc5760043567ffffffffffffffff81116102fc576103386103326102a3923690600401610f9c565b9061179b565b60405191829182611020565b346102fc5761035236610eca565b61035a611945565b610362611972565b6103906102a3610371836128fb565b9193909461038a606061038383611344565b9201611358565b90612729565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d60405193849384610f2f565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576103ec9036906004016112c4565b906103f56111b7565b906064359081116102fc576101f061048b6102399461045161041c5f953690600401610fcd565b610425336128b9565b97604051946104338661111a565b33865260208601526024356040860152151560608501523691611381565b60808201526040519283917f945ed33f000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b604051809481927f48c89491000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ffb565b346102fc576102a36104ef6104da36610eca565b6104e2611945565b6104ea611972565b611a3b565b5f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f009492945d60405193849384610f2f565b346102fc575f6003193601126102fc5760207f00000000000000000000000000000000000000000000000000000000000000005c6001600160a01b0360405191168152f35b346102fc576102a36104ef61057a36610eca565b610582611945565b61058a611972565b6128fb565b346102fc575f6003193601126102fc576040515f80549060018260011c91600184169182156106c2575b60209485851084146106955785879486865291825f146106575750506001146105fe575b506105ea92500383611152565b6102a3604051928284938452830190610ffb565b5f808052859250907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b85831061063f5750506105ea9350820101856105dd565b80548389018501528794508693909201918101610628565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016858201526105ea95151560051b85010192508791506105dd9050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b92607f16926105b9565b346102fc5760606003193601126102fc5767ffffffffffffffff6004358181116102fc576106fe9036906004016112c4565b906107076111a1565b6044359182116102fc5761072261072a923690600401610fcd565b9290916128b9565b905f5b845181101561075f57806fffffffffffffffffffffffffffffffff604061075660019489611691565b5101520161072d565b506101f06101fe8561077d5f94610239976040519361019a8561111a565b60808201526040519283917f5a3c3987000000000000000000000000000000000000000000000000000000006020840152602483016116d2565b60806003193601126102fc5767ffffffffffffffff6004358181116102fc576107e49036906004016112c4565b906107ed6111b7565b906064359081116102fc576101f061048b6102399461081461041c5f953690600401610fcd565b60808201526040519283917f08a465f60000000000000000000000000000000000000000000000000000000060208401526024830161143e565b60a06003193601126102fc5767ffffffffffffffff600435116102fc573660236004350112156102fc5767ffffffffffffffff60043560040135116102fc5736602460c060043560040135026004350101116102fc5760243567ffffffffffffffff81116102fc576108c4903690600401610f9c565b67ffffffffffffffff604435116102fc576060600319604435360301126102fc5760643567ffffffffffffffff81116102fc57610905903690600401610fcd565b60843567ffffffffffffffff81116102fc57610925903690600401610f9c565b949093610930611945565b806004356004013503610e75575f5b600435600401358110610bd25750505060443560040135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd6044353603018212156102fc57816044350160048101359067ffffffffffffffff82116102fc5760248260071b36039101136102fc576109e3575b6102a361033886865f7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005d61179b565b6001600160a01b039492947f0000000000000000000000000000000000000000000000000000000000000000163b156102fc57604051947f2a2d80d10000000000000000000000000000000000000000000000000000000086523360048701526060602487015260c486019260443501602481019367ffffffffffffffff6004830135116102fc57600482013560071b360385136102fc5760606064890152600482013590529192869260e484019291905f905b60048101358210610b5457505050602091601f19601f865f9787956001600160a01b03610ac860246044350161118d565b16608488015260448035013560a48801526003198787030160448801528186528786013787868286010152011601030181836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19182156102f1576102a39361033893610b45575b8294508193506109b3565b610b4e90611106565b84610b3a565b9195945091926001600160a01b03610b6b8761118d565b168152602080870135916001600160a01b0383168093036102fc57600492600192820152610b9b604089016128a6565b65ffffffffffff8091166040830152610bb660608a016128a6565b1660608201526080809101970193019050889495939291610a97565b610be7610be082848661192a565b3691611381565b604051610bf3816110a1565b5f81526020915f838301525f60408301528281015190606060408201519101515f1a91835283830152604082015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc81850260043501360301126102fc5760405190610c60826110ea565b610c73602460c08602600435010161118d565b808352610c89604460c08702600435010161118d565b908185850152610ca2606460c08802600435010161118d565b60408581019190915260043560c08802016084810135606087015260a4810135608087015260c4013560a086015283015183519386015160ff91909116926001600160a01b0383163b156102fc575f6001600160a01b03809460e4948b98849860c460c06040519c8d9b8c9a7fd505accf000000000000000000000000000000000000000000000000000000008c521660048b01523060248b0152608482820260043501013560448b0152026004350101356064880152608487015260a486015260c4850152165af19081610e66575b50610e5c57610d7f612877565b906001600160a01b0381511690836001600160a01b0381830151166044604051809581937fdd62ed3e00000000000000000000000000000000000000000000000000000000835260048301523060248301525afa9182156102f1575f92610e2c575b506060015103610df75750506001905b0161093f565b805115610e045780519101fd5b7fa7285689000000000000000000000000000000000000000000000000000000005f5260045ffd5b9091508381813d8311610e55575b610e448183611152565b810103126102fc5751906060610de1565b503d610e3a565b5050600190610df1565b610e6f90611106565b8a610d72565b7faaad13f7000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102fc57610eab36610eca565b610eb3611945565b610ebb611972565b6103906102a361037183611a3b565b600319906020828201126102fc576004359167ffffffffffffffff83116102fc578260a0920301126102fc5760040190565b9081518082526020808093019301915f5b828110610f1b575050505090565b835185529381019392810192600101610f0d565b939290610f4490606086526060860190610efc565b936020948181036020830152602080855192838152019401905f5b818110610f7f57505050610f7c9394506040818403910152610efc565b90565b82516001600160a01b031686529487019491870191600101610f5f565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc576020808501948460051b0101116102fc57565b9181601f840112156102fc5782359167ffffffffffffffff83116102fc57602083818601950101116102fc57565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6020808201906020835283518092526040830192602060408460051b8301019501935f915b8483106110555750505050505090565b9091929394958480611091837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc086600196030187528a51610ffb565b9801930193019194939290611045565b6060810190811067ffffffffffffffff8211176110bd57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60c0810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd57604052565b60a0810190811067ffffffffffffffff8211176110bd57604052565b60e0810190811067ffffffffffffffff8211176110bd57604052565b90601f601f19910116810190811067ffffffffffffffff8211176110bd57604052565b67ffffffffffffffff81116110bd5760051b60200190565b35906001600160a01b03821682036102fc57565b602435906001600160a01b03821682036102fc57565b6044359081151582036102fc57565b9190916080818403126102fc57604090815191608083019467ffffffffffffffff95848110878211176110bd57825283956112008461118d565b8552602090818501359081116102fc57840182601f820112156102fc5780359061122982611175565b9361123686519586611152565b82855283850190846060809502840101928184116102fc578501915b8383106112745750505050508401528181013590830152606090810135910152565b84838303126102fc57875190611289826110a1565b6112928461118d565b825261129f87850161118d565b87830152888401359081151582036102fc578288928b89950152815201920191611252565b81601f820112156102fc578035916020916112de84611175565b936112ec6040519586611152565b808552838086019160051b830101928084116102fc57848301915b8483106113175750505050505090565b823567ffffffffffffffff81116102fc578691611339848480948901016111c6565b815201920191611307565b356001600160a01b03811681036102fc5790565b3580151581036102fc5790565b67ffffffffffffffff81116110bd57601f01601f191660200190565b92919261138d82611365565b9161139b6040519384611152565b8294818452818301116102fc578281602093845f960137010152565b9060808101916001600160a01b03808251168352602093848301519460808186015285518092528060a086019601925f905b83821061140b5750505050506060816040829301516040850152015191015290565b845180518216895280840151821689850152604090810151151590890152606090970196938201936001909101906113e9565b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106114bd5750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b909192939583806114f8837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611481565b81601f820112156102fc5780519061151e82611365565b9261152c6040519485611152565b828452602083830101116102fc57815f9260208093018386015e8301015290565b906020828203126102fc57815167ffffffffffffffff81116102fc57610f7c9201611507565b9080601f830112156102fc5781519060209161158e81611175565b9361159c6040519586611152565b81855260208086019260051b8201019283116102fc57602001905b8282106115c5575050505090565b815181529083019083016115b7565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc5784611600918301611573565b936020808301518581116102fc5783019082601f830112156102fc5781519161162883611175565b926116366040519485611152565b808452828085019160051b830101918583116102fc578301905b82821061167257505050509360408301519081116102fc57610f7c9201611573565b81516001600160a01b03811681036102fc578152908301908301611650565b80518210156116a55760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b91909160209081815260c08101916001600160a01b0385511681830152808501519260a06040840152835180915260e08301918060e08360051b8601019501925f905b8382106117515750505050506080846040610f7c959601516060840152606081015115158284015201519060a0601f1982850301910152610ffb565b9091929395838061178c837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff208a600196030186528a516113b7565b98019201920190939291611715565b91906117a6336128b9565b907f000000000000000000000000000000000000000000000000000000000000000093845c6118b1576001906001865d6117df83611175565b926117ed6040519485611152565b808452601f196117fc82611175565b015f5b8181106118a05750505f5b8181106118575750505050905f61184c92945d7f0000000000000000000000000000000000000000000000000000000000000000805c9161184e575b506136b1565b565b5f905d5f611846565b806118845f8061186c610be08996888a61192a565b602081519101305af461187d612877565b903061415c565b61188e8288611691565b526118998187611691565b500161180a565b8060606020809389010152016117ff565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc576020019181360383136102fc57565b908210156116a5576119419160051b8101906118d9565b9091565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00805c6118b1576001905d565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036119a457565b7f089676d5000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b906119da82611175565b6119e76040519182611152565b828152601f196119f78294611175565b0190602036910137565b91908201809211611a0e57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b604081013542116126c35790611a5e611a5760208401846136f4565b90506119d0565b915f5b611a6e60208301836136f4565b90508110156125c757611a9881611a93611a8b60208601866136f4565b369391613748565b6111c6565b936040850151936001600160a01b038651169060208701518051156116a55760200151604001511515806125be575b1561256357611aec611ad886611344565b8784611ae660608a01611358565b92613add565b5f5b60208801515181101561255357611b03613788565b6020890151515f198101908111611a0e578214806020830152821582525f1461254c576060890151905b611b3b8360208c0151611691565b51604081015190919015611cee57611bd36001600160a01b03835116936001600160a01b03881685145f14611ce7576001945b60405195611b7b8761111a565b5f8752611b87816137be565b6020870152604086015260609485918d838301526080820152604051809381927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611cb0575b50506020015115611c9657816001600160a01b036020611c909360019695611c388c8c611691565b5201611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b5051167f000000000000000000000000000000000000000000000000000000000000000061420a565b01611aee565b602001519097506001600160a01b03169250600190611c90565b60209294509081611cd592903d10611ce0575b611ccd8183611152565b8101906137f5565b91505092905f611c10565b503d611cc3565b5f94611b6e565b888a6001600160a01b038495945116806001600160a01b038a16145f14612132575050815115905061206e57888a80151580612053575b611f4d575b6001600160a01b03939291611ddd82611e15978b5f95897f0000000000000000000000000000000000000000000000000000000000000000921680885282602052604088205c611f3c575b5050505b6001611d9c8983511660208401998b8b51169080158a14611f3657508391614223565b999092511694611db1608091828101906118d9565b93909460405197611dc1896110ea565b8852306020890152604088015260608701528501523691611381565b60a0820152604051809681927f21457897000000000000000000000000000000000000000000000000000000008352600483016139b1565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94611f0c575b506020015115611ee95791611ebc826001600160a01b0360019695611e7a611ee49686611691565b51611e858d8d611691565b52611eb3828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b50511692611691565b51907f000000000000000000000000000000000000000000000000000000000000000061420a565b611c90565b98506001929450611f02906001600160a01b0392611691565b5197511692611c90565b6020919450611f2c903d805f833e611f248183611152565b810190613969565b5094919050611e52565b91614223565b611f4592614341565b5f8281611d75565b50611f5a90929192611344565b91611f648b6142fd565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039485166004820152306024820152908416604482015292871660648401525f8380608481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f1578a611ddd8d611e15976001600160a01b03975f95612044575b50975092505091929350611d2a565b61204d90611106565b5f612035565b5061205d82611344565b6001600160a01b0316301415611d25565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916001600160a01b0384511692803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03949094166004850152306024850152604484018c90525f908490606490829084905af180156102f1578a611ddd8d611e15976001600160a01b03975f95612123575b50611d79565b61212c90611106565b5f61211d565b6001600160a01b0360208796949701511690898183145f146123d7576121cd925061220597915060016121735f96956001600160a01b0393848b5116614223565b509282895116956020890151151588146123ae5761219082611344565b945b6121a1608093848101906118d9565b959096604051996121b18b6110ea565b8a52166020890152604088015260608701528501523691611381565b60a0820152604051809581927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f1575f93612384575b5060200151156122c357816001600160a01b036020611ee493600196956122698c8c611691565b526122998383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b60208181015191516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101859052939a50909116945081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612359575b50600190611c90565b602090813d831161237d575b61236f8183611152565b810103126102fc575f612350565b503d612365565b60209193506123a4903d805f833e61239c8183611152565b81019061387c565b5093919050612242565b837f00000000000000000000000000000000000000000000000000000000000000001694612192565b6001600160a01b036124669561242e9394956123f860809b8c8101906118d9565b9390946040519761240889611136565b5f8952602089015216604087015260609a8b978888015286015260a08501523691611381565b60c0820152604051809381927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612525575b50506020015115611c9657816001600160a01b036020611ee493600196956124cb8c8c611691565b526124fb8383830151167f00000000000000000000000000000000000000000000000000000000000000006141c0565b500151167f000000000000000000000000000000000000000000000000000000000000000061420a565b6020929450908161254192903d10611ce057611ccd8183611152565b91505092905f6124a3565b5f90611b2d565b5091955090935050600101611a61565b61258d827f00000000000000000000000000000000000000000000000000000000000000006141c0565b506125b986837f000000000000000000000000000000000000000000000000000000000000000061420a565b611aec565b50321515611ac7565b50506125f27f0000000000000000000000000000000000000000000000000000000000000000613a71565b916125fd83516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b0380612663838b611691565b51165f528560205261269160405f205c8261267e858d611691565b51165f528860205260405f205c90611a01565b61269b8387611691565b526126a6828a611691565b51165f52856020525f604081205d01612644565b50949391509150565b7fe08b8af0000000000000000000000000000000000000000000000000000000005f5260045ffd5b905f198201918213600116611a0e57565b7f80000000000000000000000000000000000000000000000000000000000000008114611a0e575f190190565b907f000000000000000000000000000000000000000000000000000000000000000090815c7f0000000000000000000000000000000000000000000000000000000000000000612779815c6126eb565b907f0000000000000000000000000000000000000000000000000000000000000000915b5f81121561283a575050506127b1906126eb565b917f0000000000000000000000000000000000000000000000000000000000000000925b5f8112156127ea575050505061184c906136b1565b61283590825f5261282f60205f83828220015c91828252888152886040916128228a8d8587205c906001600160a01b03891690613eb0565b8484525281205d84613e0d565b506126fc565b6127d5565b61287290825f5261282f60205f8a8785848420015c938484528181526128228c6040948587205c906001600160a01b03891690613add565b61279d565b3d156128a1573d9061288882611365565b916128966040519384611152565b82523d5f602084013e565b606090565b359065ffffffffffff821682036102fc57565b905f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03815c16156128f1575050565b909192505d600190565b90604082013542116126c357612917611a5760208401846136f4565b915f5b61292760208301836136f4565b90508110156135d15761294481611a93611a8b60208601866136f4565b60608101519061297e6001600160a01b038251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506020810151515f198101908111611a0e575b5f8112156129a45750505060010161291a565b6129b2816020840151611691565b516129bb613788565b9082156020830152602084015151805f19810111611a0e575f1901831480835261358f575b6020820151156135545760408401516001600160a01b03855116915b604081015115612c1d5783916001600160a01b036060926020612aa0970151151580612c14575b612bed575b5116906001600160a01b0385168203612be6576001915b60405192612a4c8461111a565b60018452612a59816137be565b6020840152604083015288838301526080820152604051809581927f43583be500000000000000000000000000000000000000000000000000000000835260048301613a22565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f95612bbf575b506020015115612bb057612ba69284612b02612bab979694612b7594611691565b52612b366001600160a01b0382167f00000000000000000000000000000000000000000000000000000000000000006141c0565b506001600160a01b03612b4d8460408a01516137b1565b91167f000000000000000000000000000000000000000000000000000000000000000061420a565b6001600160a01b038551167f000000000000000000000000000000000000000000000000000000000000000061420a565b6126fc565b612991565b505050612bab919350926126fc565b6020919550612bdc9060603d606011611ce057611ccd8183611152565b5095919050612ae1565b5f91612a3f565b612c0f612bf98d611344565b8d8b611ae6886040888451169301519301611358565b612a28565b50321515612a23565b906001600160a01b03825116806001600160a01b038516145f14613137575060208401516130495750604051927f967870920000000000000000000000000000000000000000000000000000000084526001600160a01b03831660048501526020846024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa9384156102f1575f94613015575b5083916001600160a01b038151166001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03909116600482015230602482015260448101959095525f8580606481010381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f157612dec955f92613006575b505b611ddd6001600160a01b03612da88b828551168360208701511690614223565b50925116918c6002612dbf608092838101906118d9565b92909360405196612dcf886110ea565b875230602088015289604088015260608701528501523691611381565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19384156102f1575f94612fe3575b506020015115612ecf57908291612bab9493612e45898d611691565b52612e7a836001600160a01b0384167f000000000000000000000000000000000000000000000000000000000000000061420a565b80831080612eb4575b612e90575b5050506126fc565b612ea6612eac93612ea08b611344565b926137b1565b91614356565b5f8080612e88565b50306001600160a01b03612ec78b611344565b161415612e83565b9450908094808210612ee8575b505050612bab906126fc565b91612ef8602092612f77946137b1565b90612f2d826001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683614356565b60405193849283927f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f157612fb8575b8080612edc565b602090813d8311612fdc575b612fce8183611152565b810103126102fc575f612fb1565b503d612fc4565b6020919450612ffb903d805f833e611f248183611152565b509094919050612e29565b61300f90611106565b5f612d86565b9093506020813d602011613041575b8161303160209383611152565b810103126102fc5751925f612cbc565b3d9150613024565b909261305489611344565b6001600160a01b033091160361306f575b5f612dec94612d88565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016936130a38a611344565b6130ac846142fd565b90863b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152306024820152918116604483015285166064820152945f908690608490829084905af19081156102f157612dec955f92613128575b50945050613065565b61313190611106565b5f61311f565b6001600160a01b036020849695940151168a8282145f1461340b5750505061320c61316e5f92846001600160a01b03885116614223565b92906131d48c6001600160a01b03808a5116938951151586146133df576131a361319784611344565b935b60808101906118d9565b929093604051966131b3886110ea565b875216602086015260408501528c6060850152600260808501523691611381565b60a0820152604051809381927f4af29ec4000000000000000000000000000000000000000000000000000000008352600483016138f8565b0381836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19081156102f1575f916133c4575b5060208401518c908a90156133aa5783836001600160a01b03936132836132899461327c8f9c9b9a98996132b29a611691565b5192611691565b52611691565b5191167f000000000000000000000000000000000000000000000000000000000000000061420a565b51156132f457612bab92916001600160a01b036020612ba6930151167f0000000000000000000000000000000000000000000000000000000000000000614341565b516040517f15afd4090000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810191909152602081806044810103815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156102f15761337f575b50612bab906126fc565b602090813d83116133a3575b6133958183611152565b810103126102fc575f613375565b503d61338b565b50509091506133bb92939650611691565b519384916132b2565b6133d891503d805f833e61239c8183611152565b9050613249565b6131a3827f00000000000000000000000000000000000000000000000000000000000000001693613199565b61349e965090613466916060948b61342b608099989993848101906118d9565b9390946040519761343b89611136565b6001895260208901526001600160a01b038b1660408901528888015286015260a08501523691611381565b60c0820152604051809581927f2bfb780c00000000000000000000000000000000000000000000000000000000835260048301613810565b03815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af19283156102f15787918b915f9561352d575b506020015115612bb057612ba69284613505612bab9796946001600160a01b0394611691565b52167f000000000000000000000000000000000000000000000000000000000000000061420a565b602091955061354a9060603d606011611ce057611ccd8183611152565b50959190506134df565b6fffffffffffffffffffffffffffffffff6001600160a01b0360206135858188015161357f886126eb565b90611691565b51015116916129fc565b6135cc856001600160a01b0360208401611c67828251167f00000000000000000000000000000000000000000000000000000000000000006141c0565b6129e0565b50506135fc7f0000000000000000000000000000000000000000000000000000000000000000613a71565b9161360783516119d0565b7f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091905f5b86518110156126ba576001906001600160a01b038061366d838b611691565b51165f528560205261368860405f205c8261267e858d611691565b6136928387611691565b5261369d828a611691565b51165f52856020525f604081205d0161364e565b4780156136f0577f00000000000000000000000000000000000000000000000000000000000000005c6136f0576001600160a01b0361184c92166140e0565b5050565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156102fc570180359067ffffffffffffffff82116102fc57602001918160051b360383136102fc57565b91908110156116a55760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81813603018212156102fc570190565b604051906040820182811067ffffffffffffffff8211176110bd576040525f6020838281520152565b91908203918211611a0e57565b600211156137c857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b908160609103126102fc578051916040602083015192015190565b61010060c0610f7c93602084528051613828816137be565b602085015260208101516001600160a01b0380911660408601528060408301511660608601526060820151166080850152608081015160a085015260a08101518285015201519160e0808201520190610ffb565b90916060828403126102fc5781519167ffffffffffffffff928381116102fc57846138a8918301611573565b9360208201519360408301519081116102fc57610f7c9201611507565b9081518082526020808093019301915f5b8281106138e4575050505090565b8351855293810193928101926001016138d6565b602081526001600160a01b038083511660208301526020830151166040820152613931604083015160c0606084015260e08301906138c5565b9060608301516080820152608083015160058110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b916060838303126102fc5782519260208101519267ffffffffffffffff938481116102fc578161399a918401611573565b9360408301519081116102fc57610f7c9201611507565b602081526001600160a01b038083511660208301526020830151166040820152604082015160608201526139f4606083015160c0608084015260e08301906138c5565b90608083015160048110156137c857610f7c9360a0918284015201519060c0601f1982850301910152610ffb565b91909160808060a08301948051613a38816137be565b84526020810151613a48816137be565b60208501526001600160a01b036040820151166040850152606081015160608501520151910152565b90815c613a7d81611175565b613a8a6040519182611152565b818152613a9682611175565b601f196020910136602084013781945f5b848110613ab5575050505050565b600190825f5280845f20015c6001600160a01b03613ad38388611691565b9116905201613aa7565b919280613dd8575b15613c51575050804710613c29576001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001691823b156102fc57604051907fd0e30db00000000000000000000000000000000000000000000000000000000082525f915f8160048185895af180156102f157613c12575b506044602092937f00000000000000000000000000000000000000000000000000000000000000001694613b98838783614356565b8460405196879485937f15afd409000000000000000000000000000000000000000000000000000000008552600485015260248401525af1908115613c065750613bdf5750565b602090813d8311613bff575b613bf58183611152565b810103126102fc57565b503d613beb565b604051903d90823e3d90fd5b60209250613c1f90611106565b60445f9250613b63565b7fa01a9df6000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915f9080613c61575b50505050565b6001600160a01b0393847f00000000000000000000000000000000000000000000000000000000000000001694807f00000000000000000000000000000000000000000000000000000000000000001691613cbb846142fd565b96803b156102fc576040517f36c785160000000000000000000000000000000000000000000000000000000081526001600160a01b039283166004820152848316602482015297821660448901529186161660648701525f908690608490829084905af19485156102f157613d8095613dc4575b5082936020936040518097819582947f15afd40900000000000000000000000000000000000000000000000000000000845260048401602090939291936001600160a01b0360408201951681520152565b03925af1908115613c065750613d99575b808080613c5b565b602090813d8311613dbd575b613daf8183611152565b810103126102fc575f613d91565b503d613da5565b60209350613dd190611106565b5f92613d2f565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690821614613ae5565b6001810191805f5260209183835260405f205c8015155f14613ea7575f1990818101835c8380820191828403613e6a575b5050505050815c81810192818411611a0e575f93815d835284832001015d5f52525f604081205d600190565b613e77613e87938861443a565b865f52885f2001015c918561443a565b835f52808383885f2001015d5f5285855260405f205d5f80808381613e3e565b50505050505f90565b5f949383156140d857806140a3575b15614007576001600160a01b0391827f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03929092166004830152306024830152604482018590525f908290606490829084905af180156102f157613ff4575b5084827f000000000000000000000000000000000000000000000000000000000000000016803b15613ff05781906024604051809481937f2e1a7d4d0000000000000000000000000000000000000000000000000000000083528960048401525af18015613fe557613fcd575b5061184c939450166140e0565b613fd78691611106565b613fe15784613fc0565b8480fd5b6040513d88823e3d90fd5b5080fd5b613fff919550611106565b5f935f613f53565b929350906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b156102fc576040517fae6393290000000000000000000000000000000000000000000000000000000081526001600160a01b03938416600482015293909216602484015260448301525f908290606490829084905af180156102f15761409a5750565b61184c90611106565b506001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690831614613ebf565b505050509050565b814710614130575f8080936001600160a01b038294165af1614100612877565b501561410857565b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b7fcd786059000000000000000000000000000000000000000000000000000000005f523060045260245ffd5b90614171575080511561410857805190602001fd5b815115806141b7575b614182575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561417a565b6001810190825f528160205260405f205c155f1461420357805c815f52838160205f20015d60018101809111611a0e57815d5c915f5260205260405f205d600190565b5050505f90565b905f5260205261421f60405f2091825c611a01565b905d565b916044929391936001600160a01b03604094859282808551998a9586947fc9c1661b0000000000000000000000000000000000000000000000000000000086521660048501521660248301527f0000000000000000000000000000000000000000000000000000000000000000165afa9384156142f3575f935f956142bc575b50506142b96142b285946119d0565b9485611691565b52565b809295508194503d83116142ec575b6142d58183611152565b810103126102fc5760208251920151925f806142a3565b503d6142cb565b83513d5f823e3d90fd5b6001600160a01b0390818111614311571690565b7f6dfcc650000000000000000000000000000000000000000000000000000000005f5260a060045260245260445ffd5b905f5260205261421f60405f2091825c6137b1565b6040519260208401907fa9059cbb0000000000000000000000000000000000000000000000000000000082526001600160a01b038094166024860152604485015260448452608084019084821067ffffffffffffffff8311176110bd576143d5935f9384936040521694519082865af16143ce612877565b908361415c565b8051908115159182614416575b50506143eb5750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b81925090602091810103126102fc57602001518015908115036102fc575f806143e2565b5c111561444357565b7f0f4ae0e4000000000000000000000000000000000000000000000000000000005f5260045ffdfea2646970667358221220229a5cf89aa7c2d0a4b4d5db20bba6c2b3a74b080303fc6ec00ba582a5dcf75164736f6c634300081a0033", "linkReferences": {}, "deployedLinkReferences": {} -} \ No newline at end of file +} diff --git a/crates/contracts/artifacts/ChainalysisOracle.json b/crates/contracts/artifacts/ChainalysisOracle.json index 1d98ba5e5e..7b7318b2b8 100644 --- a/crates/contracts/artifacts/ChainalysisOracle.json +++ b/crates/contracts/artifacts/ChainalysisOracle.json @@ -1 +1,190 @@ -{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"NonSanctionedAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"SanctionedAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"SanctionedAddressesAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"SanctionedAddressesRemoved","type":"event"},{"inputs":[{"internalType":"address[]","name":"newSanctions","type":"address[]"}],"name":"addToSanctionsList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isSanctioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isSanctionedVerbose","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"removeSanctions","type":"address[]"}],"name":"removeFromSanctionsList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]} +{ + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "NonSanctionedAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "SanctionedAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "addrs", + "type": "address[]" + } + ], + "name": "SanctionedAddressesAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "addrs", + "type": "address[]" + } + ], + "name": "SanctionedAddressesRemoved", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "newSanctions", + "type": "address[]" + } + ], + "name": "addToSanctionsList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isSanctioned", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isSanctionedVerbose", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "removeSanctions", + "type": "address[]" + } + ], + "name": "removeFromSanctionsList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/CoWSwapEthFlow.json b/crates/contracts/artifacts/CoWSwapEthFlow.json index 00890bd262..36565487f1 100644 --- a/crates/contracts/artifacts/CoWSwapEthFlow.json +++ b/crates/contracts/artifacts/CoWSwapEthFlow.json @@ -1 +1,502 @@ -{"abi":[{"inputs":[{"internalType":"contract ICoWSwapSettlement","name":"_cowSwapSettlement","type":"address"},{"internalType":"contract IWrappedNativeToken","name":"_wrappedNativeToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"inputs":[],"name":"IncorrectEthAmount","type":"error"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"NotAllowedToInvalidateOrder","type":"error"},{"inputs":[],"name":"NotAllowedZeroSellAmount","type":"error"},{"inputs":[],"name":"OrderIsAlreadyExpired","type":"error"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"OrderIsAlreadyOwned","type":"error"},{"inputs":[],"name":"ReceiverMustBeSet","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"orderUid","type":"bytes"}],"name":"OrderInvalidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contract IERC20","name":"sellToken","type":"address"},{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes32","name":"kind","type":"bytes32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"bytes32","name":"sellTokenBalance","type":"bytes32"},{"internalType":"bytes32","name":"buyTokenBalance","type":"bytes32"}],"indexed":false,"internalType":"struct GPv2Order.Data","name":"order","type":"tuple"},{"components":[{"internalType":"enum ICoWSwapOnchainOrders.OnchainSigningScheme","name":"scheme","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct ICoWSwapOnchainOrders.OnchainSignature","name":"signature","type":"tuple"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OrderPlacement","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"orderUid","type":"bytes"},{"indexed":true,"internalType":"address","name":"refunder","type":"address"}],"name":"OrderRefund","type":"event"},{"inputs":[],"name":"cowSwapSettlement","outputs":[{"internalType":"contract ICoWSwapSettlement","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"int64","name":"quoteId","type":"int64"}],"internalType":"struct EthFlowOrder.Data","name":"order","type":"tuple"}],"name":"createOrder","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"int64","name":"quoteId","type":"int64"}],"internalType":"struct EthFlowOrder.Data","name":"order","type":"tuple"}],"name":"invalidateOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"int64","name":"quoteId","type":"int64"}],"internalType":"struct EthFlowOrder.Data[]","name":"orderArray","type":"tuple[]"}],"name":"invalidateOrdersIgnoringNotAllowed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"orders","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint32","name":"validTo","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"wrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrapAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrappedNativeToken","outputs":[{"internalType":"contract IWrappedNativeToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"0x60e06040523480156200001157600080fd5b5060405162001b2a38038062001b2a83398101604081905262000034916200021e565b816200004b816200015260201b6200089b1760201c565b608052506001600160a01b0380831660a081905290821660c081905260408051634daa966160e11b81529051919263095ea7b3929091639b552cc291600480830192602092919082900301816000875af1158015620000ae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000d491906200025d565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260001960248201526044016020604051808303816000875af115801562000123573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000149919062000284565b505050620002a8565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f6c85c0337eba1661327f94f3bf46c8a7f9311a563f4d5c948362567f5d8ed60c918101919091527ff9446b8e937d86f0bc87cac73923491692b123ca5f8761908494703758206adf606082015246608082018190526001600160a01b03831660a083015260009160c00160405160208183030381529060405280519060200120915050919050565b6001600160a01b03811681146200021b57600080fd5b50565b600080604083850312156200023257600080fd5b82516200023f8162000205565b6020840151909250620002528162000205565b809150509250929050565b6000602082840312156200027057600080fd5b81516200027d8162000205565b9392505050565b6000602082840312156200029757600080fd5b815180151581146200027d57600080fd5b60805160a05160c0516118216200030960003960008181610129015281816105ff015281816107ad0152818161082501528181610c3301526110310152600081816102ce0152610f4b015260008181610bf70152610cd901526118216000f3fe6080604052600436106100b55760003560e01c80637bc41b9611610069578063de0e9a3e1161004e578063de0e9a3e1461027c578063ea598cb01461029c578063ec30bb88146102bc57600080fd5b80637bc41b96146101c85780639c3f1e90146101e857600080fd5b8063322bba211161009a578063322bba21146101705780634c84c1c8146101915780634cb76498146101a857600080fd5b80631626ba7e146100c157806317fcb39b1461011757600080fd5b366100bc57005b600080fd5b3480156100cd57600080fd5b506100e16100dc36600461126e565b6102f0565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b34801561012357600080fd5b5061014b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010e565b61018361017e36600461132b565b6103de565b60405190815260200161010e565b34801561019d57600080fd5b506101a6610720565b005b3480156101b457600080fd5b506101a66101c3366004611344565b61072b565b3480156101d457600080fd5b506101a66101e336600461132b565b610770565b3480156101f457600080fd5b5061024b6102033660046113ba565b60006020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000900463ffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835263ffffffff90911660208301520161010e565b34801561028857600080fd5b506101a66102973660046113ba565b61077e565b3480156102a857600080fd5b506101a66102b73660046113ba565b610821565b3480156102c857600080fd5b5061014b7f000000000000000000000000000000000000000000000000000000000000000081565b60008281526020818152604080832081518083019092525473ffffffffffffffffffffffffffffffffffffffff81168083527401000000000000000000000000000000000000000090910463ffffffff1692820192909252901580159061036f5750805173ffffffffffffffffffffffffffffffffffffffff90811614155b8015610385575042816020015163ffffffff1610155b156103b357507f1626ba7e0000000000000000000000000000000000000000000000000000000090506103d8565b507fffffffff0000000000000000000000000000000000000000000000000000000090505b92915050565b60006103f260a08301356040840135611402565b341461042a576040517f8b6ebb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160400135600003610468576040517feaec5c9d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4261047960e0840160c0850161142e565b63ffffffff1610156104b7576040517f89bb260100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051808201909152338152600090602081016104db60e0860160c0870161142e565b63ffffffff169052604080518082019091529091506000908082815260200130604051602001610536919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290529050600061057c61012086016101008701611462565b6020808501516040516105c393920160c09290921b825260e01b7fffffffff00000000000000000000000000000000000000000000000000000000166008820152600c0190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052835190915061063a906106337f000000000000000000000000000000000000000000000000000000000000000061062d368a90038a018a6114b1565b9061095b565b8484610b2a565b60008181526020819052604090205490945073ffffffffffffffffffffffffffffffffffffffff16156106a1576040517f56a1d2b2000000000000000000000000000000000000000000000000000000008152600481018590526024015b60405180910390fd5b505060008281526020818152604090912082518154929093015163ffffffff1674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff90931692909217179055919050565b61072947610821565b565b60005b8181101561076b5761075983838381811061074b5761074b61154b565b905061012002016000610c2c565b806107638161157a565b91505061072e565b505050565b61077b816001610c2c565b50565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b5050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461081a576040519150601f19603f3d011682016040523d82523d6000602084013e61081a565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f6c85c0337eba1661327f94f3bf46c8a7f9311a563f4d5c948362567f5d8ed60c918101919091527ff9446b8e937d86f0bc87cac73923491692b123ca5f8761908494703758206adf6060820152466080820181905273ffffffffffffffffffffffffffffffffffffffff831660a083015260009160c00160405160208183030381529060405280519060200120915050919050565b604080516101808101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082018190526101608201529083015173ffffffffffffffffffffffffffffffffffffffff16610a0a576040517fefc9ccdf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518061018001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001846000015173ffffffffffffffffffffffffffffffffffffffff168152602001846020015173ffffffffffffffffffffffffffffffffffffffff168152602001846040015181526020018460600151815260200163ffffffff80168152602001846080015181526020018460a0015181526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020018460e00151151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9815250905092915050565b60008473ffffffffffffffffffffffffffffffffffffffff167fcf5f9de2984132265203b5c335b25727702ca77262ff622e136baa7362bf1da9858585604051610b7693929190611676565b60405180910390a25050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020919050565b6000610c617f000000000000000000000000000000000000000000000000000000000000000061062d368690038601866114b1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a082209152604080517f190100000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600282015260228101929092526042909120600081815260208181529083902083518085019094525473ffffffffffffffffffffffffffffffffffffffff8082168086527401000000000000000000000000000000000000000090920463ffffffff1692850183905294955091934290911015911480610d8d5750815173ffffffffffffffffffffffffffffffffffffffff16155b80610db75750808015610db75750815173ffffffffffffffffffffffffffffffffffffffff163314155b15610dff578415610df7576040517ff8cc70ce00000000000000000000000000000000000000000000000000000000815260048101849052602401610698565b505050505050565b60008381526020818152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff1790558051603880825260608201909252918201818036833750505060a0860151909150610e7a90829086903090611149565b8115610ebc577fb8bad102ac8bbacfef31ff1c906ec6d951c230b4dce750bb0376b812ad35852a81604051610eaf9190611790565b60405180910390a1610f0b565b3373ffffffffffffffffffffffffffffffffffffffff167f195271068a288191e4b265c641a56b9832919f69e9e7d6c2f31ba40278aeb85a82604051610f029190611790565b60405180910390a25b6040517f2479fb6e00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690632479fb6e90610f80908590600401611790565b6020604051808303816000875af1158015610f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc391906117a3565b90506000808760600151838960e001510281610fe157610fe16117bc565b048860e00151039050808389606001510301915050804710156110a4576040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815247820360048201819052907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b50505050505b845160405160009173ffffffffffffffffffffffffffffffffffffffff169083908381818185875af1925050503d80600081146110fd576040519150601f19603f3d011682016040523d82523d6000602084013e611102565b606091505b505090508061113d576040517f6d963f8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050505050565b60388451146111b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a2075696420627566666572206f766572666c6f77000000000000006044820152606401610698565b60388401526034830152602090910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715611219576112196111c6565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611266576112666111c6565b604052919050565b6000806040838503121561128157600080fd5b8235915060208084013567ffffffffffffffff808211156112a157600080fd5b818601915086601f8301126112b557600080fd5b8135818111156112c7576112c76111c6565b6112f7847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161121f565b9150808252878482850101111561130d57600080fd5b80848401858401376000848284010152508093505050509250929050565b6000610120828403121561133e57600080fd5b50919050565b6000806020838503121561135757600080fd5b823567ffffffffffffffff8082111561136f57600080fd5b818501915085601f83011261138357600080fd5b81358181111561139257600080fd5b866020610120830285010111156113a857600080fd5b60209290920196919550909350505050565b6000602082840312156113cc57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103d8576103d86113d3565b803563ffffffff8116811461142957600080fd5b919050565b60006020828403121561144057600080fd5b61144982611415565b9392505050565b8035600781900b811461142957600080fd5b60006020828403121561147457600080fd5b61144982611450565b803573ffffffffffffffffffffffffffffffffffffffff8116811461142957600080fd5b8035801515811461142957600080fd5b600061012082840312156114c457600080fd5b6114cc6111f5565b6114d58361147d565b81526114e36020840161147d565b602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015261151c60c08401611415565b60c082015261152d60e084016114a1565b60e0820152610100611540818501611450565b908201529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036115ab576115ab6113d3565b5060010190565b6000815180845260005b818110156115d8576020818501810151868301820152016115bc565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6000815160028110611651577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8084525060208201516040602085015261166e60408501826115b2565b949350505050565b835173ffffffffffffffffffffffffffffffffffffffff16815260006101c060208601516116bc602085018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408601516116e4604085018273ffffffffffffffffffffffffffffffffffffffff169052565b50606086015160608401526080860151608084015260a086015161171060a085018263ffffffff169052565b5060c086015160c084015260e086015160e0840152610100808701518185015250610120808701516117458286018215159052565b505061014086810151908401526101608087015190840152610180830181905261177181840186611616565b90508281036101a084015261178681856115b2565b9695505050505050565b60208152600061144960208301846115b2565b6000602082840312156117b557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220d3219a243fb3b7683c6c6a0918144885c8551f0fd87b19a0e7355ed3d10e937064736f6c63430008100033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract ICoWSwapSettlement", + "name": "_cowSwapSettlement", + "type": "address" + }, + { + "internalType": "contract IWrappedNativeToken", + "name": "_wrappedNativeToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EthTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "IncorrectEthAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "name": "NotAllowedToInvalidateOrder", + "type": "error" + }, + { + "inputs": [], + "name": "NotAllowedZeroSellAmount", + "type": "error" + }, + { + "inputs": [], + "name": "OrderIsAlreadyExpired", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "name": "OrderIsAlreadyOwned", + "type": "error" + }, + { + "inputs": [], + "name": "ReceiverMustBeSet", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + } + ], + "name": "OrderInvalidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "sellTokenBalance", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "buyTokenBalance", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct GPv2Order.Data", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum ICoWSwapOnchainOrders.OnchainSigningScheme", + "name": "scheme", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct ICoWSwapOnchainOrders.OnchainSignature", + "name": "signature", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OrderPlacement", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "address", + "name": "refunder", + "type": "address" + } + ], + "name": "OrderRefund", + "type": "event" + }, + { + "inputs": [], + "name": "cowSwapSettlement", + "outputs": [ + { + "internalType": "contract ICoWSwapSettlement", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "int64", + "name": "quoteId", + "type": "int64" + } + ], + "internalType": "struct EthFlowOrder.Data", + "name": "order", + "type": "tuple" + } + ], + "name": "createOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "int64", + "name": "quoteId", + "type": "int64" + } + ], + "internalType": "struct EthFlowOrder.Data", + "name": "order", + "type": "tuple" + } + ], + "name": "invalidateOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "int64", + "name": "quoteId", + "type": "int64" + } + ], + "internalType": "struct EthFlowOrder.Data[]", + "name": "orderArray", + "type": "tuple[]" + } + ], + "name": "invalidateOrdersIgnoringNotAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "orders", + "outputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "unwrap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "wrap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "wrapAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "wrappedNativeToken", + "outputs": [ + { + "internalType": "contract IWrappedNativeToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x60e06040523480156200001157600080fd5b5060405162001b2a38038062001b2a83398101604081905262000034916200021e565b816200004b816200015260201b6200089b1760201c565b608052506001600160a01b0380831660a081905290821660c081905260408051634daa966160e11b81529051919263095ea7b3929091639b552cc291600480830192602092919082900301816000875af1158015620000ae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000d491906200025d565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260001960248201526044016020604051808303816000875af115801562000123573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000149919062000284565b505050620002a8565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f6c85c0337eba1661327f94f3bf46c8a7f9311a563f4d5c948362567f5d8ed60c918101919091527ff9446b8e937d86f0bc87cac73923491692b123ca5f8761908494703758206adf606082015246608082018190526001600160a01b03831660a083015260009160c00160405160208183030381529060405280519060200120915050919050565b6001600160a01b03811681146200021b57600080fd5b50565b600080604083850312156200023257600080fd5b82516200023f8162000205565b6020840151909250620002528162000205565b809150509250929050565b6000602082840312156200027057600080fd5b81516200027d8162000205565b9392505050565b6000602082840312156200029757600080fd5b815180151581146200027d57600080fd5b60805160a05160c0516118216200030960003960008181610129015281816105ff015281816107ad0152818161082501528181610c3301526110310152600081816102ce0152610f4b015260008181610bf70152610cd901526118216000f3fe6080604052600436106100b55760003560e01c80637bc41b9611610069578063de0e9a3e1161004e578063de0e9a3e1461027c578063ea598cb01461029c578063ec30bb88146102bc57600080fd5b80637bc41b96146101c85780639c3f1e90146101e857600080fd5b8063322bba211161009a578063322bba21146101705780634c84c1c8146101915780634cb76498146101a857600080fd5b80631626ba7e146100c157806317fcb39b1461011757600080fd5b366100bc57005b600080fd5b3480156100cd57600080fd5b506100e16100dc36600461126e565b6102f0565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b34801561012357600080fd5b5061014b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010e565b61018361017e36600461132b565b6103de565b60405190815260200161010e565b34801561019d57600080fd5b506101a6610720565b005b3480156101b457600080fd5b506101a66101c3366004611344565b61072b565b3480156101d457600080fd5b506101a66101e336600461132b565b610770565b3480156101f457600080fd5b5061024b6102033660046113ba565b60006020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff81169074010000000000000000000000000000000000000000900463ffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835263ffffffff90911660208301520161010e565b34801561028857600080fd5b506101a66102973660046113ba565b61077e565b3480156102a857600080fd5b506101a66102b73660046113ba565b610821565b3480156102c857600080fd5b5061014b7f000000000000000000000000000000000000000000000000000000000000000081565b60008281526020818152604080832081518083019092525473ffffffffffffffffffffffffffffffffffffffff81168083527401000000000000000000000000000000000000000090910463ffffffff1692820192909252901580159061036f5750805173ffffffffffffffffffffffffffffffffffffffff90811614155b8015610385575042816020015163ffffffff1610155b156103b357507f1626ba7e0000000000000000000000000000000000000000000000000000000090506103d8565b507fffffffff0000000000000000000000000000000000000000000000000000000090505b92915050565b60006103f260a08301356040840135611402565b341461042a576040517f8b6ebb4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160400135600003610468576040517feaec5c9d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4261047960e0840160c0850161142e565b63ffffffff1610156104b7576040517f89bb260100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051808201909152338152600090602081016104db60e0860160c0870161142e565b63ffffffff169052604080518082019091529091506000908082815260200130604051602001610536919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290529050600061057c61012086016101008701611462565b6020808501516040516105c393920160c09290921b825260e01b7fffffffff00000000000000000000000000000000000000000000000000000000166008820152600c0190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052835190915061063a906106337f000000000000000000000000000000000000000000000000000000000000000061062d368a90038a018a6114b1565b9061095b565b8484610b2a565b60008181526020819052604090205490945073ffffffffffffffffffffffffffffffffffffffff16156106a1576040517f56a1d2b2000000000000000000000000000000000000000000000000000000008152600481018590526024015b60405180910390fd5b505060008281526020818152604090912082518154929093015163ffffffff1674010000000000000000000000000000000000000000027fffffffffffffffff00000000000000000000000000000000000000000000000090921673ffffffffffffffffffffffffffffffffffffffff90931692909217179055919050565b61072947610821565b565b60005b8181101561076b5761075983838381811061074b5761074b61154b565b905061012002016000610c2c565b806107638161157a565b91505061072e565b505050565b61077b816001610c2c565b50565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b5050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461081a576040519150601f19603f3d011682016040523d82523d6000602084013e61081a565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f6c85c0337eba1661327f94f3bf46c8a7f9311a563f4d5c948362567f5d8ed60c918101919091527ff9446b8e937d86f0bc87cac73923491692b123ca5f8761908494703758206adf6060820152466080820181905273ffffffffffffffffffffffffffffffffffffffff831660a083015260009160c00160405160208183030381529060405280519060200120915050919050565b604080516101808101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082018190526101608201529083015173ffffffffffffffffffffffffffffffffffffffff16610a0a576040517fefc9ccdf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518061018001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001846000015173ffffffffffffffffffffffffffffffffffffffff168152602001846020015173ffffffffffffffffffffffffffffffffffffffff168152602001846040015181526020018460600151815260200163ffffffff80168152602001846080015181526020018460a0015181526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020018460e00151151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9815250905092915050565b60008473ffffffffffffffffffffffffffffffffffffffff167fcf5f9de2984132265203b5c335b25727702ca77262ff622e136baa7362bf1da9858585604051610b7693929190611676565b60405180910390a25050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020919050565b6000610c617f000000000000000000000000000000000000000000000000000000000000000061062d368690038601866114b1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a082209152604080517f190100000000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600282015260228101929092526042909120600081815260208181529083902083518085019094525473ffffffffffffffffffffffffffffffffffffffff8082168086527401000000000000000000000000000000000000000090920463ffffffff1692850183905294955091934290911015911480610d8d5750815173ffffffffffffffffffffffffffffffffffffffff16155b80610db75750808015610db75750815173ffffffffffffffffffffffffffffffffffffffff163314155b15610dff578415610df7576040517ff8cc70ce00000000000000000000000000000000000000000000000000000000815260048101849052602401610698565b505050505050565b60008381526020818152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff1790558051603880825260608201909252918201818036833750505060a0860151909150610e7a90829086903090611149565b8115610ebc577fb8bad102ac8bbacfef31ff1c906ec6d951c230b4dce750bb0376b812ad35852a81604051610eaf9190611790565b60405180910390a1610f0b565b3373ffffffffffffffffffffffffffffffffffffffff167f195271068a288191e4b265c641a56b9832919f69e9e7d6c2f31ba40278aeb85a82604051610f029190611790565b60405180910390a25b6040517f2479fb6e00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690632479fb6e90610f80908590600401611790565b6020604051808303816000875af1158015610f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc391906117a3565b90506000808760600151838960e001510281610fe157610fe16117bc565b048860e00151039050808389606001510301915050804710156110a4576040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815247820360048201819052907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b50505050505b845160405160009173ffffffffffffffffffffffffffffffffffffffff169083908381818185875af1925050503d80600081146110fd576040519150601f19603f3d011682016040523d82523d6000602084013e611102565b606091505b505090508061113d576040517f6d963f8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050505050565b60388451146111b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a2075696420627566666572206f766572666c6f77000000000000006044820152606401610698565b60388401526034830152602090910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715611219576112196111c6565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611266576112666111c6565b604052919050565b6000806040838503121561128157600080fd5b8235915060208084013567ffffffffffffffff808211156112a157600080fd5b818601915086601f8301126112b557600080fd5b8135818111156112c7576112c76111c6565b6112f7847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161121f565b9150808252878482850101111561130d57600080fd5b80848401858401376000848284010152508093505050509250929050565b6000610120828403121561133e57600080fd5b50919050565b6000806020838503121561135757600080fd5b823567ffffffffffffffff8082111561136f57600080fd5b818501915085601f83011261138357600080fd5b81358181111561139257600080fd5b866020610120830285010111156113a857600080fd5b60209290920196919550909350505050565b6000602082840312156113cc57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156103d8576103d86113d3565b803563ffffffff8116811461142957600080fd5b919050565b60006020828403121561144057600080fd5b61144982611415565b9392505050565b8035600781900b811461142957600080fd5b60006020828403121561147457600080fd5b61144982611450565b803573ffffffffffffffffffffffffffffffffffffffff8116811461142957600080fd5b8035801515811461142957600080fd5b600061012082840312156114c457600080fd5b6114cc6111f5565b6114d58361147d565b81526114e36020840161147d565b602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015261151c60c08401611415565b60c082015261152d60e084016114a1565b60e0820152610100611540818501611450565b908201529392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036115ab576115ab6113d3565b5060010190565b6000815180845260005b818110156115d8576020818501810151868301820152016115bc565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6000815160028110611651577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8084525060208201516040602085015261166e60408501826115b2565b949350505050565b835173ffffffffffffffffffffffffffffffffffffffff16815260006101c060208601516116bc602085018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408601516116e4604085018273ffffffffffffffffffffffffffffffffffffffff169052565b50606086015160608401526080860151608084015260a086015161171060a085018263ffffffff169052565b5060c086015160c084015260e086015160e0840152610100808701518185015250610120808701516117458286018215159052565b505061014086810151908401526101608087015190840152610180830181905261177181840186611616565b90508281036101a084015261178681856115b2565b9695505050505050565b60208152600061144960208301846115b2565b6000602082840312156117b557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220d3219a243fb3b7683c6c6a0918144885c8551f0fd87b19a0e7355ed3d10e937064736f6c63430008100033" +} diff --git a/crates/contracts/artifacts/CoWSwapOnchainOrders.json b/crates/contracts/artifacts/CoWSwapOnchainOrders.json index 39359dbe9f..a999dec321 100644 --- a/crates/contracts/artifacts/CoWSwapOnchainOrders.json +++ b/crates/contracts/artifacts/CoWSwapOnchainOrders.json @@ -1 +1,133 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"settlementContractAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"orderUid","type":"bytes"}],"name":"OrderInvalidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contract IERC20","name":"sellToken","type":"address"},{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes32","name":"kind","type":"bytes32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"bytes32","name":"sellTokenBalance","type":"bytes32"},{"internalType":"bytes32","name":"buyTokenBalance","type":"bytes32"}],"indexed":false,"internalType":"struct GPv2Order.Data","name":"order","type":"tuple"},{"components":[{"internalType":"enum ICoWSwapOnchainOrders.OnchainSigningScheme","name":"scheme","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct ICoWSwapOnchainOrders.OnchainSignature","name":"signature","type":"tuple"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OrderPlacement","type":"event"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "settlementContractAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + } + ], + "name": "OrderInvalidation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "sellTokenBalance", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "buyTokenBalance", + "type": "bytes32" + } + ], + "indexed": false, + "internalType": "struct GPv2Order.Data", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum ICoWSwapOnchainOrders.OnchainSigningScheme", + "name": "scheme", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct ICoWSwapOnchainOrders.OnchainSignature", + "name": "signature", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "OrderPlacement", + "type": "event" + } + ] +} diff --git a/crates/contracts/artifacts/CowAmm.json b/crates/contracts/artifacts/CowAmm.json index da86ba3a8c..2f9b322da2 100644 --- a/crates/contracts/artifacts/CowAmm.json +++ b/crates/contracts/artifacts/CowAmm.json @@ -1 +1,1500 @@ -{"abi":[{"type":"constructor","inputs":[{"name":"_solutionSettler","type":"address","internalType":"contract ISettlement"},{"name":"_token0","type":"address","internalType":"contract IERC20"},{"name":"_token1","type":"address","internalType":"contract IERC20"}],"stateMutability":"nonpayable"},{"type":"function","name":"COMMITMENT_SLOT","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"EMPTY_COMMITMENT","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"MAX_ORDER_DURATION","inputs":[],"outputs":[{"name":"","type":"uint32","internalType":"uint32"}],"stateMutability":"view"},{"type":"function","name":"NO_TRADING","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"commit","inputs":[{"name":"orderHash","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"commitment","inputs":[],"outputs":[{"name":"value","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"disableTrading","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"enableTrading","inputs":[{"name":"tradingParams","type":"tuple","internalType":"struct ConstantProduct.TradingParams","components":[{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"getTradeableOrder","inputs":[{"name":"tradingParams","type":"tuple","internalType":"struct ConstantProduct.TradingParams","components":[{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}]}],"outputs":[{"name":"order","type":"tuple","internalType":"struct GPv2Order.Data","components":[{"name":"sellToken","type":"address","internalType":"contract IERC20"},{"name":"buyToken","type":"address","internalType":"contract IERC20"},{"name":"receiver","type":"address","internalType":"address"},{"name":"sellAmount","type":"uint256","internalType":"uint256"},{"name":"buyAmount","type":"uint256","internalType":"uint256"},{"name":"validTo","type":"uint32","internalType":"uint32"},{"name":"appData","type":"bytes32","internalType":"bytes32"},{"name":"feeAmount","type":"uint256","internalType":"uint256"},{"name":"kind","type":"bytes32","internalType":"bytes32"},{"name":"partiallyFillable","type":"bool","internalType":"bool"},{"name":"sellTokenBalance","type":"bytes32","internalType":"bytes32"},{"name":"buyTokenBalance","type":"bytes32","internalType":"bytes32"}]}],"stateMutability":"view"},{"type":"function","name":"hash","inputs":[{"name":"tradingParams","type":"tuple","internalType":"struct ConstantProduct.TradingParams","components":[{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}]}],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"pure"},{"type":"function","name":"isValidSignature","inputs":[{"name":"_hash","type":"bytes32","internalType":"bytes32"},{"name":"signature","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"","type":"bytes4","internalType":"bytes4"}],"stateMutability":"view"},{"type":"function","name":"manager","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"solutionSettler","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract ISettlement"}],"stateMutability":"view"},{"type":"function","name":"solutionSettlerDomainSeparator","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"token0","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IERC20"}],"stateMutability":"view"},{"type":"function","name":"token1","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IERC20"}],"stateMutability":"view"},{"type":"function","name":"tradingParamsHash","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"verify","inputs":[{"name":"tradingParams","type":"tuple","internalType":"struct ConstantProduct.TradingParams","components":[{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}]},{"name":"order","type":"tuple","internalType":"struct GPv2Order.Data","components":[{"name":"sellToken","type":"address","internalType":"contract IERC20"},{"name":"buyToken","type":"address","internalType":"contract IERC20"},{"name":"receiver","type":"address","internalType":"address"},{"name":"sellAmount","type":"uint256","internalType":"uint256"},{"name":"buyAmount","type":"uint256","internalType":"uint256"},{"name":"validTo","type":"uint32","internalType":"uint32"},{"name":"appData","type":"bytes32","internalType":"bytes32"},{"name":"feeAmount","type":"uint256","internalType":"uint256"},{"name":"kind","type":"bytes32","internalType":"bytes32"},{"name":"partiallyFillable","type":"bool","internalType":"bool"},{"name":"sellTokenBalance","type":"bytes32","internalType":"bytes32"},{"name":"buyTokenBalance","type":"bytes32","internalType":"bytes32"}]}],"outputs":[],"stateMutability":"view"},{"type":"event","name":"TradingDisabled","inputs":[],"anonymous":false},{"type":"event","name":"TradingEnabled","inputs":[{"name":"hash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"params","type":"tuple","indexed":false,"internalType":"struct ConstantProduct.TradingParams","components":[{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}]}],"anonymous":false},{"type":"error","name":"CommitOutsideOfSettlement","inputs":[]},{"type":"error","name":"OnlyManagerCanCall","inputs":[]},{"type":"error","name":"OrderDoesNotMatchCommitmentHash","inputs":[]},{"type":"error","name":"OrderDoesNotMatchDefaultTradeableOrder","inputs":[]},{"type":"error","name":"OrderDoesNotMatchMessageHash","inputs":[]},{"type":"error","name":"OrderNotValid","inputs":[{"name":"","type":"string","internalType":"string"}]},{"type":"error","name":"PollTryAtBlock","inputs":[{"name":"blockNumber","type":"uint256","internalType":"uint256"},{"name":"message","type":"string","internalType":"string"}]},{"type":"error","name":"TradingParamsDoNotMatchHash","inputs":[]}],"bytecode":"0x610120604052348015610010575f80fd5b5060405161267838038061267883398101604081905261002f9161052f565b6001600160a01b03831660808190526040805163f698da2560e01b8152905163f698da259160048082019260209290919082900301815f875af1158015610078573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009c9190610579565b610100526100aa823361015f565b6100b4813361015f565b336001600160a01b031660e0816001600160a01b0316815250505f836001600160a01b0316639b552cc26040518163ffffffff1660e01b81526004016020604051808303815f875af115801561010c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101309190610590565b905061013c838261015f565b610146828261015f565b506001600160a01b0391821660a0521660c0525061061c565b6101746001600160a01b038316825f19610178565b5050565b8015806101f05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ee9190610579565b155b6102675760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526102bd9185916102c216565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201525f9061030e906001600160a01b03851690849061038d565b905080515f148061032e57508080602001905181019061032e91906105b2565b6102bd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025e565b606061039b84845f856103a3565b949350505050565b6060824710156104045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025e565b5f80866001600160a01b0316858760405161041f91906105d1565b5f6040518083038185875af1925050503d805f8114610459576040519150601f19603f3d011682016040523d82523d5f602084013e61045e565b606091505b5090925090506104708783838761047b565b979650505050505050565b606083156104e95782515f036104e2576001600160a01b0385163b6104e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025e565b508161039b565b61039b83838151156104fe5781518083602001fd5b8060405162461bcd60e51b815260040161025e91906105e7565b6001600160a01b038116811461052c575f80fd5b50565b5f805f60608486031215610541575f80fd5b835161054c81610518565b602085015190935061055d81610518565b604085015190925061056e81610518565b809150509250925092565b5f60208284031215610589575f80fd5b5051919050565b5f602082840312156105a0575f80fd5b81516105ab81610518565b9392505050565b5f602082840312156105c2575f80fd5b815180151581146105ab575f80fd5b5f82518060208501845e5f920191825250919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051611fbd6106bb5f395f81816102db015261042b01525f8181610236015281816104d90152610bf901525f81816102b40152818161059901528181610d5c01528181610ebf01528181610f8e015261100d01525f81816101380152818161057701528181610d3b01528181610e2801528181610f6b015261103001525f818161032201526112140152611fbd5ff3fe608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033","deployedBytecode":"0x608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033","methodIdentifiers":{"COMMITMENT_SLOT()":"3e706e32","EMPTY_COMMITMENT()":"ff2dbc98","MAX_ORDER_DURATION()":"981a160b","NO_TRADING()":"1c7de941","commit(bytes32)":"f14fcbc8","commitment()":"1303a484","disableTrading()":"17700f01","enableTrading((uint256,address,bytes,bytes32))":"c5f3d254","getTradeableOrder((uint256,address,bytes,bytes32))":"e3e6f5b2","hash((uint256,address,bytes,bytes32))":"b09aaaca","isValidSignature(bytes32,bytes)":"1626ba7e","manager()":"481c6a75","solutionSettler()":"e516715b","solutionSettlerDomainSeparator()":"d25e0cb6","token0()":"0dfe1681","token1()":"d21220a7","tradingParamsHash()":"eec50b97","verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))":"a029a8d4"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"_solutionSettler\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_token0\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_token1\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CommitOutsideOfSettlement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyManagerCanCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderDoesNotMatchCommitmentHash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderDoesNotMatchDefaultTradeableOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderDoesNotMatchMessageHash\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"OrderNotValid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"PollTryAtBlock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TradingParamsDoNotMatchHash\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TradingDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"TradingEnabled\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COMMITMENT_SLOT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EMPTY_COMMITMENT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_ORDER_DURATION\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NO_TRADING\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"commitment\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"value\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"}],\"name\":\"enableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"}],\"name\":\"getTradeableOrder\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"order\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"}],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"isValidSignature\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"solutionSettler\",\"outputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"solutionSettlerDomainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tradingParamsHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"verify\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CoW Protocol Developers\",\"details\":\"Automated market maker based on the concept of function-maximising AMMs. It relies on the CoW Protocol infrastructure to guarantee batch execution of its orders. Order creation and execution is based on the Composable CoW base contracts.\",\"errors\":{\"OrderNotValid(string)\":[{\"details\":\"This error is returned by the `getTradeableOrder` function if the order condition is not met. A parameter of `string` type is included to allow the caller to specify the reason for the failure.\"}]},\"events\":{\"TradingEnabled(bytes32,(uint256,address,bytes,bytes32))\":{\"params\":{\"hash\":\"The hash of the trading parameters.\",\"params\":\"Trading has been enabled for these parameters.\"}}},\"kind\":\"dev\",\"methods\":{\"commit(bytes32)\":{\"details\":\"The commitment is used to enforce that exactly one AMM order is valid when a CoW Protocol batch is settled.\",\"params\":{\"orderHash\":\"the order hash that will be enforced by the order verification function.\"}},\"constructor\":{\"params\":{\"_solutionSettler\":\"The CoW Protocol contract used to settle user orders on the current chain.\",\"_token0\":\"The first of the two tokens traded by this AMM.\",\"_token1\":\"The second of the two tokens traded by this AMM.\"}},\"enableTrading((uint256,address,bytes,bytes32))\":{\"params\":{\"tradingParams\":\"Trading is enabled with the parameters specified here.\"}},\"getTradeableOrder((uint256,address,bytes,bytes32))\":{\"params\":{\"tradingParams\":\"the trading parameters of all discrete orders cut from this AMM\"},\"returns\":{\"order\":\"the tradeable order for submission to the CoW Protocol API\"}},\"hash((uint256,address,bytes,bytes32))\":{\"details\":\"Computes an identifier that uniquely represents the parameters in the function input parameters.\",\"params\":{\"tradingParams\":\"Bytestring that decodes to `TradingParams`\"},\"returns\":{\"_0\":\"The hash of the input parameter, intended to be used as a unique identifier\"}},\"isValidSignature(bytes32,bytes)\":{\"details\":\"Should return whether the signature provided is valid for the provided data\",\"params\":{\"hash\":\"Hash of the data to be signed\",\"signature\":\"Signature byte array associated with _data\"}},\"verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))\":{\"params\":{\"order\":\"`GPv2Order.Data` of a discrete order to be verified.\",\"tradingParams\":\"the trading parameters of all discrete orders cut from this AMM\"}}},\"stateVariables\":{\"COMMITMENT_SLOT\":{\"details\":\"This value is: uint256(keccak256(\\\"CoWAMM.ConstantProduct.commitment\\\")) - 1\"}},\"title\":\"CoW AMM\",\"version\":1},\"userdoc\":{\"errors\":{\"CommitOutsideOfSettlement()\":[{\"notice\":\"The `commit` function can only be called inside a CoW Swap settlement. This error is thrown when the function is called from another context.\"}],\"OnlyManagerCanCall()\":[{\"notice\":\"This function is permissioned and can only be called by the contract's manager.\"}],\"OrderDoesNotMatchCommitmentHash()\":[{\"notice\":\"Error thrown when a solver tries to settle an AMM order on CoW Protocol whose hash doesn't match the one that has been committed to.\"}],\"OrderDoesNotMatchDefaultTradeableOrder()\":[{\"notice\":\"If an AMM order is settled and the AMM committment is set to empty, then that order must match the output of `getTradeableOrder`. This error is thrown when some of the parameters don't match the expected ones.\"}],\"OrderDoesNotMatchMessageHash()\":[{\"notice\":\"On signature verification, the hash of the order supplied as part of the signature does not match the provided message hash. This usually means that the verification function is being provided a signature that belongs to a different order.\"}],\"PollTryAtBlock(uint256,string)\":[{\"notice\":\"No order is currently available for trading, but the watchtower should try again at the specified block.\"}],\"TradingParamsDoNotMatchHash()\":[{\"notice\":\"The order trade parameters that were provided during signature verification does not match the data stored in this contract _or_ the AMM has not enabled trading.\"}]},\"events\":{\"TradingDisabled()\":{\"notice\":\"Emitted when the manager disables all trades by the AMM. Existing open order will not be tradeable. Note that the AMM could resume trading with different parameters at a later point.\"},\"TradingEnabled(bytes32,(uint256,address,bytes,bytes32))\":{\"notice\":\"Emitted when the manager enables the AMM to trade on CoW Protocol.\"}},\"kind\":\"user\",\"methods\":{\"COMMITMENT_SLOT()\":{\"notice\":\"The transient storage slot specified in this variable stores the value of the order commitment, that is, the only order hash that can be validated by calling `isValidSignature`. The hash corresponding to the constant `EMPTY_COMMITMENT` has special semantics, discussed in the related documentation.\"},\"EMPTY_COMMITMENT()\":{\"notice\":\"The value representing the absence of a commitment. It signifies that the AMM will enforce that the order matches the order obtained from calling `getTradeableOrder`.\"},\"MAX_ORDER_DURATION()\":{\"notice\":\"The largest possible duration of any AMM order, starting from the current block timestamp.\"},\"NO_TRADING()\":{\"notice\":\"The value representing that no trading parameters are currently accepted as valid by this contract, meaning that no trading can occur.\"},\"commit(bytes32)\":{\"notice\":\"Restricts a specific AMM to being able to trade only the order with the specified hash.\"},\"disableTrading()\":{\"notice\":\"Disable any form of trading on CoW Protocol by this AMM.\"},\"enableTrading((uint256,address,bytes,bytes32))\":{\"notice\":\"Once this function is called, it will be possible to trade with this AMM on CoW Protocol.\"},\"getTradeableOrder((uint256,address,bytes,bytes32))\":{\"notice\":\"The order returned by this function is the order that needs to be executed for the price on this AMM to match that of the reference pair.\"},\"manager()\":{\"notice\":\"The address that can execute administrative tasks on this AMM, as for example enabling/disabling trading or withdrawing funds.\"},\"solutionSettler()\":{\"notice\":\"The address of the CoW Protocol settlement contract. It is the only address that can set commitments.\"},\"solutionSettlerDomainSeparator()\":{\"notice\":\"The domain separator used for hashing CoW Protocol orders.\"},\"token0()\":{\"notice\":\"The first of the two tokens traded by this AMM.\"},\"token1()\":{\"notice\":\"The second of the two tokens traded by this AMM.\"},\"tradingParamsHash()\":{\"notice\":\"The hash of the data describing which `TradingParams` currently apply to this AMM. If this parameter is set to `NO_TRADING`, then the AMM does not accept any order as valid. If trading is enabled, then this value will be the [`hash`] of the only admissible [`TradingParams`].\"},\"verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))\":{\"notice\":\"This function checks that the input order is admissible for the constant-product curve for the given trading parameters.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ConstantProduct.sol\":\"ConstantProduct\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/\",\":balancer/=lib/composable-cow/lib/balancer/src/\",\":canonical-weth/=lib/composable-cow/lib/canonical-weth/src/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/\",\":math/=lib/composable-cow/lib/balancer/src/lib/math/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol\":{\"keccak256\":\"0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f\",\"dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol\":{\"keccak256\":\"0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d\",\"dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89\",\"dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38\"]},\"lib/composable-cow/src/BaseConditionalOrder.sol\":{\"keccak256\":\"0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402\",\"dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v\"]},\"lib/composable-cow/src/interfaces/IConditionalOrder.sol\":{\"keccak256\":\"0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699\",\"dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ\"]},\"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol\":{\"keccak256\":\"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777\",\"dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf\"]},\"lib/openzeppelin/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e\",\"dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng\"]},\"lib/openzeppelin/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45\",\"dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq\"]},\"lib/openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a\",\"dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv\"]},\"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68\",\"dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS\"]},\"lib/openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"lib/openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c\",\"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS\"]},\"src/ConstantProduct.sol\":{\"keccak256\":\"0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085\",\"dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/interfaces/ISettlement.sol\":{\"keccak256\":\"0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd\",\"dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq\"]},\"src/interfaces/IWatchtowerCustomErrors.sol\":{\"keccak256\":\"0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a\",\"dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"contract ISettlement","name":"_solutionSettler","type":"address"},{"internalType":"contract IERC20","name":"_token0","type":"address"},{"internalType":"contract IERC20","name":"_token1","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"type":"error","name":"CommitOutsideOfSettlement"},{"inputs":[],"type":"error","name":"OnlyManagerCanCall"},{"inputs":[],"type":"error","name":"OrderDoesNotMatchCommitmentHash"},{"inputs":[],"type":"error","name":"OrderDoesNotMatchDefaultTradeableOrder"},{"inputs":[],"type":"error","name":"OrderDoesNotMatchMessageHash"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"type":"error","name":"OrderNotValid"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"string","name":"message","type":"string"}],"type":"error","name":"PollTryAtBlock"},{"inputs":[],"type":"error","name":"TradingParamsDoNotMatchHash"},{"inputs":[],"type":"event","name":"TradingDisabled","anonymous":false},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32","indexed":true},{"internalType":"struct ConstantProduct.TradingParams","name":"params","type":"tuple","components":[{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}],"indexed":false}],"type":"event","name":"TradingEnabled","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"COMMITMENT_SLOT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"EMPTY_COMMITMENT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"MAX_ORDER_DURATION","outputs":[{"internalType":"uint32","name":"","type":"uint32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"NO_TRADING","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"commit"},{"inputs":[],"stateMutability":"view","type":"function","name":"commitment","outputs":[{"internalType":"bytes32","name":"value","type":"bytes32"}]},{"inputs":[],"stateMutability":"nonpayable","type":"function","name":"disableTrading"},{"inputs":[{"internalType":"struct ConstantProduct.TradingParams","name":"tradingParams","type":"tuple","components":[{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}]}],"stateMutability":"nonpayable","type":"function","name":"enableTrading"},{"inputs":[{"internalType":"struct ConstantProduct.TradingParams","name":"tradingParams","type":"tuple","components":[{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}]}],"stateMutability":"view","type":"function","name":"getTradeableOrder","outputs":[{"internalType":"struct GPv2Order.Data","name":"order","type":"tuple","components":[{"internalType":"contract IERC20","name":"sellToken","type":"address"},{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes32","name":"kind","type":"bytes32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"bytes32","name":"sellTokenBalance","type":"bytes32"},{"internalType":"bytes32","name":"buyTokenBalance","type":"bytes32"}]}]},{"inputs":[{"internalType":"struct ConstantProduct.TradingParams","name":"tradingParams","type":"tuple","components":[{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}]}],"stateMutability":"pure","type":"function","name":"hash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"stateMutability":"view","type":"function","name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"solutionSettler","outputs":[{"internalType":"contract ISettlement","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"solutionSettlerDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"token0","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"token1","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"tradingParamsHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[{"internalType":"struct ConstantProduct.TradingParams","name":"tradingParams","type":"tuple","components":[{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}]},{"internalType":"struct GPv2Order.Data","name":"order","type":"tuple","components":[{"internalType":"contract IERC20","name":"sellToken","type":"address"},{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes32","name":"kind","type":"bytes32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"bytes32","name":"sellTokenBalance","type":"bytes32"},{"internalType":"bytes32","name":"buyTokenBalance","type":"bytes32"}]}],"stateMutability":"view","type":"function","name":"verify"}],"devdoc":{"kind":"dev","methods":{"commit(bytes32)":{"details":"The commitment is used to enforce that exactly one AMM order is valid when a CoW Protocol batch is settled.","params":{"orderHash":"the order hash that will be enforced by the order verification function."}},"constructor":{"params":{"_solutionSettler":"The CoW Protocol contract used to settle user orders on the current chain.","_token0":"The first of the two tokens traded by this AMM.","_token1":"The second of the two tokens traded by this AMM."}},"enableTrading((uint256,address,bytes,bytes32))":{"params":{"tradingParams":"Trading is enabled with the parameters specified here."}},"getTradeableOrder((uint256,address,bytes,bytes32))":{"params":{"tradingParams":"the trading parameters of all discrete orders cut from this AMM"},"returns":{"order":"the tradeable order for submission to the CoW Protocol API"}},"hash((uint256,address,bytes,bytes32))":{"details":"Computes an identifier that uniquely represents the parameters in the function input parameters.","params":{"tradingParams":"Bytestring that decodes to `TradingParams`"},"returns":{"_0":"The hash of the input parameter, intended to be used as a unique identifier"}},"isValidSignature(bytes32,bytes)":{"details":"Should return whether the signature provided is valid for the provided data","params":{"hash":"Hash of the data to be signed","signature":"Signature byte array associated with _data"}},"verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))":{"params":{"order":"`GPv2Order.Data` of a discrete order to be verified.","tradingParams":"the trading parameters of all discrete orders cut from this AMM"}}},"version":1},"userdoc":{"kind":"user","methods":{"COMMITMENT_SLOT()":{"notice":"The transient storage slot specified in this variable stores the value of the order commitment, that is, the only order hash that can be validated by calling `isValidSignature`. The hash corresponding to the constant `EMPTY_COMMITMENT` has special semantics, discussed in the related documentation."},"EMPTY_COMMITMENT()":{"notice":"The value representing the absence of a commitment. It signifies that the AMM will enforce that the order matches the order obtained from calling `getTradeableOrder`."},"MAX_ORDER_DURATION()":{"notice":"The largest possible duration of any AMM order, starting from the current block timestamp."},"NO_TRADING()":{"notice":"The value representing that no trading parameters are currently accepted as valid by this contract, meaning that no trading can occur."},"commit(bytes32)":{"notice":"Restricts a specific AMM to being able to trade only the order with the specified hash."},"disableTrading()":{"notice":"Disable any form of trading on CoW Protocol by this AMM."},"enableTrading((uint256,address,bytes,bytes32))":{"notice":"Once this function is called, it will be possible to trade with this AMM on CoW Protocol."},"getTradeableOrder((uint256,address,bytes,bytes32))":{"notice":"The order returned by this function is the order that needs to be executed for the price on this AMM to match that of the reference pair."},"manager()":{"notice":"The address that can execute administrative tasks on this AMM, as for example enabling/disabling trading or withdrawing funds."},"solutionSettler()":{"notice":"The address of the CoW Protocol settlement contract. It is the only address that can set commitments."},"solutionSettlerDomainSeparator()":{"notice":"The domain separator used for hashing CoW Protocol orders."},"token0()":{"notice":"The first of the two tokens traded by this AMM."},"token1()":{"notice":"The second of the two tokens traded by this AMM."},"tradingParamsHash()":{"notice":"The hash of the data describing which `TradingParams` currently apply to this AMM. If this parameter is set to `NO_TRADING`, then the AMM does not accept any order as valid. If trading is enabled, then this value will be the [`hash`] of the only admissible [`TradingParams`]."},"verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))":{"notice":"This function checks that the input order is admissible for the constant-product curve for the given trading parameters."}},"version":1}},"settings":{"remappings":["@openzeppelin/=lib/composable-cow/lib/@openzeppelin/","@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/","balancer/=lib/composable-cow/lib/balancer/src/","canonical-weth/=lib/composable-cow/lib/canonical-weth/src/","composable-cow/=lib/composable-cow/","cowprotocol/=lib/composable-cow/lib/cowprotocol/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/","math/=lib/composable-cow/lib/balancer/src/lib/math/","murky/=lib/composable-cow/lib/murky/src/","openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin/","safe/=lib/composable-cow/lib/safe/","uniswap-v2-core/=lib/uniswap-v2-core/contracts/","lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/","lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/","lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/","lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/"],"optimizer":{"enabled":true,"runs":100000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/ConstantProduct.sol":"ConstantProduct"},"evmVersion":"cancun","libraries":{}},"sources":{"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol":{"keccak256":"0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528","urls":["bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f","dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF"],"license":"LGPL-3.0-or-later"},"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol":{"keccak256":"0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f","urls":["bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d","dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg"],"license":"LGPL-3.0-or-later"},"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol":{"keccak256":"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb","urls":["bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89","dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38"],"license":"LGPL-3.0-only"},"lib/composable-cow/src/BaseConditionalOrder.sol":{"keccak256":"0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588","urls":["bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402","dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v"],"license":"MIT"},"lib/composable-cow/src/interfaces/IConditionalOrder.sol":{"keccak256":"0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b","urls":["bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699","dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ"],"license":"GPL-3.0"},"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol":{"keccak256":"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae","urls":["bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777","dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf"],"license":"MIT"},"lib/openzeppelin/contracts/interfaces/IERC1271.sol":{"keccak256":"0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544","urls":["bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e","dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng"],"license":"MIT"},"lib/openzeppelin/contracts/interfaces/IERC20.sol":{"keccak256":"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45","urls":["bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45","dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/IERC20.sol":{"keccak256":"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305","urls":["bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5","dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol":{"keccak256":"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a","urls":["bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a","dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol":{"keccak256":"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1","urls":["bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68","dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS"],"license":"MIT"},"lib/openzeppelin/contracts/utils/Address.sol":{"keccak256":"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa","urls":["bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931","dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm"],"license":"MIT"},"lib/openzeppelin/contracts/utils/math/Math.sol":{"keccak256":"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3","urls":["bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c","dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS"],"license":"MIT"},"src/ConstantProduct.sol":{"keccak256":"0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115","urls":["bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085","dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf"],"license":"GPL-3.0"},"src/interfaces/IPriceOracle.sol":{"keccak256":"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e","urls":["bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2","dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu"],"license":"GPL-3.0"},"src/interfaces/ISettlement.sol":{"keccak256":"0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661","urls":["bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd","dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq"],"license":"GPL-3.0"},"src/interfaces/IWatchtowerCustomErrors.sol":{"keccak256":"0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611","urls":["bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a","dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ"],"license":"GPL-3.0"}},"version":1},"id":169} +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "_solutionSettler", + "type": "address", + "internalType": "contract ISettlement" + }, + { + "name": "_token0", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "_token1", + "type": "address", + "internalType": "contract IERC20" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "COMMITMENT_SLOT", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "EMPTY_COMMITMENT", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "MAX_ORDER_DURATION", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint32", + "internalType": "uint32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "NO_TRADING", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "commit", + "inputs": [ + { + "name": "orderHash", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "commitment", + "inputs": [], + "outputs": [ + { + "name": "value", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "disableTrading", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "enableTrading", + "inputs": [ + { + "name": "tradingParams", + "type": "tuple", + "internalType": "struct ConstantProduct.TradingParams", + "components": [ + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getTradeableOrder", + "inputs": [ + { + "name": "tradingParams", + "type": "tuple", + "internalType": "struct ConstantProduct.TradingParams", + "components": [ + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct GPv2Order.Data", + "components": [ + { + "name": "sellToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "buyToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "receiver", + "type": "address", + "internalType": "address" + }, + { + "name": "sellAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "buyAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "validTo", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "feeAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "partiallyFillable", + "type": "bool", + "internalType": "bool" + }, + { + "name": "sellTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "buyTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "hash", + "inputs": [ + { + "name": "tradingParams", + "type": "tuple", + "internalType": "struct ConstantProduct.TradingParams", + "components": [ + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "isValidSignature", + "inputs": [ + { + "name": "_hash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "manager", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "solutionSettler", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ISettlement" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "solutionSettlerDomainSeparator", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "token0", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IERC20" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "token1", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IERC20" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "tradingParamsHash", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "verify", + "inputs": [ + { + "name": "tradingParams", + "type": "tuple", + "internalType": "struct ConstantProduct.TradingParams", + "components": [ + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "order", + "type": "tuple", + "internalType": "struct GPv2Order.Data", + "components": [ + { + "name": "sellToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "buyToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "receiver", + "type": "address", + "internalType": "address" + }, + { + "name": "sellAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "buyAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "validTo", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "feeAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "partiallyFillable", + "type": "bool", + "internalType": "bool" + }, + { + "name": "sellTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "buyTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "outputs": [], + "stateMutability": "view" + }, + { + "type": "event", + "name": "TradingDisabled", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "TradingEnabled", + "inputs": [ + { + "name": "hash", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "params", + "type": "tuple", + "indexed": false, + "internalType": "struct ConstantProduct.TradingParams", + "components": [ + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "CommitOutsideOfSettlement", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyManagerCanCall", + "inputs": [] + }, + { + "type": "error", + "name": "OrderDoesNotMatchCommitmentHash", + "inputs": [] + }, + { + "type": "error", + "name": "OrderDoesNotMatchDefaultTradeableOrder", + "inputs": [] + }, + { + "type": "error", + "name": "OrderDoesNotMatchMessageHash", + "inputs": [] + }, + { + "type": "error", + "name": "OrderNotValid", + "inputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ] + }, + { + "type": "error", + "name": "PollTryAtBlock", + "inputs": [ + { + "name": "blockNumber", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "message", + "type": "string", + "internalType": "string" + } + ] + }, + { + "type": "error", + "name": "TradingParamsDoNotMatchHash", + "inputs": [] + } + ], + "bytecode": "0x610120604052348015610010575f80fd5b5060405161267838038061267883398101604081905261002f9161052f565b6001600160a01b03831660808190526040805163f698da2560e01b8152905163f698da259160048082019260209290919082900301815f875af1158015610078573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009c9190610579565b610100526100aa823361015f565b6100b4813361015f565b336001600160a01b031660e0816001600160a01b0316815250505f836001600160a01b0316639b552cc26040518163ffffffff1660e01b81526004016020604051808303815f875af115801561010c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101309190610590565b905061013c838261015f565b610146828261015f565b506001600160a01b0391821660a0521660c0525061061c565b6101746001600160a01b038316825f19610178565b5050565b8015806101f05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ee9190610579565b155b6102675760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526102bd9185916102c216565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201525f9061030e906001600160a01b03851690849061038d565b905080515f148061032e57508080602001905181019061032e91906105b2565b6102bd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025e565b606061039b84845f856103a3565b949350505050565b6060824710156104045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025e565b5f80866001600160a01b0316858760405161041f91906105d1565b5f6040518083038185875af1925050503d805f8114610459576040519150601f19603f3d011682016040523d82523d5f602084013e61045e565b606091505b5090925090506104708783838761047b565b979650505050505050565b606083156104e95782515f036104e2576001600160a01b0385163b6104e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025e565b508161039b565b61039b83838151156104fe5781518083602001fd5b8060405162461bcd60e51b815260040161025e91906105e7565b6001600160a01b038116811461052c575f80fd5b50565b5f805f60608486031215610541575f80fd5b835161054c81610518565b602085015190935061055d81610518565b604085015190925061056e81610518565b809150509250925092565b5f60208284031215610589575f80fd5b5051919050565b5f602082840312156105a0575f80fd5b81516105ab81610518565b9392505050565b5f602082840312156105c2575f80fd5b815180151581146105ab575f80fd5b5f82518060208501845e5f920191825250919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051611fbd6106bb5f395f81816102db015261042b01525f8181610236015281816104d90152610bf901525f81816102b40152818161059901528181610d5c01528181610ebf01528181610f8e015261100d01525f81816101380152818161057701528181610d3b01528181610e2801528181610f6b015261103001525f818161032201526112140152611fbd5ff3fe608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033", + "deployedBytecode": "0x608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033", + "methodIdentifiers": { + "COMMITMENT_SLOT()": "3e706e32", + "EMPTY_COMMITMENT()": "ff2dbc98", + "MAX_ORDER_DURATION()": "981a160b", + "NO_TRADING()": "1c7de941", + "commit(bytes32)": "f14fcbc8", + "commitment()": "1303a484", + "disableTrading()": "17700f01", + "enableTrading((uint256,address,bytes,bytes32))": "c5f3d254", + "getTradeableOrder((uint256,address,bytes,bytes32))": "e3e6f5b2", + "hash((uint256,address,bytes,bytes32))": "b09aaaca", + "isValidSignature(bytes32,bytes)": "1626ba7e", + "manager()": "481c6a75", + "solutionSettler()": "e516715b", + "solutionSettlerDomainSeparator()": "d25e0cb6", + "token0()": "0dfe1681", + "token1()": "d21220a7", + "tradingParamsHash()": "eec50b97", + "verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))": "a029a8d4" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"_solutionSettler\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_token0\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"_token1\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CommitOutsideOfSettlement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyManagerCanCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderDoesNotMatchCommitmentHash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderDoesNotMatchDefaultTradeableOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderDoesNotMatchMessageHash\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"OrderNotValid\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"PollTryAtBlock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TradingParamsDoNotMatchHash\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TradingDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"indexed\":false,\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"TradingEnabled\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"COMMITMENT_SLOT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EMPTY_COMMITMENT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_ORDER_DURATION\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NO_TRADING\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"}],\"name\":\"commit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"commitment\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"value\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"}],\"name\":\"enableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"}],\"name\":\"getTradeableOrder\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"order\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"}],\"name\":\"hash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"isValidSignature\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"solutionSettler\",\"outputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"solutionSettlerDomainSeparator\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tradingParamsHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"internalType\":\"struct ConstantProduct.TradingParams\",\"name\":\"tradingParams\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"verify\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CoW Protocol Developers\",\"details\":\"Automated market maker based on the concept of function-maximising AMMs. It relies on the CoW Protocol infrastructure to guarantee batch execution of its orders. Order creation and execution is based on the Composable CoW base contracts.\",\"errors\":{\"OrderNotValid(string)\":[{\"details\":\"This error is returned by the `getTradeableOrder` function if the order condition is not met. A parameter of `string` type is included to allow the caller to specify the reason for the failure.\"}]},\"events\":{\"TradingEnabled(bytes32,(uint256,address,bytes,bytes32))\":{\"params\":{\"hash\":\"The hash of the trading parameters.\",\"params\":\"Trading has been enabled for these parameters.\"}}},\"kind\":\"dev\",\"methods\":{\"commit(bytes32)\":{\"details\":\"The commitment is used to enforce that exactly one AMM order is valid when a CoW Protocol batch is settled.\",\"params\":{\"orderHash\":\"the order hash that will be enforced by the order verification function.\"}},\"constructor\":{\"params\":{\"_solutionSettler\":\"The CoW Protocol contract used to settle user orders on the current chain.\",\"_token0\":\"The first of the two tokens traded by this AMM.\",\"_token1\":\"The second of the two tokens traded by this AMM.\"}},\"enableTrading((uint256,address,bytes,bytes32))\":{\"params\":{\"tradingParams\":\"Trading is enabled with the parameters specified here.\"}},\"getTradeableOrder((uint256,address,bytes,bytes32))\":{\"params\":{\"tradingParams\":\"the trading parameters of all discrete orders cut from this AMM\"},\"returns\":{\"order\":\"the tradeable order for submission to the CoW Protocol API\"}},\"hash((uint256,address,bytes,bytes32))\":{\"details\":\"Computes an identifier that uniquely represents the parameters in the function input parameters.\",\"params\":{\"tradingParams\":\"Bytestring that decodes to `TradingParams`\"},\"returns\":{\"_0\":\"The hash of the input parameter, intended to be used as a unique identifier\"}},\"isValidSignature(bytes32,bytes)\":{\"details\":\"Should return whether the signature provided is valid for the provided data\",\"params\":{\"hash\":\"Hash of the data to be signed\",\"signature\":\"Signature byte array associated with _data\"}},\"verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))\":{\"params\":{\"order\":\"`GPv2Order.Data` of a discrete order to be verified.\",\"tradingParams\":\"the trading parameters of all discrete orders cut from this AMM\"}}},\"stateVariables\":{\"COMMITMENT_SLOT\":{\"details\":\"This value is: uint256(keccak256(\\\"CoWAMM.ConstantProduct.commitment\\\")) - 1\"}},\"title\":\"CoW AMM\",\"version\":1},\"userdoc\":{\"errors\":{\"CommitOutsideOfSettlement()\":[{\"notice\":\"The `commit` function can only be called inside a CoW Swap settlement. This error is thrown when the function is called from another context.\"}],\"OnlyManagerCanCall()\":[{\"notice\":\"This function is permissioned and can only be called by the contract's manager.\"}],\"OrderDoesNotMatchCommitmentHash()\":[{\"notice\":\"Error thrown when a solver tries to settle an AMM order on CoW Protocol whose hash doesn't match the one that has been committed to.\"}],\"OrderDoesNotMatchDefaultTradeableOrder()\":[{\"notice\":\"If an AMM order is settled and the AMM committment is set to empty, then that order must match the output of `getTradeableOrder`. This error is thrown when some of the parameters don't match the expected ones.\"}],\"OrderDoesNotMatchMessageHash()\":[{\"notice\":\"On signature verification, the hash of the order supplied as part of the signature does not match the provided message hash. This usually means that the verification function is being provided a signature that belongs to a different order.\"}],\"PollTryAtBlock(uint256,string)\":[{\"notice\":\"No order is currently available for trading, but the watchtower should try again at the specified block.\"}],\"TradingParamsDoNotMatchHash()\":[{\"notice\":\"The order trade parameters that were provided during signature verification does not match the data stored in this contract _or_ the AMM has not enabled trading.\"}]},\"events\":{\"TradingDisabled()\":{\"notice\":\"Emitted when the manager disables all trades by the AMM. Existing open order will not be tradeable. Note that the AMM could resume trading with different parameters at a later point.\"},\"TradingEnabled(bytes32,(uint256,address,bytes,bytes32))\":{\"notice\":\"Emitted when the manager enables the AMM to trade on CoW Protocol.\"}},\"kind\":\"user\",\"methods\":{\"COMMITMENT_SLOT()\":{\"notice\":\"The transient storage slot specified in this variable stores the value of the order commitment, that is, the only order hash that can be validated by calling `isValidSignature`. The hash corresponding to the constant `EMPTY_COMMITMENT` has special semantics, discussed in the related documentation.\"},\"EMPTY_COMMITMENT()\":{\"notice\":\"The value representing the absence of a commitment. It signifies that the AMM will enforce that the order matches the order obtained from calling `getTradeableOrder`.\"},\"MAX_ORDER_DURATION()\":{\"notice\":\"The largest possible duration of any AMM order, starting from the current block timestamp.\"},\"NO_TRADING()\":{\"notice\":\"The value representing that no trading parameters are currently accepted as valid by this contract, meaning that no trading can occur.\"},\"commit(bytes32)\":{\"notice\":\"Restricts a specific AMM to being able to trade only the order with the specified hash.\"},\"disableTrading()\":{\"notice\":\"Disable any form of trading on CoW Protocol by this AMM.\"},\"enableTrading((uint256,address,bytes,bytes32))\":{\"notice\":\"Once this function is called, it will be possible to trade with this AMM on CoW Protocol.\"},\"getTradeableOrder((uint256,address,bytes,bytes32))\":{\"notice\":\"The order returned by this function is the order that needs to be executed for the price on this AMM to match that of the reference pair.\"},\"manager()\":{\"notice\":\"The address that can execute administrative tasks on this AMM, as for example enabling/disabling trading or withdrawing funds.\"},\"solutionSettler()\":{\"notice\":\"The address of the CoW Protocol settlement contract. It is the only address that can set commitments.\"},\"solutionSettlerDomainSeparator()\":{\"notice\":\"The domain separator used for hashing CoW Protocol orders.\"},\"token0()\":{\"notice\":\"The first of the two tokens traded by this AMM.\"},\"token1()\":{\"notice\":\"The second of the two tokens traded by this AMM.\"},\"tradingParamsHash()\":{\"notice\":\"The hash of the data describing which `TradingParams` currently apply to this AMM. If this parameter is set to `NO_TRADING`, then the AMM does not accept any order as valid. If trading is enabled, then this value will be the [`hash`] of the only admissible [`TradingParams`].\"},\"verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))\":{\"notice\":\"This function checks that the input order is admissible for the constant-product curve for the given trading parameters.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ConstantProduct.sol\":\"ConstantProduct\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/\",\":balancer/=lib/composable-cow/lib/balancer/src/\",\":canonical-weth/=lib/composable-cow/lib/canonical-weth/src/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/\",\":math/=lib/composable-cow/lib/balancer/src/lib/math/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol\":{\"keccak256\":\"0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f\",\"dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol\":{\"keccak256\":\"0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d\",\"dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89\",\"dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38\"]},\"lib/composable-cow/src/BaseConditionalOrder.sol\":{\"keccak256\":\"0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402\",\"dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v\"]},\"lib/composable-cow/src/interfaces/IConditionalOrder.sol\":{\"keccak256\":\"0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699\",\"dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ\"]},\"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol\":{\"keccak256\":\"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777\",\"dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf\"]},\"lib/openzeppelin/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e\",\"dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng\"]},\"lib/openzeppelin/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45\",\"dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq\"]},\"lib/openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a\",\"dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv\"]},\"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68\",\"dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS\"]},\"lib/openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"lib/openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c\",\"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS\"]},\"src/ConstantProduct.sol\":{\"keccak256\":\"0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085\",\"dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/interfaces/ISettlement.sol\":{\"keccak256\":\"0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd\",\"dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq\"]},\"src/interfaces/IWatchtowerCustomErrors.sol\":{\"keccak256\":\"0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a\",\"dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.25+commit.b61c2a91" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "contract ISettlement", + "name": "_solutionSettler", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_token0", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "_token1", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "type": "error", + "name": "CommitOutsideOfSettlement" + }, + { + "inputs": [], + "type": "error", + "name": "OnlyManagerCanCall" + }, + { + "inputs": [], + "type": "error", + "name": "OrderDoesNotMatchCommitmentHash" + }, + { + "inputs": [], + "type": "error", + "name": "OrderDoesNotMatchDefaultTradeableOrder" + }, + { + "inputs": [], + "type": "error", + "name": "OrderDoesNotMatchMessageHash" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "type": "error", + "name": "OrderNotValid" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "string", + "name": "message", + "type": "string" + } + ], + "type": "error", + "name": "PollTryAtBlock" + }, + { + "inputs": [], + "type": "error", + "name": "TradingParamsDoNotMatchHash" + }, + { + "inputs": [], + "type": "event", + "name": "TradingDisabled", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32", + "indexed": true + }, + { + "internalType": "struct ConstantProduct.TradingParams", + "name": "params", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ], + "indexed": false + } + ], + "type": "event", + "name": "TradingEnabled", + "anonymous": false + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "COMMITMENT_SLOT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "EMPTY_COMMITMENT", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "MAX_ORDER_DURATION", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "NO_TRADING", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "commit" + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "commitment", + "outputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + } + ] + }, + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "function", + "name": "disableTrading" + }, + { + "inputs": [ + { + "internalType": "struct ConstantProduct.TradingParams", + "name": "tradingParams", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ] + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "enableTrading" + }, + { + "inputs": [ + { + "internalType": "struct ConstantProduct.TradingParams", + "name": "tradingParams", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "getTradeableOrder", + "outputs": [ + { + "internalType": "struct GPv2Order.Data", + "name": "order", + "type": "tuple", + "components": [ + { + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "sellTokenBalance", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "buyTokenBalance", + "type": "bytes32" + } + ] + } + ] + }, + { + "inputs": [ + { + "internalType": "struct ConstantProduct.TradingParams", + "name": "tradingParams", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ] + } + ], + "stateMutability": "pure", + "type": "function", + "name": "hash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function", + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "solutionSettler", + "outputs": [ + { + "internalType": "contract ISettlement", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "solutionSettlerDomainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "token0", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "token1", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "tradingParamsHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "struct ConstantProduct.TradingParams", + "name": "tradingParams", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ] + }, + { + "internalType": "struct GPv2Order.Data", + "name": "order", + "type": "tuple", + "components": [ + { + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "sellTokenBalance", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "buyTokenBalance", + "type": "bytes32" + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "verify" + } + ], + "devdoc": { + "kind": "dev", + "methods": { + "commit(bytes32)": { + "details": "The commitment is used to enforce that exactly one AMM order is valid when a CoW Protocol batch is settled.", + "params": { + "orderHash": "the order hash that will be enforced by the order verification function." + } + }, + "constructor": { + "params": { + "_solutionSettler": "The CoW Protocol contract used to settle user orders on the current chain.", + "_token0": "The first of the two tokens traded by this AMM.", + "_token1": "The second of the two tokens traded by this AMM." + } + }, + "enableTrading((uint256,address,bytes,bytes32))": { + "params": { + "tradingParams": "Trading is enabled with the parameters specified here." + } + }, + "getTradeableOrder((uint256,address,bytes,bytes32))": { + "params": { + "tradingParams": "the trading parameters of all discrete orders cut from this AMM" + }, + "returns": { + "order": "the tradeable order for submission to the CoW Protocol API" + } + }, + "hash((uint256,address,bytes,bytes32))": { + "details": "Computes an identifier that uniquely represents the parameters in the function input parameters.", + "params": { + "tradingParams": "Bytestring that decodes to `TradingParams`" + }, + "returns": { + "_0": "The hash of the input parameter, intended to be used as a unique identifier" + } + }, + "isValidSignature(bytes32,bytes)": { + "details": "Should return whether the signature provided is valid for the provided data", + "params": { + "hash": "Hash of the data to be signed", + "signature": "Signature byte array associated with _data" + } + }, + "verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))": { + "params": { + "order": "`GPv2Order.Data` of a discrete order to be verified.", + "tradingParams": "the trading parameters of all discrete orders cut from this AMM" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "COMMITMENT_SLOT()": { + "notice": "The transient storage slot specified in this variable stores the value of the order commitment, that is, the only order hash that can be validated by calling `isValidSignature`. The hash corresponding to the constant `EMPTY_COMMITMENT` has special semantics, discussed in the related documentation." + }, + "EMPTY_COMMITMENT()": { + "notice": "The value representing the absence of a commitment. It signifies that the AMM will enforce that the order matches the order obtained from calling `getTradeableOrder`." + }, + "MAX_ORDER_DURATION()": { + "notice": "The largest possible duration of any AMM order, starting from the current block timestamp." + }, + "NO_TRADING()": { + "notice": "The value representing that no trading parameters are currently accepted as valid by this contract, meaning that no trading can occur." + }, + "commit(bytes32)": { + "notice": "Restricts a specific AMM to being able to trade only the order with the specified hash." + }, + "disableTrading()": { + "notice": "Disable any form of trading on CoW Protocol by this AMM." + }, + "enableTrading((uint256,address,bytes,bytes32))": { + "notice": "Once this function is called, it will be possible to trade with this AMM on CoW Protocol." + }, + "getTradeableOrder((uint256,address,bytes,bytes32))": { + "notice": "The order returned by this function is the order that needs to be executed for the price on this AMM to match that of the reference pair." + }, + "manager()": { + "notice": "The address that can execute administrative tasks on this AMM, as for example enabling/disabling trading or withdrawing funds." + }, + "solutionSettler()": { + "notice": "The address of the CoW Protocol settlement contract. It is the only address that can set commitments." + }, + "solutionSettlerDomainSeparator()": { + "notice": "The domain separator used for hashing CoW Protocol orders." + }, + "token0()": { + "notice": "The first of the two tokens traded by this AMM." + }, + "token1()": { + "notice": "The second of the two tokens traded by this AMM." + }, + "tradingParamsHash()": { + "notice": "The hash of the data describing which `TradingParams` currently apply to this AMM. If this parameter is set to `NO_TRADING`, then the AMM does not accept any order as valid. If trading is enabled, then this value will be the [`hash`] of the only admissible [`TradingParams`]." + }, + "verify((uint256,address,bytes,bytes32),(address,address,address,uint256,uint256,uint32,bytes32,uint256,bytes32,bool,bytes32,bytes32))": { + "notice": "This function checks that the input order is admissible for the constant-product curve for the given trading parameters." + } + }, + "version": 1 + } + }, + "settings": { + "remappings": [ + "@openzeppelin/=lib/composable-cow/lib/@openzeppelin/", + "@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/", + "balancer/=lib/composable-cow/lib/balancer/src/", + "canonical-weth/=lib/composable-cow/lib/canonical-weth/src/", + "composable-cow/=lib/composable-cow/", + "cowprotocol/=lib/composable-cow/lib/cowprotocol/", + "ds-test/=lib/forge-std/lib/ds-test/src/", + "erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/", + "forge-std/=lib/forge-std/src/", + "helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/", + "math/=lib/composable-cow/lib/balancer/src/lib/math/", + "murky/=lib/composable-cow/lib/murky/src/", + "openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/", + "openzeppelin/=lib/openzeppelin/", + "safe/=lib/composable-cow/lib/safe/", + "uniswap-v2-core/=lib/uniswap-v2-core/contracts/", + "lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/", + "lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/", + "lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/", + "lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/" + ], + "optimizer": { + "enabled": true, + "runs": 100000 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/ConstantProduct.sol": "ConstantProduct" + }, + "evmVersion": "cancun", + "libraries": {} + }, + "sources": { + "lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol": { + "keccak256": "0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528", + "urls": [ + "bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f", + "dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF" + ], + "license": "LGPL-3.0-or-later" + }, + "lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol": { + "keccak256": "0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f", + "urls": [ + "bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d", + "dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg" + ], + "license": "LGPL-3.0-or-later" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol": { + "keccak256": "0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb", + "urls": [ + "bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89", + "dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/src/BaseConditionalOrder.sol": { + "keccak256": "0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588", + "urls": [ + "bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402", + "dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v" + ], + "license": "MIT" + }, + "lib/composable-cow/src/interfaces/IConditionalOrder.sol": { + "keccak256": "0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b", + "urls": [ + "bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699", + "dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol": { + "keccak256": "0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae", + "urls": [ + "bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777", + "dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/interfaces/IERC1271.sol": { + "keccak256": "0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544", + "urls": [ + "bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e", + "dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/interfaces/IERC20.sol": { + "keccak256": "0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45", + "urls": [ + "bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45", + "dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/IERC20.sol": { + "keccak256": "0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305", + "urls": [ + "bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5", + "dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { + "keccak256": "0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a", + "urls": [ + "bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a", + "dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "keccak256": "0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1", + "urls": [ + "bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68", + "dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/Address.sol": { + "keccak256": "0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa", + "urls": [ + "bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931", + "dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/math/Math.sol": { + "keccak256": "0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3", + "urls": [ + "bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c", + "dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS" + ], + "license": "MIT" + }, + "src/ConstantProduct.sol": { + "keccak256": "0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115", + "urls": [ + "bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085", + "dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf" + ], + "license": "GPL-3.0" + }, + "src/interfaces/IPriceOracle.sol": { + "keccak256": "0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e", + "urls": [ + "bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2", + "dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu" + ], + "license": "GPL-3.0" + }, + "src/interfaces/ISettlement.sol": { + "keccak256": "0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661", + "urls": [ + "bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd", + "dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq" + ], + "license": "GPL-3.0" + }, + "src/interfaces/IWatchtowerCustomErrors.sol": { + "keccak256": "0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611", + "urls": [ + "bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a", + "dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ" + ], + "license": "GPL-3.0" + } + }, + "version": 1 + }, + "id": 169 +} diff --git a/crates/contracts/artifacts/CowAmmConstantProductFactory.json b/crates/contracts/artifacts/CowAmmConstantProductFactory.json index 17548777e4..131f459659 100644 --- a/crates/contracts/artifacts/CowAmmConstantProductFactory.json +++ b/crates/contracts/artifacts/CowAmmConstantProductFactory.json @@ -1 +1,1432 @@ -{"abi":[{"type":"constructor","inputs":[{"name":"_settler","type":"address","internalType":"contract ISettlement"}],"stateMutability":"nonpayable"},{"type":"function","name":"ammDeterministicAddress","inputs":[{"name":"ammOwner","type":"address","internalType":"address"},{"name":"token0","type":"address","internalType":"contract IERC20"},{"name":"token1","type":"address","internalType":"contract IERC20"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"create","inputs":[{"name":"token0","type":"address","internalType":"contract IERC20"},{"name":"amount0","type":"uint256","internalType":"uint256"},{"name":"token1","type":"address","internalType":"contract IERC20"},{"name":"amount1","type":"uint256","internalType":"uint256"},{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"amm","type":"address","internalType":"contract ConstantProduct"}],"stateMutability":"nonpayable"},{"type":"function","name":"deposit","inputs":[{"name":"amm","type":"address","internalType":"contract ConstantProduct"},{"name":"amount0","type":"uint256","internalType":"uint256"},{"name":"amount1","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"disableTrading","inputs":[{"name":"amm","type":"address","internalType":"contract ConstantProduct"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"getTradeableOrderWithSignature","inputs":[{"name":"amm","type":"address","internalType":"contract ConstantProduct"},{"name":"params","type":"tuple","internalType":"struct IConditionalOrder.ConditionalOrderParams","components":[{"name":"handler","type":"address","internalType":"contract IConditionalOrder"},{"name":"salt","type":"bytes32","internalType":"bytes32"},{"name":"staticInput","type":"bytes","internalType":"bytes"}]},{"name":"","type":"bytes","internalType":"bytes"},{"name":"","type":"bytes32[]","internalType":"bytes32[]"}],"outputs":[{"name":"order","type":"tuple","internalType":"struct GPv2Order.Data","components":[{"name":"sellToken","type":"address","internalType":"contract IERC20"},{"name":"buyToken","type":"address","internalType":"contract IERC20"},{"name":"receiver","type":"address","internalType":"address"},{"name":"sellAmount","type":"uint256","internalType":"uint256"},{"name":"buyAmount","type":"uint256","internalType":"uint256"},{"name":"validTo","type":"uint32","internalType":"uint32"},{"name":"appData","type":"bytes32","internalType":"bytes32"},{"name":"feeAmount","type":"uint256","internalType":"uint256"},{"name":"kind","type":"bytes32","internalType":"bytes32"},{"name":"partiallyFillable","type":"bool","internalType":"bool"},{"name":"sellTokenBalance","type":"bytes32","internalType":"bytes32"},{"name":"buyTokenBalance","type":"bytes32","internalType":"bytes32"}]},{"name":"signature","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[{"name":"","type":"address","internalType":"contract ConstantProduct"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"settler","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract ISettlement"}],"stateMutability":"view"},{"type":"function","name":"updateParameters","inputs":[{"name":"amm","type":"address","internalType":"contract ConstantProduct"},{"name":"minTradedToken0","type":"uint256","internalType":"uint256"},{"name":"priceOracle","type":"address","internalType":"contract IPriceOracle"},{"name":"priceOracleData","type":"bytes","internalType":"bytes"},{"name":"appData","type":"bytes32","internalType":"bytes32"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"withdraw","inputs":[{"name":"amm","type":"address","internalType":"contract ConstantProduct"},{"name":"amount0","type":"uint256","internalType":"uint256"},{"name":"amount1","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"ConditionalOrderCreated","inputs":[{"name":"owner","type":"address","indexed":true,"internalType":"address"},{"name":"params","type":"tuple","indexed":false,"internalType":"struct IConditionalOrder.ConditionalOrderParams","components":[{"name":"handler","type":"address","internalType":"contract IConditionalOrder"},{"name":"salt","type":"bytes32","internalType":"bytes32"},{"name":"staticInput","type":"bytes","internalType":"bytes"}]}],"anonymous":false},{"type":"event","name":"Deployed","inputs":[{"name":"amm","type":"address","indexed":true,"internalType":"contract ConstantProduct"},{"name":"owner","type":"address","indexed":true,"internalType":"address"},{"name":"token0","type":"address","indexed":false,"internalType":"contract IERC20"},{"name":"token1","type":"address","indexed":false,"internalType":"contract IERC20"}],"anonymous":false},{"type":"event","name":"TradingDisabled","inputs":[{"name":"amm","type":"address","indexed":true,"internalType":"contract ConstantProduct"}],"anonymous":false},{"type":"error","name":"OnlyOwnerCanCall","inputs":[{"name":"owner","type":"address","internalType":"address"}]},{"type":"error","name":"OrderNotValid","inputs":[{"name":"","type":"string","internalType":"string"}]}],"bytecode":"0x60a0604052348015600e575f80fd5b506040516141b33803806141b3833981016040819052602b91603b565b6001600160a01b03166080526066565b5f60208284031215604a575f80fd5b81516001600160a01b0381168114605f575f80fd5b9392505050565b60805161412761008c5f395f8181610189015281816102a801526108c401526141275ff3fe608060405234801561000f575f80fd5b506004361061009f575f3560e01c806337ebdf5011610072578063666e1b3911610058578063666e1b391461014f578063ab221a7614610184578063b5c5f672146101ab575f80fd5b806337ebdf50146101295780635b5d9ee61461013c575f80fd5b80630efe6a8b146100a357806322b155c6146100b857806326e0a196146100f55780632791056514610116575b5f80fd5b6100b66100b13660046111ea565b6101be565b005b6100cb6100c6366004611261565b6102a3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101086101033660046112fb565b61045f565b6040516100ec9291906114fd565b6100b6610124366004611527565b610797565b6100cb610137366004611549565b61082f565b6100b661014a366004611591565b610a01565b6100cb61015d366004611527565b5f6020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6100cb7f000000000000000000000000000000000000000000000000000000000000000081565b6100b66101b93660046111ea565b610b17565b61024f3384848673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102319190611617565b73ffffffffffffffffffffffffffffffffffffffff16929190610c46565b61029e3384838673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050565b5f33807f00000000000000000000000000000000000000000000000000000000000000008c8b6040516102d5906111b9565b73ffffffffffffffffffffffffffffffffffffffff9384168152918316602083015290911660408201526060018190604051809103905ff590508015801561031f573d5f803e3d5ffd5b506040805173ffffffffffffffffffffffffffffffffffffffff8e811682528c81166020830152929450828416928516917f6707255b2c5ca81220b2f3e408a269cb83baa6aa7e5e37aa1756883a6cdf06f1910160405180910390a373ffffffffffffffffffffffffffffffffffffffff8281165f90815260208190526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790556103d8828b8a6101be565b5f60405180608001604052808981526020018873ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509082525060200185905290506104508382610cdb565b50509998505050505050505050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060306104cf6020890189611527565b73ffffffffffffffffffffffffffffffffffffffff1614610551576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f63616e206f6e6c792068616e646c65206f776e206f726465727300000000000060448201526064015b60405180910390fd5b5f61055f6040890189611632565b81019061056c919061175c565b90508873ffffffffffffffffffffffffffffffffffffffff1663eec50b976040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105db919061185a565b6040517fb09aaaca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b169063b09aaaca9061062d9085906004016118c3565b602060405180830381865afa158015610648573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061066c919061185a565b146106d3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f696e76616c69642074726164696e6720706172616d65746572730000000000006044820152606401610548565b6040517fe3e6f5b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a169063e3e6f5b2906107259084906004016118c3565b61018060405180830381865afa158015610741573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061076591906118f7565b9250828160405160200161077a9291906119b3565b604051602081830303815290604052915050965096945050505050565b73ffffffffffffffffffffffffffffffffffffffff8082165f9081526020819052604090205482911633146108225773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b61082b82610e05565b5050565b5f807fff000000000000000000000000000000000000000000000000000000000000003073ffffffffffffffffffffffffffffffffffffffff8716604051610879602082016111b9565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166020840152808b169183019190915288166060820152608001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261093a92916020016119eb565b604051602081830303815290604052805190602001206040516020016109c294939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052805160209091012095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8087165f908152602081905260409020548791163314610a8c5773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b5f60405180608001604052808881526020018773ffffffffffffffffffffffffffffffffffffffff16815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505050908252506020018490529050610b0388610e05565b610b0d8882610cdb565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8084165f908152602081905260409020548491163314610ba25773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b610bf18433858773ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b610c408433848773ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b50505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610c40908590610ea3565b6040517fc5f3d25400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063c5f3d25490610d2d9084906004016118c3565b5f604051808303815f87803b158015610d44575f80fd5b505af1158015610d56573d5f803e3d5ffd5b5050604080516060810182523081525f6020808301829052835191955073ffffffffffffffffffffffffffffffffffffffff881694507f2cceac5555b0ca45a3744ced542f54b56ad2eb45e521962372eef212a2cbf36193830191610dbd918891016118c3565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610df891906119ff565b60405180910390a2505050565b8073ffffffffffffffffffffffffffffffffffffffff166317700f016040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610e4a575f80fd5b505af1158015610e5c573d5f803e3d5ffd5b505060405173ffffffffffffffffffffffffffffffffffffffff841692507fc75bf4f03c02fab9414a7d7a54048c0486722bc72f33ad924709a0593608ad2791505f90a250565b5f610f04826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610fb09092919063ffffffff16565b905080515f1480610f24575080806020019051810190610f249190611a43565b61029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610548565b6060610fbe84845f85610fc6565b949350505050565b606082471015611058576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610548565b5f808673ffffffffffffffffffffffffffffffffffffffff1685876040516110809190611a5c565b5f6040518083038185875af1925050503d805f81146110ba576040519150601f19603f3d011682016040523d82523d5f602084013e6110bf565b606091505b50915091506110d0878383876110db565b979650505050505050565b606083156111705782515f036111695773ffffffffffffffffffffffffffffffffffffffff85163b611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610548565b5081610fbe565b610fbe83838151156111855781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489190611a67565b61267880611a7a83390190565b73ffffffffffffffffffffffffffffffffffffffff811681146111e7575f80fd5b50565b5f805f606084860312156111fc575f80fd5b8335611207816111c6565b95602085013595506040909401359392505050565b5f8083601f84011261122c575f80fd5b50813567ffffffffffffffff811115611243575f80fd5b60208301915083602082850101111561125a575f80fd5b9250929050565b5f805f805f805f805f6101008a8c03121561127a575f80fd5b8935611285816111c6565b985060208a0135975060408a013561129c816111c6565b965060608a0135955060808a0135945060a08a01356112ba816111c6565b935060c08a013567ffffffffffffffff8111156112d5575f80fd5b6112e18c828d0161121c565b9a9d999c50979a9699959894979660e00135949350505050565b5f805f805f8060808789031215611310575f80fd5b863561131b816111c6565b9550602087013567ffffffffffffffff80821115611337575f80fd5b908801906060828b03121561134a575f80fd5b9095506040880135908082111561135f575f80fd5b61136b8a838b0161121c565b90965094506060890135915080821115611383575f80fd5b818901915089601f830112611396575f80fd5b8135818111156113a4575f80fd5b8a60208260051b85010111156113b8575f80fd5b6020830194508093505050509295509295509295565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161140f602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040810151611437604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a081015161146360a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516114988285018215159052565b5050610140818101519083015261016090810151910152565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f6101a061150b83866113ce565b8061018084015261151e818401856114b1565b95945050505050565b5f60208284031215611537575f80fd5b8135611542816111c6565b9392505050565b5f805f6060848603121561155b575f80fd5b8335611566816111c6565b92506020840135611576816111c6565b91506040840135611586816111c6565b809150509250925092565b5f805f805f8060a087890312156115a6575f80fd5b86356115b1816111c6565b95506020870135945060408701356115c8816111c6565b9350606087013567ffffffffffffffff8111156115e3575f80fd5b6115ef89828a0161121c565b979a9699509497949695608090950135949350505050565b8051611612816111c6565b919050565b5f60208284031215611627575f80fd5b8151611542816111c6565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611665575f80fd5b83018035915067ffffffffffffffff82111561167f575f80fd5b60200191503681900382131561125a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff811182821017156116e3576116e3611693565b60405290565b604051610180810167ffffffffffffffff811182821017156116e3576116e3611693565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561175457611754611693565b604052919050565b5f602080838503121561176d575f80fd5b823567ffffffffffffffff80821115611784575f80fd5b9084019060808287031215611797575f80fd5b61179f6116c0565b82358152838301356117b0816111c6565b818501526040830135828111156117c5575f80fd5b8301601f810188136117d5575f80fd5b8035838111156117e7576117e7611693565b611817867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161170d565b9350808452888682840101111561182c575f80fd5b80868301878601375f8682860101525050816040820152606083013560608201528094505050505092915050565b5f6020828403121561186a575f80fd5b5051919050565b8051825273ffffffffffffffffffffffffffffffffffffffff60208201511660208301525f6040820151608060408501526118af60808501826114b1565b606093840151949093019390935250919050565b602081525f6115426020830184611871565b805163ffffffff81168114611612575f80fd5b80518015158114611612575f80fd5b5f6101808284031215611908575f80fd5b6119106116e9565b61191983611607565b815261192760208401611607565b602082015261193860408401611607565b6040820152606083015160608201526080830151608082015261195d60a084016118d5565b60a082015260c083015160c082015260e083015160e08201526101008084015181830152506101206119908185016118e8565b908201526101408381015190820152610160928301519281019290925250919050565b5f6101a06119c183866113ce565b8061018084015261151e81840185611871565b5f81518060208401855e5f93019283525090919050565b5f610fbe6119f983866119d4565b846119d4565b6020815273ffffffffffffffffffffffffffffffffffffffff8251166020820152602082015160408201525f6040830151606080840152610fbe60808401826114b1565b5f60208284031215611a53575f80fd5b611542826118e8565b5f61154282846119d4565b602081525f61154260208301846114b156fe610120604052348015610010575f80fd5b5060405161267838038061267883398101604081905261002f9161052f565b6001600160a01b03831660808190526040805163f698da2560e01b8152905163f698da259160048082019260209290919082900301815f875af1158015610078573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009c9190610579565b610100526100aa823361015f565b6100b4813361015f565b336001600160a01b031660e0816001600160a01b0316815250505f836001600160a01b0316639b552cc26040518163ffffffff1660e01b81526004016020604051808303815f875af115801561010c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101309190610590565b905061013c838261015f565b610146828261015f565b506001600160a01b0391821660a0521660c0525061061c565b6101746001600160a01b038316825f19610178565b5050565b8015806101f05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ee9190610579565b155b6102675760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526102bd9185916102c216565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201525f9061030e906001600160a01b03851690849061038d565b905080515f148061032e57508080602001905181019061032e91906105b2565b6102bd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025e565b606061039b84845f856103a3565b949350505050565b6060824710156104045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025e565b5f80866001600160a01b0316858760405161041f91906105d1565b5f6040518083038185875af1925050503d805f8114610459576040519150601f19603f3d011682016040523d82523d5f602084013e61045e565b606091505b5090925090506104708783838761047b565b979650505050505050565b606083156104e95782515f036104e2576001600160a01b0385163b6104e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025e565b508161039b565b61039b83838151156104fe5781518083602001fd5b8060405162461bcd60e51b815260040161025e91906105e7565b6001600160a01b038116811461052c575f80fd5b50565b5f805f60608486031215610541575f80fd5b835161054c81610518565b602085015190935061055d81610518565b604085015190925061056e81610518565b809150509250925092565b5f60208284031215610589575f80fd5b5051919050565b5f602082840312156105a0575f80fd5b81516105ab81610518565b9392505050565b5f602082840312156105c2575f80fd5b815180151581146105ab575f80fd5b5f82518060208501845e5f920191825250919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051611fbd6106bb5f395f81816102db015261042b01525f8181610236015281816104d90152610bf901525f81816102b40152818161059901528181610d5c01528181610ebf01528181610f8e015261100d01525f81816101380152818161057701528181610d3b01528181610e2801528181610f6b015261103001525f818161032201526112140152611fbd5ff3fe608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033a26469706673582212201190cf42f989cee23f12597c8c1e9daab6d8c816513349c3ce7fd229cae5b0ff64736f6c63430008190033","deployedBytecode":"0x608060405234801561000f575f80fd5b506004361061009f575f3560e01c806337ebdf5011610072578063666e1b3911610058578063666e1b391461014f578063ab221a7614610184578063b5c5f672146101ab575f80fd5b806337ebdf50146101295780635b5d9ee61461013c575f80fd5b80630efe6a8b146100a357806322b155c6146100b857806326e0a196146100f55780632791056514610116575b5f80fd5b6100b66100b13660046111ea565b6101be565b005b6100cb6100c6366004611261565b6102a3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101086101033660046112fb565b61045f565b6040516100ec9291906114fd565b6100b6610124366004611527565b610797565b6100cb610137366004611549565b61082f565b6100b661014a366004611591565b610a01565b6100cb61015d366004611527565b5f6020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6100cb7f000000000000000000000000000000000000000000000000000000000000000081565b6100b66101b93660046111ea565b610b17565b61024f3384848673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102319190611617565b73ffffffffffffffffffffffffffffffffffffffff16929190610c46565b61029e3384838673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050565b5f33807f00000000000000000000000000000000000000000000000000000000000000008c8b6040516102d5906111b9565b73ffffffffffffffffffffffffffffffffffffffff9384168152918316602083015290911660408201526060018190604051809103905ff590508015801561031f573d5f803e3d5ffd5b506040805173ffffffffffffffffffffffffffffffffffffffff8e811682528c81166020830152929450828416928516917f6707255b2c5ca81220b2f3e408a269cb83baa6aa7e5e37aa1756883a6cdf06f1910160405180910390a373ffffffffffffffffffffffffffffffffffffffff8281165f90815260208190526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790556103d8828b8a6101be565b5f60405180608001604052808981526020018873ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509082525060200185905290506104508382610cdb565b50509998505050505050505050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060306104cf6020890189611527565b73ffffffffffffffffffffffffffffffffffffffff1614610551576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f63616e206f6e6c792068616e646c65206f776e206f726465727300000000000060448201526064015b60405180910390fd5b5f61055f6040890189611632565b81019061056c919061175c565b90508873ffffffffffffffffffffffffffffffffffffffff1663eec50b976040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105db919061185a565b6040517fb09aaaca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b169063b09aaaca9061062d9085906004016118c3565b602060405180830381865afa158015610648573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061066c919061185a565b146106d3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f696e76616c69642074726164696e6720706172616d65746572730000000000006044820152606401610548565b6040517fe3e6f5b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a169063e3e6f5b2906107259084906004016118c3565b61018060405180830381865afa158015610741573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061076591906118f7565b9250828160405160200161077a9291906119b3565b604051602081830303815290604052915050965096945050505050565b73ffffffffffffffffffffffffffffffffffffffff8082165f9081526020819052604090205482911633146108225773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b61082b82610e05565b5050565b5f807fff000000000000000000000000000000000000000000000000000000000000003073ffffffffffffffffffffffffffffffffffffffff8716604051610879602082016111b9565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166020840152808b169183019190915288166060820152608001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261093a92916020016119eb565b604051602081830303815290604052805190602001206040516020016109c294939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052805160209091012095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8087165f908152602081905260409020548791163314610a8c5773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b5f60405180608001604052808881526020018773ffffffffffffffffffffffffffffffffffffffff16815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505050908252506020018490529050610b0388610e05565b610b0d8882610cdb565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8084165f908152602081905260409020548491163314610ba25773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b610bf18433858773ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b610c408433848773ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b50505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610c40908590610ea3565b6040517fc5f3d25400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063c5f3d25490610d2d9084906004016118c3565b5f604051808303815f87803b158015610d44575f80fd5b505af1158015610d56573d5f803e3d5ffd5b5050604080516060810182523081525f6020808301829052835191955073ffffffffffffffffffffffffffffffffffffffff881694507f2cceac5555b0ca45a3744ced542f54b56ad2eb45e521962372eef212a2cbf36193830191610dbd918891016118c3565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610df891906119ff565b60405180910390a2505050565b8073ffffffffffffffffffffffffffffffffffffffff166317700f016040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610e4a575f80fd5b505af1158015610e5c573d5f803e3d5ffd5b505060405173ffffffffffffffffffffffffffffffffffffffff841692507fc75bf4f03c02fab9414a7d7a54048c0486722bc72f33ad924709a0593608ad2791505f90a250565b5f610f04826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610fb09092919063ffffffff16565b905080515f1480610f24575080806020019051810190610f249190611a43565b61029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610548565b6060610fbe84845f85610fc6565b949350505050565b606082471015611058576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610548565b5f808673ffffffffffffffffffffffffffffffffffffffff1685876040516110809190611a5c565b5f6040518083038185875af1925050503d805f81146110ba576040519150601f19603f3d011682016040523d82523d5f602084013e6110bf565b606091505b50915091506110d0878383876110db565b979650505050505050565b606083156111705782515f036111695773ffffffffffffffffffffffffffffffffffffffff85163b611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610548565b5081610fbe565b610fbe83838151156111855781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489190611a67565b61267880611a7a83390190565b73ffffffffffffffffffffffffffffffffffffffff811681146111e7575f80fd5b50565b5f805f606084860312156111fc575f80fd5b8335611207816111c6565b95602085013595506040909401359392505050565b5f8083601f84011261122c575f80fd5b50813567ffffffffffffffff811115611243575f80fd5b60208301915083602082850101111561125a575f80fd5b9250929050565b5f805f805f805f805f6101008a8c03121561127a575f80fd5b8935611285816111c6565b985060208a0135975060408a013561129c816111c6565b965060608a0135955060808a0135945060a08a01356112ba816111c6565b935060c08a013567ffffffffffffffff8111156112d5575f80fd5b6112e18c828d0161121c565b9a9d999c50979a9699959894979660e00135949350505050565b5f805f805f8060808789031215611310575f80fd5b863561131b816111c6565b9550602087013567ffffffffffffffff80821115611337575f80fd5b908801906060828b03121561134a575f80fd5b9095506040880135908082111561135f575f80fd5b61136b8a838b0161121c565b90965094506060890135915080821115611383575f80fd5b818901915089601f830112611396575f80fd5b8135818111156113a4575f80fd5b8a60208260051b85010111156113b8575f80fd5b6020830194508093505050509295509295509295565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161140f602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040810151611437604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a081015161146360a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516114988285018215159052565b5050610140818101519083015261016090810151910152565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f6101a061150b83866113ce565b8061018084015261151e818401856114b1565b95945050505050565b5f60208284031215611537575f80fd5b8135611542816111c6565b9392505050565b5f805f6060848603121561155b575f80fd5b8335611566816111c6565b92506020840135611576816111c6565b91506040840135611586816111c6565b809150509250925092565b5f805f805f8060a087890312156115a6575f80fd5b86356115b1816111c6565b95506020870135945060408701356115c8816111c6565b9350606087013567ffffffffffffffff8111156115e3575f80fd5b6115ef89828a0161121c565b979a9699509497949695608090950135949350505050565b8051611612816111c6565b919050565b5f60208284031215611627575f80fd5b8151611542816111c6565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611665575f80fd5b83018035915067ffffffffffffffff82111561167f575f80fd5b60200191503681900382131561125a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff811182821017156116e3576116e3611693565b60405290565b604051610180810167ffffffffffffffff811182821017156116e3576116e3611693565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561175457611754611693565b604052919050565b5f602080838503121561176d575f80fd5b823567ffffffffffffffff80821115611784575f80fd5b9084019060808287031215611797575f80fd5b61179f6116c0565b82358152838301356117b0816111c6565b818501526040830135828111156117c5575f80fd5b8301601f810188136117d5575f80fd5b8035838111156117e7576117e7611693565b611817867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161170d565b9350808452888682840101111561182c575f80fd5b80868301878601375f8682860101525050816040820152606083013560608201528094505050505092915050565b5f6020828403121561186a575f80fd5b5051919050565b8051825273ffffffffffffffffffffffffffffffffffffffff60208201511660208301525f6040820151608060408501526118af60808501826114b1565b606093840151949093019390935250919050565b602081525f6115426020830184611871565b805163ffffffff81168114611612575f80fd5b80518015158114611612575f80fd5b5f6101808284031215611908575f80fd5b6119106116e9565b61191983611607565b815261192760208401611607565b602082015261193860408401611607565b6040820152606083015160608201526080830151608082015261195d60a084016118d5565b60a082015260c083015160c082015260e083015160e08201526101008084015181830152506101206119908185016118e8565b908201526101408381015190820152610160928301519281019290925250919050565b5f6101a06119c183866113ce565b8061018084015261151e81840185611871565b5f81518060208401855e5f93019283525090919050565b5f610fbe6119f983866119d4565b846119d4565b6020815273ffffffffffffffffffffffffffffffffffffffff8251166020820152602082015160408201525f6040830151606080840152610fbe60808401826114b1565b5f60208284031215611a53575f80fd5b611542826118e8565b5f61154282846119d4565b602081525f61154260208301846114b156fe610120604052348015610010575f80fd5b5060405161267838038061267883398101604081905261002f9161052f565b6001600160a01b03831660808190526040805163f698da2560e01b8152905163f698da259160048082019260209290919082900301815f875af1158015610078573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009c9190610579565b610100526100aa823361015f565b6100b4813361015f565b336001600160a01b031660e0816001600160a01b0316815250505f836001600160a01b0316639b552cc26040518163ffffffff1660e01b81526004016020604051808303815f875af115801561010c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101309190610590565b905061013c838261015f565b610146828261015f565b506001600160a01b0391821660a0521660c0525061061c565b6101746001600160a01b038316825f19610178565b5050565b8015806101f05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ee9190610579565b155b6102675760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526102bd9185916102c216565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201525f9061030e906001600160a01b03851690849061038d565b905080515f148061032e57508080602001905181019061032e91906105b2565b6102bd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025e565b606061039b84845f856103a3565b949350505050565b6060824710156104045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025e565b5f80866001600160a01b0316858760405161041f91906105d1565b5f6040518083038185875af1925050503d805f8114610459576040519150601f19603f3d011682016040523d82523d5f602084013e61045e565b606091505b5090925090506104708783838761047b565b979650505050505050565b606083156104e95782515f036104e2576001600160a01b0385163b6104e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025e565b508161039b565b61039b83838151156104fe5781518083602001fd5b8060405162461bcd60e51b815260040161025e91906105e7565b6001600160a01b038116811461052c575f80fd5b50565b5f805f60608486031215610541575f80fd5b835161054c81610518565b602085015190935061055d81610518565b604085015190925061056e81610518565b809150509250925092565b5f60208284031215610589575f80fd5b5051919050565b5f602082840312156105a0575f80fd5b81516105ab81610518565b9392505050565b5f602082840312156105c2575f80fd5b815180151581146105ab575f80fd5b5f82518060208501845e5f920191825250919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051611fbd6106bb5f395f81816102db015261042b01525f8181610236015281816104d90152610bf901525f81816102b40152818161059901528181610d5c01528181610ebf01528181610f8e015261100d01525f81816101380152818161057701528181610d3b01528181610e2801528181610f6b015261103001525f818161032201526112140152611fbd5ff3fe608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033a26469706673582212201190cf42f989cee23f12597c8c1e9daab6d8c816513349c3ce7fd229cae5b0ff64736f6c63430008190033","methodIdentifiers":{"ammDeterministicAddress(address,address,address)":"37ebdf50","create(address,uint256,address,uint256,uint256,address,bytes,bytes32)":"22b155c6","deposit(address,uint256,uint256)":"0efe6a8b","disableTrading(address)":"27910565","getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])":"26e0a196","owner(address)":"666e1b39","settler()":"ab221a76","updateParameters(address,uint256,address,bytes,bytes32)":"5b5d9ee6","withdraw(address,uint256,uint256)":"b5c5f672"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"_settler\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OnlyOwnerCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"OrderNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IConditionalOrder\",\"name\":\"handler\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"staticInput\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct IConditionalOrder.ConditionalOrderParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"ConditionalOrderCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"token0\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"Deployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"TradingDisabled\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ammOwner\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"ammDeterministicAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"disableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IConditionalOrder\",\"name\":\"handler\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"staticInput\",\"type\":\"bytes\"}],\"internalType\":\"struct IConditionalOrder.ConditionalOrderParams\",\"name\":\"params\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"name\":\"getTradeableOrderWithSignature\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"order\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settler\",\"outputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"name\":\"updateParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CoW Protocol Developers\",\"details\":\"Factory contract for the CoW AMM, an automated market maker based on the concept of function-maximising AMMs. The factory deploys new AMM and is responsible for managing deposits, enabling/disabling trading and updating trade parameters.\",\"errors\":{\"OnlyOwnerCanCall(address)\":[{\"params\":{\"owner\":\"The owner of the AMM.\"}}],\"OrderNotValid(string)\":[{\"details\":\"This error is returned by the `getTradeableOrder` function if the order condition is not met. A parameter of `string` type is included to allow the caller to specify the reason for the failure.\"}]},\"events\":{\"Deployed(address,address,address,address)\":{\"params\":{\"amm\":\"The address of the AMM that can now trade on CoW Protocol.\",\"owner\":\"The owner of the AMM.\",\"token0\":\"The first token traded by the AMM.\",\"token1\":\"The second token traded by the AMM.\"}},\"TradingDisabled(address)\":{\"params\":{\"amm\":\"The address of the AMM that stops trading on CoW Protocol.\"}}},\"kind\":\"dev\",\"methods\":{\"ammDeterministicAddress(address,address,address)\":{\"params\":{\"ammOwner\":\"The (expected) owner of the AMM.\",\"token0\":\"The address of the first token traded by the AMM.\",\"token1\":\"The address of the second token traded by the AMM.\"},\"returns\":{\"_0\":\"The deterministic address at which this contract deploys a CoW AMM for the specified input parameters.\"}},\"constructor\":{\"params\":{\"_settler\":\"The address of the GPv2Settlement contract.\"}},\"create(address,uint256,address,uint256,uint256,address,bytes,bytes32)\":{\"params\":{\"amount0\":\"The initial amount of the first token in the pair.\",\"amount1\":\"The initial amount of the second token in the pair.\",\"appData\":\"The app data to pass to the AMM.\",\"minTradedToken0\":\"The minimum amount of token0 before the AMM attempts auto-rebalance.\",\"priceOracle\":\"The address of the price oracle to use for the AMM.\",\"priceOracleData\":\"The data to pass to the price oracle.\",\"token0\":\"The address of the first token in the pair.\",\"token1\":\"The address of the second token in the pair.\"},\"returns\":{\"amm\":\"The address of the newly deployed AMM.\"}},\"deposit(address,uint256,uint256)\":{\"params\":{\"amm\":\"the AMM where to send the funds\",\"amount0\":\"amount of AMM's token0 to deposit\",\"amount1\":\"amount of AMM's token1 to deposit\"}},\"disableTrading(address)\":{\"params\":{\"amm\":\"The AMM for which to disable trading.\"}},\"getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])\":{\"details\":\"Some parameters are unused as they refer to features of ComposableCoW that aren't implemented in this contract. They are still needed to let the watchtower interact with this contract in the same way as ComposableCoW.\",\"params\":{\"amm\":\"owner of the order.\",\"params\":\"`ConditionalOrderParams` for the order; precisely, the handler must be this contract, the salt can be any value, and the static input must be the current trading parameters of the AMM.\"},\"returns\":{\"order\":\"discrete order for submitting to CoW Protocol API\",\"signature\":\"for submitting to CoW Protocol API\"}},\"updateParameters(address,uint256,address,bytes,bytes32)\":{\"params\":{\"amm\":\"The address of the AMM whose parameters to change.\",\"appData\":\"The app data to pass to the AMM.\",\"minTradedToken0\":\"The minimum amount of token0 before the AMM attempts auto-rebalance.\",\"priceOracle\":\"The address of the price oracle to use for the AMM.\",\"priceOracleData\":\"The data to pass to the price oracle.\"}},\"withdraw(address,uint256,uint256)\":{\"params\":{\"amm\":\"the AMM whose funds to withdraw\",\"amount0\":\"amount of AMM's token0 to withdraw\",\"amount1\":\"amount of AMM's token1 to withdraw\"}}},\"title\":\"CoW AMM Factory\",\"version\":1},\"userdoc\":{\"errors\":{\"OnlyOwnerCanCall(address)\":[{\"notice\":\"This function is permissioned and can only be called by the owner of the AMM that is involved in the transaction.\"}]},\"events\":{\"Deployed(address,address,address,address)\":{\"notice\":\"A CoW AMM has been created. The emitted AMM parameters are immutable for the new AMM.\"},\"TradingDisabled(address)\":{\"notice\":\"A CoW AMM stopped trading; no CoW Protocol orders can be settled until trading is enabled again.\"}},\"kind\":\"user\",\"methods\":{\"ammDeterministicAddress(address,address,address)\":{\"notice\":\"Computes the determinisitic address of a CoW AMM deployment.\"},\"create(address,uint256,address,uint256,uint256,address,bytes,bytes32)\":{\"notice\":\"Creates a new CoW AMM with the specified imput parameters.\"},\"deposit(address,uint256,uint256)\":{\"notice\":\"Deposit sender's funds into the the AMM contract, assuming that the sender has approved this contract to spend both tokens.\"},\"disableTrading(address)\":{\"notice\":\"Disable trading for an AMM managed by this contract.\"},\"getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])\":{\"notice\":\"This function exists to let the watchtower off-chain service automatically create AMM orders and post them on the orderbook. It outputs an order for the input AMM together with a valid signature.\"},\"owner(address)\":{\"notice\":\"For each AMM created by this contract, this mapping stores its owner.\"},\"settler()\":{\"notice\":\"The settlement contract for CoW Protocol on this network.\"},\"updateParameters(address,uint256,address,bytes,bytes32)\":{\"notice\":\"Change the parameters used for trading on the specified AMM. Only a single order per AMM can be valid at a time, meaning that any previous order stops being tradeable.\"},\"withdraw(address,uint256,uint256)\":{\"notice\":\"Take funds from the AMM and sends them to the owner.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ConstantProductFactory.sol\":\"ConstantProductFactory\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/\",\":balancer/=lib/composable-cow/lib/balancer/src/\",\":canonical-weth/=lib/composable-cow/lib/canonical-weth/src/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/\",\":math/=lib/composable-cow/lib/balancer/src/lib/math/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol\":{\"keccak256\":\"0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f\",\"dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol\":{\"keccak256\":\"0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d\",\"dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg\"]},\"lib/composable-cow/lib/safe/contracts/Safe.sol\":{\"keccak256\":\"0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119\",\"dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9\"]},\"lib/composable-cow/lib/safe/contracts/base/Executor.sol\":{\"keccak256\":\"0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c\",\"dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp\"]},\"lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol\":{\"keccak256\":\"0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e\",\"dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV\"]},\"lib/composable-cow/lib/safe/contracts/base/GuardManager.sol\":{\"keccak256\":\"0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64\",\"dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx\"]},\"lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol\":{\"keccak256\":\"0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d\",\"dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz\"]},\"lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol\":{\"keccak256\":\"0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a\",\"dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK\"]},\"lib/composable-cow/lib/safe/contracts/common/Enum.sol\":{\"keccak256\":\"0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34\",\"dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo\"]},\"lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol\":{\"keccak256\":\"0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9\",\"dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g\"]},\"lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol\":{\"keccak256\":\"0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3\",\"dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N\"]},\"lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol\":{\"keccak256\":\"0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3\",\"dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu\"]},\"lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol\":{\"keccak256\":\"0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80\",\"dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4\"]},\"lib/composable-cow/lib/safe/contracts/common/Singleton.sol\":{\"keccak256\":\"0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde\",\"dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo\"]},\"lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol\":{\"keccak256\":\"0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e\",\"dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ\"]},\"lib/composable-cow/lib/safe/contracts/external/SafeMath.sol\":{\"keccak256\":\"0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c\",\"dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x\"]},\"lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol\":{\"keccak256\":\"0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515\",\"dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV\"]},\"lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol\":{\"keccak256\":\"0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4\",\"dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/Base.sol\":{\"keccak256\":\"0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9\",\"dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol\":{\"keccak256\":\"0x6e19ba1deb09a34cca28891bfefd853697b808dfb8a9cddd4051d3058d3eb718\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://0b1059e752bd142160a4fbe8ee08377a50902d31b8b909df002480d191af0cf4\",\"dweb:/ipfs/QmbuUmvgoodsZGgqR793duEWF5t7h6USAXfpr2N1VvBmeP\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol\":{\"keccak256\":\"0xbe7db6cbdb034c9aee1eae12200ab2e94fa4743ae08dbba2f1a001c4b62f3e0b\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://4fbba0ea04349873b38f7c7104d0a88ffd6e7ec399a3fdd0e1297ce12eebb19e\",\"dweb:/ipfs/QmYiDukcX2y7ratxsMX6hLMKzGQTD67CKLpuiSpgm1HGue\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol\":{\"keccak256\":\"0x531476118b7948b06a0c7094badd6f1ae33ae2ddca815110030e87ee62c4a895\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f21ad2619b5bcbc977c5943d2f668e8bfb9ef6968db1193415e046171a5a150a\",\"dweb:/ipfs/QmYZeu3vr6eRWjeYp8GvWSVRLm9baFbTyEGgAy2hMAqbLX\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol\":{\"keccak256\":\"0xc60a1d55ff0cf532a44bd864683719e3d6e1fa6d20d4c77812e21c33afecf304\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://298c7efe668a4ca8d3b712770973931d604c84304aececd621f0350d7d293b68\",\"dweb:/ipfs/QmVcNdQ7ZsnmDgSX8TFRLHk4HZUXH86u2akAM5q3g1PFfZ\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol\":{\"keccak256\":\"0xfb0f8f01a7191ab358f196a7e055441ede00f36805f12c579a742a5cd3c4f8d7\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://0d485ea9fc430a89953ffe2d2c7032b5a330f086bbb784e81eb6b00a692f6438\",\"dweb:/ipfs/QmNofKrkU9VTtGMN9Rc6js2jyUscSFxce8kjBz5rZL4RSJ\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol\":{\"keccak256\":\"0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c\",\"dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol\":{\"keccak256\":\"0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c\",\"dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89\",\"dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol\":{\"keccak256\":\"0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25\",\"dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978\"]},\"lib/composable-cow/src/BaseConditionalOrder.sol\":{\"keccak256\":\"0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402\",\"dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v\"]},\"lib/composable-cow/src/ComposableCoW.sol\":{\"keccak256\":\"0x565c6fabc8a1e185acfb4539baeb7e3cabb004b54da2c777cbdbb3c98dbd6a52\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://2b876b6b4a69f69b7f9445e67a0e60dd7a65f028d54ba9c4c8c983a00ee23642\",\"dweb:/ipfs/Qmf95tsR515WFv2yBKp4NzhFc9xvfZRtS194Lq7SY2r7zC\"]},\"lib/composable-cow/src/interfaces/IConditionalOrder.sol\":{\"keccak256\":\"0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699\",\"dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ\"]},\"lib/composable-cow/src/interfaces/ISwapGuard.sol\":{\"keccak256\":\"0x60abdef709d22cb95e4b1d4680cb70d5286cfb5aa71ec65868cc44164ef8790f\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7593245e22ffc533a073891affdbb003fa56eaa5ef7f0202a673b52968ad7ed5\",\"dweb:/ipfs/QmRhAvNzbHp8qfrw7eHZP6EDWw42tXMXSV3KuyhyxFy3Nx\"]},\"lib/composable-cow/src/interfaces/IValueFactory.sol\":{\"keccak256\":\"0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de\",\"dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih\"]},\"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol\":{\"keccak256\":\"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777\",\"dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf\"]},\"lib/composable-cow/src/vendored/CoWSettlement.sol\":{\"keccak256\":\"0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840\",\"dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR\"]},\"lib/openzeppelin/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e\",\"dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng\"]},\"lib/openzeppelin/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45\",\"dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq\"]},\"lib/openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a\",\"dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv\"]},\"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68\",\"dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS\"]},\"lib/openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0xcf688741f79f4838d5301dcf72d0af9eff11bbab6ab0bb112ad144c7fb672dac\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://85d9c87a481fe99fd28a146c205da0867ef7e1b7edbe0036abc86d2e64eb1f04\",\"dweb:/ipfs/QmR7m1zWQNfZHUKTtqnjoCjCBbNFcjCxV27rxf6iMfhVtG\"]},\"lib/openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c\",\"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS\"]},\"src/ConstantProduct.sol\":{\"keccak256\":\"0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085\",\"dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf\"]},\"src/ConstantProductFactory.sol\":{\"keccak256\":\"0xab972f93d38a733f8608bbf139b4991de9a184a7f727d4e965ed1702d25682c3\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1235406c1be8486952fec59b6b8ad3e23e3d4bd0891b32b58a87e31ae3bb5ec3\",\"dweb:/ipfs/QmbonoF2yhCqC8tiqS84oaYFkhBHQYGgqmbxexBc82VUco\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/interfaces/ISettlement.sol\":{\"keccak256\":\"0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd\",\"dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq\"]},\"src/interfaces/IWatchtowerCustomErrors.sol\":{\"keccak256\":\"0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a\",\"dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"contract ISettlement","name":"_settler","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"type":"error","name":"OnlyOwnerCanCall"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"type":"error","name":"OrderNotValid"},{"inputs":[{"internalType":"address","name":"owner","type":"address","indexed":true},{"internalType":"struct IConditionalOrder.ConditionalOrderParams","name":"params","type":"tuple","components":[{"internalType":"contract IConditionalOrder","name":"handler","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"staticInput","type":"bytes"}],"indexed":false}],"type":"event","name":"ConditionalOrderCreated","anonymous":false},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address","indexed":true},{"internalType":"address","name":"owner","type":"address","indexed":true},{"internalType":"contract IERC20","name":"token0","type":"address","indexed":false},{"internalType":"contract IERC20","name":"token1","type":"address","indexed":false}],"type":"event","name":"Deployed","anonymous":false},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address","indexed":true}],"type":"event","name":"TradingDisabled","anonymous":false},{"inputs":[{"internalType":"address","name":"ammOwner","type":"address"},{"internalType":"contract IERC20","name":"token0","type":"address"},{"internalType":"contract IERC20","name":"token1","type":"address"}],"stateMutability":"view","type":"function","name":"ammDeterministicAddress","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[{"internalType":"contract IERC20","name":"token0","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"contract IERC20","name":"token1","type":"address"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"create","outputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address"}]},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"deposit"},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"disableTrading"},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address"},{"internalType":"struct IConditionalOrder.ConditionalOrderParams","name":"params","type":"tuple","components":[{"internalType":"contract IConditionalOrder","name":"handler","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"bytes","name":"staticInput","type":"bytes"}]},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function","name":"getTradeableOrderWithSignature","outputs":[{"internalType":"struct GPv2Order.Data","name":"order","type":"tuple","components":[{"internalType":"contract IERC20","name":"sellToken","type":"address"},{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes32","name":"kind","type":"bytes32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"bytes32","name":"sellTokenBalance","type":"bytes32"},{"internalType":"bytes32","name":"buyTokenBalance","type":"bytes32"}]},{"internalType":"bytes","name":"signature","type":"bytes"}]},{"inputs":[{"internalType":"contract ConstantProduct","name":"","type":"address"}],"stateMutability":"view","type":"function","name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"settler","outputs":[{"internalType":"contract ISettlement","name":"","type":"address"}]},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address"},{"internalType":"uint256","name":"minTradedToken0","type":"uint256"},{"internalType":"contract IPriceOracle","name":"priceOracle","type":"address"},{"internalType":"bytes","name":"priceOracleData","type":"bytes"},{"internalType":"bytes32","name":"appData","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"updateParameters"},{"inputs":[{"internalType":"contract ConstantProduct","name":"amm","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"withdraw"}],"devdoc":{"kind":"dev","methods":{"ammDeterministicAddress(address,address,address)":{"params":{"ammOwner":"The (expected) owner of the AMM.","token0":"The address of the first token traded by the AMM.","token1":"The address of the second token traded by the AMM."},"returns":{"_0":"The deterministic address at which this contract deploys a CoW AMM for the specified input parameters."}},"constructor":{"params":{"_settler":"The address of the GPv2Settlement contract."}},"create(address,uint256,address,uint256,uint256,address,bytes,bytes32)":{"params":{"amount0":"The initial amount of the first token in the pair.","amount1":"The initial amount of the second token in the pair.","appData":"The app data to pass to the AMM.","minTradedToken0":"The minimum amount of token0 before the AMM attempts auto-rebalance.","priceOracle":"The address of the price oracle to use for the AMM.","priceOracleData":"The data to pass to the price oracle.","token0":"The address of the first token in the pair.","token1":"The address of the second token in the pair."},"returns":{"amm":"The address of the newly deployed AMM."}},"deposit(address,uint256,uint256)":{"params":{"amm":"the AMM where to send the funds","amount0":"amount of AMM's token0 to deposit","amount1":"amount of AMM's token1 to deposit"}},"disableTrading(address)":{"params":{"amm":"The AMM for which to disable trading."}},"getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])":{"details":"Some parameters are unused as they refer to features of ComposableCoW that aren't implemented in this contract. They are still needed to let the watchtower interact with this contract in the same way as ComposableCoW.","params":{"amm":"owner of the order.","params":"`ConditionalOrderParams` for the order; precisely, the handler must be this contract, the salt can be any value, and the static input must be the current trading parameters of the AMM."},"returns":{"order":"discrete order for submitting to CoW Protocol API","signature":"for submitting to CoW Protocol API"}},"updateParameters(address,uint256,address,bytes,bytes32)":{"params":{"amm":"The address of the AMM whose parameters to change.","appData":"The app data to pass to the AMM.","minTradedToken0":"The minimum amount of token0 before the AMM attempts auto-rebalance.","priceOracle":"The address of the price oracle to use for the AMM.","priceOracleData":"The data to pass to the price oracle."}},"withdraw(address,uint256,uint256)":{"params":{"amm":"the AMM whose funds to withdraw","amount0":"amount of AMM's token0 to withdraw","amount1":"amount of AMM's token1 to withdraw"}}},"version":1},"userdoc":{"kind":"user","methods":{"ammDeterministicAddress(address,address,address)":{"notice":"Computes the determinisitic address of a CoW AMM deployment."},"create(address,uint256,address,uint256,uint256,address,bytes,bytes32)":{"notice":"Creates a new CoW AMM with the specified imput parameters."},"deposit(address,uint256,uint256)":{"notice":"Deposit sender's funds into the the AMM contract, assuming that the sender has approved this contract to spend both tokens."},"disableTrading(address)":{"notice":"Disable trading for an AMM managed by this contract."},"getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])":{"notice":"This function exists to let the watchtower off-chain service automatically create AMM orders and post them on the orderbook. It outputs an order for the input AMM together with a valid signature."},"owner(address)":{"notice":"For each AMM created by this contract, this mapping stores its owner."},"settler()":{"notice":"The settlement contract for CoW Protocol on this network."},"updateParameters(address,uint256,address,bytes,bytes32)":{"notice":"Change the parameters used for trading on the specified AMM. Only a single order per AMM can be valid at a time, meaning that any previous order stops being tradeable."},"withdraw(address,uint256,uint256)":{"notice":"Take funds from the AMM and sends them to the owner."}},"version":1}},"settings":{"remappings":["@openzeppelin/=lib/composable-cow/lib/@openzeppelin/","@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/","balancer/=lib/composable-cow/lib/balancer/src/","canonical-weth/=lib/composable-cow/lib/canonical-weth/src/","composable-cow/=lib/composable-cow/","cowprotocol/=lib/composable-cow/lib/cowprotocol/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/","math/=lib/composable-cow/lib/balancer/src/lib/math/","murky/=lib/composable-cow/lib/murky/src/","openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin/","safe/=lib/composable-cow/lib/safe/","uniswap-v2-core/=lib/uniswap-v2-core/contracts/","lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/","lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/","lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/","lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/"],"optimizer":{"enabled":true,"runs":100000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/ConstantProductFactory.sol":"ConstantProductFactory"},"evmVersion":"cancun","libraries":{}},"sources":{"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol":{"keccak256":"0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528","urls":["bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f","dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF"],"license":"LGPL-3.0-or-later"},"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol":{"keccak256":"0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f","urls":["bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d","dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg"],"license":"LGPL-3.0-or-later"},"lib/composable-cow/lib/safe/contracts/Safe.sol":{"keccak256":"0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638","urls":["bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119","dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/Executor.sol":{"keccak256":"0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a","urls":["bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c","dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol":{"keccak256":"0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165","urls":["bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e","dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/GuardManager.sol":{"keccak256":"0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d","urls":["bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64","dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol":{"keccak256":"0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a","urls":["bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d","dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol":{"keccak256":"0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c","urls":["bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a","dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/Enum.sol":{"keccak256":"0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453","urls":["bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34","dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol":{"keccak256":"0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba","urls":["bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9","dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol":{"keccak256":"0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05","urls":["bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3","dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol":{"keccak256":"0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13","urls":["bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3","dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol":{"keccak256":"0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c","urls":["bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80","dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/Singleton.sol":{"keccak256":"0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50","urls":["bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde","dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol":{"keccak256":"0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e","urls":["bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e","dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/external/SafeMath.sol":{"keccak256":"0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89","urls":["bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c","dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol":{"keccak256":"0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9","urls":["bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515","dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol":{"keccak256":"0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5","urls":["bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4","dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/Base.sol":{"keccak256":"0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15","urls":["bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9","dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol":{"keccak256":"0x6e19ba1deb09a34cca28891bfefd853697b808dfb8a9cddd4051d3058d3eb718","urls":["bzz-raw://0b1059e752bd142160a4fbe8ee08377a50902d31b8b909df002480d191af0cf4","dweb:/ipfs/QmbuUmvgoodsZGgqR793duEWF5t7h6USAXfpr2N1VvBmeP"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol":{"keccak256":"0xbe7db6cbdb034c9aee1eae12200ab2e94fa4743ae08dbba2f1a001c4b62f3e0b","urls":["bzz-raw://4fbba0ea04349873b38f7c7104d0a88ffd6e7ec399a3fdd0e1297ce12eebb19e","dweb:/ipfs/QmYiDukcX2y7ratxsMX6hLMKzGQTD67CKLpuiSpgm1HGue"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol":{"keccak256":"0x531476118b7948b06a0c7094badd6f1ae33ae2ddca815110030e87ee62c4a895","urls":["bzz-raw://f21ad2619b5bcbc977c5943d2f668e8bfb9ef6968db1193415e046171a5a150a","dweb:/ipfs/QmYZeu3vr6eRWjeYp8GvWSVRLm9baFbTyEGgAy2hMAqbLX"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol":{"keccak256":"0xc60a1d55ff0cf532a44bd864683719e3d6e1fa6d20d4c77812e21c33afecf304","urls":["bzz-raw://298c7efe668a4ca8d3b712770973931d604c84304aececd621f0350d7d293b68","dweb:/ipfs/QmVcNdQ7ZsnmDgSX8TFRLHk4HZUXH86u2akAM5q3g1PFfZ"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol":{"keccak256":"0xfb0f8f01a7191ab358f196a7e055441ede00f36805f12c579a742a5cd3c4f8d7","urls":["bzz-raw://0d485ea9fc430a89953ffe2d2c7032b5a330f086bbb784e81eb6b00a692f6438","dweb:/ipfs/QmNofKrkU9VTtGMN9Rc6js2jyUscSFxce8kjBz5rZL4RSJ"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol":{"keccak256":"0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493","urls":["bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c","dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol":{"keccak256":"0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479","urls":["bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c","dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol":{"keccak256":"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb","urls":["bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89","dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol":{"keccak256":"0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457","urls":["bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25","dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978"],"license":"LGPL-3.0-only"},"lib/composable-cow/src/BaseConditionalOrder.sol":{"keccak256":"0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588","urls":["bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402","dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v"],"license":"MIT"},"lib/composable-cow/src/ComposableCoW.sol":{"keccak256":"0x565c6fabc8a1e185acfb4539baeb7e3cabb004b54da2c777cbdbb3c98dbd6a52","urls":["bzz-raw://2b876b6b4a69f69b7f9445e67a0e60dd7a65f028d54ba9c4c8c983a00ee23642","dweb:/ipfs/Qmf95tsR515WFv2yBKp4NzhFc9xvfZRtS194Lq7SY2r7zC"],"license":"GPL-3.0"},"lib/composable-cow/src/interfaces/IConditionalOrder.sol":{"keccak256":"0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b","urls":["bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699","dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ"],"license":"GPL-3.0"},"lib/composable-cow/src/interfaces/ISwapGuard.sol":{"keccak256":"0x60abdef709d22cb95e4b1d4680cb70d5286cfb5aa71ec65868cc44164ef8790f","urls":["bzz-raw://7593245e22ffc533a073891affdbb003fa56eaa5ef7f0202a673b52968ad7ed5","dweb:/ipfs/QmRhAvNzbHp8qfrw7eHZP6EDWw42tXMXSV3KuyhyxFy3Nx"],"license":"GPL-3.0"},"lib/composable-cow/src/interfaces/IValueFactory.sol":{"keccak256":"0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122","urls":["bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de","dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih"],"license":"GPL-3.0"},"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol":{"keccak256":"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae","urls":["bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777","dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf"],"license":"MIT"},"lib/composable-cow/src/vendored/CoWSettlement.sol":{"keccak256":"0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7","urls":["bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840","dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR"],"license":"MIT"},"lib/openzeppelin/contracts/interfaces/IERC1271.sol":{"keccak256":"0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544","urls":["bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e","dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng"],"license":"MIT"},"lib/openzeppelin/contracts/interfaces/IERC20.sol":{"keccak256":"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45","urls":["bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45","dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/IERC20.sol":{"keccak256":"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305","urls":["bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5","dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol":{"keccak256":"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a","urls":["bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a","dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol":{"keccak256":"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1","urls":["bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68","dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS"],"license":"MIT"},"lib/openzeppelin/contracts/utils/Address.sol":{"keccak256":"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa","urls":["bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931","dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm"],"license":"MIT"},"lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol":{"keccak256":"0xcf688741f79f4838d5301dcf72d0af9eff11bbab6ab0bb112ad144c7fb672dac","urls":["bzz-raw://85d9c87a481fe99fd28a146c205da0867ef7e1b7edbe0036abc86d2e64eb1f04","dweb:/ipfs/QmR7m1zWQNfZHUKTtqnjoCjCBbNFcjCxV27rxf6iMfhVtG"],"license":"MIT"},"lib/openzeppelin/contracts/utils/math/Math.sol":{"keccak256":"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3","urls":["bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c","dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS"],"license":"MIT"},"src/ConstantProduct.sol":{"keccak256":"0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115","urls":["bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085","dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf"],"license":"GPL-3.0"},"src/ConstantProductFactory.sol":{"keccak256":"0xab972f93d38a733f8608bbf139b4991de9a184a7f727d4e965ed1702d25682c3","urls":["bzz-raw://1235406c1be8486952fec59b6b8ad3e23e3d4bd0891b32b58a87e31ae3bb5ec3","dweb:/ipfs/QmbonoF2yhCqC8tiqS84oaYFkhBHQYGgqmbxexBc82VUco"],"license":"GPL-3.0"},"src/interfaces/IPriceOracle.sol":{"keccak256":"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e","urls":["bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2","dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu"],"license":"GPL-3.0"},"src/interfaces/ISettlement.sol":{"keccak256":"0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661","urls":["bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd","dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq"],"license":"GPL-3.0"},"src/interfaces/IWatchtowerCustomErrors.sol":{"keccak256":"0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611","urls":["bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a","dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ"],"license":"GPL-3.0"}},"version":1},"id":170} +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "_settler", + "type": "address", + "internalType": "contract ISettlement" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "ammDeterministicAddress", + "inputs": [ + { + "name": "ammOwner", + "type": "address", + "internalType": "address" + }, + { + "name": "token0", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "token1", + "type": "address", + "internalType": "contract IERC20" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "create", + "inputs": [ + { + "name": "token0", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "amount0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "token1", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "amount1", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [ + { + "name": "amm", + "type": "address", + "internalType": "contract ConstantProduct" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "contract ConstantProduct" + }, + { + "name": "amount0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "amount1", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "disableTrading", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "contract ConstantProduct" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getTradeableOrderWithSignature", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "contract ConstantProduct" + }, + { + "name": "params", + "type": "tuple", + "internalType": "struct IConditionalOrder.ConditionalOrderParams", + "components": [ + { + "name": "handler", + "type": "address", + "internalType": "contract IConditionalOrder" + }, + { + "name": "salt", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "staticInput", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "", + "type": "bytes32[]", + "internalType": "bytes32[]" + } + ], + "outputs": [ + { + "name": "order", + "type": "tuple", + "internalType": "struct GPv2Order.Data", + "components": [ + { + "name": "sellToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "buyToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "receiver", + "type": "address", + "internalType": "address" + }, + { + "name": "sellAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "buyAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "validTo", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "feeAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "partiallyFillable", + "type": "bool", + "internalType": "bool" + }, + { + "name": "sellTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "buyTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "owner", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ConstantProduct" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "settler", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ISettlement" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "updateParameters", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "contract ConstantProduct" + }, + { + "name": "minTradedToken0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceOracle", + "type": "address", + "internalType": "contract IPriceOracle" + }, + { + "name": "priceOracleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "contract ConstantProduct" + }, + { + "name": "amount0", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "amount1", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "ConditionalOrderCreated", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "params", + "type": "tuple", + "indexed": false, + "internalType": "struct IConditionalOrder.ConditionalOrderParams", + "components": [ + { + "name": "handler", + "type": "address", + "internalType": "contract IConditionalOrder" + }, + { + "name": "salt", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "staticInput", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Deployed", + "inputs": [ + { + "name": "amm", + "type": "address", + "indexed": true, + "internalType": "contract ConstantProduct" + }, + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "token0", + "type": "address", + "indexed": false, + "internalType": "contract IERC20" + }, + { + "name": "token1", + "type": "address", + "indexed": false, + "internalType": "contract IERC20" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TradingDisabled", + "inputs": [ + { + "name": "amm", + "type": "address", + "indexed": true, + "internalType": "contract ConstantProduct" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "OnlyOwnerCanCall", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "OrderNotValid", + "inputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ] + } + ], + "bytecode": "0x60a0604052348015600e575f80fd5b506040516141b33803806141b3833981016040819052602b91603b565b6001600160a01b03166080526066565b5f60208284031215604a575f80fd5b81516001600160a01b0381168114605f575f80fd5b9392505050565b60805161412761008c5f395f8181610189015281816102a801526108c401526141275ff3fe608060405234801561000f575f80fd5b506004361061009f575f3560e01c806337ebdf5011610072578063666e1b3911610058578063666e1b391461014f578063ab221a7614610184578063b5c5f672146101ab575f80fd5b806337ebdf50146101295780635b5d9ee61461013c575f80fd5b80630efe6a8b146100a357806322b155c6146100b857806326e0a196146100f55780632791056514610116575b5f80fd5b6100b66100b13660046111ea565b6101be565b005b6100cb6100c6366004611261565b6102a3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101086101033660046112fb565b61045f565b6040516100ec9291906114fd565b6100b6610124366004611527565b610797565b6100cb610137366004611549565b61082f565b6100b661014a366004611591565b610a01565b6100cb61015d366004611527565b5f6020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6100cb7f000000000000000000000000000000000000000000000000000000000000000081565b6100b66101b93660046111ea565b610b17565b61024f3384848673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102319190611617565b73ffffffffffffffffffffffffffffffffffffffff16929190610c46565b61029e3384838673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050565b5f33807f00000000000000000000000000000000000000000000000000000000000000008c8b6040516102d5906111b9565b73ffffffffffffffffffffffffffffffffffffffff9384168152918316602083015290911660408201526060018190604051809103905ff590508015801561031f573d5f803e3d5ffd5b506040805173ffffffffffffffffffffffffffffffffffffffff8e811682528c81166020830152929450828416928516917f6707255b2c5ca81220b2f3e408a269cb83baa6aa7e5e37aa1756883a6cdf06f1910160405180910390a373ffffffffffffffffffffffffffffffffffffffff8281165f90815260208190526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790556103d8828b8a6101be565b5f60405180608001604052808981526020018873ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509082525060200185905290506104508382610cdb565b50509998505050505050505050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060306104cf6020890189611527565b73ffffffffffffffffffffffffffffffffffffffff1614610551576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f63616e206f6e6c792068616e646c65206f776e206f726465727300000000000060448201526064015b60405180910390fd5b5f61055f6040890189611632565b81019061056c919061175c565b90508873ffffffffffffffffffffffffffffffffffffffff1663eec50b976040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105db919061185a565b6040517fb09aaaca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b169063b09aaaca9061062d9085906004016118c3565b602060405180830381865afa158015610648573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061066c919061185a565b146106d3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f696e76616c69642074726164696e6720706172616d65746572730000000000006044820152606401610548565b6040517fe3e6f5b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a169063e3e6f5b2906107259084906004016118c3565b61018060405180830381865afa158015610741573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061076591906118f7565b9250828160405160200161077a9291906119b3565b604051602081830303815290604052915050965096945050505050565b73ffffffffffffffffffffffffffffffffffffffff8082165f9081526020819052604090205482911633146108225773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b61082b82610e05565b5050565b5f807fff000000000000000000000000000000000000000000000000000000000000003073ffffffffffffffffffffffffffffffffffffffff8716604051610879602082016111b9565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166020840152808b169183019190915288166060820152608001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261093a92916020016119eb565b604051602081830303815290604052805190602001206040516020016109c294939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052805160209091012095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8087165f908152602081905260409020548791163314610a8c5773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b5f60405180608001604052808881526020018773ffffffffffffffffffffffffffffffffffffffff16815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505050908252506020018490529050610b0388610e05565b610b0d8882610cdb565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8084165f908152602081905260409020548491163314610ba25773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b610bf18433858773ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b610c408433848773ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b50505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610c40908590610ea3565b6040517fc5f3d25400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063c5f3d25490610d2d9084906004016118c3565b5f604051808303815f87803b158015610d44575f80fd5b505af1158015610d56573d5f803e3d5ffd5b5050604080516060810182523081525f6020808301829052835191955073ffffffffffffffffffffffffffffffffffffffff881694507f2cceac5555b0ca45a3744ced542f54b56ad2eb45e521962372eef212a2cbf36193830191610dbd918891016118c3565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610df891906119ff565b60405180910390a2505050565b8073ffffffffffffffffffffffffffffffffffffffff166317700f016040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610e4a575f80fd5b505af1158015610e5c573d5f803e3d5ffd5b505060405173ffffffffffffffffffffffffffffffffffffffff841692507fc75bf4f03c02fab9414a7d7a54048c0486722bc72f33ad924709a0593608ad2791505f90a250565b5f610f04826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610fb09092919063ffffffff16565b905080515f1480610f24575080806020019051810190610f249190611a43565b61029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610548565b6060610fbe84845f85610fc6565b949350505050565b606082471015611058576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610548565b5f808673ffffffffffffffffffffffffffffffffffffffff1685876040516110809190611a5c565b5f6040518083038185875af1925050503d805f81146110ba576040519150601f19603f3d011682016040523d82523d5f602084013e6110bf565b606091505b50915091506110d0878383876110db565b979650505050505050565b606083156111705782515f036111695773ffffffffffffffffffffffffffffffffffffffff85163b611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610548565b5081610fbe565b610fbe83838151156111855781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489190611a67565b61267880611a7a83390190565b73ffffffffffffffffffffffffffffffffffffffff811681146111e7575f80fd5b50565b5f805f606084860312156111fc575f80fd5b8335611207816111c6565b95602085013595506040909401359392505050565b5f8083601f84011261122c575f80fd5b50813567ffffffffffffffff811115611243575f80fd5b60208301915083602082850101111561125a575f80fd5b9250929050565b5f805f805f805f805f6101008a8c03121561127a575f80fd5b8935611285816111c6565b985060208a0135975060408a013561129c816111c6565b965060608a0135955060808a0135945060a08a01356112ba816111c6565b935060c08a013567ffffffffffffffff8111156112d5575f80fd5b6112e18c828d0161121c565b9a9d999c50979a9699959894979660e00135949350505050565b5f805f805f8060808789031215611310575f80fd5b863561131b816111c6565b9550602087013567ffffffffffffffff80821115611337575f80fd5b908801906060828b03121561134a575f80fd5b9095506040880135908082111561135f575f80fd5b61136b8a838b0161121c565b90965094506060890135915080821115611383575f80fd5b818901915089601f830112611396575f80fd5b8135818111156113a4575f80fd5b8a60208260051b85010111156113b8575f80fd5b6020830194508093505050509295509295509295565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161140f602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040810151611437604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a081015161146360a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516114988285018215159052565b5050610140818101519083015261016090810151910152565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f6101a061150b83866113ce565b8061018084015261151e818401856114b1565b95945050505050565b5f60208284031215611537575f80fd5b8135611542816111c6565b9392505050565b5f805f6060848603121561155b575f80fd5b8335611566816111c6565b92506020840135611576816111c6565b91506040840135611586816111c6565b809150509250925092565b5f805f805f8060a087890312156115a6575f80fd5b86356115b1816111c6565b95506020870135945060408701356115c8816111c6565b9350606087013567ffffffffffffffff8111156115e3575f80fd5b6115ef89828a0161121c565b979a9699509497949695608090950135949350505050565b8051611612816111c6565b919050565b5f60208284031215611627575f80fd5b8151611542816111c6565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611665575f80fd5b83018035915067ffffffffffffffff82111561167f575f80fd5b60200191503681900382131561125a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff811182821017156116e3576116e3611693565b60405290565b604051610180810167ffffffffffffffff811182821017156116e3576116e3611693565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561175457611754611693565b604052919050565b5f602080838503121561176d575f80fd5b823567ffffffffffffffff80821115611784575f80fd5b9084019060808287031215611797575f80fd5b61179f6116c0565b82358152838301356117b0816111c6565b818501526040830135828111156117c5575f80fd5b8301601f810188136117d5575f80fd5b8035838111156117e7576117e7611693565b611817867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161170d565b9350808452888682840101111561182c575f80fd5b80868301878601375f8682860101525050816040820152606083013560608201528094505050505092915050565b5f6020828403121561186a575f80fd5b5051919050565b8051825273ffffffffffffffffffffffffffffffffffffffff60208201511660208301525f6040820151608060408501526118af60808501826114b1565b606093840151949093019390935250919050565b602081525f6115426020830184611871565b805163ffffffff81168114611612575f80fd5b80518015158114611612575f80fd5b5f6101808284031215611908575f80fd5b6119106116e9565b61191983611607565b815261192760208401611607565b602082015261193860408401611607565b6040820152606083015160608201526080830151608082015261195d60a084016118d5565b60a082015260c083015160c082015260e083015160e08201526101008084015181830152506101206119908185016118e8565b908201526101408381015190820152610160928301519281019290925250919050565b5f6101a06119c183866113ce565b8061018084015261151e81840185611871565b5f81518060208401855e5f93019283525090919050565b5f610fbe6119f983866119d4565b846119d4565b6020815273ffffffffffffffffffffffffffffffffffffffff8251166020820152602082015160408201525f6040830151606080840152610fbe60808401826114b1565b5f60208284031215611a53575f80fd5b611542826118e8565b5f61154282846119d4565b602081525f61154260208301846114b156fe610120604052348015610010575f80fd5b5060405161267838038061267883398101604081905261002f9161052f565b6001600160a01b03831660808190526040805163f698da2560e01b8152905163f698da259160048082019260209290919082900301815f875af1158015610078573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009c9190610579565b610100526100aa823361015f565b6100b4813361015f565b336001600160a01b031660e0816001600160a01b0316815250505f836001600160a01b0316639b552cc26040518163ffffffff1660e01b81526004016020604051808303815f875af115801561010c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101309190610590565b905061013c838261015f565b610146828261015f565b506001600160a01b0391821660a0521660c0525061061c565b6101746001600160a01b038316825f19610178565b5050565b8015806101f05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ee9190610579565b155b6102675760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526102bd9185916102c216565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201525f9061030e906001600160a01b03851690849061038d565b905080515f148061032e57508080602001905181019061032e91906105b2565b6102bd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025e565b606061039b84845f856103a3565b949350505050565b6060824710156104045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025e565b5f80866001600160a01b0316858760405161041f91906105d1565b5f6040518083038185875af1925050503d805f8114610459576040519150601f19603f3d011682016040523d82523d5f602084013e61045e565b606091505b5090925090506104708783838761047b565b979650505050505050565b606083156104e95782515f036104e2576001600160a01b0385163b6104e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025e565b508161039b565b61039b83838151156104fe5781518083602001fd5b8060405162461bcd60e51b815260040161025e91906105e7565b6001600160a01b038116811461052c575f80fd5b50565b5f805f60608486031215610541575f80fd5b835161054c81610518565b602085015190935061055d81610518565b604085015190925061056e81610518565b809150509250925092565b5f60208284031215610589575f80fd5b5051919050565b5f602082840312156105a0575f80fd5b81516105ab81610518565b9392505050565b5f602082840312156105c2575f80fd5b815180151581146105ab575f80fd5b5f82518060208501845e5f920191825250919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051611fbd6106bb5f395f81816102db015261042b01525f8181610236015281816104d90152610bf901525f81816102b40152818161059901528181610d5c01528181610ebf01528181610f8e015261100d01525f81816101380152818161057701528181610d3b01528181610e2801528181610f6b015261103001525f818161032201526112140152611fbd5ff3fe608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033a26469706673582212201190cf42f989cee23f12597c8c1e9daab6d8c816513349c3ce7fd229cae5b0ff64736f6c63430008190033", + "deployedBytecode": "0x608060405234801561000f575f80fd5b506004361061009f575f3560e01c806337ebdf5011610072578063666e1b3911610058578063666e1b391461014f578063ab221a7614610184578063b5c5f672146101ab575f80fd5b806337ebdf50146101295780635b5d9ee61461013c575f80fd5b80630efe6a8b146100a357806322b155c6146100b857806326e0a196146100f55780632791056514610116575b5f80fd5b6100b66100b13660046111ea565b6101be565b005b6100cb6100c6366004611261565b6102a3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101086101033660046112fb565b61045f565b6040516100ec9291906114fd565b6100b6610124366004611527565b610797565b6100cb610137366004611549565b61082f565b6100b661014a366004611591565b610a01565b6100cb61015d366004611527565b5f6020819052908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6100cb7f000000000000000000000000000000000000000000000000000000000000000081565b6100b66101b93660046111ea565b610b17565b61024f3384848673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102319190611617565b73ffffffffffffffffffffffffffffffffffffffff16929190610c46565b61029e3384838673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b505050565b5f33807f00000000000000000000000000000000000000000000000000000000000000008c8b6040516102d5906111b9565b73ffffffffffffffffffffffffffffffffffffffff9384168152918316602083015290911660408201526060018190604051809103905ff590508015801561031f573d5f803e3d5ffd5b506040805173ffffffffffffffffffffffffffffffffffffffff8e811682528c81166020830152929450828416928516917f6707255b2c5ca81220b2f3e408a269cb83baa6aa7e5e37aa1756883a6cdf06f1910160405180910390a373ffffffffffffffffffffffffffffffffffffffff8281165f90815260208190526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169183169190911790556103d8828b8a6101be565b5f60405180608001604052808981526020018873ffffffffffffffffffffffffffffffffffffffff16815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509082525060200185905290506104508382610cdb565b50509998505050505050505050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060306104cf6020890189611527565b73ffffffffffffffffffffffffffffffffffffffff1614610551576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f63616e206f6e6c792068616e646c65206f776e206f726465727300000000000060448201526064015b60405180910390fd5b5f61055f6040890189611632565b81019061056c919061175c565b90508873ffffffffffffffffffffffffffffffffffffffff1663eec50b976040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105db919061185a565b6040517fb09aaaca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b169063b09aaaca9061062d9085906004016118c3565b602060405180830381865afa158015610648573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061066c919061185a565b146106d3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f696e76616c69642074726164696e6720706172616d65746572730000000000006044820152606401610548565b6040517fe3e6f5b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a169063e3e6f5b2906107259084906004016118c3565b61018060405180830381865afa158015610741573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061076591906118f7565b9250828160405160200161077a9291906119b3565b604051602081830303815290604052915050965096945050505050565b73ffffffffffffffffffffffffffffffffffffffff8082165f9081526020819052604090205482911633146108225773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b61082b82610e05565b5050565b5f807fff000000000000000000000000000000000000000000000000000000000000003073ffffffffffffffffffffffffffffffffffffffff8716604051610879602082016111b9565b8181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09081018352601f90910116604081815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166020840152808b169183019190915288166060820152608001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261093a92916020016119eb565b604051602081830303815290604052805190602001206040516020016109c294939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660018401526015830152603582015260550190565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152919052805160209091012095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8087165f908152602081905260409020548791163314610a8c5773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b5f60405180608001604052808881526020018773ffffffffffffffffffffffffffffffffffffffff16815260200186868080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505050908252506020018490529050610b0388610e05565b610b0d8882610cdb565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8084165f908152602081905260409020548491163314610ba25773ffffffffffffffffffffffffffffffffffffffff8181165f90815260208190526040908190205490517f68bafff800000000000000000000000000000000000000000000000000000000815291166004820152602401610548565b610bf18433858773ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b610c408433848773ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561020d573d5f803e3d5ffd5b50505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610c40908590610ea3565b6040517fc5f3d25400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83169063c5f3d25490610d2d9084906004016118c3565b5f604051808303815f87803b158015610d44575f80fd5b505af1158015610d56573d5f803e3d5ffd5b5050604080516060810182523081525f6020808301829052835191955073ffffffffffffffffffffffffffffffffffffffff881694507f2cceac5555b0ca45a3744ced542f54b56ad2eb45e521962372eef212a2cbf36193830191610dbd918891016118c3565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152915251610df891906119ff565b60405180910390a2505050565b8073ffffffffffffffffffffffffffffffffffffffff166317700f016040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610e4a575f80fd5b505af1158015610e5c573d5f803e3d5ffd5b505060405173ffffffffffffffffffffffffffffffffffffffff841692507fc75bf4f03c02fab9414a7d7a54048c0486722bc72f33ad924709a0593608ad2791505f90a250565b5f610f04826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610fb09092919063ffffffff16565b905080515f1480610f24575080806020019051810190610f249190611a43565b61029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610548565b6060610fbe84845f85610fc6565b949350505050565b606082471015611058576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610548565b5f808673ffffffffffffffffffffffffffffffffffffffff1685876040516110809190611a5c565b5f6040518083038185875af1925050503d805f81146110ba576040519150601f19603f3d011682016040523d82523d5f602084013e6110bf565b606091505b50915091506110d0878383876110db565b979650505050505050565b606083156111705782515f036111695773ffffffffffffffffffffffffffffffffffffffff85163b611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610548565b5081610fbe565b610fbe83838151156111855781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489190611a67565b61267880611a7a83390190565b73ffffffffffffffffffffffffffffffffffffffff811681146111e7575f80fd5b50565b5f805f606084860312156111fc575f80fd5b8335611207816111c6565b95602085013595506040909401359392505050565b5f8083601f84011261122c575f80fd5b50813567ffffffffffffffff811115611243575f80fd5b60208301915083602082850101111561125a575f80fd5b9250929050565b5f805f805f805f805f6101008a8c03121561127a575f80fd5b8935611285816111c6565b985060208a0135975060408a013561129c816111c6565b965060608a0135955060808a0135945060a08a01356112ba816111c6565b935060c08a013567ffffffffffffffff8111156112d5575f80fd5b6112e18c828d0161121c565b9a9d999c50979a9699959894979660e00135949350505050565b5f805f805f8060808789031215611310575f80fd5b863561131b816111c6565b9550602087013567ffffffffffffffff80821115611337575f80fd5b908801906060828b03121561134a575f80fd5b9095506040880135908082111561135f575f80fd5b61136b8a838b0161121c565b90965094506060890135915080821115611383575f80fd5b818901915089601f830112611396575f80fd5b8135818111156113a4575f80fd5b8a60208260051b85010111156113b8575f80fd5b6020830194508093505050509295509295509295565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161140f602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040810151611437604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a081015161146360a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516114988285018215159052565b5050610140818101519083015261016090810151910152565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f6101a061150b83866113ce565b8061018084015261151e818401856114b1565b95945050505050565b5f60208284031215611537575f80fd5b8135611542816111c6565b9392505050565b5f805f6060848603121561155b575f80fd5b8335611566816111c6565b92506020840135611576816111c6565b91506040840135611586816111c6565b809150509250925092565b5f805f805f8060a087890312156115a6575f80fd5b86356115b1816111c6565b95506020870135945060408701356115c8816111c6565b9350606087013567ffffffffffffffff8111156115e3575f80fd5b6115ef89828a0161121c565b979a9699509497949695608090950135949350505050565b8051611612816111c6565b919050565b5f60208284031215611627575f80fd5b8151611542816111c6565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611665575f80fd5b83018035915067ffffffffffffffff82111561167f575f80fd5b60200191503681900382131561125a575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff811182821017156116e3576116e3611693565b60405290565b604051610180810167ffffffffffffffff811182821017156116e3576116e3611693565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561175457611754611693565b604052919050565b5f602080838503121561176d575f80fd5b823567ffffffffffffffff80821115611784575f80fd5b9084019060808287031215611797575f80fd5b61179f6116c0565b82358152838301356117b0816111c6565b818501526040830135828111156117c5575f80fd5b8301601f810188136117d5575f80fd5b8035838111156117e7576117e7611693565b611817867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161170d565b9350808452888682840101111561182c575f80fd5b80868301878601375f8682860101525050816040820152606083013560608201528094505050505092915050565b5f6020828403121561186a575f80fd5b5051919050565b8051825273ffffffffffffffffffffffffffffffffffffffff60208201511660208301525f6040820151608060408501526118af60808501826114b1565b606093840151949093019390935250919050565b602081525f6115426020830184611871565b805163ffffffff81168114611612575f80fd5b80518015158114611612575f80fd5b5f6101808284031215611908575f80fd5b6119106116e9565b61191983611607565b815261192760208401611607565b602082015261193860408401611607565b6040820152606083015160608201526080830151608082015261195d60a084016118d5565b60a082015260c083015160c082015260e083015160e08201526101008084015181830152506101206119908185016118e8565b908201526101408381015190820152610160928301519281019290925250919050565b5f6101a06119c183866113ce565b8061018084015261151e81840185611871565b5f81518060208401855e5f93019283525090919050565b5f610fbe6119f983866119d4565b846119d4565b6020815273ffffffffffffffffffffffffffffffffffffffff8251166020820152602082015160408201525f6040830151606080840152610fbe60808401826114b1565b5f60208284031215611a53575f80fd5b611542826118e8565b5f61154282846119d4565b602081525f61154260208301846114b156fe610120604052348015610010575f80fd5b5060405161267838038061267883398101604081905261002f9161052f565b6001600160a01b03831660808190526040805163f698da2560e01b8152905163f698da259160048082019260209290919082900301815f875af1158015610078573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061009c9190610579565b610100526100aa823361015f565b6100b4813361015f565b336001600160a01b031660e0816001600160a01b0316815250505f836001600160a01b0316639b552cc26040518163ffffffff1660e01b81526004016020604051808303815f875af115801561010c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101309190610590565b905061013c838261015f565b610146828261015f565b506001600160a01b0391821660a0521660c0525061061c565b6101746001600160a01b038316825f19610178565b5050565b8015806101f05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101ca573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ee9190610579565b155b6102675760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526102bd9185916102c216565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201525f9061030e906001600160a01b03851690849061038d565b905080515f148061032e57508080602001905181019061032e91906105b2565b6102bd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161025e565b606061039b84845f856103a3565b949350505050565b6060824710156104045760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161025e565b5f80866001600160a01b0316858760405161041f91906105d1565b5f6040518083038185875af1925050503d805f8114610459576040519150601f19603f3d011682016040523d82523d5f602084013e61045e565b606091505b5090925090506104708783838761047b565b979650505050505050565b606083156104e95782515f036104e2576001600160a01b0385163b6104e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161025e565b508161039b565b61039b83838151156104fe5781518083602001fd5b8060405162461bcd60e51b815260040161025e91906105e7565b6001600160a01b038116811461052c575f80fd5b50565b5f805f60608486031215610541575f80fd5b835161054c81610518565b602085015190935061055d81610518565b604085015190925061056e81610518565b809150509250925092565b5f60208284031215610589575f80fd5b5051919050565b5f602082840312156105a0575f80fd5b81516105ab81610518565b9392505050565b5f602082840312156105c2575f80fd5b815180151581146105ab575f80fd5b5f82518060208501845e5f920191825250919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b60805160a05160c05160e05161010051611fbd6106bb5f395f81816102db015261042b01525f8181610236015281816104d90152610bf901525f81816102b40152818161059901528181610d5c01528181610ebf01528181610f8e015261100d01525f81816101380152818161057701528181610d3b01528181610e2801528181610f6b015261103001525f818161032201526112140152611fbd5ff3fe608060405234801561000f575f80fd5b506004361061012f575f3560e01c8063b09aaaca116100ad578063e3e6f5b21161007d578063eec50b9711610063578063eec50b9714610344578063f14fcbc81461034c578063ff2dbc9814610203575f80fd5b8063e3e6f5b2146102fd578063e516715b1461031d575f80fd5b8063b09aaaca14610289578063c5f3d2541461029c578063d21220a7146102af578063d25e0cb6146102d6575f80fd5b80631c7de94111610102578063481c6a75116100e8578063481c6a7514610231578063981a160b14610258578063a029a8d414610276575f80fd5b80631c7de941146102035780633e706e321461020a575f80fd5b80630dfe1681146101335780631303a484146101845780631626ba7e146101b557806317700f01146101f9575b5f80fd5b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c5b60405190815260200161017b565b6101c86101c33660046116bf565b61035f565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161017b565b6102016104d7565b005b6101a75f81565b6101a77f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b59381565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b61026161012c81565b60405163ffffffff909116815260200161017b565b6102016102843660046119ee565b610573565b6101a7610297366004611a3b565b610bc8565b6102016102aa366004611a75565b610bf7565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f000000000000000000000000000000000000000000000000000000000000000081565b61031061030b366004611a3b565b610cb7565b60405161017b9190611aac565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6101a75f5481565b61020161035a366004611b9a565b6111fc565b5f808061036e84860186611bb1565b915091505f5461037d82610bc8565b146103b4576040517ff1a6789000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0820180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f190100000000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006002820152602281019190915260429020868114610494576040517f593fcacd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61049f818385611291565b6104a98284610573565b507f1626ba7e00000000000000000000000000000000000000000000000000000000925050505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610546576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8080556040517fbcb8b8fbdea8aa6dc4ae41213e4da81e605a3d1a56ed851b9355182321c091909190a1565b80517f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff808416911614610677578073ffffffffffffffffffffffffffffffffffffffff16835f015173ffffffffffffffffffffffffffffffffffffffff1614610675576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642073656c6c20746f6b656e000000000000000000000000000060448201526064015b60405180910390fd5b905b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa1580156106e1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107059190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610772573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107969190611bff565b90508273ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff1614610831576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642062757920746f6b656e000000000000000000000000000000604482015260640161066c565b604085015173ffffffffffffffffffffffffffffffffffffffff16156108b3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7265636569766572206d757374206265207a65726f2061646472657373000000604482015260640161066c565b6108bf61012c42611c43565b8560a0015163ffffffff161115610932576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f76616c696469747920746f6f2066617220696e20746865206675747572650000604482015260640161066c565b85606001518560c00151146109a3576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420617070446174610000000000000000000000000000000000604482015260640161066c565b60e085015115610a0f576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f66656520616d6f756e74206d757374206265207a65726f000000000000000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610160015114610a9d576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f627579546f6b656e42616c616e6365206d757374206265206572633230000000604482015260640161066c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc985610140015114610b2b576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f73656c6c546f6b656e42616c616e6365206d7573742062652065726332300000604482015260640161066c565b6060850151610b3a9082611c56565b60808601516060870151610b4e9085611c6d565b610b589190611c56565b1015610bc0576040517fc8fc272500000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f726563656976656420616d6f756e7420746f6f206c6f77000000000000000000604482015260640161066c565b505050505050565b5f81604051602001610bda9190611ccc565b604051602081830303815290604052805190602001209050919050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163314610c66576040517ff87d0d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610c7361029783611d27565b9050805f81905550807f510e4a4f76907c2d6158b343f7c4f2f597df385b727c26e9ef90e75093ace19a83604051610cab9190611d79565b60405180910390a25050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091525f80836020015173ffffffffffffffffffffffffffffffffffffffff1663355efdd97f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000087604001516040518463ffffffff1660e01b8152600401610d9e93929190611e3a565b6040805180830381865afa158015610db8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ddc9190611e72565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291935091505f90819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e919190611bff565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610f19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3d9190611bff565b90925090505f80808080610f518888611c56565b90505f610f5e8a88611c56565b90505f8282101561100b577f000000000000000000000000000000000000000000000000000000000000000096507f00000000000000000000000000000000000000000000000000000000000000009550610fd6610fbd60028b611ec1565b610fd184610fcc8e6002611c56565b611346565b61137e565b945061100185610fe6818d611c56565b610ff09085611c43565b610ffa8c8f611c56565b60016113cb565b9350849050611098565b7f000000000000000000000000000000000000000000000000000000000000000096507f0000000000000000000000000000000000000000000000000000000000000000955061106e61105f60028a611ec1565b610fd185610fcc8f6002611c56565b94506110928561107e818e611c56565b6110889086611c43565b610ffa8b8e611c56565b93508390505b8c518110156110df576110df6040518060400160405280601781526020017f74726164656420616d6f756e7420746f6f20736d616c6c000000000000000000815250611426565b6040518061018001604052808873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200161115661012c611466565b63ffffffff1681526020018e6060015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc98152509b505050505050505050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461126b576040517fbf84897700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b807f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935d50565b7f6c3c90245457060f6517787b2c4b8cf500ca889d2304af02043bd5b513e3b5935c8381146113405780156112f2576040517fdafbdd1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112fc84610cb7565b90506113088382611487565b61133e576040517fd9ff24c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b50505050565b5f82156113735781611359600185611c6d565b6113639190611ec1565b61136e906001611c43565b611375565b5f5b90505b92915050565b5f818310156113c5576113c56040518060400160405280601581526020017f7375627472616374696f6e20756e646572666c6f770000000000000000000000815250611426565b50900390565b5f806113d8868686611599565b905060018360028111156113ee576113ee611ed4565b14801561140a57505f848061140557611405611e94565b868809115b1561141d5761141a600182611c43565b90505b95945050505050565b611431436001611c43565b816040517f1fe8506e00000000000000000000000000000000000000000000000000000000815260040161066c929190611f01565b5f81806114738142611f19565b61147d9190611f3b565b6113789190611f63565b5f80825f015173ffffffffffffffffffffffffffffffffffffffff16845f015173ffffffffffffffffffffffffffffffffffffffff161490505f836020015173ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff161490505f846060015186606001511490505f856080015187608001511490505f8660a0015163ffffffff168860a0015163ffffffff161490505f8761010001518961010001511490505f88610120015115158a6101200151151514905086801561155e5750855b80156115675750845b80156115705750835b80156115795750825b80156115825750815b801561158b5750805b9a9950505050505050505050565b5f80807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff858709858702925082811083820303915050805f036115ef578382816115e5576115e5611e94565b04925050506104d0565b808411611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f770000000000000000000000604482015260640161066c565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f805f604084860312156116d1575f80fd5b83359250602084013567ffffffffffffffff808211156116ef575f80fd5b818601915086601f830112611702575f80fd5b813581811115611710575f80fd5b876020828501011115611721575f80fd5b6020830194508093505050509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040516080810167ffffffffffffffff8111828210171561178457611784611734565b60405290565b604051610180810167ffffffffffffffff8111828210171561178457611784611734565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117f5576117f5611734565b604052919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461181e575f80fd5b50565b5f60808284031215611831575f80fd5b611839611761565b90508135815260208083013561184e816117fd565b82820152604083013567ffffffffffffffff8082111561186c575f80fd5b818501915085601f83011261187f575f80fd5b81358181111561189157611891611734565b6118c1847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016117ae565b915080825286848285010111156118d6575f80fd5b80848401858401375f848284010152508060408501525050506060820135606082015292915050565b803561190a816117fd565b919050565b803563ffffffff8116811461190a575f80fd5b8035801515811461190a575f80fd5b5f6101808284031215611942575f80fd5b61194a61178a565b9050611955826118ff565b8152611963602083016118ff565b6020820152611974604083016118ff565b6040820152606082013560608201526080820135608082015261199960a0830161190f565b60a082015260c082013560c082015260e082013560e08201526101008083013581830152506101206119cc818401611922565b9082015261014082810135908201526101609182013591810191909152919050565b5f806101a08385031215611a00575f80fd5b823567ffffffffffffffff811115611a16575f80fd5b611a2285828601611821565b925050611a328460208501611931565b90509250929050565b5f60208284031215611a4b575f80fd5b813567ffffffffffffffff811115611a61575f80fd5b611a6d84828501611821565b949350505050565b5f60208284031215611a85575f80fd5b813567ffffffffffffffff811115611a9b575f80fd5b8201608081850312156104d0575f80fd5b815173ffffffffffffffffffffffffffffffffffffffff16815261018081016020830151611af2602084018273ffffffffffffffffffffffffffffffffffffffff169052565b506040830151611b1a604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606083015160608301526080830151608083015260a0830151611b4660a084018263ffffffff169052565b5060c083015160c083015260e083015160e083015261010080840151818401525061012080840151611b7b8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b5f60208284031215611baa575f80fd5b5035919050565b5f806101a08385031215611bc3575f80fd5b611bcd8484611931565b915061018083013567ffffffffffffffff811115611be9575f80fd5b611bf585828601611821565b9150509250929050565b5f60208284031215611c0f575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561137857611378611c16565b808202811582820484141761137857611378611c16565b8181038181111561137857611378611c16565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201525f604083015160806060840152611d1160a0840182611c80565b9050606084015160808401528091505092915050565b5f6113783683611821565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152813560208201525f6020830135611d93816117fd565b73ffffffffffffffffffffffffffffffffffffffff811660408401525060408301357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611de4575f80fd5b830160208101903567ffffffffffffffff811115611e00575f80fd5b803603821315611e0e575f80fd5b60806060850152611e2360a085018284611d32565b915050606084013560808401528091505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261141d6060830184611c80565b5f8060408385031215611e83575f80fd5b505080516020909101519092909150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82611ecf57611ecf611e94565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b828152604060208201525f611a6d6040830184611c80565b5f63ffffffff80841680611f2f57611f2f611e94565b92169190910492915050565b63ffffffff818116838216028082169190828114611f5b57611f5b611c16565b505092915050565b63ffffffff818116838216019080821115611f8057611f80611c16565b509291505056fea2646970667358221220e3fb228b525d90b942c7e58fe2e2034a17bd258c082fd47740e764a7be45bac664736f6c63430008190033a26469706673582212201190cf42f989cee23f12597c8c1e9daab6d8c816513349c3ce7fd229cae5b0ff64736f6c63430008190033", + "methodIdentifiers": { + "ammDeterministicAddress(address,address,address)": "37ebdf50", + "create(address,uint256,address,uint256,uint256,address,bytes,bytes32)": "22b155c6", + "deposit(address,uint256,uint256)": "0efe6a8b", + "disableTrading(address)": "27910565", + "getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])": "26e0a196", + "owner(address)": "666e1b39", + "settler()": "ab221a76", + "updateParameters(address,uint256,address,bytes,bytes32)": "5b5d9ee6", + "withdraw(address,uint256,uint256)": "b5c5f672" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"_settler\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OnlyOwnerCanCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"OrderNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IConditionalOrder\",\"name\":\"handler\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"staticInput\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct IConditionalOrder.ConditionalOrderParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"ConditionalOrderCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"token0\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"Deployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"TradingDisabled\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ammOwner\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"ammDeterministicAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"disableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IConditionalOrder\",\"name\":\"handler\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"staticInput\",\"type\":\"bytes\"}],\"internalType\":\"struct IConditionalOrder.ConditionalOrderParams\",\"name\":\"params\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"name\":\"getTradeableOrderWithSignature\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"order\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settler\",\"outputs\":[{\"internalType\":\"contract ISettlement\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minTradedToken0\",\"type\":\"uint256\"},{\"internalType\":\"contract IPriceOracle\",\"name\":\"priceOracle\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"priceOracleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"}],\"name\":\"updateParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ConstantProduct\",\"name\":\"amm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CoW Protocol Developers\",\"details\":\"Factory contract for the CoW AMM, an automated market maker based on the concept of function-maximising AMMs. The factory deploys new AMM and is responsible for managing deposits, enabling/disabling trading and updating trade parameters.\",\"errors\":{\"OnlyOwnerCanCall(address)\":[{\"params\":{\"owner\":\"The owner of the AMM.\"}}],\"OrderNotValid(string)\":[{\"details\":\"This error is returned by the `getTradeableOrder` function if the order condition is not met. A parameter of `string` type is included to allow the caller to specify the reason for the failure.\"}]},\"events\":{\"Deployed(address,address,address,address)\":{\"params\":{\"amm\":\"The address of the AMM that can now trade on CoW Protocol.\",\"owner\":\"The owner of the AMM.\",\"token0\":\"The first token traded by the AMM.\",\"token1\":\"The second token traded by the AMM.\"}},\"TradingDisabled(address)\":{\"params\":{\"amm\":\"The address of the AMM that stops trading on CoW Protocol.\"}}},\"kind\":\"dev\",\"methods\":{\"ammDeterministicAddress(address,address,address)\":{\"params\":{\"ammOwner\":\"The (expected) owner of the AMM.\",\"token0\":\"The address of the first token traded by the AMM.\",\"token1\":\"The address of the second token traded by the AMM.\"},\"returns\":{\"_0\":\"The deterministic address at which this contract deploys a CoW AMM for the specified input parameters.\"}},\"constructor\":{\"params\":{\"_settler\":\"The address of the GPv2Settlement contract.\"}},\"create(address,uint256,address,uint256,uint256,address,bytes,bytes32)\":{\"params\":{\"amount0\":\"The initial amount of the first token in the pair.\",\"amount1\":\"The initial amount of the second token in the pair.\",\"appData\":\"The app data to pass to the AMM.\",\"minTradedToken0\":\"The minimum amount of token0 before the AMM attempts auto-rebalance.\",\"priceOracle\":\"The address of the price oracle to use for the AMM.\",\"priceOracleData\":\"The data to pass to the price oracle.\",\"token0\":\"The address of the first token in the pair.\",\"token1\":\"The address of the second token in the pair.\"},\"returns\":{\"amm\":\"The address of the newly deployed AMM.\"}},\"deposit(address,uint256,uint256)\":{\"params\":{\"amm\":\"the AMM where to send the funds\",\"amount0\":\"amount of AMM's token0 to deposit\",\"amount1\":\"amount of AMM's token1 to deposit\"}},\"disableTrading(address)\":{\"params\":{\"amm\":\"The AMM for which to disable trading.\"}},\"getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])\":{\"details\":\"Some parameters are unused as they refer to features of ComposableCoW that aren't implemented in this contract. They are still needed to let the watchtower interact with this contract in the same way as ComposableCoW.\",\"params\":{\"amm\":\"owner of the order.\",\"params\":\"`ConditionalOrderParams` for the order; precisely, the handler must be this contract, the salt can be any value, and the static input must be the current trading parameters of the AMM.\"},\"returns\":{\"order\":\"discrete order for submitting to CoW Protocol API\",\"signature\":\"for submitting to CoW Protocol API\"}},\"updateParameters(address,uint256,address,bytes,bytes32)\":{\"params\":{\"amm\":\"The address of the AMM whose parameters to change.\",\"appData\":\"The app data to pass to the AMM.\",\"minTradedToken0\":\"The minimum amount of token0 before the AMM attempts auto-rebalance.\",\"priceOracle\":\"The address of the price oracle to use for the AMM.\",\"priceOracleData\":\"The data to pass to the price oracle.\"}},\"withdraw(address,uint256,uint256)\":{\"params\":{\"amm\":\"the AMM whose funds to withdraw\",\"amount0\":\"amount of AMM's token0 to withdraw\",\"amount1\":\"amount of AMM's token1 to withdraw\"}}},\"title\":\"CoW AMM Factory\",\"version\":1},\"userdoc\":{\"errors\":{\"OnlyOwnerCanCall(address)\":[{\"notice\":\"This function is permissioned and can only be called by the owner of the AMM that is involved in the transaction.\"}]},\"events\":{\"Deployed(address,address,address,address)\":{\"notice\":\"A CoW AMM has been created. The emitted AMM parameters are immutable for the new AMM.\"},\"TradingDisabled(address)\":{\"notice\":\"A CoW AMM stopped trading; no CoW Protocol orders can be settled until trading is enabled again.\"}},\"kind\":\"user\",\"methods\":{\"ammDeterministicAddress(address,address,address)\":{\"notice\":\"Computes the determinisitic address of a CoW AMM deployment.\"},\"create(address,uint256,address,uint256,uint256,address,bytes,bytes32)\":{\"notice\":\"Creates a new CoW AMM with the specified imput parameters.\"},\"deposit(address,uint256,uint256)\":{\"notice\":\"Deposit sender's funds into the the AMM contract, assuming that the sender has approved this contract to spend both tokens.\"},\"disableTrading(address)\":{\"notice\":\"Disable trading for an AMM managed by this contract.\"},\"getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])\":{\"notice\":\"This function exists to let the watchtower off-chain service automatically create AMM orders and post them on the orderbook. It outputs an order for the input AMM together with a valid signature.\"},\"owner(address)\":{\"notice\":\"For each AMM created by this contract, this mapping stores its owner.\"},\"settler()\":{\"notice\":\"The settlement contract for CoW Protocol on this network.\"},\"updateParameters(address,uint256,address,bytes,bytes32)\":{\"notice\":\"Change the parameters used for trading on the specified AMM. Only a single order per AMM can be valid at a time, meaning that any previous order stops being tradeable.\"},\"withdraw(address,uint256,uint256)\":{\"notice\":\"Take funds from the AMM and sends them to the owner.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ConstantProductFactory.sol\":\"ConstantProductFactory\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/\",\":balancer/=lib/composable-cow/lib/balancer/src/\",\":canonical-weth/=lib/composable-cow/lib/canonical-weth/src/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/\",\":math/=lib/composable-cow/lib/balancer/src/lib/math/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol\":{\"keccak256\":\"0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f\",\"dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol\":{\"keccak256\":\"0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d\",\"dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg\"]},\"lib/composable-cow/lib/safe/contracts/Safe.sol\":{\"keccak256\":\"0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119\",\"dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9\"]},\"lib/composable-cow/lib/safe/contracts/base/Executor.sol\":{\"keccak256\":\"0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c\",\"dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp\"]},\"lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol\":{\"keccak256\":\"0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e\",\"dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV\"]},\"lib/composable-cow/lib/safe/contracts/base/GuardManager.sol\":{\"keccak256\":\"0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64\",\"dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx\"]},\"lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol\":{\"keccak256\":\"0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d\",\"dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz\"]},\"lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol\":{\"keccak256\":\"0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a\",\"dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK\"]},\"lib/composable-cow/lib/safe/contracts/common/Enum.sol\":{\"keccak256\":\"0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34\",\"dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo\"]},\"lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol\":{\"keccak256\":\"0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9\",\"dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g\"]},\"lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol\":{\"keccak256\":\"0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3\",\"dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N\"]},\"lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol\":{\"keccak256\":\"0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3\",\"dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu\"]},\"lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol\":{\"keccak256\":\"0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80\",\"dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4\"]},\"lib/composable-cow/lib/safe/contracts/common/Singleton.sol\":{\"keccak256\":\"0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde\",\"dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo\"]},\"lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol\":{\"keccak256\":\"0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e\",\"dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ\"]},\"lib/composable-cow/lib/safe/contracts/external/SafeMath.sol\":{\"keccak256\":\"0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c\",\"dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x\"]},\"lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol\":{\"keccak256\":\"0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515\",\"dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV\"]},\"lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol\":{\"keccak256\":\"0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4\",\"dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/Base.sol\":{\"keccak256\":\"0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9\",\"dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol\":{\"keccak256\":\"0x6e19ba1deb09a34cca28891bfefd853697b808dfb8a9cddd4051d3058d3eb718\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://0b1059e752bd142160a4fbe8ee08377a50902d31b8b909df002480d191af0cf4\",\"dweb:/ipfs/QmbuUmvgoodsZGgqR793duEWF5t7h6USAXfpr2N1VvBmeP\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol\":{\"keccak256\":\"0xbe7db6cbdb034c9aee1eae12200ab2e94fa4743ae08dbba2f1a001c4b62f3e0b\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://4fbba0ea04349873b38f7c7104d0a88ffd6e7ec399a3fdd0e1297ce12eebb19e\",\"dweb:/ipfs/QmYiDukcX2y7ratxsMX6hLMKzGQTD67CKLpuiSpgm1HGue\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol\":{\"keccak256\":\"0x531476118b7948b06a0c7094badd6f1ae33ae2ddca815110030e87ee62c4a895\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f21ad2619b5bcbc977c5943d2f668e8bfb9ef6968db1193415e046171a5a150a\",\"dweb:/ipfs/QmYZeu3vr6eRWjeYp8GvWSVRLm9baFbTyEGgAy2hMAqbLX\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol\":{\"keccak256\":\"0xc60a1d55ff0cf532a44bd864683719e3d6e1fa6d20d4c77812e21c33afecf304\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://298c7efe668a4ca8d3b712770973931d604c84304aececd621f0350d7d293b68\",\"dweb:/ipfs/QmVcNdQ7ZsnmDgSX8TFRLHk4HZUXH86u2akAM5q3g1PFfZ\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol\":{\"keccak256\":\"0xfb0f8f01a7191ab358f196a7e055441ede00f36805f12c579a742a5cd3c4f8d7\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://0d485ea9fc430a89953ffe2d2c7032b5a330f086bbb784e81eb6b00a692f6438\",\"dweb:/ipfs/QmNofKrkU9VTtGMN9Rc6js2jyUscSFxce8kjBz5rZL4RSJ\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol\":{\"keccak256\":\"0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c\",\"dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol\":{\"keccak256\":\"0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c\",\"dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89\",\"dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol\":{\"keccak256\":\"0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25\",\"dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978\"]},\"lib/composable-cow/src/BaseConditionalOrder.sol\":{\"keccak256\":\"0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402\",\"dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v\"]},\"lib/composable-cow/src/ComposableCoW.sol\":{\"keccak256\":\"0x565c6fabc8a1e185acfb4539baeb7e3cabb004b54da2c777cbdbb3c98dbd6a52\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://2b876b6b4a69f69b7f9445e67a0e60dd7a65f028d54ba9c4c8c983a00ee23642\",\"dweb:/ipfs/Qmf95tsR515WFv2yBKp4NzhFc9xvfZRtS194Lq7SY2r7zC\"]},\"lib/composable-cow/src/interfaces/IConditionalOrder.sol\":{\"keccak256\":\"0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699\",\"dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ\"]},\"lib/composable-cow/src/interfaces/ISwapGuard.sol\":{\"keccak256\":\"0x60abdef709d22cb95e4b1d4680cb70d5286cfb5aa71ec65868cc44164ef8790f\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7593245e22ffc533a073891affdbb003fa56eaa5ef7f0202a673b52968ad7ed5\",\"dweb:/ipfs/QmRhAvNzbHp8qfrw7eHZP6EDWw42tXMXSV3KuyhyxFy3Nx\"]},\"lib/composable-cow/src/interfaces/IValueFactory.sol\":{\"keccak256\":\"0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de\",\"dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih\"]},\"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol\":{\"keccak256\":\"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777\",\"dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf\"]},\"lib/composable-cow/src/vendored/CoWSettlement.sol\":{\"keccak256\":\"0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840\",\"dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR\"]},\"lib/openzeppelin/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e\",\"dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng\"]},\"lib/openzeppelin/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45\",\"dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq\"]},\"lib/openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5\",\"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53\"]},\"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a\",\"dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv\"]},\"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68\",\"dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS\"]},\"lib/openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931\",\"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm\"]},\"lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0xcf688741f79f4838d5301dcf72d0af9eff11bbab6ab0bb112ad144c7fb672dac\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://85d9c87a481fe99fd28a146c205da0867ef7e1b7edbe0036abc86d2e64eb1f04\",\"dweb:/ipfs/QmR7m1zWQNfZHUKTtqnjoCjCBbNFcjCxV27rxf6iMfhVtG\"]},\"lib/openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c\",\"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS\"]},\"src/ConstantProduct.sol\":{\"keccak256\":\"0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085\",\"dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf\"]},\"src/ConstantProductFactory.sol\":{\"keccak256\":\"0xab972f93d38a733f8608bbf139b4991de9a184a7f727d4e965ed1702d25682c3\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1235406c1be8486952fec59b6b8ad3e23e3d4bd0891b32b58a87e31ae3bb5ec3\",\"dweb:/ipfs/QmbonoF2yhCqC8tiqS84oaYFkhBHQYGgqmbxexBc82VUco\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/interfaces/ISettlement.sol\":{\"keccak256\":\"0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd\",\"dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq\"]},\"src/interfaces/IWatchtowerCustomErrors.sol\":{\"keccak256\":\"0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a\",\"dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.25+commit.b61c2a91" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "contract ISettlement", + "name": "_settler", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "type": "error", + "name": "OnlyOwnerCanCall" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "type": "error", + "name": "OrderNotValid" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address", + "indexed": true + }, + { + "internalType": "struct IConditionalOrder.ConditionalOrderParams", + "name": "params", + "type": "tuple", + "components": [ + { + "internalType": "contract IConditionalOrder", + "name": "handler", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "staticInput", + "type": "bytes" + } + ], + "indexed": false + } + ], + "type": "event", + "name": "ConditionalOrderCreated", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address", + "indexed": true + }, + { + "internalType": "address", + "name": "owner", + "type": "address", + "indexed": true + }, + { + "internalType": "contract IERC20", + "name": "token0", + "type": "address", + "indexed": false + }, + { + "internalType": "contract IERC20", + "name": "token1", + "type": "address", + "indexed": false + } + ], + "type": "event", + "name": "Deployed", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address", + "indexed": true + } + ], + "type": "event", + "name": "TradingDisabled", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ammOwner", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "token0", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "token1", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "ammDeterministicAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token0", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "token1", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "create", + "outputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address" + } + ] + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit" + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "disableTrading" + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address" + }, + { + "internalType": "struct IConditionalOrder.ConditionalOrderParams", + "name": "params", + "type": "tuple", + "components": [ + { + "internalType": "contract IConditionalOrder", + "name": "handler", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "staticInput", + "type": "bytes" + } + ] + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function", + "name": "getTradeableOrderWithSignature", + "outputs": [ + { + "internalType": "struct GPv2Order.Data", + "name": "order", + "type": "tuple", + "components": [ + { + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "sellTokenBalance", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "buyTokenBalance", + "type": "bytes32" + } + ] + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ] + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "settler", + "outputs": [ + { + "internalType": "contract ISettlement", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minTradedToken0", + "type": "uint256" + }, + { + "internalType": "contract IPriceOracle", + "name": "priceOracle", + "type": "address" + }, + { + "internalType": "bytes", + "name": "priceOracleData", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "updateParameters" + }, + { + "inputs": [ + { + "internalType": "contract ConstantProduct", + "name": "amm", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw" + } + ], + "devdoc": { + "kind": "dev", + "methods": { + "ammDeterministicAddress(address,address,address)": { + "params": { + "ammOwner": "The (expected) owner of the AMM.", + "token0": "The address of the first token traded by the AMM.", + "token1": "The address of the second token traded by the AMM." + }, + "returns": { + "_0": "The deterministic address at which this contract deploys a CoW AMM for the specified input parameters." + } + }, + "constructor": { + "params": { + "_settler": "The address of the GPv2Settlement contract." + } + }, + "create(address,uint256,address,uint256,uint256,address,bytes,bytes32)": { + "params": { + "amount0": "The initial amount of the first token in the pair.", + "amount1": "The initial amount of the second token in the pair.", + "appData": "The app data to pass to the AMM.", + "minTradedToken0": "The minimum amount of token0 before the AMM attempts auto-rebalance.", + "priceOracle": "The address of the price oracle to use for the AMM.", + "priceOracleData": "The data to pass to the price oracle.", + "token0": "The address of the first token in the pair.", + "token1": "The address of the second token in the pair." + }, + "returns": { + "amm": "The address of the newly deployed AMM." + } + }, + "deposit(address,uint256,uint256)": { + "params": { + "amm": "the AMM where to send the funds", + "amount0": "amount of AMM's token0 to deposit", + "amount1": "amount of AMM's token1 to deposit" + } + }, + "disableTrading(address)": { + "params": { + "amm": "The AMM for which to disable trading." + } + }, + "getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])": { + "details": "Some parameters are unused as they refer to features of ComposableCoW that aren't implemented in this contract. They are still needed to let the watchtower interact with this contract in the same way as ComposableCoW.", + "params": { + "amm": "owner of the order.", + "params": "`ConditionalOrderParams` for the order; precisely, the handler must be this contract, the salt can be any value, and the static input must be the current trading parameters of the AMM." + }, + "returns": { + "order": "discrete order for submitting to CoW Protocol API", + "signature": "for submitting to CoW Protocol API" + } + }, + "updateParameters(address,uint256,address,bytes,bytes32)": { + "params": { + "amm": "The address of the AMM whose parameters to change.", + "appData": "The app data to pass to the AMM.", + "minTradedToken0": "The minimum amount of token0 before the AMM attempts auto-rebalance.", + "priceOracle": "The address of the price oracle to use for the AMM.", + "priceOracleData": "The data to pass to the price oracle." + } + }, + "withdraw(address,uint256,uint256)": { + "params": { + "amm": "the AMM whose funds to withdraw", + "amount0": "amount of AMM's token0 to withdraw", + "amount1": "amount of AMM's token1 to withdraw" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "ammDeterministicAddress(address,address,address)": { + "notice": "Computes the determinisitic address of a CoW AMM deployment." + }, + "create(address,uint256,address,uint256,uint256,address,bytes,bytes32)": { + "notice": "Creates a new CoW AMM with the specified imput parameters." + }, + "deposit(address,uint256,uint256)": { + "notice": "Deposit sender's funds into the the AMM contract, assuming that the sender has approved this contract to spend both tokens." + }, + "disableTrading(address)": { + "notice": "Disable trading for an AMM managed by this contract." + }, + "getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])": { + "notice": "This function exists to let the watchtower off-chain service automatically create AMM orders and post them on the orderbook. It outputs an order for the input AMM together with a valid signature." + }, + "owner(address)": { + "notice": "For each AMM created by this contract, this mapping stores its owner." + }, + "settler()": { + "notice": "The settlement contract for CoW Protocol on this network." + }, + "updateParameters(address,uint256,address,bytes,bytes32)": { + "notice": "Change the parameters used for trading on the specified AMM. Only a single order per AMM can be valid at a time, meaning that any previous order stops being tradeable." + }, + "withdraw(address,uint256,uint256)": { + "notice": "Take funds from the AMM and sends them to the owner." + } + }, + "version": 1 + } + }, + "settings": { + "remappings": [ + "@openzeppelin/=lib/composable-cow/lib/@openzeppelin/", + "@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/", + "balancer/=lib/composable-cow/lib/balancer/src/", + "canonical-weth/=lib/composable-cow/lib/canonical-weth/src/", + "composable-cow/=lib/composable-cow/", + "cowprotocol/=lib/composable-cow/lib/cowprotocol/", + "ds-test/=lib/forge-std/lib/ds-test/src/", + "erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/", + "forge-std/=lib/forge-std/src/", + "helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/", + "math/=lib/composable-cow/lib/balancer/src/lib/math/", + "murky/=lib/composable-cow/lib/murky/src/", + "openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/", + "openzeppelin/=lib/openzeppelin/", + "safe/=lib/composable-cow/lib/safe/", + "uniswap-v2-core/=lib/uniswap-v2-core/contracts/", + "lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/", + "lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/", + "lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/", + "lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/" + ], + "optimizer": { + "enabled": true, + "runs": 100000 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/ConstantProductFactory.sol": "ConstantProductFactory" + }, + "evmVersion": "cancun", + "libraries": {} + }, + "sources": { + "lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol": { + "keccak256": "0xb950f05f76ac8044b82314ea5510941fdbc0f0e76e7f159023d435652b429528", + "urls": [ + "bzz-raw://c081155e1b18c060aaab781b4887744413efffdfc55ce190db45c321444f165f", + "dweb:/ipfs/QmbK3Qu7ZgwBfx2Es5EQcvG6q2srkHjzfNK2ziQ4ojxLSF" + ], + "license": "LGPL-3.0-or-later" + }, + "lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol": { + "keccak256": "0xffd0cc3de3209aa38045d57def570ccbde028a39a54b00c696dbe19f4f6d7f9f", + "urls": [ + "bzz-raw://5714a47cae551d3364bfc6a753d92822b29d277298e55942a2814ed1e2afd87d", + "dweb:/ipfs/QmS2G8ftdhk11qoSYHX8twZK5vFArhcnVVe6gy5UGTvXmg" + ], + "license": "LGPL-3.0-or-later" + }, + "lib/composable-cow/lib/safe/contracts/Safe.sol": { + "keccak256": "0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638", + "urls": [ + "bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119", + "dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/Executor.sol": { + "keccak256": "0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a", + "urls": [ + "bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c", + "dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol": { + "keccak256": "0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165", + "urls": [ + "bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e", + "dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/GuardManager.sol": { + "keccak256": "0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d", + "urls": [ + "bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64", + "dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol": { + "keccak256": "0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a", + "urls": [ + "bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d", + "dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol": { + "keccak256": "0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c", + "urls": [ + "bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a", + "dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/Enum.sol": { + "keccak256": "0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453", + "urls": [ + "bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34", + "dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol": { + "keccak256": "0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba", + "urls": [ + "bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9", + "dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol": { + "keccak256": "0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05", + "urls": [ + "bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3", + "dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol": { + "keccak256": "0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13", + "urls": [ + "bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3", + "dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol": { + "keccak256": "0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c", + "urls": [ + "bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80", + "dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/Singleton.sol": { + "keccak256": "0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50", + "urls": [ + "bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde", + "dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol": { + "keccak256": "0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e", + "urls": [ + "bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e", + "dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/external/SafeMath.sol": { + "keccak256": "0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89", + "urls": [ + "bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c", + "dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol": { + "keccak256": "0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9", + "urls": [ + "bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515", + "dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol": { + "keccak256": "0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5", + "urls": [ + "bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4", + "dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/Base.sol": { + "keccak256": "0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15", + "urls": [ + "bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9", + "dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol": { + "keccak256": "0x6e19ba1deb09a34cca28891bfefd853697b808dfb8a9cddd4051d3058d3eb718", + "urls": [ + "bzz-raw://0b1059e752bd142160a4fbe8ee08377a50902d31b8b909df002480d191af0cf4", + "dweb:/ipfs/QmbuUmvgoodsZGgqR793duEWF5t7h6USAXfpr2N1VvBmeP" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol": { + "keccak256": "0xbe7db6cbdb034c9aee1eae12200ab2e94fa4743ae08dbba2f1a001c4b62f3e0b", + "urls": [ + "bzz-raw://4fbba0ea04349873b38f7c7104d0a88ffd6e7ec399a3fdd0e1297ce12eebb19e", + "dweb:/ipfs/QmYiDukcX2y7ratxsMX6hLMKzGQTD67CKLpuiSpgm1HGue" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol": { + "keccak256": "0x531476118b7948b06a0c7094badd6f1ae33ae2ddca815110030e87ee62c4a895", + "urls": [ + "bzz-raw://f21ad2619b5bcbc977c5943d2f668e8bfb9ef6968db1193415e046171a5a150a", + "dweb:/ipfs/QmYZeu3vr6eRWjeYp8GvWSVRLm9baFbTyEGgAy2hMAqbLX" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol": { + "keccak256": "0xc60a1d55ff0cf532a44bd864683719e3d6e1fa6d20d4c77812e21c33afecf304", + "urls": [ + "bzz-raw://298c7efe668a4ca8d3b712770973931d604c84304aececd621f0350d7d293b68", + "dweb:/ipfs/QmVcNdQ7ZsnmDgSX8TFRLHk4HZUXH86u2akAM5q3g1PFfZ" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol": { + "keccak256": "0xfb0f8f01a7191ab358f196a7e055441ede00f36805f12c579a742a5cd3c4f8d7", + "urls": [ + "bzz-raw://0d485ea9fc430a89953ffe2d2c7032b5a330f086bbb784e81eb6b00a692f6438", + "dweb:/ipfs/QmNofKrkU9VTtGMN9Rc6js2jyUscSFxce8kjBz5rZL4RSJ" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol": { + "keccak256": "0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493", + "urls": [ + "bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c", + "dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol": { + "keccak256": "0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479", + "urls": [ + "bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c", + "dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol": { + "keccak256": "0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb", + "urls": [ + "bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89", + "dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol": { + "keccak256": "0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457", + "urls": [ + "bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25", + "dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/src/BaseConditionalOrder.sol": { + "keccak256": "0x510558386b92b1d5961d8158ae6e3288a1d520c03123d109042a5ec3290b9588", + "urls": [ + "bzz-raw://e071465250cbc11d946f422f4ff774d757291cac00f4c69fbac1d1e34cdae402", + "dweb:/ipfs/QmUF2qNwJhvs3GeWmsWnL6y21eL6mb3QEW7EPYY7NZc25v" + ], + "license": "MIT" + }, + "lib/composable-cow/src/ComposableCoW.sol": { + "keccak256": "0x565c6fabc8a1e185acfb4539baeb7e3cabb004b54da2c777cbdbb3c98dbd6a52", + "urls": [ + "bzz-raw://2b876b6b4a69f69b7f9445e67a0e60dd7a65f028d54ba9c4c8c983a00ee23642", + "dweb:/ipfs/Qmf95tsR515WFv2yBKp4NzhFc9xvfZRtS194Lq7SY2r7zC" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/interfaces/IConditionalOrder.sol": { + "keccak256": "0x52c9a2b5d5cc7345fe4b4c039af88c5621bc7c6059534cc7c76b77833aafae7b", + "urls": [ + "bzz-raw://1660e1510b82216e38b669f16b69f4a37b012b00655d0fc6794e4d77d2182699", + "dweb:/ipfs/QmNiZ7rMT74sKT9d6SUEnKXiWjaYLL8nAzSdLBXBAzYNmZ" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/interfaces/ISwapGuard.sol": { + "keccak256": "0x60abdef709d22cb95e4b1d4680cb70d5286cfb5aa71ec65868cc44164ef8790f", + "urls": [ + "bzz-raw://7593245e22ffc533a073891affdbb003fa56eaa5ef7f0202a673b52968ad7ed5", + "dweb:/ipfs/QmRhAvNzbHp8qfrw7eHZP6EDWw42tXMXSV3KuyhyxFy3Nx" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/interfaces/IValueFactory.sol": { + "keccak256": "0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122", + "urls": [ + "bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de", + "dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol": { + "keccak256": "0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae", + "urls": [ + "bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777", + "dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf" + ], + "license": "MIT" + }, + "lib/composable-cow/src/vendored/CoWSettlement.sol": { + "keccak256": "0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7", + "urls": [ + "bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840", + "dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/interfaces/IERC1271.sol": { + "keccak256": "0x0705a4b1b86d7b0bd8432118f226ba139c44b9dcaba0a6eafba2dd7d0639c544", + "urls": [ + "bzz-raw://c45b821ef9e882e57c256697a152e108f0f2ad6997609af8904cae99c9bd422e", + "dweb:/ipfs/QmRKCJW6jjzR5UYZcLpGnhEJ75UVbH6EHkEa49sWx2SKng" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/interfaces/IERC20.sol": { + "keccak256": "0x6ebf1944ab804b8660eb6fc52f9fe84588cee01c2566a69023e59497e7d27f45", + "urls": [ + "bzz-raw://2900536cdadec954ced8789a9d1ed4b5e640029e1424e91fd5b88026486f4d45", + "dweb:/ipfs/QmUMUX7CuYoiHvFkhifqtXGaciw2wnm4t9sAoPzETZ3Gbq" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/IERC20.sol": { + "keccak256": "0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305", + "urls": [ + "bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5", + "dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { + "keccak256": "0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a", + "urls": [ + "bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a", + "dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "keccak256": "0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1", + "urls": [ + "bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68", + "dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/Address.sol": { + "keccak256": "0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa", + "urls": [ + "bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931", + "dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol": { + "keccak256": "0xcf688741f79f4838d5301dcf72d0af9eff11bbab6ab0bb112ad144c7fb672dac", + "urls": [ + "bzz-raw://85d9c87a481fe99fd28a146c205da0867ef7e1b7edbe0036abc86d2e64eb1f04", + "dweb:/ipfs/QmR7m1zWQNfZHUKTtqnjoCjCBbNFcjCxV27rxf6iMfhVtG" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/math/Math.sol": { + "keccak256": "0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3", + "urls": [ + "bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c", + "dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS" + ], + "license": "MIT" + }, + "src/ConstantProduct.sol": { + "keccak256": "0x51571c926c65861736c96ca0396e4d806d7d04e32608ed8567f1deb86d85c115", + "urls": [ + "bzz-raw://6ac849b37d6791a1e4f52295720cb6771044c45b613f1308a438e5294ddff085", + "dweb:/ipfs/QmeftQAdXrQcbL9oV3LaTENX65jjFnGk6zV1oPn4kGfqBf" + ], + "license": "GPL-3.0" + }, + "src/ConstantProductFactory.sol": { + "keccak256": "0xab972f93d38a733f8608bbf139b4991de9a184a7f727d4e965ed1702d25682c3", + "urls": [ + "bzz-raw://1235406c1be8486952fec59b6b8ad3e23e3d4bd0891b32b58a87e31ae3bb5ec3", + "dweb:/ipfs/QmbonoF2yhCqC8tiqS84oaYFkhBHQYGgqmbxexBc82VUco" + ], + "license": "GPL-3.0" + }, + "src/interfaces/IPriceOracle.sol": { + "keccak256": "0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e", + "urls": [ + "bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2", + "dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu" + ], + "license": "GPL-3.0" + }, + "src/interfaces/ISettlement.sol": { + "keccak256": "0x2d7d80f9b93937afe43cd481ed42741055110a24883f3aeda9a96009af638661", + "urls": [ + "bzz-raw://b4df5b8642906abbf703364abf9d494ab5009e3cd26cf984333d6ebcdec472cd", + "dweb:/ipfs/QmWifdZWnqVYHEYR2VttRpJdya97AayMExaMmEaFVByKQq" + ], + "license": "GPL-3.0" + }, + "src/interfaces/IWatchtowerCustomErrors.sol": { + "keccak256": "0x2dabcdecbfb1d6f50d7281797703afd9f30f580e9124b395f653a509b3c53611", + "urls": [ + "bzz-raw://8af90375b167d9a1b414c5524a0d5c06659848c6b7747ed3299861b723bce70a", + "dweb:/ipfs/QmZxan4Ln1Yaau6nXRSXvkUiK4TYC1LUsSvhWsdCmNfnmQ" + ], + "license": "GPL-3.0" + } + }, + "version": 1 + }, + "id": 170 +} diff --git a/crates/contracts/artifacts/CowAmmLegacyHelper.json b/crates/contracts/artifacts/CowAmmLegacyHelper.json index 9de14ae64e..391823f88c 100644 --- a/crates/contracts/artifacts/CowAmmLegacyHelper.json +++ b/crates/contracts/artifacts/CowAmmLegacyHelper.json @@ -1 +1,1083 @@ -{"abi":[{"type":"constructor","inputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"factory","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"getSnapshot","inputs":[{"name":"amm","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"isLegacy","inputs":[{"name":"amm","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"isLegacyEnabled","inputs":[{"name":"amm","type":"address","internalType":"address"}],"outputs":[{"name":"success","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"order","inputs":[{"name":"pool","type":"address","internalType":"address"},{"name":"prices","type":"uint256[]","internalType":"uint256[]"}],"outputs":[{"name":"_order","type":"tuple","internalType":"struct GPv2Order.Data","components":[{"name":"sellToken","type":"address","internalType":"contract IERC20"},{"name":"buyToken","type":"address","internalType":"contract IERC20"},{"name":"receiver","type":"address","internalType":"address"},{"name":"sellAmount","type":"uint256","internalType":"uint256"},{"name":"buyAmount","type":"uint256","internalType":"uint256"},{"name":"validTo","type":"uint32","internalType":"uint32"},{"name":"appData","type":"bytes32","internalType":"bytes32"},{"name":"feeAmount","type":"uint256","internalType":"uint256"},{"name":"kind","type":"bytes32","internalType":"bytes32"},{"name":"partiallyFillable","type":"bool","internalType":"bool"},{"name":"sellTokenBalance","type":"bytes32","internalType":"bytes32"},{"name":"buyTokenBalance","type":"bytes32","internalType":"bytes32"}]},{"name":"preInteractions","type":"tuple[]","internalType":"struct GPv2Interaction.Data[]","components":[{"name":"target","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"callData","type":"bytes","internalType":"bytes"}]},{"name":"postInteractions","type":"tuple[]","internalType":"struct GPv2Interaction.Data[]","components":[{"name":"target","type":"address","internalType":"address"},{"name":"value","type":"uint256","internalType":"uint256"},{"name":"callData","type":"bytes","internalType":"bytes"}]},{"name":"sig","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"type":"function","name":"tokens","inputs":[{"name":"pool","type":"address","internalType":"address"}],"outputs":[{"name":"_tokens","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"type":"event","name":"COWAMMPoolCreated","inputs":[{"name":"amm","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"error","name":"InvalidArrayLength","inputs":[]},{"type":"error","name":"MathOverflowedMulDiv","inputs":[]},{"type":"error","name":"NoOrder","inputs":[]},{"type":"error","name":"PoolDoesNotExist","inputs":[]},{"type":"error","name":"PoolIsClosed","inputs":[]},{"type":"error","name":"PoolIsPaused","inputs":[]}],"bytecode":"0x608060405234801561000f575f80fd5b5061001861001d565b6102ff565b46600181900361011257610044739941fd7db2003308e7ee17b04400012278f12ac66102c9565b61006173b3bf81714f704720dcb0351ff0d42eca61b069fc6102c9565b61007e73301076c36e034948a747bb61bab9cd03f62672e36102c9565b61009b73027e1cbf2c299cba5eb8a2584910d04f1a8aa4036102c9565b6100b873beef5afe88ef73337e5070ab2855d37dbf5493a46102c9565b6100d573c6b13d5e662fa0458f03995bcb824a1934aa895f6102c9565b6100f273d7cb8cc1b56356bb7b78d02e785ead28e21586606102c9565b61010f73079c868f97aed8e0d03f11e1529c3b056ff21cea6102c9565b50565b8060640361010f5761013773bc6159fd429be18206e60b3bb01d7289f905511b6102c9565b61015473e5d1aa8565f5dbfc06cde20dfd76b4c7c6d43bd56102c9565b610171739d8570ef9a519ca81daec35212f435d9843ba5646102c9565b61018e73d97c31e53f16f495715ce71e12e11b9545eedd8b6102c9565b6101ab73ff1bd3d570e3544c183ba77f5a4d3cc742c8d2b36102c9565b6101c873209d269dfd66b9cec764de7eb6fefc24f75bdd486102c9565b6101e573c37575ad8efe530fd8a79aeb0087e5872a24dabc6102c9565b610202731c7828dadade12a848f36be8e2d3146462abff686102c9565b61021f73aba5294bba7d3635c2a3e44d0e87ea7f58898fb76102c9565b61023c736eb7be972aebb6be2d9acf437cb412c0abee912b6102c9565b61025973c4d09969aad7f252c75dd352bbbd719e34ed06ad6102c9565b61027673a25af86a5dbea45e9fd70c1879489f63d081ad446102c9565b6102937357492cb6c8ee2998e9d83ddc8c713e781ffe548e6102c9565b6102b073c33e3ec14556a8e71be3097fe2dc8c0b9119c8976102c9565b61010f7377472826875953374ed3084c31a483f827987f145b6040516001600160a01b038216907f0d03834d0d86c7f57e877af40e26f176dc31bd637535d4ba153d1ac9de88a7ea905f90a250565b6156848061030c5f395ff3fe608060405234801561000f575f80fd5b506004361061006f575f3560e01c80632aec79a01161004d5780632aec79a0146100de578063c45a0155146100f1578063e48603391461011e575f80fd5b806310029daa14610073578063215702561461009b57806327242c9b146100bb575b5f80fd5b610086610081366004612462565b61013e565b60405190151581526020015b60405180910390f35b6100ae6100a9366004612462565b61050c565b60405161009291906124c9565b6100ce6100c93660046124db565b610cc6565b60405161009294939291906126e9565b6100866100ec366004612462565b61132d565b6100f9611340565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610092565b61013161012c366004612462565b611410565b6040516100929190612734565b6040517f5624b25b0000000000000000000000000000000000000000000000000000000081527f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d56004820152600160248201525f90819073ffffffffffffffffffffffffffffffffffffffff841690635624b25b906044015f60405180830381865afa1580156101d0573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610215919081019061288a565b80602001905181019061022891906128c4565b90505f732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161490505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff166351cad5ee87739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061034e91906128df565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381865afa1580156103ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103de91906128c4565b73ffffffffffffffffffffffffffffffffffffffff161490505f6104018661050c565b80602001905181019061041491906128f6565b90505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16636108c532888460405160200161045991906129cf565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b81526004016104ad92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602060405180830381865afa1580156104c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ec91906129e1565b90508380156104f85750825b80156105015750805b979650505050505050565b60604660018190036107bd5773ffffffffffffffffffffffffffffffffffffffff8316739941fd7db2003308e7ee17b04400012278f12ac60361056c57604051806101e001604052806101c0815260200161482f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673b3bf81714f704720dcb0351ff0d42eca61b069fc036105c057604051806101e001604052806101c081526020016150ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673301076c36e034948a747bb61bab9cd03f62672e30361061457604051806101e001604052806101c0815260200161364f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673027e1cbf2c299cba5eb8a2584910d04f1a8aa4030361066857604051806101e001604052806101c08152602001612d2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673beef5afe88ef73337e5070ab2855d37dbf5493a4036106bc57604051806101e001604052806101c081526020016142ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c6b13d5e662fa0458f03995bcb824a1934aa895f0361071057604051806101e001604052806101c0815260200161412f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d7cb8cc1b56356bb7b78d02e785ead28e21586600361076457604051806101e001604052806101c081526020016139cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673079c868f97aed8e0d03f11e1529c3b056ff21cea036107b857604051806101e001604052806101c081526020016149ef6101c091399392505050565b610cb1565b80606403610cb15773ffffffffffffffffffffffffffffffffffffffff831673bc6159fd429be18206e60b3bb01d7289f905511b0361081957604051806101e001604052806101c08152602001612eef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673e5d1aa8565f5dbfc06cde20dfd76b4c7c6d43bd50361086d57604051806101e001604052806101c0815260200161466f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316739d8570ef9a519ca81daec35212f435d9843ba564036108c157604051806101e001604052806101c08152602001614baf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d97c31e53f16f495715ce71e12e11b9545eedd8b036109155760405180610240016040528061022081526020016130af61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673ff1bd3d570e3544c183ba77f5a4d3cc742c8d2b30361096957604051806101e001604052806101c0815260200161548f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673209d269dfd66b9cec764de7eb6fefc24f75bdd48036109bd57604051806101e001604052806101c08152602001614f2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c37575ad8efe530fd8a79aeb0087e5872a24dabc03610a1157604051806101e001604052806101c0815260200161348f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316731c7828dadade12a848f36be8e2d3146462abff6803610a6557604051806101e001604052806101c08152602001613f6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673aba5294bba7d3635c2a3e44d0e87ea7f58898fb703610ab957604051806101e001604052806101c08152602001614d6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316736eb7be972aebb6be2d9acf437cb412c0abee912b03610b0d57604051806101e001604052806101c081526020016132cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c4d09969aad7f252c75dd352bbbd719e34ed06ad03610b61576040518061024001604052806102208152602001613d4f61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673a25af86a5dbea45e9fd70c1879489f63d081ad4403610bb557604051806101e001604052806101c081526020016144af6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167357492cb6c8ee2998e9d83ddc8c713e781ffe548e03610c09576040518061020001604052806101e081526020016152af6101e091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c33e3ec14556a8e71be3097fe2dc8c0b9119c89703610c5d57604051806101e001604052806101c0815260200161380f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167377472826875953374ed3084c31a483f827987f1403610cb157604051806101e001604052806101c08152602001613b8f6101c091399392505050565b505060408051602081019091525f8152919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060808060028514610d64576040517f9d89020a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060610d6f8861132d565b6112e957610d7c88611696565b610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f506f6f6c206973206e6f74206120436f5720414d4d000000000000000000000060448201526064015b60405180910390fd5b5f8873ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e31573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e5591906128c4565b90505f8973ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ec591906128c4565b90508973ffffffffffffffffffffffffffffffffffffffff16634ada218b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f10573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3491906129e1565b15155f03610f6e576040517f21081abf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110816040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110610fe357610fe3612a00565b9050602002013581526020018b8b5f81811061100157611001612a00565b9050602002013581526020018c73ffffffffffffffffffffffffffffffffffffffff16636dbc88136040518163ffffffff1660e01b8152600401602060405180830381865afa158015611056573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061107a91906128df565b905261174e565b9650866040516020016110949190612a2d565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815260018084528383019092529450816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816110d157905050955060405180606001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020015f815260200161123b739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561118e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111b291906128df565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08b0180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405160240161124d91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ff14fcbc8000000000000000000000000000000000000000000000000000000001790529052865187905f906112d7576112d7612a00565b602002602001018190525050506112ff565b6112f4888888611ad6565b929750909550935090505b8781604051602001611312929190612a3c565b60405160208183030381529060405291505093509350935093565b5f806113388361050c565b511192915050565b5f46600181900361136657738deed8ed7c5fcb55884f13f121654bb4bb7c843791505090565b8060640361138957732af6c59fc957d4a45ddbbd927fa30f7c5051f58391505090565b8062aa36a7036113ae5773bd18758055dbe3ed37a2471394559ae97a5da5c091505090565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e737570706f7274656420636861696e0000000000000000000000000000006044820152606401610dde565b60408051600280825260608083018452926020830190803683370190505090506114398261132d565b6115b5578173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114aa91906128c4565b815f815181106114bc576114bc612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561153f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061156391906128c4565b8160018151811061157657611576612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050919050565b5f6115bf8361215f565b509050805f815181106115d4576115d4612a00565b6020026020010151825f815181106115ee576115ee612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508060018151811061163b5761163b612a00565b60200260200101518260018151811061165657611656612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050919050565b5f806116a0611340565b6040517f666e1b3900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152919091169063666e1b3990602401602060405180830381865afa15801561170c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061173091906128c4565b73ffffffffffffffffffffffffffffffffffffffff16141592915050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810191909152602082015182516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201525f92839216906370a0823190602401602060405180830381865afa158015611822573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061184691906128df565b604085810151865191517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116906370a0823190602401602060405180830381865afa1580156118b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118db91906128df565b915091505f805f805f8860800151876118f49190612aae565b90505f8960600151876119079190612aae565b90508181101561196d578960200151955089604001519450611939818b6080015160026119349190612aae565b61227b565b61194460028a612af2565b61194e9190612b05565b9350611966848861195f828c612b05565b60016122cb565b92506119b9565b8960400151955089602001519450611990828b6060015160026119349190612aae565b61199b600289612af2565b6119a59190612b05565b93506119b6848961195f828b612b05565b92505b6040518061018001604052808773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200161012c42611a339190612b18565b63ffffffff1681526020018b60a0015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981525098505050505050505050919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060806060611b448761013e565b611b7a576040517fefc869b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80611b858961215f565b915091505f8160400151806020019051810190611ba29190612b3c565b9050611c836040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff168152602001855f81518110611be057611be0612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200185600181518110611c1657611c16612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110611c4c57611c4c612a00565b9050602002013581526020018b8b5f818110611c6a57611c6a612a00565b9050602002013581526020018360a0015181525061174e565b96505f739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0791906128df565b9050807fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48989604051602001611d3c9190612a2d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181525f60608401818152608085018452845260208085018a9052835180820185529182528484019190915291519092611da092909101612bf4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611dde94939291602401612c9d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f5fd7e97d000000000000000000000000000000000000000000000000000000001790528151600180825281840190935292975082015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611e685790505060408051606081018252855173ffffffffffffffffffffffffffffffffffffffff1681525f602082015291985081018c611f558b857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405173ffffffffffffffffffffffffffffffffffffffff90921660248301526044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052875188905f9061200757612007612a00565b602090810291909101015260408051600180825281830190925290816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816120275790505095506040518060600160405280845f015173ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020018c5f801b6040516024016120bd92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052865187905f9061214757612147612a00565b60200260200101819052505050505093509350935093565b60408051606081810183525f80835260208301529181018290526121828361050c565b80602001905181019061219591906128f6565b90505f81604001518060200190518101906121b09190612b3c565b6040805160028082526060820183529293509190602083019080368337019050509250805f0151835f815181106121e9576121e9612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080602001518360018151811061223b5761223b612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050915091565b5f815f036122945761228d8284612af2565b90506122c5565b82156122c057816122a6600185612b05565b6122b09190612af2565b6122bb906001612ccd565b6122c2565b5f5b90505b92915050565b5f806122d886868661231a565b90506122e383612412565b80156122fe57505f84806122f9576122f9612ac5565b868809115b156123115761230e600182612ccd565b90505b95945050505050565b5f838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870982811083820303915050805f0361236d5783828161236357612363612ac5565b049250505061240b565b8084116123a6576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b5f600282600381111561242757612427612ce0565b6124319190612d0d565b60ff166001149050919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461245f575f80fd5b50565b5f60208284031215612472575f80fd5b813561240b8161243e565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6122c2602083018461247d565b5f805f604084860312156124ed575f80fd5b83356124f88161243e565b9250602084013567ffffffffffffffff80821115612514575f80fd5b818601915086601f830112612527575f80fd5b813581811115612535575f80fd5b8760208260051b8501011115612549575f80fd5b6020830194508093505050509250925092565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161259d602084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408101516125c5604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a08101516125f160a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516126268285018215159052565b5050610140818101519083015261016090810151910152565b5f82825180855260208086019550808260051b8401018186015f5b848110156126dc578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00189528151805173ffffffffffffffffffffffffffffffffffffffff16845284810151858501526040908101516060918501829052906126c88186018361247d565b9a86019a945050509083019060010161265a565b5090979650505050505050565b5f6101e06126f7838861255c565b8061018084015261270a8184018761263f565b90508281036101a084015261271f818661263f565b90508281036101c0840152610501818561247d565b602080825282518282018190525f9190848201906040850190845b8181101561278157835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161274f565b50909695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160c0810167ffffffffffffffff811182821017156127dd576127dd61278d565b60405290565b5f82601f8301126127f2575f80fd5b815167ffffffffffffffff8082111561280d5761280d61278d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156128535761285361278d565b8160405283815286602085880101111561286b575f80fd5b8360208701602083015e5f602085830101528094505050505092915050565b5f6020828403121561289a575f80fd5b815167ffffffffffffffff8111156128b0575f80fd5b6128bc848285016127e3565b949350505050565b5f602082840312156128d4575f80fd5b815161240b8161243e565b5f602082840312156128ef575f80fd5b5051919050565b5f60208284031215612906575f80fd5b815167ffffffffffffffff8082111561291d575f80fd5b9083019060608286031215612930575f80fd5b60405160608101818110838211171561294b5761294b61278d565b60405282516129598161243e565b815260208381015190820152604083015182811115612976575f80fd5b612982878286016127e3565b60408301525095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8151168252602081015160208301525f6040820151606060408501526128bc606085018261247d565b602081525f6122c26020830184612991565b5f602082840312156129f1575f80fd5b8151801515811461240b575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61018081016122c5828461255c565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1681525f82518060208501601485015e5f92016014019182525092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82612b0057612b00612ac5565b500490565b818103818111156122c5576122c5612a81565b63ffffffff818116838216019080821115612b3557612b35612a81565b5092915050565b5f60208284031215612b4c575f80fd5b815167ffffffffffffffff80821115612b63575f80fd5b9083019060c08286031215612b76575f80fd5b612b7e6127ba565b8251612b898161243e565b81526020830151612b998161243e565b6020820152604083810151908201526060830151612bb68161243e565b6060820152608083015182811115612bcc575f80fd5b612bd8878286016127e3565b60808301525060a083015160a082015280935050505092915050565b602080825282516060838301528051608084018190525f9291820190839060a08601905b80831015612c385783518252928401926001929092019190840190612c18565b508387015193507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0925082868203016040870152612c768185612991565b93505050604085015181858403016060860152612c93838261247d565b9695505050505050565b848152836020820152608060408201525f612cbb608083018561247d565b8281036060840152610501818561247d565b808201808211156122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f60ff831680612d1f57612d1f612ac5565b8060ff8416069150509291505056fe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dac5a0e756ac88c1d3a4c41900d977fe93c2d34fc95a00ca3e84eb4c6b50faf949000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005afe3855358e112b5647b952709e6165e1c1eeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000002e7e978da0c53404a8cf66ed4ba2c7706c07b62a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d85c99996d84d25387bc0d01e50e3ea814f64e7e04a3b949a571789e196c5a910000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000000000000000000000000000000affd9fdeb8e08000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020a99fd9950b5d5dceeaf4939e221dca8ca9b938ab0001000000000000000000250000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85178a729ee3008c7d48832d02267b72e5f34ada8f554a6731a368f01590ed71b34000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000008156197a5425c0c8000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000080000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a000000000000000000000000678df3415fc31947da4324ec63212874be5a82f8000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8512e31981e34960969eb549f5e826cf77f655e72b03603ad574a79fd015f4de4de0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a16c95a4d2e3c000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c0ce9e05c2aee5f22f9941c4cd1f1a1d13194b109779422d5ad9a980157bd0f1640000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851a2029fbb545978d05378b6df19e3754fe5ed2d0ba1e051027503934372f7beb20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000000000000000000000000000000052ba9efc38441a000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002021d4c792ea7e38e0d0819c2011a2b1cb7252bd9900020000000000000000001e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424daca44b6a304baa16d11b6db07066c1276b1273ee3f94590bbd03201a61882af9a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000098cb76000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b4e16d0168e52d35cacd2c6185b44281ec28c9dc0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85159457ac6201da7713efecd84618c7a168e88b9cb7d1c0db128af1efe0a08bbb10000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a17273fc14b64000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da80ba533f014ef4238ab7ad203c0aeacbf30a71c0346140db77c43ae3121afadd000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000aea46a60368a7bd060eec7df8cba43b7ef41ad85000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000336632e53c8ecf04000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000004042a04c54ef133ac2a3c93db69d43c6c02a330b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d67c9fb87045e07da94c81de035b5c7f435cd46568fca02aa35d709bbc9e21fa0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008e5bbbb09ed1ebde8674cda39a0c169401db4252000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008db8870ca4b8ac188c4d1a014f34a381ae27e1c20000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851209c17d9ebe3ac7352795f7f8b3d14d253d92430831d3b2c3965f9a578da7618000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000000000000000000000000000008aa3a52815262f58000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000800000000000000000000000000064ac007ff665cf8d0d3af5e0ad1c26a3f853ea000000000000000000000000a767f745331d267c7751297d982b050c93985627000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85105416460deb76d57af601be17e777b93592d8d4d4a4096c57876a91c84f418080000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000ce11e14225575945b8e6dc0d4f2dd4c570f79d9f000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000009634ca647474b6b78d3382331a77cd00a8a940da00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da932542294ff270a8bbdbe1fb921de3d09c9749dc35627361fc17c44b9b026b810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008390a1da07e376ef7add4be859ba74fb83aa02d5000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000aec1c94998000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000069c66beafb06674db41b22cfc50c34a93b8d82a2000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000def1ca1fb7fbcdc777520aa7f396b4e015f497ab000000000000000000000000000000000000000000000000025bf6196bd10000000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c0d661a16b0e85eadb705cf5158132b5dd1ebc0a49929ef68097698d15e2a4e3b40000000000000000000000000000000000000000000000000000000000000020de8c195aa41c11a0c4787372defbbddaa31306d20002000000000000000001810000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851560d33bcc26b7f10765f8ae10b1abc4ed265ba0c7a1f9948d06de97c31044aee0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000004d18815d14fe5c3304e87b3fa18318baa5c238200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020a9b2234773cc6a4f3a34a770c52c931cba5c24b20002000000000000000000870000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851437a72b19b25e8b62fdfb81146ec83c66462138d3d9e08998594853566fa9add000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000146e114355e0f6088000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204cdabe9e07ca393943acfb9286bbbd0d0a310ff600020000000000000000005c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da559d5fda20be80608e4d5ea1b41e6b9330efca7934beb094281dd4d8f4889374000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000079ef7f110fdfae4000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020e99481dc77691d8e2456e5f3f61c1810adfc1503000200000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da56871afb17e444c418900f6db3e1ade07d49eadea1accf03fcebc0a6e7e4b653000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b2617246d0c6c0087f18703d576831899ca94f01000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000048bcb79dba2b56b90000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b36ec83d844c0579ec2493f10b2087e96bb654600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8511ea56ac96a6369d36ef3fe56ae0ddff8d0cc89e1623095239c5ceed2505aa2810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000000000000000000000000000006b43c27d2e8300000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000028dbd35fd79f48bfa9444d330d14683e7101d8170000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d1e868d120e326e5581caa39852bb0da9234a511ed76e6f7a9dcceb0d5f154c70000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee48370100000000000000000000000000000000000000000000000000098e46995425ca000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851f0e8ec512b2507dae99175a0a4792d8a53e0863fbb5e735a5c993295bbd17f480000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb00000000000000000000000000000000000000000000000000094f8d9168e271000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204683e340a8049261057d5ab1b29c8d840e75695e00020000000000000000005a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dad003838829115f5d9ff3ed69c8d2b4b26e10eb1a79331206c28fbb4734390a5e000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000808507121b80c02388fad14726482e061b8da827000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000189b23422a9b84d8000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020fd1cf6fd41f229ca86ada0584c63c49c3d66bbc90002000000000000000004380000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8513956efd63537b00bb3b152d3c4961207b6ca14d6f506c66fc0aef4c8e2e176b5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e0000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000000000000000000000000000000000000000004500000000000000000000000015b4c67070d3748b8ec93c8a32f7efe2e8f684c900000000000000000000000000000000000000000000000000000000000000c0056e9806d953dbe2df4352a90ad2c1148c51460e941107f0909fae382b1661cf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000022441d81416430a54336ab28765abd31a792ad37000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85133f583d55c4509d5e10ebe3c7c69bce17af4c57419d6c9c90c8f588dd3232c0d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000af204776c7245bf4147c2612bf6e5972ee4837010000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000410d586a20a4c0000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063a2646970667358221220c3b6b701e7d5db53232efcebe1fe1bdd40a35653449ba7cd10551b9e5bf6a94a64736f6c63430008190033","deployedBytecode":"0x608060405234801561000f575f80fd5b506004361061006f575f3560e01c80632aec79a01161004d5780632aec79a0146100de578063c45a0155146100f1578063e48603391461011e575f80fd5b806310029daa14610073578063215702561461009b57806327242c9b146100bb575b5f80fd5b610086610081366004612462565b61013e565b60405190151581526020015b60405180910390f35b6100ae6100a9366004612462565b61050c565b60405161009291906124c9565b6100ce6100c93660046124db565b610cc6565b60405161009294939291906126e9565b6100866100ec366004612462565b61132d565b6100f9611340565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610092565b61013161012c366004612462565b611410565b6040516100929190612734565b6040517f5624b25b0000000000000000000000000000000000000000000000000000000081527f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d56004820152600160248201525f90819073ffffffffffffffffffffffffffffffffffffffff841690635624b25b906044015f60405180830381865afa1580156101d0573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610215919081019061288a565b80602001905181019061022891906128c4565b90505f732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161490505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff166351cad5ee87739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061034e91906128df565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381865afa1580156103ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103de91906128c4565b73ffffffffffffffffffffffffffffffffffffffff161490505f6104018661050c565b80602001905181019061041491906128f6565b90505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16636108c532888460405160200161045991906129cf565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b81526004016104ad92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602060405180830381865afa1580156104c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ec91906129e1565b90508380156104f85750825b80156105015750805b979650505050505050565b60604660018190036107bd5773ffffffffffffffffffffffffffffffffffffffff8316739941fd7db2003308e7ee17b04400012278f12ac60361056c57604051806101e001604052806101c0815260200161482f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673b3bf81714f704720dcb0351ff0d42eca61b069fc036105c057604051806101e001604052806101c081526020016150ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673301076c36e034948a747bb61bab9cd03f62672e30361061457604051806101e001604052806101c0815260200161364f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673027e1cbf2c299cba5eb8a2584910d04f1a8aa4030361066857604051806101e001604052806101c08152602001612d2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673beef5afe88ef73337e5070ab2855d37dbf5493a4036106bc57604051806101e001604052806101c081526020016142ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c6b13d5e662fa0458f03995bcb824a1934aa895f0361071057604051806101e001604052806101c0815260200161412f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d7cb8cc1b56356bb7b78d02e785ead28e21586600361076457604051806101e001604052806101c081526020016139cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673079c868f97aed8e0d03f11e1529c3b056ff21cea036107b857604051806101e001604052806101c081526020016149ef6101c091399392505050565b610cb1565b80606403610cb15773ffffffffffffffffffffffffffffffffffffffff831673bc6159fd429be18206e60b3bb01d7289f905511b0361081957604051806101e001604052806101c08152602001612eef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673e5d1aa8565f5dbfc06cde20dfd76b4c7c6d43bd50361086d57604051806101e001604052806101c0815260200161466f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316739d8570ef9a519ca81daec35212f435d9843ba564036108c157604051806101e001604052806101c08152602001614baf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d97c31e53f16f495715ce71e12e11b9545eedd8b036109155760405180610240016040528061022081526020016130af61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673ff1bd3d570e3544c183ba77f5a4d3cc742c8d2b30361096957604051806101e001604052806101c0815260200161548f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673209d269dfd66b9cec764de7eb6fefc24f75bdd48036109bd57604051806101e001604052806101c08152602001614f2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c37575ad8efe530fd8a79aeb0087e5872a24dabc03610a1157604051806101e001604052806101c0815260200161348f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316731c7828dadade12a848f36be8e2d3146462abff6803610a6557604051806101e001604052806101c08152602001613f6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673aba5294bba7d3635c2a3e44d0e87ea7f58898fb703610ab957604051806101e001604052806101c08152602001614d6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316736eb7be972aebb6be2d9acf437cb412c0abee912b03610b0d57604051806101e001604052806101c081526020016132cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c4d09969aad7f252c75dd352bbbd719e34ed06ad03610b61576040518061024001604052806102208152602001613d4f61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673a25af86a5dbea45e9fd70c1879489f63d081ad4403610bb557604051806101e001604052806101c081526020016144af6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167357492cb6c8ee2998e9d83ddc8c713e781ffe548e03610c09576040518061020001604052806101e081526020016152af6101e091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c33e3ec14556a8e71be3097fe2dc8c0b9119c89703610c5d57604051806101e001604052806101c0815260200161380f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167377472826875953374ed3084c31a483f827987f1403610cb157604051806101e001604052806101c08152602001613b8f6101c091399392505050565b505060408051602081019091525f8152919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060808060028514610d64576040517f9d89020a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060610d6f8861132d565b6112e957610d7c88611696565b610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f506f6f6c206973206e6f74206120436f5720414d4d000000000000000000000060448201526064015b60405180910390fd5b5f8873ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e31573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e5591906128c4565b90505f8973ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ec591906128c4565b90508973ffffffffffffffffffffffffffffffffffffffff16634ada218b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f10573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3491906129e1565b15155f03610f6e576040517f21081abf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110816040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110610fe357610fe3612a00565b9050602002013581526020018b8b5f81811061100157611001612a00565b9050602002013581526020018c73ffffffffffffffffffffffffffffffffffffffff16636dbc88136040518163ffffffff1660e01b8152600401602060405180830381865afa158015611056573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061107a91906128df565b905261174e565b9650866040516020016110949190612a2d565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815260018084528383019092529450816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816110d157905050955060405180606001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020015f815260200161123b739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561118e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111b291906128df565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08b0180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405160240161124d91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ff14fcbc8000000000000000000000000000000000000000000000000000000001790529052865187905f906112d7576112d7612a00565b602002602001018190525050506112ff565b6112f4888888611ad6565b929750909550935090505b8781604051602001611312929190612a3c565b60405160208183030381529060405291505093509350935093565b5f806113388361050c565b511192915050565b5f46600181900361136657738deed8ed7c5fcb55884f13f121654bb4bb7c843791505090565b8060640361138957732af6c59fc957d4a45ddbbd927fa30f7c5051f58391505090565b8062aa36a7036113ae5773bd18758055dbe3ed37a2471394559ae97a5da5c091505090565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e737570706f7274656420636861696e0000000000000000000000000000006044820152606401610dde565b60408051600280825260608083018452926020830190803683370190505090506114398261132d565b6115b5578173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114aa91906128c4565b815f815181106114bc576114bc612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561153f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061156391906128c4565b8160018151811061157657611576612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050919050565b5f6115bf8361215f565b509050805f815181106115d4576115d4612a00565b6020026020010151825f815181106115ee576115ee612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508060018151811061163b5761163b612a00565b60200260200101518260018151811061165657611656612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050919050565b5f806116a0611340565b6040517f666e1b3900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152919091169063666e1b3990602401602060405180830381865afa15801561170c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061173091906128c4565b73ffffffffffffffffffffffffffffffffffffffff16141592915050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810191909152602082015182516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201525f92839216906370a0823190602401602060405180830381865afa158015611822573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061184691906128df565b604085810151865191517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116906370a0823190602401602060405180830381865afa1580156118b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118db91906128df565b915091505f805f805f8860800151876118f49190612aae565b90505f8960600151876119079190612aae565b90508181101561196d578960200151955089604001519450611939818b6080015160026119349190612aae565b61227b565b61194460028a612af2565b61194e9190612b05565b9350611966848861195f828c612b05565b60016122cb565b92506119b9565b8960400151955089602001519450611990828b6060015160026119349190612aae565b61199b600289612af2565b6119a59190612b05565b93506119b6848961195f828b612b05565b92505b6040518061018001604052808773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200161012c42611a339190612b18565b63ffffffff1681526020018b60a0015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981525098505050505050505050919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060806060611b448761013e565b611b7a576040517fefc869b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80611b858961215f565b915091505f8160400151806020019051810190611ba29190612b3c565b9050611c836040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff168152602001855f81518110611be057611be0612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200185600181518110611c1657611c16612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110611c4c57611c4c612a00565b9050602002013581526020018b8b5f818110611c6a57611c6a612a00565b9050602002013581526020018360a0015181525061174e565b96505f739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0791906128df565b9050807fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48989604051602001611d3c9190612a2d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181525f60608401818152608085018452845260208085018a9052835180820185529182528484019190915291519092611da092909101612bf4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611dde94939291602401612c9d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f5fd7e97d000000000000000000000000000000000000000000000000000000001790528151600180825281840190935292975082015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611e685790505060408051606081018252855173ffffffffffffffffffffffffffffffffffffffff1681525f602082015291985081018c611f558b857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405173ffffffffffffffffffffffffffffffffffffffff90921660248301526044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052875188905f9061200757612007612a00565b602090810291909101015260408051600180825281830190925290816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816120275790505095506040518060600160405280845f015173ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020018c5f801b6040516024016120bd92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052865187905f9061214757612147612a00565b60200260200101819052505050505093509350935093565b60408051606081810183525f80835260208301529181018290526121828361050c565b80602001905181019061219591906128f6565b90505f81604001518060200190518101906121b09190612b3c565b6040805160028082526060820183529293509190602083019080368337019050509250805f0151835f815181106121e9576121e9612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080602001518360018151811061223b5761223b612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050915091565b5f815f036122945761228d8284612af2565b90506122c5565b82156122c057816122a6600185612b05565b6122b09190612af2565b6122bb906001612ccd565b6122c2565b5f5b90505b92915050565b5f806122d886868661231a565b90506122e383612412565b80156122fe57505f84806122f9576122f9612ac5565b868809115b156123115761230e600182612ccd565b90505b95945050505050565b5f838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870982811083820303915050805f0361236d5783828161236357612363612ac5565b049250505061240b565b8084116123a6576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b5f600282600381111561242757612427612ce0565b6124319190612d0d565b60ff166001149050919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461245f575f80fd5b50565b5f60208284031215612472575f80fd5b813561240b8161243e565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6122c2602083018461247d565b5f805f604084860312156124ed575f80fd5b83356124f88161243e565b9250602084013567ffffffffffffffff80821115612514575f80fd5b818601915086601f830112612527575f80fd5b813581811115612535575f80fd5b8760208260051b8501011115612549575f80fd5b6020830194508093505050509250925092565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161259d602084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408101516125c5604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a08101516125f160a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516126268285018215159052565b5050610140818101519083015261016090810151910152565b5f82825180855260208086019550808260051b8401018186015f5b848110156126dc578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00189528151805173ffffffffffffffffffffffffffffffffffffffff16845284810151858501526040908101516060918501829052906126c88186018361247d565b9a86019a945050509083019060010161265a565b5090979650505050505050565b5f6101e06126f7838861255c565b8061018084015261270a8184018761263f565b90508281036101a084015261271f818661263f565b90508281036101c0840152610501818561247d565b602080825282518282018190525f9190848201906040850190845b8181101561278157835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161274f565b50909695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160c0810167ffffffffffffffff811182821017156127dd576127dd61278d565b60405290565b5f82601f8301126127f2575f80fd5b815167ffffffffffffffff8082111561280d5761280d61278d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156128535761285361278d565b8160405283815286602085880101111561286b575f80fd5b8360208701602083015e5f602085830101528094505050505092915050565b5f6020828403121561289a575f80fd5b815167ffffffffffffffff8111156128b0575f80fd5b6128bc848285016127e3565b949350505050565b5f602082840312156128d4575f80fd5b815161240b8161243e565b5f602082840312156128ef575f80fd5b5051919050565b5f60208284031215612906575f80fd5b815167ffffffffffffffff8082111561291d575f80fd5b9083019060608286031215612930575f80fd5b60405160608101818110838211171561294b5761294b61278d565b60405282516129598161243e565b815260208381015190820152604083015182811115612976575f80fd5b612982878286016127e3565b60408301525095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8151168252602081015160208301525f6040820151606060408501526128bc606085018261247d565b602081525f6122c26020830184612991565b5f602082840312156129f1575f80fd5b8151801515811461240b575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61018081016122c5828461255c565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1681525f82518060208501601485015e5f92016014019182525092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82612b0057612b00612ac5565b500490565b818103818111156122c5576122c5612a81565b63ffffffff818116838216019080821115612b3557612b35612a81565b5092915050565b5f60208284031215612b4c575f80fd5b815167ffffffffffffffff80821115612b63575f80fd5b9083019060c08286031215612b76575f80fd5b612b7e6127ba565b8251612b898161243e565b81526020830151612b998161243e565b6020820152604083810151908201526060830151612bb68161243e565b6060820152608083015182811115612bcc575f80fd5b612bd8878286016127e3565b60808301525060a083015160a082015280935050505092915050565b602080825282516060838301528051608084018190525f9291820190839060a08601905b80831015612c385783518252928401926001929092019190840190612c18565b508387015193507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0925082868203016040870152612c768185612991565b93505050604085015181858403016060860152612c93838261247d565b9695505050505050565b848152836020820152608060408201525f612cbb608083018561247d565b8281036060840152610501818561247d565b808201808211156122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f60ff831680612d1f57612d1f612ac5565b8060ff8416069150509291505056fe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dac5a0e756ac88c1d3a4c41900d977fe93c2d34fc95a00ca3e84eb4c6b50faf949000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005afe3855358e112b5647b952709e6165e1c1eeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000002e7e978da0c53404a8cf66ed4ba2c7706c07b62a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d85c99996d84d25387bc0d01e50e3ea814f64e7e04a3b949a571789e196c5a910000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000000000000000000000000000000affd9fdeb8e08000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020a99fd9950b5d5dceeaf4939e221dca8ca9b938ab0001000000000000000000250000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85178a729ee3008c7d48832d02267b72e5f34ada8f554a6731a368f01590ed71b34000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000008156197a5425c0c8000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000080000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a000000000000000000000000678df3415fc31947da4324ec63212874be5a82f8000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8512e31981e34960969eb549f5e826cf77f655e72b03603ad574a79fd015f4de4de0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a16c95a4d2e3c000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c0ce9e05c2aee5f22f9941c4cd1f1a1d13194b109779422d5ad9a980157bd0f1640000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851a2029fbb545978d05378b6df19e3754fe5ed2d0ba1e051027503934372f7beb20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000000000000000000000000000000052ba9efc38441a000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002021d4c792ea7e38e0d0819c2011a2b1cb7252bd9900020000000000000000001e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424daca44b6a304baa16d11b6db07066c1276b1273ee3f94590bbd03201a61882af9a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000098cb76000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b4e16d0168e52d35cacd2c6185b44281ec28c9dc0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85159457ac6201da7713efecd84618c7a168e88b9cb7d1c0db128af1efe0a08bbb10000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a17273fc14b64000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da80ba533f014ef4238ab7ad203c0aeacbf30a71c0346140db77c43ae3121afadd000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000aea46a60368a7bd060eec7df8cba43b7ef41ad85000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000336632e53c8ecf04000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000004042a04c54ef133ac2a3c93db69d43c6c02a330b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d67c9fb87045e07da94c81de035b5c7f435cd46568fca02aa35d709bbc9e21fa0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008e5bbbb09ed1ebde8674cda39a0c169401db4252000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008db8870ca4b8ac188c4d1a014f34a381ae27e1c20000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851209c17d9ebe3ac7352795f7f8b3d14d253d92430831d3b2c3965f9a578da7618000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000000000000000000000000000008aa3a52815262f58000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000800000000000000000000000000064ac007ff665cf8d0d3af5e0ad1c26a3f853ea000000000000000000000000a767f745331d267c7751297d982b050c93985627000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85105416460deb76d57af601be17e777b93592d8d4d4a4096c57876a91c84f418080000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000ce11e14225575945b8e6dc0d4f2dd4c570f79d9f000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000009634ca647474b6b78d3382331a77cd00a8a940da00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da932542294ff270a8bbdbe1fb921de3d09c9749dc35627361fc17c44b9b026b810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008390a1da07e376ef7add4be859ba74fb83aa02d5000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000aec1c94998000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000069c66beafb06674db41b22cfc50c34a93b8d82a2000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000def1ca1fb7fbcdc777520aa7f396b4e015f497ab000000000000000000000000000000000000000000000000025bf6196bd10000000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c0d661a16b0e85eadb705cf5158132b5dd1ebc0a49929ef68097698d15e2a4e3b40000000000000000000000000000000000000000000000000000000000000020de8c195aa41c11a0c4787372defbbddaa31306d20002000000000000000001810000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851560d33bcc26b7f10765f8ae10b1abc4ed265ba0c7a1f9948d06de97c31044aee0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000004d18815d14fe5c3304e87b3fa18318baa5c238200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020a9b2234773cc6a4f3a34a770c52c931cba5c24b20002000000000000000000870000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851437a72b19b25e8b62fdfb81146ec83c66462138d3d9e08998594853566fa9add000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000146e114355e0f6088000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204cdabe9e07ca393943acfb9286bbbd0d0a310ff600020000000000000000005c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da559d5fda20be80608e4d5ea1b41e6b9330efca7934beb094281dd4d8f4889374000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000079ef7f110fdfae4000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020e99481dc77691d8e2456e5f3f61c1810adfc1503000200000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da56871afb17e444c418900f6db3e1ade07d49eadea1accf03fcebc0a6e7e4b653000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b2617246d0c6c0087f18703d576831899ca94f01000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000048bcb79dba2b56b90000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b36ec83d844c0579ec2493f10b2087e96bb654600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8511ea56ac96a6369d36ef3fe56ae0ddff8d0cc89e1623095239c5ceed2505aa2810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000000000000000000000000000006b43c27d2e8300000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000028dbd35fd79f48bfa9444d330d14683e7101d8170000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d1e868d120e326e5581caa39852bb0da9234a511ed76e6f7a9dcceb0d5f154c70000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee48370100000000000000000000000000000000000000000000000000098e46995425ca000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851f0e8ec512b2507dae99175a0a4792d8a53e0863fbb5e735a5c993295bbd17f480000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb00000000000000000000000000000000000000000000000000094f8d9168e271000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204683e340a8049261057d5ab1b29c8d840e75695e00020000000000000000005a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dad003838829115f5d9ff3ed69c8d2b4b26e10eb1a79331206c28fbb4734390a5e000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000808507121b80c02388fad14726482e061b8da827000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000189b23422a9b84d8000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020fd1cf6fd41f229ca86ada0584c63c49c3d66bbc90002000000000000000004380000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8513956efd63537b00bb3b152d3c4961207b6ca14d6f506c66fc0aef4c8e2e176b5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e0000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000000000000000000000000000000000000000004500000000000000000000000015b4c67070d3748b8ec93c8a32f7efe2e8f684c900000000000000000000000000000000000000000000000000000000000000c0056e9806d953dbe2df4352a90ad2c1148c51460e941107f0909fae382b1661cf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000022441d81416430a54336ab28765abd31a792ad37000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85133f583d55c4509d5e10ebe3c7c69bce17af4c57419d6c9c90c8f588dd3232c0d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000af204776c7245bf4147c2612bf6e5972ee4837010000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000410d586a20a4c0000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063a2646970667358221220c3b6b701e7d5db53232efcebe1fe1bdd40a35653449ba7cd10551b9e5bf6a94a64736f6c63430008190033","methodIdentifiers":{"factory()":"c45a0155","getSnapshot(address)":"21570256","isLegacy(address)":"2aec79a0","isLegacyEnabled(address)":"10029daa","order(address,uint256[])":"27242c9b","tokens(address)":"e4860339"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidArrayLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIsClosed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIsPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"COWAMMPoolCreated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"getSnapshot\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"isLegacy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"isLegacyEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"prices\",\"type\":\"uint256[]\"}],\"name\":\"order\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"preInteractions\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"postInteractions\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"tokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"PoolDoesNotExist()\":[{\"details\":\"Indexers monitoring CoW AMM pools MAY use this as a signal to purge the pool from their index.\"}],\"PoolIsClosed()\":[{\"details\":\"Indexers monitoring CoW AMM pools MAY use this as a signal to purge the pool from their index.\"}],\"PoolIsPaused()\":[{\"details\":\"Indexers monitoring CoW AMM pools SHOULD use this as a signal to retain the pool in the index with back-off on polling for orders.\"}]},\"events\":{\"COWAMMPoolCreated(address)\":{\"params\":{\"amm\":\"The address of the newly tradeable CoW AMM Pool\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"This is a specific hack to broadcast legacy data in a forward-compatible\"},\"getSnapshot(address)\":{\"details\":\"Returns the IConditionalOrder.ConditionalOrderParams for a legacy CoW AMM. Returns bytes(0) if the pool isn't found in the snapshot data.\"},\"isLegacy(address)\":{\"details\":\"Given an `amm`, check if it is in the hardcoded list of legacy CoW AMMs.\"},\"isLegacyEnabled(address)\":{\"details\":\"Given an `amm` that is is known to be legacy, check if it is still valid.\"},\"order(address,uint256[])\":{\"details\":\"Reverts with `NoOrder` if the `pool` has no canonical order matching the given price vector.\",\"params\":{\"pool\":\"to calculate the order / signature for\",\"prices\":\"supplied for determining the order, assumed to be in the same order as returned from `tokens(pool)`. Tokens prices are expressed relative to each other: for example, if tokens[0] is WETH, tokens[2] is DAI, and the price is 1 WETH per 3000 DAI, then a valid price vector is [3000, *, 1, ...]. If tokens[1] is another stablecoin with 18 decimals, then a valid price vector could be [3000, 3000, 1, ...]. This price vector is compatible with the price vector used in a call to `settle`, assuming the traded token array is in the same order as in `tokens(pool)`.\"},\"returns\":{\"_order\":\"The CoW Protocol JIT order\",\"postInteractions\":\"The array array for any **POST** interactions (empty if none)\",\"preInteractions\":\"The array array for any **PRE** interactions (empty if none)\",\"sig\":\"A valid CoW-Protocol signature for the resulting order using the ERC-1271 signature scheme.\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"NoOrder()\":[{\"notice\":\"Returned by the `order` function if there is no order matching the supplied parameters.\"}],\"PoolDoesNotExist()\":[{\"notice\":\"All functions that take `pool` as an argument MUST revert with this error if the `pool` does not exist.\"}],\"PoolIsClosed()\":[{\"notice\":\"All functions that take `pool` as an argument MUST revert with this error in the event that the pool is closed (ONLY applicable if the pool can be closed).\"}],\"PoolIsPaused()\":[{\"notice\":\"All functions that take `pool` as an argument MUST revert with this error in the event that the pool is paused (ONLY applicable if the pool is pausable).\"}]},\"events\":{\"COWAMMPoolCreated(address)\":{\"notice\":\"AMM protocols capable of operating as a CoW AMM MUST emit an event on pool creation.\"}},\"kind\":\"user\",\"methods\":{\"factory()\":{\"notice\":\"AMM Pool helpers MUST return the factory target for indexing of CoW AMM pools.\"},\"order(address,uint256[])\":{\"notice\":\"AMM Pool helpers MUST provide a method for returning the canonical order required to satisfy the pool's invariants, given a pricing vector.\"},\"tokens(address)\":{\"notice\":\"AMM Pool helpers MUST return all tokens that may be traded on this pool. The order of the tokens is expected to be consistent and must be the same as that used for the input price vector in the `order` function.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ConstantProductHelper.sol\":\"ConstantProductHelper\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/composable-cow/lib/cowprotocol/src/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x2db02cc0e23db99d10cd21590425b714060a556bcfb934cb5ab3b80aef1610ba\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c05f8a21a244e6566a3e555028cebeebd1c38902f0cea2e9b014cc7becaf3140\",\"dweb:/ipfs/QmTBY1GphjwAnY2nC9qKMwj5HeAUJMgFdo5YZcVxsVyqFb\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol\":{\"keccak256\":\"0x7b69b3d536c995e84a5fe4ec3dc63ddf01a3538f72ece83828e87aa90df33a7d\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://7ba34b22f5b25cd6fecfd0d5e9b6077b36130a2cb4539b1311de0f328c226958\",\"dweb:/ipfs/QmUURWvPbrZ6Z4iDv8Sa8soQCZyKZCsCcdMzgY9Jy5RNV2\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol\":{\"keccak256\":\"0xb96efb76433446cf0ccb9f5bc926301a9c8bcbfd17dcd6a36a1e6207f5b436b2\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://5ec097e17d3e47e16808a5246a99af7ef618bb58ccb61d7331bfca1929cbbd82\",\"dweb:/ipfs/QmbH7rg5s5gdpa5KENMUXHyGBWJyQn6XEwv9JakRSCcv8n\"]},\"lib/composable-cow/lib/safe/contracts/Safe.sol\":{\"keccak256\":\"0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119\",\"dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9\"]},\"lib/composable-cow/lib/safe/contracts/base/Executor.sol\":{\"keccak256\":\"0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c\",\"dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp\"]},\"lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol\":{\"keccak256\":\"0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e\",\"dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV\"]},\"lib/composable-cow/lib/safe/contracts/base/GuardManager.sol\":{\"keccak256\":\"0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64\",\"dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx\"]},\"lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol\":{\"keccak256\":\"0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d\",\"dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz\"]},\"lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol\":{\"keccak256\":\"0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a\",\"dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK\"]},\"lib/composable-cow/lib/safe/contracts/common/Enum.sol\":{\"keccak256\":\"0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34\",\"dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo\"]},\"lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol\":{\"keccak256\":\"0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9\",\"dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g\"]},\"lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol\":{\"keccak256\":\"0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3\",\"dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N\"]},\"lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol\":{\"keccak256\":\"0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3\",\"dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu\"]},\"lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol\":{\"keccak256\":\"0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80\",\"dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4\"]},\"lib/composable-cow/lib/safe/contracts/common/Singleton.sol\":{\"keccak256\":\"0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde\",\"dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo\"]},\"lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol\":{\"keccak256\":\"0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e\",\"dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ\"]},\"lib/composable-cow/lib/safe/contracts/external/SafeMath.sol\":{\"keccak256\":\"0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c\",\"dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x\"]},\"lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol\":{\"keccak256\":\"0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515\",\"dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV\"]},\"lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol\":{\"keccak256\":\"0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4\",\"dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol\":{\"keccak256\":\"0x4d562221e6645b6e79da99d2b322331617051fa90e06ec7ce3f9a6a87bae116c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5a574dd50b9e9a594afda4a96701295e18a0054fcaf5083573ee80033b2da060\",\"dweb:/ipfs/QmNQf5rfHqMCGKBcqZowz89JEZe8rjjoYEkySBy7oxwh4Y\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/ExtensibleBase.sol\":{\"keccak256\":\"0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9\",\"dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol\":{\"keccak256\":\"0x3020c96c812548a2bf6413168ee21033638a36736b695909f7cf54277beefd76\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://6ffdf49fb516791f4cad239fc780bb5d9934bb06744b99b0fbc067f31ad13591\",\"dweb:/ipfs/QmPXwVoDhnhnQFSxEiHDZYRQJ5ozAECSFrUHMTjwAJ1LuM\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol\":{\"keccak256\":\"0x36eacc47b1ce7697e679c1b5c0d3a86d8f46a0436b666f86e88df04765cde5c1\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7097bfb174ea424ef55f9a5b55f4a9857f7368cdd3061888f5ffb3e29503f071\",\"dweb:/ipfs/QmRPvAvMdGRuh8AjePtamBGUU55p1tSP8ZHUUMfxWgi1ew\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol\":{\"keccak256\":\"0x51e8dad81059527f9b6b6827d742a0fbc0960c66e364dd1e67c8f151970c6ee4\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://b368a4eb15d50487986db1543a5c786324a4d0de680a421d131e21c25459f666\",\"dweb:/ipfs/QmVca3J2JBEZtxW3uNMvYc9ugQH24CqantLnVzKcZwG71W\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol\":{\"keccak256\":\"0x549d737c3eef66cec2a858b34dce4db42e56d8f053635742230873e6049e81ed\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f03f130c36be396895acfa7891ccca36725c6a6496085d88fc33071e00093073\",\"dweb:/ipfs/QmfLfenjQ1gWnotx5Vdda1kJBqjnCi53bGNqyZ5cN6wxXV\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol\":{\"keccak256\":\"0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c\",\"dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol\":{\"keccak256\":\"0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c\",\"dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89\",\"dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol\":{\"keccak256\":\"0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25\",\"dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978\"]},\"lib/composable-cow/src/BaseConditionalOrder.sol\":{\"keccak256\":\"0x8b429a011579b3d84df3bb3135b3299054790018220666befa9ab5af24f49e8f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a30f0535cf7fc4fabc42b83a04bd687b8e989ae8d0c3f6db63b69504c15a7a34\",\"dweb:/ipfs/QmSeKTQWEx74SV6hrdX3sGLV6L9MF8fPPqoyyvdB4Kt3bo\"]},\"lib/composable-cow/src/ComposableCoW.sol\":{\"keccak256\":\"0xcf1583fd0565c921f108e81d516591c9ff123f840dbdd349e9e98d793de4409f\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://112df8eb50205574a22bbb8db9f7d064ec4c753052f798668db88fd222724883\",\"dweb:/ipfs/QmSV7gBaWDn4PhJGCYayuFqvRortZHnzUjsZNGrm2NriEu\"]},\"lib/composable-cow/src/interfaces/IConditionalOrder.sol\":{\"keccak256\":\"0xe9e47811223793dfa9a5fc3098cf874385f547e536ef47da634b505659aeedc7\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://40c3daf74830a4394052b916ca920fce07761a2b66e8af8c877b72d2efaa49eb\",\"dweb:/ipfs/QmZ9adA6R1hCHnvg6DwnTn7zqta6zU1Ctb564zb8aiqRFD\"]},\"lib/composable-cow/src/interfaces/ISwapGuard.sol\":{\"keccak256\":\"0xac211fb24463a9c04a05bb58fe42d9bea10e58fe9ca35e7f544868eeb5972339\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://3ce2a180c5368c6807aecafb242675476bbc653ac72b3bd727db3467efe8b900\",\"dweb:/ipfs/QmWzTqMQCuvX5Zpn2sjxYUS9o3upsip4yNvwCMQGbXAk6Y\"]},\"lib/composable-cow/src/interfaces/IValueFactory.sol\":{\"keccak256\":\"0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de\",\"dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih\"]},\"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol\":{\"keccak256\":\"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777\",\"dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf\"]},\"lib/composable-cow/src/vendored/CoWSettlement.sol\":{\"keccak256\":\"0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840\",\"dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR\"]},\"lib/openzeppelin/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0x85a45f3f10014a0f8be41157a32b6a5f905753ea64a4b64e29fc12b7deeecf39\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c3c74009ce36136b36c77c23935b8e4a7b4f253be2da2be4fb4a916b1ce43743\",\"dweb:/ipfs/QmcH36v3iN7SJJuF73AunLR2LtNxhVJ1wm63ph4dPZ4pcL\"]},\"lib/openzeppelin/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2608291cb038b388d80b79a06b6118a42f7894ff67b7da10ec0dbbf5b2973ba\",\"dweb:/ipfs/QmWohqcBLbcxmA4eGPhZDXe5RYMMEEpFq22nfkaUMvTfw1\"]},\"lib/openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0ea104e577e63faea3b69c415637e99e755dcbf64c5833d7140c35a714d6d90c\",\"dweb:/ipfs/Qmau6x4Ns9XdyynRCNNp3RhLqijJjFm7z5fyZazfYFGYdq\"]},\"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f5196ec75139918c6c7bb4251b36395e668f1fa6d206beba7e7520e74913940d\",\"dweb:/ipfs/QmSyqjksXxmm2mCG6qRd1yuwLykypkSVBbnBnGqJRcuJMi\"]},\"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b3036b3a83b7c48f96641f2a9002b9f2dcb6a5958dd670894ada21ae8229b3d0\",\"dweb:/ipfs/QmUNfSBdoVtjhETaUJCYcaC7pTMgbhht926tJ2uXJbiVd3\"]},\"lib/openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b7bd24e224f67f65bfadf85dc2929fa965456bb2415478bd0125471b5ce35245\",\"dweb:/ipfs/QmRaydGr8BTHs1kvaZfsNU69pKzUAGFrvABn1KiRSbE51y\"]},\"lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0x6400c4bee15052e043e5d10315135972529bd1c8012f43da494dc6b4f4661058\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://da5d3d47d35af4373743a559ea4b9b7ecfe4bab6f0703f410c1e59959b7966ac\",\"dweb:/ipfs/QmTHdoghh4WLu4yURjGEgRk162pcwwdsG52MPGa12GqnGR\"]},\"lib/openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4ece9f0b9c8daca08c76b6b5405a6446b6f73b3a15fab7ff56e296cbd4a2c875\",\"dweb:/ipfs/QmQyRpyPRL5SQuAgj6SHmbir3foX65FJjbVTTQrA2EFg6L\"]},\"src/ConstantProduct.sol\":{\"keccak256\":\"0x4883252f066b38972e5466f54d7cbf6e1a5b7c55823f012837f254ccd7aaa707\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://5bcfdb33677ad8f14d939cb1570fbcdd0c5d25843d93f35e70c41a58f278345c\",\"dweb:/ipfs/QmRN1eRCJoGj3RygAbaRaGQ85DJjApEZv1qLUqGYbh1frT\"]},\"src/ConstantProductFactory.sol\":{\"keccak256\":\"0xd9e2a5d4cc9cde16d1d8469194eff6e32b97758413574fc866067a392d3d9255\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1745aea9ad3571a9edf950a8fd9d745042b2c697fa1bd0c46982fddc21dc7fc8\",\"dweb:/ipfs/QmVQMyM3uSRzvL61Fnb9rH5mYaLBQrkh69iB9Gx3Lk6QWD\"]},\"src/ConstantProductHelper.sol\":{\"keccak256\":\"0xb184c91352617489a5f22ce8bb29f9840a00f8055ac283e6d1d85984e786b677\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://9413468585f4d8faac44b2c1f7c02cd4f21f5df570c6573c7ccab584a420d366\",\"dweb:/ipfs/QmSE5dkMEjbt1pEv5Y1Ao7EeudNWET7TwtAP6FPUVXiGbR\"]},\"src/interfaces/ICOWAMMPoolFactory.sol\":{\"keccak256\":\"0x2b65e467fa06b6149a7f2eee4879973fc5845ab12f86e718f1c2708e0bf98829\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://2ea7e105fc8953eb819f64a1e426881d834afbe990fbcda08c30c18a2d1a332a\",\"dweb:/ipfs/QmSUpommi6khq2EgLSTNSEorHjKtoztqa9D5BfTZ83LBqX\"]},\"src/interfaces/ICOWAMMPoolHelper.sol\":{\"keccak256\":\"0xa5b11fe7aefe1d3ab091d5f381c15381a3dc7c5a4e0a597c33cbb0deecd3d704\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://6525ad30ec83975097671ec389ed20772dcbd0de07ea0e92b6b9bdf0a12c0163\",\"dweb:/ipfs/QmcYnz4FmMWLqdWpjEGHDXCWAWbKu98vDzUcHpkLJ5Cfg6\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/interfaces/ISettlement.sol\":{\"keccak256\":\"0x51833975e3c96a6bfc9b255d122e145fc28a968b920fda5744ea0d9bf022e84a\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://3b2228e777904811715e693f6fe577be18b128db72219a6f3ca528fb9c119bc6\",\"dweb:/ipfs/QmXnNgdMLJBhztH5US1EnxGV8PB4yvLZqhN1sTkvrdvSZ2\"]},\"src/legacy/Helper.sol\":{\"keccak256\":\"0xf0494ad9f71fdf2602dbd30f885ffd0b1a88beedcd7459ec75f759efb11dc1c4\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://e6b3916e22daa8fd8deae7b85b270972ea652ff696301852644f077dc8f82b2d\",\"dweb:/ipfs/QmcWJX9WoiBVsCjZVuv6SDYAQYDWDctXD8nkZVMqSbxZzK\"]},\"src/legacy/Snapshot.sol\":{\"keccak256\":\"0x2a0c3ff6bf1b8a86161f982589aed2012dd462aa8a1cdc06a73b9c2ca636ff4f\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://db6d85afd2b2711ebc9282c351c9a5e491d8d20f0646ae8ab45f548e426ab1eb\",\"dweb:/ipfs/QmNzZCc2CWBerhW2Eu44QRowFokYnCMcWaNiPJoRMsLKxV\"]},\"src/libraries/GetTradeableOrder.sol\":{\"keccak256\":\"0x095d47c2d45ff22440ddf8f76bb6b9cbfd7250d35849e79ccb89c8eeb126b645\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://787103261569a4b07b762f6a106178e5ec384b3b89bd24bfc079bc27ccde4b72\",\"dweb:/ipfs/QmTYN4jPyPecNWwqKpqqFbvZtBPwWvf4Z8MCPTSmZy85wM\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"type":"error","name":"InvalidArrayLength"},{"inputs":[],"type":"error","name":"MathOverflowedMulDiv"},{"inputs":[],"type":"error","name":"NoOrder"},{"inputs":[],"type":"error","name":"PoolDoesNotExist"},{"inputs":[],"type":"error","name":"PoolIsClosed"},{"inputs":[],"type":"error","name":"PoolIsPaused"},{"inputs":[{"internalType":"address","name":"amm","type":"address","indexed":true}],"type":"event","name":"COWAMMPoolCreated","anonymous":false},{"inputs":[],"stateMutability":"view","type":"function","name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[{"internalType":"address","name":"amm","type":"address"}],"stateMutability":"view","type":"function","name":"getSnapshot","outputs":[{"internalType":"bytes","name":"","type":"bytes"}]},{"inputs":[{"internalType":"address","name":"amm","type":"address"}],"stateMutability":"view","type":"function","name":"isLegacy","outputs":[{"internalType":"bool","name":"","type":"bool"}]},{"inputs":[{"internalType":"address","name":"amm","type":"address"}],"stateMutability":"view","type":"function","name":"isLegacyEnabled","outputs":[{"internalType":"bool","name":"success","type":"bool"}]},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256[]","name":"prices","type":"uint256[]"}],"stateMutability":"view","type":"function","name":"order","outputs":[{"internalType":"struct GPv2Order.Data","name":"_order","type":"tuple","components":[{"internalType":"contract IERC20","name":"sellToken","type":"address"},{"internalType":"contract IERC20","name":"buyToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"bytes32","name":"kind","type":"bytes32"},{"internalType":"bool","name":"partiallyFillable","type":"bool"},{"internalType":"bytes32","name":"sellTokenBalance","type":"bytes32"},{"internalType":"bytes32","name":"buyTokenBalance","type":"bytes32"}]},{"internalType":"struct GPv2Interaction.Data[]","name":"preInteractions","type":"tuple[]","components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}]},{"internalType":"struct GPv2Interaction.Data[]","name":"postInteractions","type":"tuple[]","components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}]},{"internalType":"bytes","name":"sig","type":"bytes"}]},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"view","type":"function","name":"tokens","outputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"}]}],"devdoc":{"kind":"dev","methods":{"constructor":{"details":"This is a specific hack to broadcast legacy data in a forward-compatible"},"getSnapshot(address)":{"details":"Returns the IConditionalOrder.ConditionalOrderParams for a legacy CoW AMM. Returns bytes(0) if the pool isn't found in the snapshot data."},"isLegacy(address)":{"details":"Given an `amm`, check if it is in the hardcoded list of legacy CoW AMMs."},"isLegacyEnabled(address)":{"details":"Given an `amm` that is is known to be legacy, check if it is still valid."},"order(address,uint256[])":{"details":"Reverts with `NoOrder` if the `pool` has no canonical order matching the given price vector.","params":{"pool":"to calculate the order / signature for","prices":"supplied for determining the order, assumed to be in the same order as returned from `tokens(pool)`. Tokens prices are expressed relative to each other: for example, if tokens[0] is WETH, tokens[2] is DAI, and the price is 1 WETH per 3000 DAI, then a valid price vector is [3000, *, 1, ...]. If tokens[1] is another stablecoin with 18 decimals, then a valid price vector could be [3000, 3000, 1, ...]. This price vector is compatible with the price vector used in a call to `settle`, assuming the traded token array is in the same order as in `tokens(pool)`."},"returns":{"_order":"The CoW Protocol JIT order","postInteractions":"The array array for any **POST** interactions (empty if none)","preInteractions":"The array array for any **PRE** interactions (empty if none)","sig":"A valid CoW-Protocol signature for the resulting order using the ERC-1271 signature scheme."}}},"version":1},"userdoc":{"kind":"user","methods":{"factory()":{"notice":"AMM Pool helpers MUST return the factory target for indexing of CoW AMM pools."},"order(address,uint256[])":{"notice":"AMM Pool helpers MUST provide a method for returning the canonical order required to satisfy the pool's invariants, given a pricing vector."},"tokens(address)":{"notice":"AMM Pool helpers MUST return all tokens that may be traded on this pool. The order of the tokens is expected to be consistent and must be the same as that used for the input price vector in the `order` function."}},"version":1}},"settings":{"remappings":["@openzeppelin/=lib/composable-cow/lib/@openzeppelin/","@openzeppelin/contracts/=lib/openzeppelin/contracts/","composable-cow/=lib/composable-cow/","cowprotocol/=lib/composable-cow/lib/cowprotocol/src/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","murky/=lib/composable-cow/lib/murky/src/","openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin/","safe/=lib/composable-cow/lib/safe/","uniswap-v2-core/=lib/uniswap-v2-core/contracts/","lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/","lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/","lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/","lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/"],"optimizer":{"enabled":true,"runs":100000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/ConstantProductHelper.sol":"ConstantProductHelper"},"evmVersion":"cancun","libraries":{}},"sources":{"lib/composable-cow/lib/cowprotocol/src/contracts/interfaces/IERC20.sol":{"keccak256":"0x2db02cc0e23db99d10cd21590425b714060a556bcfb934cb5ab3b80aef1610ba","urls":["bzz-raw://c05f8a21a244e6566a3e555028cebeebd1c38902f0cea2e9b014cc7becaf3140","dweb:/ipfs/QmTBY1GphjwAnY2nC9qKMwj5HeAUJMgFdo5YZcVxsVyqFb"],"license":"MIT"},"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol":{"keccak256":"0x7b69b3d536c995e84a5fe4ec3dc63ddf01a3538f72ece83828e87aa90df33a7d","urls":["bzz-raw://7ba34b22f5b25cd6fecfd0d5e9b6077b36130a2cb4539b1311de0f328c226958","dweb:/ipfs/QmUURWvPbrZ6Z4iDv8Sa8soQCZyKZCsCcdMzgY9Jy5RNV2"],"license":"LGPL-3.0-or-later"},"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol":{"keccak256":"0xb96efb76433446cf0ccb9f5bc926301a9c8bcbfd17dcd6a36a1e6207f5b436b2","urls":["bzz-raw://5ec097e17d3e47e16808a5246a99af7ef618bb58ccb61d7331bfca1929cbbd82","dweb:/ipfs/QmbH7rg5s5gdpa5KENMUXHyGBWJyQn6XEwv9JakRSCcv8n"],"license":"LGPL-3.0-or-later"},"lib/composable-cow/lib/safe/contracts/Safe.sol":{"keccak256":"0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638","urls":["bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119","dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/Executor.sol":{"keccak256":"0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a","urls":["bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c","dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol":{"keccak256":"0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165","urls":["bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e","dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/GuardManager.sol":{"keccak256":"0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d","urls":["bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64","dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol":{"keccak256":"0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a","urls":["bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d","dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol":{"keccak256":"0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c","urls":["bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a","dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/Enum.sol":{"keccak256":"0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453","urls":["bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34","dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol":{"keccak256":"0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba","urls":["bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9","dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol":{"keccak256":"0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05","urls":["bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3","dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol":{"keccak256":"0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13","urls":["bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3","dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol":{"keccak256":"0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c","urls":["bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80","dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/Singleton.sol":{"keccak256":"0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50","urls":["bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde","dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol":{"keccak256":"0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e","urls":["bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e","dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/external/SafeMath.sol":{"keccak256":"0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89","urls":["bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c","dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol":{"keccak256":"0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9","urls":["bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515","dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol":{"keccak256":"0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5","urls":["bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4","dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol":{"keccak256":"0x4d562221e6645b6e79da99d2b322331617051fa90e06ec7ce3f9a6a87bae116c","urls":["bzz-raw://5a574dd50b9e9a594afda4a96701295e18a0054fcaf5083573ee80033b2da060","dweb:/ipfs/QmNQf5rfHqMCGKBcqZowz89JEZe8rjjoYEkySBy7oxwh4Y"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/ExtensibleBase.sol":{"keccak256":"0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15","urls":["bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9","dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol":{"keccak256":"0x3020c96c812548a2bf6413168ee21033638a36736b695909f7cf54277beefd76","urls":["bzz-raw://6ffdf49fb516791f4cad239fc780bb5d9934bb06744b99b0fbc067f31ad13591","dweb:/ipfs/QmPXwVoDhnhnQFSxEiHDZYRQJ5ozAECSFrUHMTjwAJ1LuM"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol":{"keccak256":"0x36eacc47b1ce7697e679c1b5c0d3a86d8f46a0436b666f86e88df04765cde5c1","urls":["bzz-raw://7097bfb174ea424ef55f9a5b55f4a9857f7368cdd3061888f5ffb3e29503f071","dweb:/ipfs/QmRPvAvMdGRuh8AjePtamBGUU55p1tSP8ZHUUMfxWgi1ew"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol":{"keccak256":"0x51e8dad81059527f9b6b6827d742a0fbc0960c66e364dd1e67c8f151970c6ee4","urls":["bzz-raw://b368a4eb15d50487986db1543a5c786324a4d0de680a421d131e21c25459f666","dweb:/ipfs/QmVca3J2JBEZtxW3uNMvYc9ugQH24CqantLnVzKcZwG71W"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol":{"keccak256":"0x549d737c3eef66cec2a858b34dce4db42e56d8f053635742230873e6049e81ed","urls":["bzz-raw://f03f130c36be396895acfa7891ccca36725c6a6496085d88fc33071e00093073","dweb:/ipfs/QmfLfenjQ1gWnotx5Vdda1kJBqjnCi53bGNqyZ5cN6wxXV"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol":{"keccak256":"0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493","urls":["bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c","dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol":{"keccak256":"0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479","urls":["bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c","dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol":{"keccak256":"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb","urls":["bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89","dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38"],"license":"LGPL-3.0-only"},"lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol":{"keccak256":"0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457","urls":["bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25","dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978"],"license":"LGPL-3.0-only"},"lib/composable-cow/src/BaseConditionalOrder.sol":{"keccak256":"0x8b429a011579b3d84df3bb3135b3299054790018220666befa9ab5af24f49e8f","urls":["bzz-raw://a30f0535cf7fc4fabc42b83a04bd687b8e989ae8d0c3f6db63b69504c15a7a34","dweb:/ipfs/QmSeKTQWEx74SV6hrdX3sGLV6L9MF8fPPqoyyvdB4Kt3bo"],"license":"MIT"},"lib/composable-cow/src/ComposableCoW.sol":{"keccak256":"0xcf1583fd0565c921f108e81d516591c9ff123f840dbdd349e9e98d793de4409f","urls":["bzz-raw://112df8eb50205574a22bbb8db9f7d064ec4c753052f798668db88fd222724883","dweb:/ipfs/QmSV7gBaWDn4PhJGCYayuFqvRortZHnzUjsZNGrm2NriEu"],"license":"GPL-3.0"},"lib/composable-cow/src/interfaces/IConditionalOrder.sol":{"keccak256":"0xe9e47811223793dfa9a5fc3098cf874385f547e536ef47da634b505659aeedc7","urls":["bzz-raw://40c3daf74830a4394052b916ca920fce07761a2b66e8af8c877b72d2efaa49eb","dweb:/ipfs/QmZ9adA6R1hCHnvg6DwnTn7zqta6zU1Ctb564zb8aiqRFD"],"license":"GPL-3.0"},"lib/composable-cow/src/interfaces/ISwapGuard.sol":{"keccak256":"0xac211fb24463a9c04a05bb58fe42d9bea10e58fe9ca35e7f544868eeb5972339","urls":["bzz-raw://3ce2a180c5368c6807aecafb242675476bbc653ac72b3bd727db3467efe8b900","dweb:/ipfs/QmWzTqMQCuvX5Zpn2sjxYUS9o3upsip4yNvwCMQGbXAk6Y"],"license":"GPL-3.0"},"lib/composable-cow/src/interfaces/IValueFactory.sol":{"keccak256":"0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122","urls":["bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de","dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih"],"license":"GPL-3.0"},"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol":{"keccak256":"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae","urls":["bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777","dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf"],"license":"MIT"},"lib/composable-cow/src/vendored/CoWSettlement.sol":{"keccak256":"0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7","urls":["bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840","dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR"],"license":"MIT"},"lib/openzeppelin/contracts/interfaces/IERC1271.sol":{"keccak256":"0x85a45f3f10014a0f8be41157a32b6a5f905753ea64a4b64e29fc12b7deeecf39","urls":["bzz-raw://c3c74009ce36136b36c77c23935b8e4a7b4f253be2da2be4fb4a916b1ce43743","dweb:/ipfs/QmcH36v3iN7SJJuF73AunLR2LtNxhVJ1wm63ph4dPZ4pcL"],"license":"MIT"},"lib/openzeppelin/contracts/interfaces/IERC20.sol":{"keccak256":"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c","urls":["bzz-raw://a2608291cb038b388d80b79a06b6118a42f7894ff67b7da10ec0dbbf5b2973ba","dweb:/ipfs/QmWohqcBLbcxmA4eGPhZDXe5RYMMEEpFq22nfkaUMvTfw1"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/IERC20.sol":{"keccak256":"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70","urls":["bzz-raw://0ea104e577e63faea3b69c415637e99e755dcbf64c5833d7140c35a714d6d90c","dweb:/ipfs/Qmau6x4Ns9XdyynRCNNp3RhLqijJjFm7z5fyZazfYFGYdq"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol":{"keccak256":"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff","urls":["bzz-raw://f5196ec75139918c6c7bb4251b36395e668f1fa6d206beba7e7520e74913940d","dweb:/ipfs/QmSyqjksXxmm2mCG6qRd1yuwLykypkSVBbnBnGqJRcuJMi"],"license":"MIT"},"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol":{"keccak256":"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386","urls":["bzz-raw://b3036b3a83b7c48f96641f2a9002b9f2dcb6a5958dd670894ada21ae8229b3d0","dweb:/ipfs/QmUNfSBdoVtjhETaUJCYcaC7pTMgbhht926tJ2uXJbiVd3"],"license":"MIT"},"lib/openzeppelin/contracts/utils/Address.sol":{"keccak256":"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721","urls":["bzz-raw://b7bd24e224f67f65bfadf85dc2929fa965456bb2415478bd0125471b5ce35245","dweb:/ipfs/QmRaydGr8BTHs1kvaZfsNU69pKzUAGFrvABn1KiRSbE51y"],"license":"MIT"},"lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol":{"keccak256":"0x6400c4bee15052e043e5d10315135972529bd1c8012f43da494dc6b4f4661058","urls":["bzz-raw://da5d3d47d35af4373743a559ea4b9b7ecfe4bab6f0703f410c1e59959b7966ac","dweb:/ipfs/QmTHdoghh4WLu4yURjGEgRk162pcwwdsG52MPGa12GqnGR"],"license":"MIT"},"lib/openzeppelin/contracts/utils/math/Math.sol":{"keccak256":"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d","urls":["bzz-raw://4ece9f0b9c8daca08c76b6b5405a6446b6f73b3a15fab7ff56e296cbd4a2c875","dweb:/ipfs/QmQyRpyPRL5SQuAgj6SHmbir3foX65FJjbVTTQrA2EFg6L"],"license":"MIT"},"src/ConstantProduct.sol":{"keccak256":"0x4883252f066b38972e5466f54d7cbf6e1a5b7c55823f012837f254ccd7aaa707","urls":["bzz-raw://5bcfdb33677ad8f14d939cb1570fbcdd0c5d25843d93f35e70c41a58f278345c","dweb:/ipfs/QmRN1eRCJoGj3RygAbaRaGQ85DJjApEZv1qLUqGYbh1frT"],"license":"GPL-3.0"},"src/ConstantProductFactory.sol":{"keccak256":"0xd9e2a5d4cc9cde16d1d8469194eff6e32b97758413574fc866067a392d3d9255","urls":["bzz-raw://1745aea9ad3571a9edf950a8fd9d745042b2c697fa1bd0c46982fddc21dc7fc8","dweb:/ipfs/QmVQMyM3uSRzvL61Fnb9rH5mYaLBQrkh69iB9Gx3Lk6QWD"],"license":"GPL-3.0"},"src/ConstantProductHelper.sol":{"keccak256":"0xb184c91352617489a5f22ce8bb29f9840a00f8055ac283e6d1d85984e786b677","urls":["bzz-raw://9413468585f4d8faac44b2c1f7c02cd4f21f5df570c6573c7ccab584a420d366","dweb:/ipfs/QmSE5dkMEjbt1pEv5Y1Ao7EeudNWET7TwtAP6FPUVXiGbR"],"license":"LGPL-3.0-only"},"src/interfaces/ICOWAMMPoolFactory.sol":{"keccak256":"0x2b65e467fa06b6149a7f2eee4879973fc5845ab12f86e718f1c2708e0bf98829","urls":["bzz-raw://2ea7e105fc8953eb819f64a1e426881d834afbe990fbcda08c30c18a2d1a332a","dweb:/ipfs/QmSUpommi6khq2EgLSTNSEorHjKtoztqa9D5BfTZ83LBqX"],"license":"GPL-3.0"},"src/interfaces/ICOWAMMPoolHelper.sol":{"keccak256":"0xa5b11fe7aefe1d3ab091d5f381c15381a3dc7c5a4e0a597c33cbb0deecd3d704","urls":["bzz-raw://6525ad30ec83975097671ec389ed20772dcbd0de07ea0e92b6b9bdf0a12c0163","dweb:/ipfs/QmcYnz4FmMWLqdWpjEGHDXCWAWbKu98vDzUcHpkLJ5Cfg6"],"license":"LGPL-3.0-only"},"src/interfaces/IPriceOracle.sol":{"keccak256":"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e","urls":["bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2","dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu"],"license":"GPL-3.0"},"src/interfaces/ISettlement.sol":{"keccak256":"0x51833975e3c96a6bfc9b255d122e145fc28a968b920fda5744ea0d9bf022e84a","urls":["bzz-raw://3b2228e777904811715e693f6fe577be18b128db72219a6f3ca528fb9c119bc6","dweb:/ipfs/QmXnNgdMLJBhztH5US1EnxGV8PB4yvLZqhN1sTkvrdvSZ2"],"license":"GPL-3.0"},"src/legacy/Helper.sol":{"keccak256":"0xf0494ad9f71fdf2602dbd30f885ffd0b1a88beedcd7459ec75f759efb11dc1c4","urls":["bzz-raw://e6b3916e22daa8fd8deae7b85b270972ea652ff696301852644f077dc8f82b2d","dweb:/ipfs/QmcWJX9WoiBVsCjZVuv6SDYAQYDWDctXD8nkZVMqSbxZzK"],"license":"LGPL-3.0-only"},"src/legacy/Snapshot.sol":{"keccak256":"0x2a0c3ff6bf1b8a86161f982589aed2012dd462aa8a1cdc06a73b9c2ca636ff4f","urls":["bzz-raw://db6d85afd2b2711ebc9282c351c9a5e491d8d20f0646ae8ab45f548e426ab1eb","dweb:/ipfs/QmNzZCc2CWBerhW2Eu44QRowFokYnCMcWaNiPJoRMsLKxV"],"license":"LGPL-3.0-only"},"src/libraries/GetTradeableOrder.sol":{"keccak256":"0x095d47c2d45ff22440ddf8f76bb6b9cbfd7250d35849e79ccb89c8eeb126b645","urls":["bzz-raw://787103261569a4b07b762f6a106178e5ec384b3b89bd24bfc079bc27ccde4b72","dweb:/ipfs/QmTYN4jPyPecNWwqKpqqFbvZtBPwWvf4Z8MCPTSmZy85wM"],"license":"LGPL-3.0-only"}},"version":1},"id":126} +{ + "abi": [ + { + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "factory", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getSnapshot", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isLegacy", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isLegacyEnabled", + "inputs": [ + { + "name": "amm", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "success", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "order", + "inputs": [ + { + "name": "pool", + "type": "address", + "internalType": "address" + }, + { + "name": "prices", + "type": "uint256[]", + "internalType": "uint256[]" + } + ], + "outputs": [ + { + "name": "_order", + "type": "tuple", + "internalType": "struct GPv2Order.Data", + "components": [ + { + "name": "sellToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "buyToken", + "type": "address", + "internalType": "contract IERC20" + }, + { + "name": "receiver", + "type": "address", + "internalType": "address" + }, + { + "name": "sellAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "buyAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "validTo", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "appData", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "feeAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "kind", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "partiallyFillable", + "type": "bool", + "internalType": "bool" + }, + { + "name": "sellTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "buyTokenBalance", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "preInteractions", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "postInteractions", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "sig", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "tokens", + "inputs": [ + { + "name": "pool", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "_tokens", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "COWAMMPoolCreated", + "inputs": [ + { + "name": "amm", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "InvalidArrayLength", + "inputs": [] + }, + { + "type": "error", + "name": "MathOverflowedMulDiv", + "inputs": [] + }, + { + "type": "error", + "name": "NoOrder", + "inputs": [] + }, + { + "type": "error", + "name": "PoolDoesNotExist", + "inputs": [] + }, + { + "type": "error", + "name": "PoolIsClosed", + "inputs": [] + }, + { + "type": "error", + "name": "PoolIsPaused", + "inputs": [] + } + ], + "bytecode": "0x608060405234801561000f575f80fd5b5061001861001d565b6102ff565b46600181900361011257610044739941fd7db2003308e7ee17b04400012278f12ac66102c9565b61006173b3bf81714f704720dcb0351ff0d42eca61b069fc6102c9565b61007e73301076c36e034948a747bb61bab9cd03f62672e36102c9565b61009b73027e1cbf2c299cba5eb8a2584910d04f1a8aa4036102c9565b6100b873beef5afe88ef73337e5070ab2855d37dbf5493a46102c9565b6100d573c6b13d5e662fa0458f03995bcb824a1934aa895f6102c9565b6100f273d7cb8cc1b56356bb7b78d02e785ead28e21586606102c9565b61010f73079c868f97aed8e0d03f11e1529c3b056ff21cea6102c9565b50565b8060640361010f5761013773bc6159fd429be18206e60b3bb01d7289f905511b6102c9565b61015473e5d1aa8565f5dbfc06cde20dfd76b4c7c6d43bd56102c9565b610171739d8570ef9a519ca81daec35212f435d9843ba5646102c9565b61018e73d97c31e53f16f495715ce71e12e11b9545eedd8b6102c9565b6101ab73ff1bd3d570e3544c183ba77f5a4d3cc742c8d2b36102c9565b6101c873209d269dfd66b9cec764de7eb6fefc24f75bdd486102c9565b6101e573c37575ad8efe530fd8a79aeb0087e5872a24dabc6102c9565b610202731c7828dadade12a848f36be8e2d3146462abff686102c9565b61021f73aba5294bba7d3635c2a3e44d0e87ea7f58898fb76102c9565b61023c736eb7be972aebb6be2d9acf437cb412c0abee912b6102c9565b61025973c4d09969aad7f252c75dd352bbbd719e34ed06ad6102c9565b61027673a25af86a5dbea45e9fd70c1879489f63d081ad446102c9565b6102937357492cb6c8ee2998e9d83ddc8c713e781ffe548e6102c9565b6102b073c33e3ec14556a8e71be3097fe2dc8c0b9119c8976102c9565b61010f7377472826875953374ed3084c31a483f827987f145b6040516001600160a01b038216907f0d03834d0d86c7f57e877af40e26f176dc31bd637535d4ba153d1ac9de88a7ea905f90a250565b6156848061030c5f395ff3fe608060405234801561000f575f80fd5b506004361061006f575f3560e01c80632aec79a01161004d5780632aec79a0146100de578063c45a0155146100f1578063e48603391461011e575f80fd5b806310029daa14610073578063215702561461009b57806327242c9b146100bb575b5f80fd5b610086610081366004612462565b61013e565b60405190151581526020015b60405180910390f35b6100ae6100a9366004612462565b61050c565b60405161009291906124c9565b6100ce6100c93660046124db565b610cc6565b60405161009294939291906126e9565b6100866100ec366004612462565b61132d565b6100f9611340565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610092565b61013161012c366004612462565b611410565b6040516100929190612734565b6040517f5624b25b0000000000000000000000000000000000000000000000000000000081527f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d56004820152600160248201525f90819073ffffffffffffffffffffffffffffffffffffffff841690635624b25b906044015f60405180830381865afa1580156101d0573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610215919081019061288a565b80602001905181019061022891906128c4565b90505f732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161490505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff166351cad5ee87739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061034e91906128df565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381865afa1580156103ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103de91906128c4565b73ffffffffffffffffffffffffffffffffffffffff161490505f6104018661050c565b80602001905181019061041491906128f6565b90505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16636108c532888460405160200161045991906129cf565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b81526004016104ad92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602060405180830381865afa1580156104c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ec91906129e1565b90508380156104f85750825b80156105015750805b979650505050505050565b60604660018190036107bd5773ffffffffffffffffffffffffffffffffffffffff8316739941fd7db2003308e7ee17b04400012278f12ac60361056c57604051806101e001604052806101c0815260200161482f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673b3bf81714f704720dcb0351ff0d42eca61b069fc036105c057604051806101e001604052806101c081526020016150ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673301076c36e034948a747bb61bab9cd03f62672e30361061457604051806101e001604052806101c0815260200161364f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673027e1cbf2c299cba5eb8a2584910d04f1a8aa4030361066857604051806101e001604052806101c08152602001612d2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673beef5afe88ef73337e5070ab2855d37dbf5493a4036106bc57604051806101e001604052806101c081526020016142ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c6b13d5e662fa0458f03995bcb824a1934aa895f0361071057604051806101e001604052806101c0815260200161412f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d7cb8cc1b56356bb7b78d02e785ead28e21586600361076457604051806101e001604052806101c081526020016139cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673079c868f97aed8e0d03f11e1529c3b056ff21cea036107b857604051806101e001604052806101c081526020016149ef6101c091399392505050565b610cb1565b80606403610cb15773ffffffffffffffffffffffffffffffffffffffff831673bc6159fd429be18206e60b3bb01d7289f905511b0361081957604051806101e001604052806101c08152602001612eef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673e5d1aa8565f5dbfc06cde20dfd76b4c7c6d43bd50361086d57604051806101e001604052806101c0815260200161466f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316739d8570ef9a519ca81daec35212f435d9843ba564036108c157604051806101e001604052806101c08152602001614baf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d97c31e53f16f495715ce71e12e11b9545eedd8b036109155760405180610240016040528061022081526020016130af61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673ff1bd3d570e3544c183ba77f5a4d3cc742c8d2b30361096957604051806101e001604052806101c0815260200161548f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673209d269dfd66b9cec764de7eb6fefc24f75bdd48036109bd57604051806101e001604052806101c08152602001614f2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c37575ad8efe530fd8a79aeb0087e5872a24dabc03610a1157604051806101e001604052806101c0815260200161348f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316731c7828dadade12a848f36be8e2d3146462abff6803610a6557604051806101e001604052806101c08152602001613f6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673aba5294bba7d3635c2a3e44d0e87ea7f58898fb703610ab957604051806101e001604052806101c08152602001614d6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316736eb7be972aebb6be2d9acf437cb412c0abee912b03610b0d57604051806101e001604052806101c081526020016132cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c4d09969aad7f252c75dd352bbbd719e34ed06ad03610b61576040518061024001604052806102208152602001613d4f61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673a25af86a5dbea45e9fd70c1879489f63d081ad4403610bb557604051806101e001604052806101c081526020016144af6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167357492cb6c8ee2998e9d83ddc8c713e781ffe548e03610c09576040518061020001604052806101e081526020016152af6101e091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c33e3ec14556a8e71be3097fe2dc8c0b9119c89703610c5d57604051806101e001604052806101c0815260200161380f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167377472826875953374ed3084c31a483f827987f1403610cb157604051806101e001604052806101c08152602001613b8f6101c091399392505050565b505060408051602081019091525f8152919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060808060028514610d64576040517f9d89020a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060610d6f8861132d565b6112e957610d7c88611696565b610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f506f6f6c206973206e6f74206120436f5720414d4d000000000000000000000060448201526064015b60405180910390fd5b5f8873ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e31573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e5591906128c4565b90505f8973ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ec591906128c4565b90508973ffffffffffffffffffffffffffffffffffffffff16634ada218b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f10573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3491906129e1565b15155f03610f6e576040517f21081abf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110816040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110610fe357610fe3612a00565b9050602002013581526020018b8b5f81811061100157611001612a00565b9050602002013581526020018c73ffffffffffffffffffffffffffffffffffffffff16636dbc88136040518163ffffffff1660e01b8152600401602060405180830381865afa158015611056573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061107a91906128df565b905261174e565b9650866040516020016110949190612a2d565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815260018084528383019092529450816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816110d157905050955060405180606001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020015f815260200161123b739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561118e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111b291906128df565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08b0180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405160240161124d91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ff14fcbc8000000000000000000000000000000000000000000000000000000001790529052865187905f906112d7576112d7612a00565b602002602001018190525050506112ff565b6112f4888888611ad6565b929750909550935090505b8781604051602001611312929190612a3c565b60405160208183030381529060405291505093509350935093565b5f806113388361050c565b511192915050565b5f46600181900361136657738deed8ed7c5fcb55884f13f121654bb4bb7c843791505090565b8060640361138957732af6c59fc957d4a45ddbbd927fa30f7c5051f58391505090565b8062aa36a7036113ae5773bd18758055dbe3ed37a2471394559ae97a5da5c091505090565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e737570706f7274656420636861696e0000000000000000000000000000006044820152606401610dde565b60408051600280825260608083018452926020830190803683370190505090506114398261132d565b6115b5578173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114aa91906128c4565b815f815181106114bc576114bc612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561153f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061156391906128c4565b8160018151811061157657611576612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050919050565b5f6115bf8361215f565b509050805f815181106115d4576115d4612a00565b6020026020010151825f815181106115ee576115ee612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508060018151811061163b5761163b612a00565b60200260200101518260018151811061165657611656612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050919050565b5f806116a0611340565b6040517f666e1b3900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152919091169063666e1b3990602401602060405180830381865afa15801561170c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061173091906128c4565b73ffffffffffffffffffffffffffffffffffffffff16141592915050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810191909152602082015182516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201525f92839216906370a0823190602401602060405180830381865afa158015611822573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061184691906128df565b604085810151865191517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116906370a0823190602401602060405180830381865afa1580156118b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118db91906128df565b915091505f805f805f8860800151876118f49190612aae565b90505f8960600151876119079190612aae565b90508181101561196d578960200151955089604001519450611939818b6080015160026119349190612aae565b61227b565b61194460028a612af2565b61194e9190612b05565b9350611966848861195f828c612b05565b60016122cb565b92506119b9565b8960400151955089602001519450611990828b6060015160026119349190612aae565b61199b600289612af2565b6119a59190612b05565b93506119b6848961195f828b612b05565b92505b6040518061018001604052808773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200161012c42611a339190612b18565b63ffffffff1681526020018b60a0015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981525098505050505050505050919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060806060611b448761013e565b611b7a576040517fefc869b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80611b858961215f565b915091505f8160400151806020019051810190611ba29190612b3c565b9050611c836040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff168152602001855f81518110611be057611be0612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200185600181518110611c1657611c16612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110611c4c57611c4c612a00565b9050602002013581526020018b8b5f818110611c6a57611c6a612a00565b9050602002013581526020018360a0015181525061174e565b96505f739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0791906128df565b9050807fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48989604051602001611d3c9190612a2d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181525f60608401818152608085018452845260208085018a9052835180820185529182528484019190915291519092611da092909101612bf4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611dde94939291602401612c9d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f5fd7e97d000000000000000000000000000000000000000000000000000000001790528151600180825281840190935292975082015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611e685790505060408051606081018252855173ffffffffffffffffffffffffffffffffffffffff1681525f602082015291985081018c611f558b857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405173ffffffffffffffffffffffffffffffffffffffff90921660248301526044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052875188905f9061200757612007612a00565b602090810291909101015260408051600180825281830190925290816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816120275790505095506040518060600160405280845f015173ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020018c5f801b6040516024016120bd92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052865187905f9061214757612147612a00565b60200260200101819052505050505093509350935093565b60408051606081810183525f80835260208301529181018290526121828361050c565b80602001905181019061219591906128f6565b90505f81604001518060200190518101906121b09190612b3c565b6040805160028082526060820183529293509190602083019080368337019050509250805f0151835f815181106121e9576121e9612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080602001518360018151811061223b5761223b612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050915091565b5f815f036122945761228d8284612af2565b90506122c5565b82156122c057816122a6600185612b05565b6122b09190612af2565b6122bb906001612ccd565b6122c2565b5f5b90505b92915050565b5f806122d886868661231a565b90506122e383612412565b80156122fe57505f84806122f9576122f9612ac5565b868809115b156123115761230e600182612ccd565b90505b95945050505050565b5f838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870982811083820303915050805f0361236d5783828161236357612363612ac5565b049250505061240b565b8084116123a6576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b5f600282600381111561242757612427612ce0565b6124319190612d0d565b60ff166001149050919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461245f575f80fd5b50565b5f60208284031215612472575f80fd5b813561240b8161243e565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6122c2602083018461247d565b5f805f604084860312156124ed575f80fd5b83356124f88161243e565b9250602084013567ffffffffffffffff80821115612514575f80fd5b818601915086601f830112612527575f80fd5b813581811115612535575f80fd5b8760208260051b8501011115612549575f80fd5b6020830194508093505050509250925092565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161259d602084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408101516125c5604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a08101516125f160a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516126268285018215159052565b5050610140818101519083015261016090810151910152565b5f82825180855260208086019550808260051b8401018186015f5b848110156126dc578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00189528151805173ffffffffffffffffffffffffffffffffffffffff16845284810151858501526040908101516060918501829052906126c88186018361247d565b9a86019a945050509083019060010161265a565b5090979650505050505050565b5f6101e06126f7838861255c565b8061018084015261270a8184018761263f565b90508281036101a084015261271f818661263f565b90508281036101c0840152610501818561247d565b602080825282518282018190525f9190848201906040850190845b8181101561278157835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161274f565b50909695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160c0810167ffffffffffffffff811182821017156127dd576127dd61278d565b60405290565b5f82601f8301126127f2575f80fd5b815167ffffffffffffffff8082111561280d5761280d61278d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156128535761285361278d565b8160405283815286602085880101111561286b575f80fd5b8360208701602083015e5f602085830101528094505050505092915050565b5f6020828403121561289a575f80fd5b815167ffffffffffffffff8111156128b0575f80fd5b6128bc848285016127e3565b949350505050565b5f602082840312156128d4575f80fd5b815161240b8161243e565b5f602082840312156128ef575f80fd5b5051919050565b5f60208284031215612906575f80fd5b815167ffffffffffffffff8082111561291d575f80fd5b9083019060608286031215612930575f80fd5b60405160608101818110838211171561294b5761294b61278d565b60405282516129598161243e565b815260208381015190820152604083015182811115612976575f80fd5b612982878286016127e3565b60408301525095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8151168252602081015160208301525f6040820151606060408501526128bc606085018261247d565b602081525f6122c26020830184612991565b5f602082840312156129f1575f80fd5b8151801515811461240b575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61018081016122c5828461255c565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1681525f82518060208501601485015e5f92016014019182525092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82612b0057612b00612ac5565b500490565b818103818111156122c5576122c5612a81565b63ffffffff818116838216019080821115612b3557612b35612a81565b5092915050565b5f60208284031215612b4c575f80fd5b815167ffffffffffffffff80821115612b63575f80fd5b9083019060c08286031215612b76575f80fd5b612b7e6127ba565b8251612b898161243e565b81526020830151612b998161243e565b6020820152604083810151908201526060830151612bb68161243e565b6060820152608083015182811115612bcc575f80fd5b612bd8878286016127e3565b60808301525060a083015160a082015280935050505092915050565b602080825282516060838301528051608084018190525f9291820190839060a08601905b80831015612c385783518252928401926001929092019190840190612c18565b508387015193507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0925082868203016040870152612c768185612991565b93505050604085015181858403016060860152612c93838261247d565b9695505050505050565b848152836020820152608060408201525f612cbb608083018561247d565b8281036060840152610501818561247d565b808201808211156122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f60ff831680612d1f57612d1f612ac5565b8060ff8416069150509291505056fe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dac5a0e756ac88c1d3a4c41900d977fe93c2d34fc95a00ca3e84eb4c6b50faf949000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005afe3855358e112b5647b952709e6165e1c1eeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000002e7e978da0c53404a8cf66ed4ba2c7706c07b62a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d85c99996d84d25387bc0d01e50e3ea814f64e7e04a3b949a571789e196c5a910000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000000000000000000000000000000affd9fdeb8e08000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020a99fd9950b5d5dceeaf4939e221dca8ca9b938ab0001000000000000000000250000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85178a729ee3008c7d48832d02267b72e5f34ada8f554a6731a368f01590ed71b34000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000008156197a5425c0c8000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000080000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a000000000000000000000000678df3415fc31947da4324ec63212874be5a82f8000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8512e31981e34960969eb549f5e826cf77f655e72b03603ad574a79fd015f4de4de0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a16c95a4d2e3c000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c0ce9e05c2aee5f22f9941c4cd1f1a1d13194b109779422d5ad9a980157bd0f1640000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851a2029fbb545978d05378b6df19e3754fe5ed2d0ba1e051027503934372f7beb20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000000000000000000000000000000052ba9efc38441a000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002021d4c792ea7e38e0d0819c2011a2b1cb7252bd9900020000000000000000001e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424daca44b6a304baa16d11b6db07066c1276b1273ee3f94590bbd03201a61882af9a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000098cb76000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b4e16d0168e52d35cacd2c6185b44281ec28c9dc0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85159457ac6201da7713efecd84618c7a168e88b9cb7d1c0db128af1efe0a08bbb10000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a17273fc14b64000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da80ba533f014ef4238ab7ad203c0aeacbf30a71c0346140db77c43ae3121afadd000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000aea46a60368a7bd060eec7df8cba43b7ef41ad85000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000336632e53c8ecf04000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000004042a04c54ef133ac2a3c93db69d43c6c02a330b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d67c9fb87045e07da94c81de035b5c7f435cd46568fca02aa35d709bbc9e21fa0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008e5bbbb09ed1ebde8674cda39a0c169401db4252000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008db8870ca4b8ac188c4d1a014f34a381ae27e1c20000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851209c17d9ebe3ac7352795f7f8b3d14d253d92430831d3b2c3965f9a578da7618000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000000000000000000000000000008aa3a52815262f58000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000800000000000000000000000000064ac007ff665cf8d0d3af5e0ad1c26a3f853ea000000000000000000000000a767f745331d267c7751297d982b050c93985627000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85105416460deb76d57af601be17e777b93592d8d4d4a4096c57876a91c84f418080000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000ce11e14225575945b8e6dc0d4f2dd4c570f79d9f000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000009634ca647474b6b78d3382331a77cd00a8a940da00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da932542294ff270a8bbdbe1fb921de3d09c9749dc35627361fc17c44b9b026b810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008390a1da07e376ef7add4be859ba74fb83aa02d5000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000aec1c94998000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000069c66beafb06674db41b22cfc50c34a93b8d82a2000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000def1ca1fb7fbcdc777520aa7f396b4e015f497ab000000000000000000000000000000000000000000000000025bf6196bd10000000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c0d661a16b0e85eadb705cf5158132b5dd1ebc0a49929ef68097698d15e2a4e3b40000000000000000000000000000000000000000000000000000000000000020de8c195aa41c11a0c4787372defbbddaa31306d20002000000000000000001810000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851560d33bcc26b7f10765f8ae10b1abc4ed265ba0c7a1f9948d06de97c31044aee0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000004d18815d14fe5c3304e87b3fa18318baa5c238200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020a9b2234773cc6a4f3a34a770c52c931cba5c24b20002000000000000000000870000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851437a72b19b25e8b62fdfb81146ec83c66462138d3d9e08998594853566fa9add000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000146e114355e0f6088000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204cdabe9e07ca393943acfb9286bbbd0d0a310ff600020000000000000000005c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da559d5fda20be80608e4d5ea1b41e6b9330efca7934beb094281dd4d8f4889374000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000079ef7f110fdfae4000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020e99481dc77691d8e2456e5f3f61c1810adfc1503000200000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da56871afb17e444c418900f6db3e1ade07d49eadea1accf03fcebc0a6e7e4b653000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b2617246d0c6c0087f18703d576831899ca94f01000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000048bcb79dba2b56b90000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b36ec83d844c0579ec2493f10b2087e96bb654600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8511ea56ac96a6369d36ef3fe56ae0ddff8d0cc89e1623095239c5ceed2505aa2810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000000000000000000000000000006b43c27d2e8300000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000028dbd35fd79f48bfa9444d330d14683e7101d8170000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d1e868d120e326e5581caa39852bb0da9234a511ed76e6f7a9dcceb0d5f154c70000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee48370100000000000000000000000000000000000000000000000000098e46995425ca000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851f0e8ec512b2507dae99175a0a4792d8a53e0863fbb5e735a5c993295bbd17f480000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb00000000000000000000000000000000000000000000000000094f8d9168e271000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204683e340a8049261057d5ab1b29c8d840e75695e00020000000000000000005a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dad003838829115f5d9ff3ed69c8d2b4b26e10eb1a79331206c28fbb4734390a5e000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000808507121b80c02388fad14726482e061b8da827000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000189b23422a9b84d8000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020fd1cf6fd41f229ca86ada0584c63c49c3d66bbc90002000000000000000004380000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8513956efd63537b00bb3b152d3c4961207b6ca14d6f506c66fc0aef4c8e2e176b5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e0000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000000000000000000000000000000000000000004500000000000000000000000015b4c67070d3748b8ec93c8a32f7efe2e8f684c900000000000000000000000000000000000000000000000000000000000000c0056e9806d953dbe2df4352a90ad2c1148c51460e941107f0909fae382b1661cf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000022441d81416430a54336ab28765abd31a792ad37000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85133f583d55c4509d5e10ebe3c7c69bce17af4c57419d6c9c90c8f588dd3232c0d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000af204776c7245bf4147c2612bf6e5972ee4837010000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000410d586a20a4c0000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063a2646970667358221220c3b6b701e7d5db53232efcebe1fe1bdd40a35653449ba7cd10551b9e5bf6a94a64736f6c63430008190033", + "deployedBytecode": "0x608060405234801561000f575f80fd5b506004361061006f575f3560e01c80632aec79a01161004d5780632aec79a0146100de578063c45a0155146100f1578063e48603391461011e575f80fd5b806310029daa14610073578063215702561461009b57806327242c9b146100bb575b5f80fd5b610086610081366004612462565b61013e565b60405190151581526020015b60405180910390f35b6100ae6100a9366004612462565b61050c565b60405161009291906124c9565b6100ce6100c93660046124db565b610cc6565b60405161009294939291906126e9565b6100866100ec366004612462565b61132d565b6100f9611340565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610092565b61013161012c366004612462565b611410565b6040516100929190612734565b6040517f5624b25b0000000000000000000000000000000000000000000000000000000081527f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d56004820152600160248201525f90819073ffffffffffffffffffffffffffffffffffffffff841690635624b25b906044015f60405180830381865afa1580156101d0573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610215919081019061288a565b80602001905181019061022891906128c4565b90505f732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161490505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16732f55e8b20d0b9fefa187aa7d00b6cbe563605bf573ffffffffffffffffffffffffffffffffffffffff166351cad5ee87739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061034e91906128df565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381865afa1580156103ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103de91906128c4565b73ffffffffffffffffffffffffffffffffffffffff161490505f6104018661050c565b80602001905181019061041491906128f6565b90505f73fdafc9d1902f4e0b84f65f49f244b32b31013b7473ffffffffffffffffffffffffffffffffffffffff16636108c532888460405160200161045991906129cf565b604051602081830303815290604052805190602001206040518363ffffffff1660e01b81526004016104ad92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602060405180830381865afa1580156104c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ec91906129e1565b90508380156104f85750825b80156105015750805b979650505050505050565b60604660018190036107bd5773ffffffffffffffffffffffffffffffffffffffff8316739941fd7db2003308e7ee17b04400012278f12ac60361056c57604051806101e001604052806101c0815260200161482f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673b3bf81714f704720dcb0351ff0d42eca61b069fc036105c057604051806101e001604052806101c081526020016150ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673301076c36e034948a747bb61bab9cd03f62672e30361061457604051806101e001604052806101c0815260200161364f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673027e1cbf2c299cba5eb8a2584910d04f1a8aa4030361066857604051806101e001604052806101c08152602001612d2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673beef5afe88ef73337e5070ab2855d37dbf5493a4036106bc57604051806101e001604052806101c081526020016142ef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c6b13d5e662fa0458f03995bcb824a1934aa895f0361071057604051806101e001604052806101c0815260200161412f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d7cb8cc1b56356bb7b78d02e785ead28e21586600361076457604051806101e001604052806101c081526020016139cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673079c868f97aed8e0d03f11e1529c3b056ff21cea036107b857604051806101e001604052806101c081526020016149ef6101c091399392505050565b610cb1565b80606403610cb15773ffffffffffffffffffffffffffffffffffffffff831673bc6159fd429be18206e60b3bb01d7289f905511b0361081957604051806101e001604052806101c08152602001612eef6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673e5d1aa8565f5dbfc06cde20dfd76b4c7c6d43bd50361086d57604051806101e001604052806101c0815260200161466f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316739d8570ef9a519ca81daec35212f435d9843ba564036108c157604051806101e001604052806101c08152602001614baf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673d97c31e53f16f495715ce71e12e11b9545eedd8b036109155760405180610240016040528061022081526020016130af61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673ff1bd3d570e3544c183ba77f5a4d3cc742c8d2b30361096957604051806101e001604052806101c0815260200161548f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673209d269dfd66b9cec764de7eb6fefc24f75bdd48036109bd57604051806101e001604052806101c08152602001614f2f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c37575ad8efe530fd8a79aeb0087e5872a24dabc03610a1157604051806101e001604052806101c0815260200161348f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316731c7828dadade12a848f36be8e2d3146462abff6803610a6557604051806101e001604052806101c08152602001613f6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673aba5294bba7d3635c2a3e44d0e87ea7f58898fb703610ab957604051806101e001604052806101c08152602001614d6f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff8316736eb7be972aebb6be2d9acf437cb412c0abee912b03610b0d57604051806101e001604052806101c081526020016132cf6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c4d09969aad7f252c75dd352bbbd719e34ed06ad03610b61576040518061024001604052806102208152602001613d4f61022091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673a25af86a5dbea45e9fd70c1879489f63d081ad4403610bb557604051806101e001604052806101c081526020016144af6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167357492cb6c8ee2998e9d83ddc8c713e781ffe548e03610c09576040518061020001604052806101e081526020016152af6101e091399392505050565b73ffffffffffffffffffffffffffffffffffffffff831673c33e3ec14556a8e71be3097fe2dc8c0b9119c89703610c5d57604051806101e001604052806101c0815260200161380f6101c091399392505050565b73ffffffffffffffffffffffffffffffffffffffff83167377472826875953374ed3084c31a483f827987f1403610cb157604051806101e001604052806101c08152602001613b8f6101c091399392505050565b505060408051602081019091525f8152919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060808060028514610d64576040517f9d89020a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060610d6f8861132d565b6112e957610d7c88611696565b610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f506f6f6c206973206e6f74206120436f5720414d4d000000000000000000000060448201526064015b60405180910390fd5b5f8873ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e31573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e5591906128c4565b90505f8973ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ec591906128c4565b90508973ffffffffffffffffffffffffffffffffffffffff16634ada218b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f10573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3491906129e1565b15155f03610f6e576040517f21081abf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110816040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110610fe357610fe3612a00565b9050602002013581526020018b8b5f81811061100157611001612a00565b9050602002013581526020018c73ffffffffffffffffffffffffffffffffffffffff16636dbc88136040518163ffffffff1660e01b8152600401602060405180830381865afa158015611056573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061107a91906128df565b905261174e565b9650866040516020016110949190612a2d565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815260018084528383019092529450816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816110d157905050955060405180606001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020015f815260200161123b739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa15801561118e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111b291906128df565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08b0180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405160240161124d91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ff14fcbc8000000000000000000000000000000000000000000000000000000001790529052865187905f906112d7576112d7612a00565b602002602001018190525050506112ff565b6112f4888888611ad6565b929750909550935090505b8781604051602001611312929190612a3c565b60405160208183030381529060405291505093509350935093565b5f806113388361050c565b511192915050565b5f46600181900361136657738deed8ed7c5fcb55884f13f121654bb4bb7c843791505090565b8060640361138957732af6c59fc957d4a45ddbbd927fa30f7c5051f58391505090565b8062aa36a7036113ae5773bd18758055dbe3ed37a2471394559ae97a5da5c091505090565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e737570706f7274656420636861696e0000000000000000000000000000006044820152606401610dde565b60408051600280825260608083018452926020830190803683370190505090506114398261132d565b6115b5578173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114aa91906128c4565b815f815181106114bc576114bc612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561153f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061156391906128c4565b8160018151811061157657611576612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050919050565b5f6115bf8361215f565b509050805f815181106115d4576115d4612a00565b6020026020010151825f815181106115ee576115ee612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508060018151811061163b5761163b612a00565b60200260200101518260018151811061165657611656612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050919050565b5f806116a0611340565b6040517f666e1b3900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152919091169063666e1b3990602401602060405180830381865afa15801561170c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061173091906128c4565b73ffffffffffffffffffffffffffffffffffffffff16141592915050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810191909152602082015182516040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201525f92839216906370a0823190602401602060405180830381865afa158015611822573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061184691906128df565b604085810151865191517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116906370a0823190602401602060405180830381865afa1580156118b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118db91906128df565b915091505f805f805f8860800151876118f49190612aae565b90505f8960600151876119079190612aae565b90508181101561196d578960200151955089604001519450611939818b6080015160026119349190612aae565b61227b565b61194460028a612af2565b61194e9190612b05565b9350611966848861195f828c612b05565b60016122cb565b92506119b9565b8960400151955089602001519450611990828b6060015160026119349190612aae565b61199b600289612af2565b6119a59190612b05565b93506119b6848961195f828b612b05565b92505b6040518061018001604052808773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200161012c42611a339190612b18565b63ffffffff1681526020018b60a0015181526020015f81526020017ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677581526020016001151581526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981526020017f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981525098505050505050505050919050565b60408051610180810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081018290526101608101919091526060806060611b448761013e565b611b7a576040517fefc869b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80611b858961215f565b915091505f8160400151806020019051810190611ba29190612b3c565b9050611c836040518060c001604052808c73ffffffffffffffffffffffffffffffffffffffff168152602001855f81518110611be057611be0612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16815260200185600181518110611c1657611c16612a00565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1681526020018b8b6001818110611c4c57611c4c612a00565b9050602002013581526020018b8b5f818110611c6a57611c6a612a00565b9050602002013581526020018360a0015181525061174e565b96505f739008d19f58aabd9ed0d60971565aa8510560ab4173ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d0791906128df565b9050807fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48989604051602001611d3c9190612a2d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181525f60608401818152608085018452845260208085018a9052835180820185529182528484019190915291519092611da092909101612bf4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611dde94939291602401612c9d565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f5fd7e97d000000000000000000000000000000000000000000000000000000001790528151600180825281840190935292975082015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611e685790505060408051606081018252855173ffffffffffffffffffffffffffffffffffffffff1681525f602082015291985081018c611f558b857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b60405173ffffffffffffffffffffffffffffffffffffffff90921660248301526044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052875188905f9061200757612007612a00565b602090810291909101015260408051600180825281830190925290816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816120275790505095506040518060600160405280845f015173ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020018c5f801b6040516024016120bd92919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f30f73c99000000000000000000000000000000000000000000000000000000001790529052865187905f9061214757612147612a00565b60200260200101819052505050505093509350935093565b60408051606081810183525f80835260208301529181018290526121828361050c565b80602001905181019061219591906128f6565b90505f81604001518060200190518101906121b09190612b3c565b6040805160028082526060820183529293509190602083019080368337019050509250805f0151835f815181106121e9576121e9612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080602001518360018151811061223b5761223b612a00565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505050915091565b5f815f036122945761228d8284612af2565b90506122c5565b82156122c057816122a6600185612b05565b6122b09190612af2565b6122bb906001612ccd565b6122c2565b5f5b90505b92915050565b5f806122d886868661231a565b90506122e383612412565b80156122fe57505f84806122f9576122f9612ac5565b868809115b156123115761230e600182612ccd565b90505b95945050505050565b5f838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870982811083820303915050805f0361236d5783828161236357612363612ac5565b049250505061240b565b8084116123a6576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b5f600282600381111561242757612427612ce0565b6124319190612d0d565b60ff166001149050919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461245f575f80fd5b50565b5f60208284031215612472575f80fd5b813561240b8161243e565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6122c2602083018461247d565b5f805f604084860312156124ed575f80fd5b83356124f88161243e565b9250602084013567ffffffffffffffff80821115612514575f80fd5b818601915086601f830112612527575f80fd5b813581811115612535575f80fd5b8760208260051b8501011115612549575f80fd5b6020830194508093505050509250925092565b805173ffffffffffffffffffffffffffffffffffffffff168252602081015161259d602084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408101516125c5604084018273ffffffffffffffffffffffffffffffffffffffff169052565b50606081015160608301526080810151608083015260a08101516125f160a084018263ffffffff169052565b5060c081015160c083015260e081015160e0830152610100808201518184015250610120808201516126268285018215159052565b5050610140818101519083015261016090810151910152565b5f82825180855260208086019550808260051b8401018186015f5b848110156126dc578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00189528151805173ffffffffffffffffffffffffffffffffffffffff16845284810151858501526040908101516060918501829052906126c88186018361247d565b9a86019a945050509083019060010161265a565b5090979650505050505050565b5f6101e06126f7838861255c565b8061018084015261270a8184018761263f565b90508281036101a084015261271f818661263f565b90508281036101c0840152610501818561247d565b602080825282518282018190525f9190848201906040850190845b8181101561278157835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161274f565b50909695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160c0810167ffffffffffffffff811182821017156127dd576127dd61278d565b60405290565b5f82601f8301126127f2575f80fd5b815167ffffffffffffffff8082111561280d5761280d61278d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156128535761285361278d565b8160405283815286602085880101111561286b575f80fd5b8360208701602083015e5f602085830101528094505050505092915050565b5f6020828403121561289a575f80fd5b815167ffffffffffffffff8111156128b0575f80fd5b6128bc848285016127e3565b949350505050565b5f602082840312156128d4575f80fd5b815161240b8161243e565b5f602082840312156128ef575f80fd5b5051919050565b5f60208284031215612906575f80fd5b815167ffffffffffffffff8082111561291d575f80fd5b9083019060608286031215612930575f80fd5b60405160608101818110838211171561294b5761294b61278d565b60405282516129598161243e565b815260208381015190820152604083015182811115612976575f80fd5b612982878286016127e3565b60408301525095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8151168252602081015160208301525f6040820151606060408501526128bc606085018261247d565b602081525f6122c26020830184612991565b5f602082840312156129f1575f80fd5b8151801515811461240b575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b61018081016122c5828461255c565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1681525f82518060208501601485015e5f92016014019182525092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82612b0057612b00612ac5565b500490565b818103818111156122c5576122c5612a81565b63ffffffff818116838216019080821115612b3557612b35612a81565b5092915050565b5f60208284031215612b4c575f80fd5b815167ffffffffffffffff80821115612b63575f80fd5b9083019060c08286031215612b76575f80fd5b612b7e6127ba565b8251612b898161243e565b81526020830151612b998161243e565b6020820152604083810151908201526060830151612bb68161243e565b6060820152608083015182811115612bcc575f80fd5b612bd8878286016127e3565b60808301525060a083015160a082015280935050505092915050565b602080825282516060838301528051608084018190525f9291820190839060a08601905b80831015612c385783518252928401926001929092019190840190612c18565b508387015193507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0925082868203016040870152612c768185612991565b93505050604085015181858403016060860152612c93838261247d565b9695505050505050565b848152836020820152608060408201525f612cbb608083018561247d565b8281036060840152610501818561247d565b808201808211156122c5576122c5612a81565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f60ff831680612d1f57612d1f612ac5565b8060ff8416069150509291505056fe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dac5a0e756ac88c1d3a4c41900d977fe93c2d34fc95a00ca3e84eb4c6b50faf949000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000005afe3855358e112b5647b952709e6165e1c1eeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000002e7e978da0c53404a8cf66ed4ba2c7706c07b62a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d85c99996d84d25387bc0d01e50e3ea814f64e7e04a3b949a571789e196c5a910000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d000000000000000000000000000000000000000000000000000affd9fdeb8e08000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020a99fd9950b5d5dceeaf4939e221dca8ca9b938ab0001000000000000000000250000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85178a729ee3008c7d48832d02267b72e5f34ada8f554a6731a368f01590ed71b34000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000008156197a5425c0c8000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000080000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a000000000000000000000000678df3415fc31947da4324ec63212874be5a82f8000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8512e31981e34960969eb549f5e826cf77f655e72b03603ad574a79fd015f4de4de0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a16c95a4d2e3c000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c0ce9e05c2aee5f22f9941c4cd1f1a1d13194b109779422d5ad9a980157bd0f1640000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851a2029fbb545978d05378b6df19e3754fe5ed2d0ba1e051027503934372f7beb20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000000000000000000000000000000052ba9efc38441a000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002021d4c792ea7e38e0d0819c2011a2b1cb7252bd9900020000000000000000001e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424daca44b6a304baa16d11b6db07066c1276b1273ee3f94590bbd03201a61882af9a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000098cb76000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b4e16d0168e52d35cacd2c6185b44281ec28c9dc0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85159457ac6201da7713efecd84618c7a168e88b9cb7d1c0db128af1efe0a08bbb10000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee483701000000000000000000000000000000000000000000000000000a17273fc14b64000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da80ba533f014ef4238ab7ad203c0aeacbf30a71c0346140db77c43ae3121afadd000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000aea46a60368a7bd060eec7df8cba43b7ef41ad85000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000336632e53c8ecf04000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000004042a04c54ef133ac2a3c93db69d43c6c02a330b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d67c9fb87045e07da94c81de035b5c7f435cd46568fca02aa35d709bbc9e21fa0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008e5bbbb09ed1ebde8674cda39a0c169401db4252000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008db8870ca4b8ac188c4d1a014f34a381ae27e1c20000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851209c17d9ebe3ac7352795f7f8b3d14d253d92430831d3b2c3965f9a578da7618000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000e91d153e0b41518a2ce8dd3d7944fa863463a97d0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000000000000000000000000000008aa3a52815262f58000000000000000000000000bd91a72dc3d9b5d9b16ee8638da1fc65311bd90a00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000800000000000000000000000000064ac007ff665cf8d0d3af5e0ad1c26a3f853ea000000000000000000000000a767f745331d267c7751297d982b050c93985627000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85105416460deb76d57af601be17e777b93592d8d4d4a4096c57876a91c84f418080000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000ce11e14225575945b8e6dc0d4f2dd4c570f79d9f000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000009634ca647474b6b78d3382331a77cd00a8a940da00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da932542294ff270a8bbdbe1fb921de3d09c9749dc35627361fc17c44b9b026b810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000008390a1da07e376ef7add4be859ba74fb83aa02d5000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000aec1c94998000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000069c66beafb06674db41b22cfc50c34a93b8d82a2000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000def1ca1fb7fbcdc777520aa7f396b4e015f497ab000000000000000000000000000000000000000000000000025bf6196bd10000000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c0d661a16b0e85eadb705cf5158132b5dd1ebc0a49929ef68097698d15e2a4e3b40000000000000000000000000000000000000000000000000000000000000020de8c195aa41c11a0c4787372defbbddaa31306d20002000000000000000001810000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851560d33bcc26b7f10765f8ae10b1abc4ed265ba0c7a1f9948d06de97c31044aee0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000004d18815d14fe5c3304e87b3fa18318baa5c238200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020a9b2234773cc6a4f3a34a770c52c931cba5c24b20002000000000000000000870000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851437a72b19b25e8b62fdfb81146ec83c66462138d3d9e08998594853566fa9add000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000177127622c4a00f3d409b75571e12cb3c8973d3c0000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000146e114355e0f6088000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204cdabe9e07ca393943acfb9286bbbd0d0a310ff600020000000000000000005c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da559d5fda20be80608e4d5ea1b41e6b9330efca7934beb094281dd4d8f4889374000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000079ef7f110fdfae4000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020e99481dc77691d8e2456e5f3f61c1810adfc1503000200000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424da56871afb17e444c418900f6db3e1ade07d49eadea1accf03fcebc0a6e7e4b653000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b2617246d0c6c0087f18703d576831899ca94f01000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000048bcb79dba2b56b90000000000000000000000000573cc0c800048f94e022463b9214d92c2d65e97b00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b36ec83d844c0579ec2493f10b2087e96bb654600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8511ea56ac96a6369d36ef3fe56ae0ddff8d0cc89e1623095239c5ceed2505aa2810000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb0000000000000000000000006a023ccd1ff6f2045c3309768ead9e68f978f6e1000000000000000000000000000000000000000000000000006b43c27d2e8300000000000000000000000000e089049027b95c2745d1a954bc1d245352d884e900000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c89000000000000000000000000000000000000000000000000000000000000002000000000000000000000000028dbd35fd79f48bfa9444d330d14683e7101d8170000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851d1e868d120e326e5581caa39852bb0da9234a511ed76e6f7a9dcceb0d5f154c70000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea6000000000000000000000000af204776c7245bf4147c2612bf6e5972ee48370100000000000000000000000000000000000000000000000000098e46995425ca000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f90002000000000000000000630000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a851f0e8ec512b2507dae99175a0a4792d8a53e0863fbb5e735a5c993295bbd17f480000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea60000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb00000000000000000000000000000000000000000000000000094f8d9168e271000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c8900000000000000000000000000000000000000000000000000000000000000204683e340a8049261057d5ab1b29c8d840e75695e00020000000000000000005a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000034323b933096534e43958f6c7bf44f2bb59424dad003838829115f5d9ff3ed69c8d2b4b26e10eb1a79331206c28fbb4734390a5e000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000808507121b80c02388fad14726482e061b8da827000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000189b23422a9b84d8000000000000000000000000ad37fe3ddedf8cdee1022da1b17412cfb649559600000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020fd1cf6fd41f229ca86ada0584c63c49c3d66bbc90002000000000000000004380000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a8513956efd63537b00bb3b152d3c4961207b6ca14d6f506c66fc0aef4c8e2e176b5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000cb444e90d8198415266c6a2724b7900fb12fc56e0000000000000000000000009c58bacc331c9aa871afd802db6379a98e80cedb000000000000000000000000000000000000000000000000000000000000004500000000000000000000000015b4c67070d3748b8ec93c8a32f7efe2e8f684c900000000000000000000000000000000000000000000000000000000000000c0056e9806d953dbe2df4352a90ad2c1148c51460e941107f0909fae382b1661cf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000022441d81416430a54336ab28765abd31a792ad37000000000000000000000000ab70bcb260073d036d1660201e9d5405f5829b7a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b148f40fff05b5ce6b22752cf8e454b556f7a85133f583d55c4509d5e10ebe3c7c69bce17af4c57419d6c9c90c8f588dd3232c0d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000af204776c7245bf4147c2612bf6e5972ee4837010000000000000000000000006c76971f98945ae98dd7d4dfca8711ebea946ea600000000000000000000000000000000000000000000000410d586a20a4c0000000000000000000000000000d3a84895080609e1163c80b2bd65736db1b86bec00000000000000000000000000000000000000000000000000000000000000c04d821ddc9d656177dad4d5c2f76a4bff2ed514ff69fa4aa4fd869d6e98d55c890000000000000000000000000000000000000000000000000000000000000020bc2acf5e821c5c9f8667a36bb1131dad26ed64f9000200000000000000000063a2646970667358221220c3b6b701e7d5db53232efcebe1fe1bdd40a35653449ba7cd10551b9e5bf6a94a64736f6c63430008190033", + "methodIdentifiers": { + "factory()": "c45a0155", + "getSnapshot(address)": "21570256", + "isLegacy(address)": "2aec79a0", + "isLegacyEnabled(address)": "10029daa", + "order(address,uint256[])": "27242c9b", + "tokens(address)": "e4860339" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidArrayLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIsClosed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIsPaused\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"COWAMMPoolCreated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"getSnapshot\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"isLegacy\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"amm\",\"type\":\"address\"}],\"name\":\"isLegacyEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"prices\",\"type\":\"uint256[]\"}],\"name\":\"order\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IERC20\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sellAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"validTo\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"appData\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"kind\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"partiallyFillable\",\"type\":\"bool\"},{\"internalType\":\"bytes32\",\"name\":\"sellTokenBalance\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"buyTokenBalance\",\"type\":\"bytes32\"}],\"internalType\":\"struct GPv2Order.Data\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"preInteractions\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"postInteractions\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"tokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"_tokens\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"PoolDoesNotExist()\":[{\"details\":\"Indexers monitoring CoW AMM pools MAY use this as a signal to purge the pool from their index.\"}],\"PoolIsClosed()\":[{\"details\":\"Indexers monitoring CoW AMM pools MAY use this as a signal to purge the pool from their index.\"}],\"PoolIsPaused()\":[{\"details\":\"Indexers monitoring CoW AMM pools SHOULD use this as a signal to retain the pool in the index with back-off on polling for orders.\"}]},\"events\":{\"COWAMMPoolCreated(address)\":{\"params\":{\"amm\":\"The address of the newly tradeable CoW AMM Pool\"}}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"This is a specific hack to broadcast legacy data in a forward-compatible\"},\"getSnapshot(address)\":{\"details\":\"Returns the IConditionalOrder.ConditionalOrderParams for a legacy CoW AMM. Returns bytes(0) if the pool isn't found in the snapshot data.\"},\"isLegacy(address)\":{\"details\":\"Given an `amm`, check if it is in the hardcoded list of legacy CoW AMMs.\"},\"isLegacyEnabled(address)\":{\"details\":\"Given an `amm` that is is known to be legacy, check if it is still valid.\"},\"order(address,uint256[])\":{\"details\":\"Reverts with `NoOrder` if the `pool` has no canonical order matching the given price vector.\",\"params\":{\"pool\":\"to calculate the order / signature for\",\"prices\":\"supplied for determining the order, assumed to be in the same order as returned from `tokens(pool)`. Tokens prices are expressed relative to each other: for example, if tokens[0] is WETH, tokens[2] is DAI, and the price is 1 WETH per 3000 DAI, then a valid price vector is [3000, *, 1, ...]. If tokens[1] is another stablecoin with 18 decimals, then a valid price vector could be [3000, 3000, 1, ...]. This price vector is compatible with the price vector used in a call to `settle`, assuming the traded token array is in the same order as in `tokens(pool)`.\"},\"returns\":{\"_order\":\"The CoW Protocol JIT order\",\"postInteractions\":\"The array array for any **POST** interactions (empty if none)\",\"preInteractions\":\"The array array for any **PRE** interactions (empty if none)\",\"sig\":\"A valid CoW-Protocol signature for the resulting order using the ERC-1271 signature scheme.\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"NoOrder()\":[{\"notice\":\"Returned by the `order` function if there is no order matching the supplied parameters.\"}],\"PoolDoesNotExist()\":[{\"notice\":\"All functions that take `pool` as an argument MUST revert with this error if the `pool` does not exist.\"}],\"PoolIsClosed()\":[{\"notice\":\"All functions that take `pool` as an argument MUST revert with this error in the event that the pool is closed (ONLY applicable if the pool can be closed).\"}],\"PoolIsPaused()\":[{\"notice\":\"All functions that take `pool` as an argument MUST revert with this error in the event that the pool is paused (ONLY applicable if the pool is pausable).\"}]},\"events\":{\"COWAMMPoolCreated(address)\":{\"notice\":\"AMM protocols capable of operating as a CoW AMM MUST emit an event on pool creation.\"}},\"kind\":\"user\",\"methods\":{\"factory()\":{\"notice\":\"AMM Pool helpers MUST return the factory target for indexing of CoW AMM pools.\"},\"order(address,uint256[])\":{\"notice\":\"AMM Pool helpers MUST provide a method for returning the canonical order required to satisfy the pool's invariants, given a pricing vector.\"},\"tokens(address)\":{\"notice\":\"AMM Pool helpers MUST return all tokens that may be traded on this pool. The order of the tokens is expected to be consistent and must be the same as that used for the input price vector in the `order` function.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ConstantProductHelper.sol\":\"ConstantProductHelper\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/src/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/composable-cow/lib/cowprotocol/src/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0x2db02cc0e23db99d10cd21590425b714060a556bcfb934cb5ab3b80aef1610ba\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c05f8a21a244e6566a3e555028cebeebd1c38902f0cea2e9b014cc7becaf3140\",\"dweb:/ipfs/QmTBY1GphjwAnY2nC9qKMwj5HeAUJMgFdo5YZcVxsVyqFb\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol\":{\"keccak256\":\"0x7b69b3d536c995e84a5fe4ec3dc63ddf01a3538f72ece83828e87aa90df33a7d\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://7ba34b22f5b25cd6fecfd0d5e9b6077b36130a2cb4539b1311de0f328c226958\",\"dweb:/ipfs/QmUURWvPbrZ6Z4iDv8Sa8soQCZyKZCsCcdMzgY9Jy5RNV2\"]},\"lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol\":{\"keccak256\":\"0xb96efb76433446cf0ccb9f5bc926301a9c8bcbfd17dcd6a36a1e6207f5b436b2\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://5ec097e17d3e47e16808a5246a99af7ef618bb58ccb61d7331bfca1929cbbd82\",\"dweb:/ipfs/QmbH7rg5s5gdpa5KENMUXHyGBWJyQn6XEwv9JakRSCcv8n\"]},\"lib/composable-cow/lib/safe/contracts/Safe.sol\":{\"keccak256\":\"0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119\",\"dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9\"]},\"lib/composable-cow/lib/safe/contracts/base/Executor.sol\":{\"keccak256\":\"0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c\",\"dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp\"]},\"lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol\":{\"keccak256\":\"0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e\",\"dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV\"]},\"lib/composable-cow/lib/safe/contracts/base/GuardManager.sol\":{\"keccak256\":\"0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64\",\"dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx\"]},\"lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol\":{\"keccak256\":\"0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d\",\"dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz\"]},\"lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol\":{\"keccak256\":\"0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a\",\"dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK\"]},\"lib/composable-cow/lib/safe/contracts/common/Enum.sol\":{\"keccak256\":\"0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34\",\"dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo\"]},\"lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol\":{\"keccak256\":\"0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9\",\"dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g\"]},\"lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol\":{\"keccak256\":\"0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3\",\"dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N\"]},\"lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol\":{\"keccak256\":\"0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3\",\"dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu\"]},\"lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol\":{\"keccak256\":\"0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80\",\"dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4\"]},\"lib/composable-cow/lib/safe/contracts/common/Singleton.sol\":{\"keccak256\":\"0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde\",\"dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo\"]},\"lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol\":{\"keccak256\":\"0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e\",\"dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ\"]},\"lib/composable-cow/lib/safe/contracts/external/SafeMath.sol\":{\"keccak256\":\"0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c\",\"dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x\"]},\"lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol\":{\"keccak256\":\"0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515\",\"dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV\"]},\"lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol\":{\"keccak256\":\"0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4\",\"dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol\":{\"keccak256\":\"0x4d562221e6645b6e79da99d2b322331617051fa90e06ec7ce3f9a6a87bae116c\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5a574dd50b9e9a594afda4a96701295e18a0054fcaf5083573ee80033b2da060\",\"dweb:/ipfs/QmNQf5rfHqMCGKBcqZowz89JEZe8rjjoYEkySBy7oxwh4Y\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/ExtensibleBase.sol\":{\"keccak256\":\"0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9\",\"dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol\":{\"keccak256\":\"0x3020c96c812548a2bf6413168ee21033638a36736b695909f7cf54277beefd76\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://6ffdf49fb516791f4cad239fc780bb5d9934bb06744b99b0fbc067f31ad13591\",\"dweb:/ipfs/QmPXwVoDhnhnQFSxEiHDZYRQJ5ozAECSFrUHMTjwAJ1LuM\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol\":{\"keccak256\":\"0x36eacc47b1ce7697e679c1b5c0d3a86d8f46a0436b666f86e88df04765cde5c1\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7097bfb174ea424ef55f9a5b55f4a9857f7368cdd3061888f5ffb3e29503f071\",\"dweb:/ipfs/QmRPvAvMdGRuh8AjePtamBGUU55p1tSP8ZHUUMfxWgi1ew\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol\":{\"keccak256\":\"0x51e8dad81059527f9b6b6827d742a0fbc0960c66e364dd1e67c8f151970c6ee4\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://b368a4eb15d50487986db1543a5c786324a4d0de680a421d131e21c25459f666\",\"dweb:/ipfs/QmVca3J2JBEZtxW3uNMvYc9ugQH24CqantLnVzKcZwG71W\"]},\"lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol\":{\"keccak256\":\"0x549d737c3eef66cec2a858b34dce4db42e56d8f053635742230873e6049e81ed\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f03f130c36be396895acfa7891ccca36725c6a6496085d88fc33071e00093073\",\"dweb:/ipfs/QmfLfenjQ1gWnotx5Vdda1kJBqjnCi53bGNqyZ5cN6wxXV\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol\":{\"keccak256\":\"0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c\",\"dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol\":{\"keccak256\":\"0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c\",\"dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89\",\"dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38\"]},\"lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol\":{\"keccak256\":\"0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25\",\"dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978\"]},\"lib/composable-cow/src/BaseConditionalOrder.sol\":{\"keccak256\":\"0x8b429a011579b3d84df3bb3135b3299054790018220666befa9ab5af24f49e8f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a30f0535cf7fc4fabc42b83a04bd687b8e989ae8d0c3f6db63b69504c15a7a34\",\"dweb:/ipfs/QmSeKTQWEx74SV6hrdX3sGLV6L9MF8fPPqoyyvdB4Kt3bo\"]},\"lib/composable-cow/src/ComposableCoW.sol\":{\"keccak256\":\"0xcf1583fd0565c921f108e81d516591c9ff123f840dbdd349e9e98d793de4409f\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://112df8eb50205574a22bbb8db9f7d064ec4c753052f798668db88fd222724883\",\"dweb:/ipfs/QmSV7gBaWDn4PhJGCYayuFqvRortZHnzUjsZNGrm2NriEu\"]},\"lib/composable-cow/src/interfaces/IConditionalOrder.sol\":{\"keccak256\":\"0xe9e47811223793dfa9a5fc3098cf874385f547e536ef47da634b505659aeedc7\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://40c3daf74830a4394052b916ca920fce07761a2b66e8af8c877b72d2efaa49eb\",\"dweb:/ipfs/QmZ9adA6R1hCHnvg6DwnTn7zqta6zU1Ctb564zb8aiqRFD\"]},\"lib/composable-cow/src/interfaces/ISwapGuard.sol\":{\"keccak256\":\"0xac211fb24463a9c04a05bb58fe42d9bea10e58fe9ca35e7f544868eeb5972339\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://3ce2a180c5368c6807aecafb242675476bbc653ac72b3bd727db3467efe8b900\",\"dweb:/ipfs/QmWzTqMQCuvX5Zpn2sjxYUS9o3upsip4yNvwCMQGbXAk6Y\"]},\"lib/composable-cow/src/interfaces/IValueFactory.sol\":{\"keccak256\":\"0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de\",\"dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih\"]},\"lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol\":{\"keccak256\":\"0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777\",\"dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf\"]},\"lib/composable-cow/src/vendored/CoWSettlement.sol\":{\"keccak256\":\"0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840\",\"dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR\"]},\"lib/openzeppelin/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0x85a45f3f10014a0f8be41157a32b6a5f905753ea64a4b64e29fc12b7deeecf39\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c3c74009ce36136b36c77c23935b8e4a7b4f253be2da2be4fb4a916b1ce43743\",\"dweb:/ipfs/QmcH36v3iN7SJJuF73AunLR2LtNxhVJ1wm63ph4dPZ4pcL\"]},\"lib/openzeppelin/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2608291cb038b388d80b79a06b6118a42f7894ff67b7da10ec0dbbf5b2973ba\",\"dweb:/ipfs/QmWohqcBLbcxmA4eGPhZDXe5RYMMEEpFq22nfkaUMvTfw1\"]},\"lib/openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0ea104e577e63faea3b69c415637e99e755dcbf64c5833d7140c35a714d6d90c\",\"dweb:/ipfs/Qmau6x4Ns9XdyynRCNNp3RhLqijJjFm7z5fyZazfYFGYdq\"]},\"lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f5196ec75139918c6c7bb4251b36395e668f1fa6d206beba7e7520e74913940d\",\"dweb:/ipfs/QmSyqjksXxmm2mCG6qRd1yuwLykypkSVBbnBnGqJRcuJMi\"]},\"lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b3036b3a83b7c48f96641f2a9002b9f2dcb6a5958dd670894ada21ae8229b3d0\",\"dweb:/ipfs/QmUNfSBdoVtjhETaUJCYcaC7pTMgbhht926tJ2uXJbiVd3\"]},\"lib/openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b7bd24e224f67f65bfadf85dc2929fa965456bb2415478bd0125471b5ce35245\",\"dweb:/ipfs/QmRaydGr8BTHs1kvaZfsNU69pKzUAGFrvABn1KiRSbE51y\"]},\"lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0x6400c4bee15052e043e5d10315135972529bd1c8012f43da494dc6b4f4661058\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://da5d3d47d35af4373743a559ea4b9b7ecfe4bab6f0703f410c1e59959b7966ac\",\"dweb:/ipfs/QmTHdoghh4WLu4yURjGEgRk162pcwwdsG52MPGa12GqnGR\"]},\"lib/openzeppelin/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4ece9f0b9c8daca08c76b6b5405a6446b6f73b3a15fab7ff56e296cbd4a2c875\",\"dweb:/ipfs/QmQyRpyPRL5SQuAgj6SHmbir3foX65FJjbVTTQrA2EFg6L\"]},\"src/ConstantProduct.sol\":{\"keccak256\":\"0x4883252f066b38972e5466f54d7cbf6e1a5b7c55823f012837f254ccd7aaa707\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://5bcfdb33677ad8f14d939cb1570fbcdd0c5d25843d93f35e70c41a58f278345c\",\"dweb:/ipfs/QmRN1eRCJoGj3RygAbaRaGQ85DJjApEZv1qLUqGYbh1frT\"]},\"src/ConstantProductFactory.sol\":{\"keccak256\":\"0xd9e2a5d4cc9cde16d1d8469194eff6e32b97758413574fc866067a392d3d9255\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://1745aea9ad3571a9edf950a8fd9d745042b2c697fa1bd0c46982fddc21dc7fc8\",\"dweb:/ipfs/QmVQMyM3uSRzvL61Fnb9rH5mYaLBQrkh69iB9Gx3Lk6QWD\"]},\"src/ConstantProductHelper.sol\":{\"keccak256\":\"0xb184c91352617489a5f22ce8bb29f9840a00f8055ac283e6d1d85984e786b677\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://9413468585f4d8faac44b2c1f7c02cd4f21f5df570c6573c7ccab584a420d366\",\"dweb:/ipfs/QmSE5dkMEjbt1pEv5Y1Ao7EeudNWET7TwtAP6FPUVXiGbR\"]},\"src/interfaces/ICOWAMMPoolFactory.sol\":{\"keccak256\":\"0x2b65e467fa06b6149a7f2eee4879973fc5845ab12f86e718f1c2708e0bf98829\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://2ea7e105fc8953eb819f64a1e426881d834afbe990fbcda08c30c18a2d1a332a\",\"dweb:/ipfs/QmSUpommi6khq2EgLSTNSEorHjKtoztqa9D5BfTZ83LBqX\"]},\"src/interfaces/ICOWAMMPoolHelper.sol\":{\"keccak256\":\"0xa5b11fe7aefe1d3ab091d5f381c15381a3dc7c5a4e0a597c33cbb0deecd3d704\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://6525ad30ec83975097671ec389ed20772dcbd0de07ea0e92b6b9bdf0a12c0163\",\"dweb:/ipfs/QmcYnz4FmMWLqdWpjEGHDXCWAWbKu98vDzUcHpkLJ5Cfg6\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/interfaces/ISettlement.sol\":{\"keccak256\":\"0x51833975e3c96a6bfc9b255d122e145fc28a968b920fda5744ea0d9bf022e84a\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://3b2228e777904811715e693f6fe577be18b128db72219a6f3ca528fb9c119bc6\",\"dweb:/ipfs/QmXnNgdMLJBhztH5US1EnxGV8PB4yvLZqhN1sTkvrdvSZ2\"]},\"src/legacy/Helper.sol\":{\"keccak256\":\"0xf0494ad9f71fdf2602dbd30f885ffd0b1a88beedcd7459ec75f759efb11dc1c4\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://e6b3916e22daa8fd8deae7b85b270972ea652ff696301852644f077dc8f82b2d\",\"dweb:/ipfs/QmcWJX9WoiBVsCjZVuv6SDYAQYDWDctXD8nkZVMqSbxZzK\"]},\"src/legacy/Snapshot.sol\":{\"keccak256\":\"0x2a0c3ff6bf1b8a86161f982589aed2012dd462aa8a1cdc06a73b9c2ca636ff4f\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://db6d85afd2b2711ebc9282c351c9a5e491d8d20f0646ae8ab45f548e426ab1eb\",\"dweb:/ipfs/QmNzZCc2CWBerhW2Eu44QRowFokYnCMcWaNiPJoRMsLKxV\"]},\"src/libraries/GetTradeableOrder.sol\":{\"keccak256\":\"0x095d47c2d45ff22440ddf8f76bb6b9cbfd7250d35849e79ccb89c8eeb126b645\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://787103261569a4b07b762f6a106178e5ec384b3b89bd24bfc079bc27ccde4b72\",\"dweb:/ipfs/QmTYN4jPyPecNWwqKpqqFbvZtBPwWvf4Z8MCPTSmZy85wM\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.25+commit.b61c2a91" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidArrayLength" + }, + { + "inputs": [], + "type": "error", + "name": "MathOverflowedMulDiv" + }, + { + "inputs": [], + "type": "error", + "name": "NoOrder" + }, + { + "inputs": [], + "type": "error", + "name": "PoolDoesNotExist" + }, + { + "inputs": [], + "type": "error", + "name": "PoolIsClosed" + }, + { + "inputs": [], + "type": "error", + "name": "PoolIsPaused" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "amm", + "type": "address", + "indexed": true + } + ], + "type": "event", + "name": "COWAMMPoolCreated", + "anonymous": false + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "amm", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "getSnapshot", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "amm", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "isLegacy", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "amm", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "isLegacyEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "prices", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function", + "name": "order", + "outputs": [ + { + "internalType": "struct GPv2Order.Data", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "kind", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "partiallyFillable", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "sellTokenBalance", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "buyTokenBalance", + "type": "bytes32" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "preInteractions", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "postInteractions", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "bytes", + "name": "sig", + "type": "bytes" + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "tokens", + "outputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ] + } + ], + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "details": "This is a specific hack to broadcast legacy data in a forward-compatible" + }, + "getSnapshot(address)": { + "details": "Returns the IConditionalOrder.ConditionalOrderParams for a legacy CoW AMM. Returns bytes(0) if the pool isn't found in the snapshot data." + }, + "isLegacy(address)": { + "details": "Given an `amm`, check if it is in the hardcoded list of legacy CoW AMMs." + }, + "isLegacyEnabled(address)": { + "details": "Given an `amm` that is is known to be legacy, check if it is still valid." + }, + "order(address,uint256[])": { + "details": "Reverts with `NoOrder` if the `pool` has no canonical order matching the given price vector.", + "params": { + "pool": "to calculate the order / signature for", + "prices": "supplied for determining the order, assumed to be in the same order as returned from `tokens(pool)`. Tokens prices are expressed relative to each other: for example, if tokens[0] is WETH, tokens[2] is DAI, and the price is 1 WETH per 3000 DAI, then a valid price vector is [3000, *, 1, ...]. If tokens[1] is another stablecoin with 18 decimals, then a valid price vector could be [3000, 3000, 1, ...]. This price vector is compatible with the price vector used in a call to `settle`, assuming the traded token array is in the same order as in `tokens(pool)`." + }, + "returns": { + "_order": "The CoW Protocol JIT order", + "postInteractions": "The array array for any **POST** interactions (empty if none)", + "preInteractions": "The array array for any **PRE** interactions (empty if none)", + "sig": "A valid CoW-Protocol signature for the resulting order using the ERC-1271 signature scheme." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "factory()": { + "notice": "AMM Pool helpers MUST return the factory target for indexing of CoW AMM pools." + }, + "order(address,uint256[])": { + "notice": "AMM Pool helpers MUST provide a method for returning the canonical order required to satisfy the pool's invariants, given a pricing vector." + }, + "tokens(address)": { + "notice": "AMM Pool helpers MUST return all tokens that may be traded on this pool. The order of the tokens is expected to be consistent and must be the same as that used for the input price vector in the `order` function." + } + }, + "version": 1 + } + }, + "settings": { + "remappings": [ + "@openzeppelin/=lib/composable-cow/lib/@openzeppelin/", + "@openzeppelin/contracts/=lib/openzeppelin/contracts/", + "composable-cow/=lib/composable-cow/", + "cowprotocol/=lib/composable-cow/lib/cowprotocol/src/", + "ds-test/=lib/forge-std/lib/ds-test/src/", + "erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/", + "forge-std/=lib/forge-std/src/", + "murky/=lib/composable-cow/lib/murky/src/", + "openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/", + "openzeppelin/=lib/openzeppelin/", + "safe/=lib/composable-cow/lib/safe/", + "uniswap-v2-core/=lib/uniswap-v2-core/contracts/", + "lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/", + "lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/", + "lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/", + "lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/" + ], + "optimizer": { + "enabled": true, + "runs": 100000 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/ConstantProductHelper.sol": "ConstantProductHelper" + }, + "evmVersion": "cancun", + "libraries": {} + }, + "sources": { + "lib/composable-cow/lib/cowprotocol/src/contracts/interfaces/IERC20.sol": { + "keccak256": "0x2db02cc0e23db99d10cd21590425b714060a556bcfb934cb5ab3b80aef1610ba", + "urls": [ + "bzz-raw://c05f8a21a244e6566a3e555028cebeebd1c38902f0cea2e9b014cc7becaf3140", + "dweb:/ipfs/QmTBY1GphjwAnY2nC9qKMwj5HeAUJMgFdo5YZcVxsVyqFb" + ], + "license": "MIT" + }, + "lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Interaction.sol": { + "keccak256": "0x7b69b3d536c995e84a5fe4ec3dc63ddf01a3538f72ece83828e87aa90df33a7d", + "urls": [ + "bzz-raw://7ba34b22f5b25cd6fecfd0d5e9b6077b36130a2cb4539b1311de0f328c226958", + "dweb:/ipfs/QmUURWvPbrZ6Z4iDv8Sa8soQCZyKZCsCcdMzgY9Jy5RNV2" + ], + "license": "LGPL-3.0-or-later" + }, + "lib/composable-cow/lib/cowprotocol/src/contracts/libraries/GPv2Order.sol": { + "keccak256": "0xb96efb76433446cf0ccb9f5bc926301a9c8bcbfd17dcd6a36a1e6207f5b436b2", + "urls": [ + "bzz-raw://5ec097e17d3e47e16808a5246a99af7ef618bb58ccb61d7331bfca1929cbbd82", + "dweb:/ipfs/QmbH7rg5s5gdpa5KENMUXHyGBWJyQn6XEwv9JakRSCcv8n" + ], + "license": "LGPL-3.0-or-later" + }, + "lib/composable-cow/lib/safe/contracts/Safe.sol": { + "keccak256": "0xbab2f7bec33283e349342e7b23f5191c678c64fe02065bac4f4f44fb3f5d2638", + "urls": [ + "bzz-raw://f95884e85691d49ba3efb9b2a160466fed17377bfa92fc8bf5923f3c61e99119", + "dweb:/ipfs/QmQjhP9RnB3Cj3DNpWLzWqqvRdKBya6Efx6xzmRrwLqjm9" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/Executor.sol": { + "keccak256": "0xf0be832e7529e92000544170a5529d73666a9b5e836b30c6f2ed6ef7d7d8c94a", + "urls": [ + "bzz-raw://710022b40c9f78a5b55b97f6ce600e4834df2ddd36bf714974d953883c82d58c", + "dweb:/ipfs/QmbdJNKH5opevm7HxQKQAe6W7dQTgSHKa4nKvbUNGRcQQp" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/FallbackManager.sol": { + "keccak256": "0x646b3088f15af8b4f71ac5eeffaa24ce0c1abed5f494f90368208b09e35d5165", + "urls": [ + "bzz-raw://7975be46d228510c70659b18076aecb3b0e7331b4d3a162444304145143bdc6e", + "dweb:/ipfs/QmRRbZrWUnoky6pVo8zMUzCTsshR4sZ2FjR13s8vyAb8dV" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/GuardManager.sol": { + "keccak256": "0xedfc7c830ab35e52d1208986b253f3422c2f0ca68054c10819fb348fcc6ccf5d", + "urls": [ + "bzz-raw://3ff8a4194d1160d2e23142937bc9d7eac7b6b553b1ee226390a0df07ebac1b64", + "dweb:/ipfs/QmSw8Y7z4TQrUTEosdWqcug7TUv9Tg1kxqMKHd7RuTnyzx" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/ModuleManager.sol": { + "keccak256": "0xd71b0d56dce386fa6f67c51061face071b2c7b03ec535d68717e2538ec47113a", + "urls": [ + "bzz-raw://30812896d9f57cae84a432c67fbb3007d566071ec203b2992f1c0f762722df0d", + "dweb:/ipfs/QmRyJ3JbsUwDQxQDTrqDDX4qNtVu7XiW8cD8WP5kgNJGGz" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/base/OwnerManager.sol": { + "keccak256": "0xec9799093eb7a73461cd5e563198751ee222f956f754ea622a03fe953e515b2c", + "urls": [ + "bzz-raw://5729c58b14e7b656c71dd3377e9519c0d34ef8c04851a9a21c3d62393e4fae7a", + "dweb:/ipfs/QmRRtfFpNqvdANny9TYBr8rA3HbT1egUCpb2uXALMHkVxK" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/Enum.sol": { + "keccak256": "0x4ff3008926a118e9f36e6747facc39dd13168e0d00f516888ae966ec20766453", + "urls": [ + "bzz-raw://385929800d1c0f92eb165fcf37a9e28b395b17d8b74f74755654d3a096a0fc34", + "dweb:/ipfs/QmagieLuN2jrp2oJHFyZuyz65Sh1CcupnXSEKypGFS5Gvo" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/NativeCurrencyPaymentFallback.sol": { + "keccak256": "0x3ddcd4130c67326033dcf773d2d87d7147e3a8386993ea3ab3f1c38da406adba", + "urls": [ + "bzz-raw://740a729397b6a0d903f4738a50e856d4e5039555024937b148d97529525dbfa9", + "dweb:/ipfs/QmQJuNVvHbkeJ6jjd75D8FsZBPXH6neoGBZdQgtsA82E7g" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/SecuredTokenTransfer.sol": { + "keccak256": "0x1eb8c3601538b73dd6a823ac4fca49bb8adc97d1302a936622156636c971eb05", + "urls": [ + "bzz-raw://c26495b1fe9229ea17f90b70f295030880d629b9ea3016ea20b634983865f7b3", + "dweb:/ipfs/QmTc1UmKcynkKn8DeviLMuy6scxNvAVSdLoX4ndUtdEL9N" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/SelfAuthorized.sol": { + "keccak256": "0xfb0e176bb208e047a234fe757e2acd13787e27879570b8544547ac787feb5f13", + "urls": [ + "bzz-raw://8e9a317f0c3c02ab1d6c38039bff2b3e0c97f4dc9d229d3d9149c1af1c5023b3", + "dweb:/ipfs/QmNcZjNChsuXF34T6f3Zu7i3tnqvKN4NyWBWZ4tXLH9kMu" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/SignatureDecoder.sol": { + "keccak256": "0x2a3baf0efa1585ddf2276505c6d34fa16f01cafff1288e40110d5e67fb459c7c", + "urls": [ + "bzz-raw://00cdded3068b9051ee0a966f40926fbc57dbe7ef8bf4285db3740f9d50468c80", + "dweb:/ipfs/QmcP5hKmaRqBe7TpgoXtncZqsNKKdCCKxZgXoxEL4Nj5F4" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/Singleton.sol": { + "keccak256": "0xcab7c6e5fb6d7295a9343f72fec26a2f632ddfe220a6f267b5c5a1eb2f9bce50", + "urls": [ + "bzz-raw://dd1c31d5787ef590a60f6b0dbc74d09e6fe4d3ad2f0529940d662bf315521cde", + "dweb:/ipfs/QmSAS5DYrGksJe4cPQ4wLrveXa1CjxAuEiohcLpPG5h2bo" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/common/StorageAccessible.sol": { + "keccak256": "0x2c5412a8f014db332322a6b24ee3cedce15dca17a721ae49fdef368568d4391e", + "urls": [ + "bzz-raw://e775f267d3e60ebe452d9533f46a0eb1f1dc4593d1bcb553e86cea205a5f361e", + "dweb:/ipfs/QmQdYDHGQsiMx1AADWRhX7tduU9ycTzrT5q3zBWvphXzKZ" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/external/SafeMath.sol": { + "keccak256": "0x5f856674d9be11344c5899deb43364e19baa75bc881cada4c159938270b2bd89", + "urls": [ + "bzz-raw://351c66e5fe92c0a51f79d133521545dabdd3f756312a7b1428c1fc813c512a1c", + "dweb:/ipfs/QmdnrRmgef8SdamEU6fVEqFD5RQwXeDFTfQuZEfX2vxC4x" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/ExtensibleFallbackHandler.sol": { + "keccak256": "0x7e511290dae21c9b1710c9250320d9b98ffd71c9501af354814485b58e1b64e9", + "urls": [ + "bzz-raw://3e55ba23bde90d2cdd07baa7172ea41bdc1d638bc7b6eb5dce03189d86412515", + "dweb:/ipfs/QmbxH73sqooeQL8ehsP2FDoXhLBoPs3wr3nod6ZgJwVcFV" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/HandlerContext.sol": { + "keccak256": "0x3e105ebac003af9c8d34e3eed517ff0355d5f487e17478c85df0f225b04846f5", + "urls": [ + "bzz-raw://657bec347d746453883c461a3d9a2275bf2b99625dcaef0960e1c0276c3d56c4", + "dweb:/ipfs/QmUGj8Tzs1CsmUf63LbTMK81EEGtYYnWKLGdHHtoYCd9CF" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/ERC165Handler.sol": { + "keccak256": "0x4d562221e6645b6e79da99d2b322331617051fa90e06ec7ce3f9a6a87bae116c", + "urls": [ + "bzz-raw://5a574dd50b9e9a594afda4a96701295e18a0054fcaf5083573ee80033b2da060", + "dweb:/ipfs/QmNQf5rfHqMCGKBcqZowz89JEZe8rjjoYEkySBy7oxwh4Y" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/ExtensibleBase.sol": { + "keccak256": "0xe5b71121b0020728158ee60756982e74809f9d77cb294a6d65930bff09d84d15", + "urls": [ + "bzz-raw://fd7fd2702b31fc8569a9986a476dd9fe9aa76624d0da6d832547f624426925f9", + "dweb:/ipfs/QmWjYGtW38Fnwvm8qFvoJYhz2nTuySGkHouwRF3eksd6Nh" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/FallbackHandler.sol": { + "keccak256": "0x3020c96c812548a2bf6413168ee21033638a36736b695909f7cf54277beefd76", + "urls": [ + "bzz-raw://6ffdf49fb516791f4cad239fc780bb5d9934bb06744b99b0fbc067f31ad13591", + "dweb:/ipfs/QmPXwVoDhnhnQFSxEiHDZYRQJ5ozAECSFrUHMTjwAJ1LuM" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/MarshalLib.sol": { + "keccak256": "0x36eacc47b1ce7697e679c1b5c0d3a86d8f46a0436b666f86e88df04765cde5c1", + "urls": [ + "bzz-raw://7097bfb174ea424ef55f9a5b55f4a9857f7368cdd3061888f5ffb3e29503f071", + "dweb:/ipfs/QmRPvAvMdGRuh8AjePtamBGUU55p1tSP8ZHUUMfxWgi1ew" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/SignatureVerifierMuxer.sol": { + "keccak256": "0x51e8dad81059527f9b6b6827d742a0fbc0960c66e364dd1e67c8f151970c6ee4", + "urls": [ + "bzz-raw://b368a4eb15d50487986db1543a5c786324a4d0de680a421d131e21c25459f666", + "dweb:/ipfs/QmVca3J2JBEZtxW3uNMvYc9ugQH24CqantLnVzKcZwG71W" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/handler/extensible/TokenCallbacks.sol": { + "keccak256": "0x549d737c3eef66cec2a858b34dce4db42e56d8f053635742230873e6049e81ed", + "urls": [ + "bzz-raw://f03f130c36be396895acfa7891ccca36725c6a6496085d88fc33071e00093073", + "dweb:/ipfs/QmfLfenjQ1gWnotx5Vdda1kJBqjnCi53bGNqyZ5cN6wxXV" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/ERC1155TokenReceiver.sol": { + "keccak256": "0x87e62665c041cade64e753ecdccf931cb100ab6e4bcc98769c1e6474be9db493", + "urls": [ + "bzz-raw://59ca1157dcfe19c72b9d1244a6ae5ec70fee9793d4d8af523b70f22ae567d55c", + "dweb:/ipfs/QmfE3kv73QuQWAWQND927LWVHVLCp19m1mLUvxVYJDEFZM" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/ERC721TokenReceiver.sol": { + "keccak256": "0x96c4c5457fede2d4c6012011dfda36f8e8ffdb7388468f2dddb35661538bf479", + "urls": [ + "bzz-raw://99a54737bc23722f79ec9cf9de63ba35b556a61df453eb332f3cac783503f26c", + "dweb:/ipfs/QmbLW5C2RhoLbwDWEPtTKpyYE5apT9B3q4U11PZG3wSM1n" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/IERC165.sol": { + "keccak256": "0x779ed3893a8812e383670b755f65c7727e9343dadaa4d7a4aa7f4aa35d859fdb", + "urls": [ + "bzz-raw://bb2039e1459ace1e68761e873632fc339866332f9f5ecb7452a0bc3a3b847e89", + "dweb:/ipfs/QmYXvDQXJnDkXFvsvKLyZXaAv4x42qvtbtmwHftP4RKX38" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/lib/safe/contracts/interfaces/ISignatureValidator.sol": { + "keccak256": "0x2459cb3ed73ecb80e1e7a6508d09a58cc59570b049f77042f669dedfcc5f6457", + "urls": [ + "bzz-raw://3c4a1371948b11f78171bc4ae4fd169a1eec11e5c4b273eb2c54bc030a1aae25", + "dweb:/ipfs/QmPuztatXZYVS65n8YbCyccJFZYPP6zQfBQ8tTY27pB978" + ], + "license": "LGPL-3.0-only" + }, + "lib/composable-cow/src/BaseConditionalOrder.sol": { + "keccak256": "0x8b429a011579b3d84df3bb3135b3299054790018220666befa9ab5af24f49e8f", + "urls": [ + "bzz-raw://a30f0535cf7fc4fabc42b83a04bd687b8e989ae8d0c3f6db63b69504c15a7a34", + "dweb:/ipfs/QmSeKTQWEx74SV6hrdX3sGLV6L9MF8fPPqoyyvdB4Kt3bo" + ], + "license": "MIT" + }, + "lib/composable-cow/src/ComposableCoW.sol": { + "keccak256": "0xcf1583fd0565c921f108e81d516591c9ff123f840dbdd349e9e98d793de4409f", + "urls": [ + "bzz-raw://112df8eb50205574a22bbb8db9f7d064ec4c753052f798668db88fd222724883", + "dweb:/ipfs/QmSV7gBaWDn4PhJGCYayuFqvRortZHnzUjsZNGrm2NriEu" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/interfaces/IConditionalOrder.sol": { + "keccak256": "0xe9e47811223793dfa9a5fc3098cf874385f547e536ef47da634b505659aeedc7", + "urls": [ + "bzz-raw://40c3daf74830a4394052b916ca920fce07761a2b66e8af8c877b72d2efaa49eb", + "dweb:/ipfs/QmZ9adA6R1hCHnvg6DwnTn7zqta6zU1Ctb564zb8aiqRFD" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/interfaces/ISwapGuard.sol": { + "keccak256": "0xac211fb24463a9c04a05bb58fe42d9bea10e58fe9ca35e7f544868eeb5972339", + "urls": [ + "bzz-raw://3ce2a180c5368c6807aecafb242675476bbc653ac72b3bd727db3467efe8b900", + "dweb:/ipfs/QmWzTqMQCuvX5Zpn2sjxYUS9o3upsip4yNvwCMQGbXAk6Y" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/interfaces/IValueFactory.sol": { + "keccak256": "0x3304ef8a0a1727258ac8278bf5426daeac37ece4653eaaff87b15143814a8122", + "urls": [ + "bzz-raw://9934d278069dd9474065777833a81e65af227b85d350b6c1f012b812101be9de", + "dweb:/ipfs/QmcMBdvY7wLs92FCyutDGQGtHnYryjnaykREvDNBNM8Yih" + ], + "license": "GPL-3.0" + }, + "lib/composable-cow/src/types/ConditionalOrdersUtilsLib.sol": { + "keccak256": "0x38e4ce4fc58c018f510ee45d78ae49253e8aa70fdf559d83ebb6c838c6b47aae", + "urls": [ + "bzz-raw://a38ccd5b8ce2895a77b7474b1ac36ebfccc975b3839f6d3bfef72700f8f6f777", + "dweb:/ipfs/QmSfs5zZ4U14NkZYSqAFUBcuKGjyfMM5Dp2sbj14FmVYPf" + ], + "license": "MIT" + }, + "lib/composable-cow/src/vendored/CoWSettlement.sol": { + "keccak256": "0x4e4e317b24017cd87eb11d16368b8c06ec19306d31946c330a86f9f136df38d7", + "urls": [ + "bzz-raw://34b9b2fc2c89e60497457cd812da9c53718c15ddfbf70f6e11832d22092c1840", + "dweb:/ipfs/QmYFzaynWZfdpmFRf2dZrQ32Ep53AtQDd5fTE3a89xVkaR" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/interfaces/IERC1271.sol": { + "keccak256": "0x85a45f3f10014a0f8be41157a32b6a5f905753ea64a4b64e29fc12b7deeecf39", + "urls": [ + "bzz-raw://c3c74009ce36136b36c77c23935b8e4a7b4f253be2da2be4fb4a916b1ce43743", + "dweb:/ipfs/QmcH36v3iN7SJJuF73AunLR2LtNxhVJ1wm63ph4dPZ4pcL" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/interfaces/IERC20.sol": { + "keccak256": "0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c", + "urls": [ + "bzz-raw://a2608291cb038b388d80b79a06b6118a42f7894ff67b7da10ec0dbbf5b2973ba", + "dweb:/ipfs/QmWohqcBLbcxmA4eGPhZDXe5RYMMEEpFq22nfkaUMvTfw1" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/IERC20.sol": { + "keccak256": "0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70", + "urls": [ + "bzz-raw://0ea104e577e63faea3b69c415637e99e755dcbf64c5833d7140c35a714d6d90c", + "dweb:/ipfs/Qmau6x4Ns9XdyynRCNNp3RhLqijJjFm7z5fyZazfYFGYdq" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { + "keccak256": "0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff", + "urls": [ + "bzz-raw://f5196ec75139918c6c7bb4251b36395e668f1fa6d206beba7e7520e74913940d", + "dweb:/ipfs/QmSyqjksXxmm2mCG6qRd1yuwLykypkSVBbnBnGqJRcuJMi" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "keccak256": "0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386", + "urls": [ + "bzz-raw://b3036b3a83b7c48f96641f2a9002b9f2dcb6a5958dd670894ada21ae8229b3d0", + "dweb:/ipfs/QmUNfSBdoVtjhETaUJCYcaC7pTMgbhht926tJ2uXJbiVd3" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/Address.sol": { + "keccak256": "0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721", + "urls": [ + "bzz-raw://b7bd24e224f67f65bfadf85dc2929fa965456bb2415478bd0125471b5ce35245", + "dweb:/ipfs/QmRaydGr8BTHs1kvaZfsNU69pKzUAGFrvABn1KiRSbE51y" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol": { + "keccak256": "0x6400c4bee15052e043e5d10315135972529bd1c8012f43da494dc6b4f4661058", + "urls": [ + "bzz-raw://da5d3d47d35af4373743a559ea4b9b7ecfe4bab6f0703f410c1e59959b7966ac", + "dweb:/ipfs/QmTHdoghh4WLu4yURjGEgRk162pcwwdsG52MPGa12GqnGR" + ], + "license": "MIT" + }, + "lib/openzeppelin/contracts/utils/math/Math.sol": { + "keccak256": "0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d", + "urls": [ + "bzz-raw://4ece9f0b9c8daca08c76b6b5405a6446b6f73b3a15fab7ff56e296cbd4a2c875", + "dweb:/ipfs/QmQyRpyPRL5SQuAgj6SHmbir3foX65FJjbVTTQrA2EFg6L" + ], + "license": "MIT" + }, + "src/ConstantProduct.sol": { + "keccak256": "0x4883252f066b38972e5466f54d7cbf6e1a5b7c55823f012837f254ccd7aaa707", + "urls": [ + "bzz-raw://5bcfdb33677ad8f14d939cb1570fbcdd0c5d25843d93f35e70c41a58f278345c", + "dweb:/ipfs/QmRN1eRCJoGj3RygAbaRaGQ85DJjApEZv1qLUqGYbh1frT" + ], + "license": "GPL-3.0" + }, + "src/ConstantProductFactory.sol": { + "keccak256": "0xd9e2a5d4cc9cde16d1d8469194eff6e32b97758413574fc866067a392d3d9255", + "urls": [ + "bzz-raw://1745aea9ad3571a9edf950a8fd9d745042b2c697fa1bd0c46982fddc21dc7fc8", + "dweb:/ipfs/QmVQMyM3uSRzvL61Fnb9rH5mYaLBQrkh69iB9Gx3Lk6QWD" + ], + "license": "GPL-3.0" + }, + "src/ConstantProductHelper.sol": { + "keccak256": "0xb184c91352617489a5f22ce8bb29f9840a00f8055ac283e6d1d85984e786b677", + "urls": [ + "bzz-raw://9413468585f4d8faac44b2c1f7c02cd4f21f5df570c6573c7ccab584a420d366", + "dweb:/ipfs/QmSE5dkMEjbt1pEv5Y1Ao7EeudNWET7TwtAP6FPUVXiGbR" + ], + "license": "LGPL-3.0-only" + }, + "src/interfaces/ICOWAMMPoolFactory.sol": { + "keccak256": "0x2b65e467fa06b6149a7f2eee4879973fc5845ab12f86e718f1c2708e0bf98829", + "urls": [ + "bzz-raw://2ea7e105fc8953eb819f64a1e426881d834afbe990fbcda08c30c18a2d1a332a", + "dweb:/ipfs/QmSUpommi6khq2EgLSTNSEorHjKtoztqa9D5BfTZ83LBqX" + ], + "license": "GPL-3.0" + }, + "src/interfaces/ICOWAMMPoolHelper.sol": { + "keccak256": "0xa5b11fe7aefe1d3ab091d5f381c15381a3dc7c5a4e0a597c33cbb0deecd3d704", + "urls": [ + "bzz-raw://6525ad30ec83975097671ec389ed20772dcbd0de07ea0e92b6b9bdf0a12c0163", + "dweb:/ipfs/QmcYnz4FmMWLqdWpjEGHDXCWAWbKu98vDzUcHpkLJ5Cfg6" + ], + "license": "LGPL-3.0-only" + }, + "src/interfaces/IPriceOracle.sol": { + "keccak256": "0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e", + "urls": [ + "bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2", + "dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu" + ], + "license": "GPL-3.0" + }, + "src/interfaces/ISettlement.sol": { + "keccak256": "0x51833975e3c96a6bfc9b255d122e145fc28a968b920fda5744ea0d9bf022e84a", + "urls": [ + "bzz-raw://3b2228e777904811715e693f6fe577be18b128db72219a6f3ca528fb9c119bc6", + "dweb:/ipfs/QmXnNgdMLJBhztH5US1EnxGV8PB4yvLZqhN1sTkvrdvSZ2" + ], + "license": "GPL-3.0" + }, + "src/legacy/Helper.sol": { + "keccak256": "0xf0494ad9f71fdf2602dbd30f885ffd0b1a88beedcd7459ec75f759efb11dc1c4", + "urls": [ + "bzz-raw://e6b3916e22daa8fd8deae7b85b270972ea652ff696301852644f077dc8f82b2d", + "dweb:/ipfs/QmcWJX9WoiBVsCjZVuv6SDYAQYDWDctXD8nkZVMqSbxZzK" + ], + "license": "LGPL-3.0-only" + }, + "src/legacy/Snapshot.sol": { + "keccak256": "0x2a0c3ff6bf1b8a86161f982589aed2012dd462aa8a1cdc06a73b9c2ca636ff4f", + "urls": [ + "bzz-raw://db6d85afd2b2711ebc9282c351c9a5e491d8d20f0646ae8ab45f548e426ab1eb", + "dweb:/ipfs/QmNzZCc2CWBerhW2Eu44QRowFokYnCMcWaNiPJoRMsLKxV" + ], + "license": "LGPL-3.0-only" + }, + "src/libraries/GetTradeableOrder.sol": { + "keccak256": "0x095d47c2d45ff22440ddf8f76bb6b9cbfd7250d35849e79ccb89c8eeb126b645", + "urls": [ + "bzz-raw://787103261569a4b07b762f6a106178e5ec384b3b89bd24bfc079bc27ccde4b72", + "dweb:/ipfs/QmTYN4jPyPecNWwqKpqqFbvZtBPwWvf4Z8MCPTSmZy85wM" + ], + "license": "LGPL-3.0-only" + } + }, + "version": 1 + }, + "id": 126 +} diff --git a/crates/contracts/artifacts/CowAmmUniswapV2PriceOracle.json b/crates/contracts/artifacts/CowAmmUniswapV2PriceOracle.json index 9a00a5db5a..c232352da2 100644 --- a/crates/contracts/artifacts/CowAmmUniswapV2PriceOracle.json +++ b/crates/contracts/artifacts/CowAmmUniswapV2PriceOracle.json @@ -1 +1,175 @@ -{"abi":[{"type":"function","name":"getPrice","inputs":[{"name":"token0","type":"address","internalType":"address"},{"name":"token1","type":"address","internalType":"address"},{"name":"data","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"priceNumerator","type":"uint256","internalType":"uint256"},{"name":"priceDenominator","type":"uint256","internalType":"uint256"}],"stateMutability":"view"}],"bytecode":"0x6080604052348015600e575f80fd5b506105468061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063355efdd91461002d575b5f80fd5b61004061003b366004610386565b610059565b6040805192835260208301919091520160405180910390f35b5f808061006884860186610411565b9050805f015173ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156100b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100da91906104a2565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080935081945050505f815f015173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610156573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017a91906104ee565b90505f825f015173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ed91906104ee565b90508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff160361022757929392905b8173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146102c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e300000000000000000000060448201526064015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e310000000000000000000060448201526064016102b8565b50505094509492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610383575f80fd5b50565b5f805f8060608587031215610399575f80fd5b84356103a481610362565b935060208501356103b481610362565b9250604085013567ffffffffffffffff808211156103d0575f80fd5b818701915087601f8301126103e3575f80fd5b8135818111156103f1575f80fd5b886020828501011115610402575f80fd5b95989497505060200194505050565b5f60208284031215610421575f80fd5b6040516020810181811067ffffffffffffffff82111715610469577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604052823561047781610362565b81529392505050565b80516dffffffffffffffffffffffffffff8116811461049d575f80fd5b919050565b5f805f606084860312156104b4575f80fd5b6104bd84610480565b92506104cb60208501610480565b9150604084015163ffffffff811681146104e3575f80fd5b809150509250925092565b5f602082840312156104fe575f80fd5b815161050981610362565b939250505056fea26469706673582212201fe6ad4d6b89d204db5394bdedef23d10ed8c7e4f83be4c5fe14dcc09470223464736f6c63430008190033","deployedBytecode":"0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063355efdd91461002d575b5f80fd5b61004061003b366004610386565b610059565b6040805192835260208301919091520160405180910390f35b5f808061006884860186610411565b9050805f015173ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156100b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100da91906104a2565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080935081945050505f815f015173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610156573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017a91906104ee565b90505f825f015173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ed91906104ee565b90508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff160361022757929392905b8173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146102c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e300000000000000000000060448201526064015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e310000000000000000000060448201526064016102b8565b50505094509492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610383575f80fd5b50565b5f805f8060608587031215610399575f80fd5b84356103a481610362565b935060208501356103b481610362565b9250604085013567ffffffffffffffff808211156103d0575f80fd5b818701915087601f8301126103e3575f80fd5b8135818111156103f1575f80fd5b886020828501011115610402575f80fd5b95989497505060200194505050565b5f60208284031215610421575f80fd5b6040516020810181811067ffffffffffffffff82111715610469577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604052823561047781610362565b81529392505050565b80516dffffffffffffffffffffffffffff8116811461049d575f80fd5b919050565b5f805f606084860312156104b4575f80fd5b6104bd84610480565b92506104cb60208501610480565b9150604084015163ffffffff811681146104e3575f80fd5b809150509250925092565b5f602082840312156104fe575f80fd5b815161050981610362565b939250505056fea26469706673582212201fe6ad4d6b89d204db5394bdedef23d10ed8c7e4f83be4c5fe14dcc09470223464736f6c63430008190033","methodIdentifiers":{"getPrice(address,address,bytes)":"355efdd9"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"priceNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"priceDenominator\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CoW Protocol Developers\",\"details\":\"This contract creates an oracle that is compatible with the IPriceOracle interface and can be used by a CoW AMM to determine the current price of the traded tokens on specific Uniswap v2 pools.\",\"kind\":\"dev\",\"methods\":{\"getPrice(address,address,bytes)\":{\"details\":\"Calling this function returns the price of token1 in terms of token0 as a fraction (numerator, denominator). For example, in a pool where token0 is DAI, token1 is ETH, and ETH is worth 2000 DAI, valid output tuples would be (2000, 1), (20000, 10), ...To keep the risk of multiplication overflow to a minimum, we recommend to use return values that fit the size of a uint128.\",\"params\":{\"data\":\"Any additional data that may be required by the specific oracle implementation. For example, it could be a specific pool id for balancer, or the address of a specific price feed for Chainlink. We recommend this data be implemented as the abi-encoding of a dedicated data struct for ease of type-checking and decoding the input.\",\"token0\":\"The first token, whose price is determined based on the second token.\",\"token1\":\"The second token; the price of the first token is determined relative to this token.\"},\"returns\":{\"priceDenominator\":\"The denominator of the price, expressed in amount of token1 per amount of token0.\",\"priceNumerator\":\"The numerator of the price, expressed in amount of token1 per amount of token0.\"}}},\"title\":\"CoW AMM UniswapV2 Price Oracle\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/oracles/UniswapV2PriceOracle.sol\":\"UniswapV2PriceOracle\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/\",\":balancer/=lib/composable-cow/lib/balancer/src/\",\":canonical-weth/=lib/composable-cow/lib/canonical-weth/src/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/\",\":math/=lib/composable-cow/lib/balancer/src/lib/math/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/uniswap-v2-core/contracts/interfaces/IUniswapV2Pair.sol\":{\"keccak256\":\"0x7c9bc70e5996c763e02ff38905282bc24fb242b0ef2519a003b36824fc524a4b\",\"urls\":[\"bzz-raw://85d5ad2dd23ee127f40907a12865a1e8cb5828814f6f2480285e1827dd72dedf\",\"dweb:/ipfs/QmayKQWJgWmr46DqWseADyUanmqxh662hPNdAkdHRjiQQH\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/oracles/UniswapV2PriceOracle.sol\":{\"keccak256\":\"0xd609e84287558861dd13aaea60b49f06261f6e098b10fe1b1dbb29441b655bf2\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6cc7fc5cea18e21d3807a9691318e398f83192aefc33b96f8085444788d8471a\",\"dweb:/ipfs/QmfQA5CZoqqkeghrztAs8C6rVSSCiCdaDhHQPJqG83UjRs\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"stateMutability":"view","type":"function","name":"getPrice","outputs":[{"internalType":"uint256","name":"priceNumerator","type":"uint256"},{"internalType":"uint256","name":"priceDenominator","type":"uint256"}]}],"devdoc":{"kind":"dev","methods":{"getPrice(address,address,bytes)":{"details":"Calling this function returns the price of token1 in terms of token0 as a fraction (numerator, denominator). For example, in a pool where token0 is DAI, token1 is ETH, and ETH is worth 2000 DAI, valid output tuples would be (2000, 1), (20000, 10), ...To keep the risk of multiplication overflow to a minimum, we recommend to use return values that fit the size of a uint128.","params":{"data":"Any additional data that may be required by the specific oracle implementation. For example, it could be a specific pool id for balancer, or the address of a specific price feed for Chainlink. We recommend this data be implemented as the abi-encoding of a dedicated data struct for ease of type-checking and decoding the input.","token0":"The first token, whose price is determined based on the second token.","token1":"The second token; the price of the first token is determined relative to this token."},"returns":{"priceDenominator":"The denominator of the price, expressed in amount of token1 per amount of token0.","priceNumerator":"The numerator of the price, expressed in amount of token1 per amount of token0."}}},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"remappings":["@openzeppelin/=lib/composable-cow/lib/@openzeppelin/","@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/","balancer/=lib/composable-cow/lib/balancer/src/","canonical-weth/=lib/composable-cow/lib/canonical-weth/src/","composable-cow/=lib/composable-cow/","cowprotocol/=lib/composable-cow/lib/cowprotocol/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/","math/=lib/composable-cow/lib/balancer/src/lib/math/","murky/=lib/composable-cow/lib/murky/src/","openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/","openzeppelin/=lib/openzeppelin/","safe/=lib/composable-cow/lib/safe/","uniswap-v2-core/=lib/uniswap-v2-core/contracts/","lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/","lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/","lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/","lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/"],"optimizer":{"enabled":true,"runs":100000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/oracles/UniswapV2PriceOracle.sol":"UniswapV2PriceOracle"},"evmVersion":"cancun","libraries":{}},"sources":{"lib/uniswap-v2-core/contracts/interfaces/IUniswapV2Pair.sol":{"keccak256":"0x7c9bc70e5996c763e02ff38905282bc24fb242b0ef2519a003b36824fc524a4b","urls":["bzz-raw://85d5ad2dd23ee127f40907a12865a1e8cb5828814f6f2480285e1827dd72dedf","dweb:/ipfs/QmayKQWJgWmr46DqWseADyUanmqxh662hPNdAkdHRjiQQH"],"license":null},"src/interfaces/IPriceOracle.sol":{"keccak256":"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e","urls":["bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2","dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu"],"license":"GPL-3.0"},"src/oracles/UniswapV2PriceOracle.sol":{"keccak256":"0xd609e84287558861dd13aaea60b49f06261f6e098b10fe1b1dbb29441b655bf2","urls":["bzz-raw://6cc7fc5cea18e21d3807a9691318e398f83192aefc33b96f8085444788d8471a","dweb:/ipfs/QmfQA5CZoqqkeghrztAs8C6rVSSCiCdaDhHQPJqG83UjRs"],"license":"GPL-3.0"}},"version":1},"id":178} +{ + "abi": [ + { + "type": "function", + "name": "getPrice", + "inputs": [ + { + "name": "token0", + "type": "address", + "internalType": "address" + }, + { + "name": "token1", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "priceNumerator", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "priceDenominator", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + } + ], + "bytecode": "0x6080604052348015600e575f80fd5b506105468061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063355efdd91461002d575b5f80fd5b61004061003b366004610386565b610059565b6040805192835260208301919091520160405180910390f35b5f808061006884860186610411565b9050805f015173ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156100b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100da91906104a2565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080935081945050505f815f015173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610156573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017a91906104ee565b90505f825f015173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ed91906104ee565b90508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff160361022757929392905b8173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146102c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e300000000000000000000060448201526064015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e310000000000000000000060448201526064016102b8565b50505094509492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610383575f80fd5b50565b5f805f8060608587031215610399575f80fd5b84356103a481610362565b935060208501356103b481610362565b9250604085013567ffffffffffffffff808211156103d0575f80fd5b818701915087601f8301126103e3575f80fd5b8135818111156103f1575f80fd5b886020828501011115610402575f80fd5b95989497505060200194505050565b5f60208284031215610421575f80fd5b6040516020810181811067ffffffffffffffff82111715610469577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604052823561047781610362565b81529392505050565b80516dffffffffffffffffffffffffffff8116811461049d575f80fd5b919050565b5f805f606084860312156104b4575f80fd5b6104bd84610480565b92506104cb60208501610480565b9150604084015163ffffffff811681146104e3575f80fd5b809150509250925092565b5f602082840312156104fe575f80fd5b815161050981610362565b939250505056fea26469706673582212201fe6ad4d6b89d204db5394bdedef23d10ed8c7e4f83be4c5fe14dcc09470223464736f6c63430008190033", + "deployedBytecode": "0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063355efdd91461002d575b5f80fd5b61004061003b366004610386565b610059565b6040805192835260208301919091520160405180910390f35b5f808061006884860186610411565b9050805f015173ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156100b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100da91906104a2565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080935081945050505f815f015173ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610156573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017a91906104ee565b90505f825f015173ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c9573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ed91906104ee565b90508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff160361022757929392905b8173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146102c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e300000000000000000000060448201526064015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614610356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f7261636c653a20696e76616c696420746f6b656e310000000000000000000060448201526064016102b8565b50505094509492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610383575f80fd5b50565b5f805f8060608587031215610399575f80fd5b84356103a481610362565b935060208501356103b481610362565b9250604085013567ffffffffffffffff808211156103d0575f80fd5b818701915087601f8301126103e3575f80fd5b8135818111156103f1575f80fd5b886020828501011115610402575f80fd5b95989497505060200194505050565b5f60208284031215610421575f80fd5b6040516020810181811067ffffffffffffffff82111715610469577f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604052823561047781610362565b81529392505050565b80516dffffffffffffffffffffffffffff8116811461049d575f80fd5b919050565b5f805f606084860312156104b4575f80fd5b6104bd84610480565b92506104cb60208501610480565b9150604084015163ffffffff811681146104e3575f80fd5b809150509250925092565b5f602082840312156104fe575f80fd5b815161050981610362565b939250505056fea26469706673582212201fe6ad4d6b89d204db5394bdedef23d10ed8c7e4f83be4c5fe14dcc09470223464736f6c63430008190033", + "methodIdentifiers": { + "getPrice(address,address,bytes)": "355efdd9" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"priceNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"priceDenominator\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"CoW Protocol Developers\",\"details\":\"This contract creates an oracle that is compatible with the IPriceOracle interface and can be used by a CoW AMM to determine the current price of the traded tokens on specific Uniswap v2 pools.\",\"kind\":\"dev\",\"methods\":{\"getPrice(address,address,bytes)\":{\"details\":\"Calling this function returns the price of token1 in terms of token0 as a fraction (numerator, denominator). For example, in a pool where token0 is DAI, token1 is ETH, and ETH is worth 2000 DAI, valid output tuples would be (2000, 1), (20000, 10), ...To keep the risk of multiplication overflow to a minimum, we recommend to use return values that fit the size of a uint128.\",\"params\":{\"data\":\"Any additional data that may be required by the specific oracle implementation. For example, it could be a specific pool id for balancer, or the address of a specific price feed for Chainlink. We recommend this data be implemented as the abi-encoding of a dedicated data struct for ease of type-checking and decoding the input.\",\"token0\":\"The first token, whose price is determined based on the second token.\",\"token1\":\"The second token; the price of the first token is determined relative to this token.\"},\"returns\":{\"priceDenominator\":\"The denominator of the price, expressed in amount of token1 per amount of token0.\",\"priceNumerator\":\"The numerator of the price, expressed in amount of token1 per amount of token0.\"}}},\"title\":\"CoW AMM UniswapV2 Price Oracle\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/oracles/UniswapV2PriceOracle.sol\":\"UniswapV2PriceOracle\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[\":@openzeppelin/=lib/composable-cow/lib/@openzeppelin/\",\":@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/\",\":balancer/=lib/composable-cow/lib/balancer/src/\",\":canonical-weth/=lib/composable-cow/lib/canonical-weth/src/\",\":composable-cow/=lib/composable-cow/\",\":cowprotocol/=lib/composable-cow/lib/cowprotocol/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/\",\":math/=lib/composable-cow/lib/balancer/src/lib/math/\",\":murky/=lib/composable-cow/lib/murky/src/\",\":openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/openzeppelin/\",\":safe/=lib/composable-cow/lib/safe/\",\":uniswap-v2-core/=lib/uniswap-v2-core/contracts/\",\"lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/\",\"lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/\",\"lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/\",\"lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/\"]},\"sources\":{\"lib/uniswap-v2-core/contracts/interfaces/IUniswapV2Pair.sol\":{\"keccak256\":\"0x7c9bc70e5996c763e02ff38905282bc24fb242b0ef2519a003b36824fc524a4b\",\"urls\":[\"bzz-raw://85d5ad2dd23ee127f40907a12865a1e8cb5828814f6f2480285e1827dd72dedf\",\"dweb:/ipfs/QmayKQWJgWmr46DqWseADyUanmqxh662hPNdAkdHRjiQQH\"]},\"src/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2\",\"dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu\"]},\"src/oracles/UniswapV2PriceOracle.sol\":{\"keccak256\":\"0xd609e84287558861dd13aaea60b49f06261f6e098b10fe1b1dbb29441b655bf2\",\"license\":\"GPL-3.0\",\"urls\":[\"bzz-raw://6cc7fc5cea18e21d3807a9691318e398f83192aefc33b96f8085444788d8471a\",\"dweb:/ipfs/QmfQA5CZoqqkeghrztAs8C6rVSSCiCdaDhHQPJqG83UjRs\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.25+commit.b61c2a91" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function", + "name": "getPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "priceNumerator", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "priceDenominator", + "type": "uint256" + } + ] + } + ], + "devdoc": { + "kind": "dev", + "methods": { + "getPrice(address,address,bytes)": { + "details": "Calling this function returns the price of token1 in terms of token0 as a fraction (numerator, denominator). For example, in a pool where token0 is DAI, token1 is ETH, and ETH is worth 2000 DAI, valid output tuples would be (2000, 1), (20000, 10), ...To keep the risk of multiplication overflow to a minimum, we recommend to use return values that fit the size of a uint128.", + "params": { + "data": "Any additional data that may be required by the specific oracle implementation. For example, it could be a specific pool id for balancer, or the address of a specific price feed for Chainlink. We recommend this data be implemented as the abi-encoding of a dedicated data struct for ease of type-checking and decoding the input.", + "token0": "The first token, whose price is determined based on the second token.", + "token1": "The second token; the price of the first token is determined relative to this token." + }, + "returns": { + "priceDenominator": "The denominator of the price, expressed in amount of token1 per amount of token0.", + "priceNumerator": "The numerator of the price, expressed in amount of token1 per amount of token0." + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } + }, + "settings": { + "remappings": [ + "@openzeppelin/=lib/composable-cow/lib/@openzeppelin/", + "@openzeppelin/contracts/=lib/composable-cow/lib/@openzeppelin/contracts/", + "balancer/=lib/composable-cow/lib/balancer/src/", + "canonical-weth/=lib/composable-cow/lib/canonical-weth/src/", + "composable-cow/=lib/composable-cow/", + "cowprotocol/=lib/composable-cow/lib/cowprotocol/", + "ds-test/=lib/forge-std/lib/ds-test/src/", + "erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/", + "forge-std/=lib/forge-std/src/", + "helpers/=lib/composable-cow/lib/balancer/src/lib/helpers/", + "math/=lib/composable-cow/lib/balancer/src/lib/math/", + "murky/=lib/composable-cow/lib/murky/src/", + "openzeppelin-contracts/=lib/composable-cow/lib/murky/lib/openzeppelin-contracts/", + "openzeppelin/=lib/openzeppelin/", + "safe/=lib/composable-cow/lib/safe/", + "uniswap-v2-core/=lib/uniswap-v2-core/contracts/", + "lib/composable-cow:@openzeppelin/=lib/openzeppelin/contracts/", + "lib/composable-cow:@openzeppelin/contracts/=lib/openzeppelin/contracts/", + "lib/composable-cow:cowprotocol/=lib/composable-cow/lib/cowprotocol/src/contracts/", + "lib/composable-cow:safe/=lib/composable-cow/lib/safe/contracts/" + ], + "optimizer": { + "enabled": true, + "runs": 100000 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/oracles/UniswapV2PriceOracle.sol": "UniswapV2PriceOracle" + }, + "evmVersion": "cancun", + "libraries": {} + }, + "sources": { + "lib/uniswap-v2-core/contracts/interfaces/IUniswapV2Pair.sol": { + "keccak256": "0x7c9bc70e5996c763e02ff38905282bc24fb242b0ef2519a003b36824fc524a4b", + "urls": [ + "bzz-raw://85d5ad2dd23ee127f40907a12865a1e8cb5828814f6f2480285e1827dd72dedf", + "dweb:/ipfs/QmayKQWJgWmr46DqWseADyUanmqxh662hPNdAkdHRjiQQH" + ], + "license": null + }, + "src/interfaces/IPriceOracle.sol": { + "keccak256": "0xf954ab9dc44a0ce3612b65d803b59c3fe1f64803870328580c36802460c8c29e", + "urls": [ + "bzz-raw://7cef4a090daa870e3c8cfa5d6498efae96427d4fe4e1a2784d26c088eea920e2", + "dweb:/ipfs/QmU56CEHqif11NaomtVBNqrBTsV6CPPvjfN88SCe7V1Uxu" + ], + "license": "GPL-3.0" + }, + "src/oracles/UniswapV2PriceOracle.sol": { + "keccak256": "0xd609e84287558861dd13aaea60b49f06261f6e098b10fe1b1dbb29441b655bf2", + "urls": [ + "bzz-raw://6cc7fc5cea18e21d3807a9691318e398f83192aefc33b96f8085444788d8471a", + "dweb:/ipfs/QmfQA5CZoqqkeghrztAs8C6rVSSCiCdaDhHQPJqG83UjRs" + ], + "license": "GPL-3.0" + } + }, + "version": 1 + }, + "id": 178 +} diff --git a/crates/contracts/artifacts/CowProtocolToken.json b/crates/contracts/artifacts/CowProtocolToken.json index a0668311da..11d6f90755 100644 --- a/crates/contracts/artifacts/CowProtocolToken.json +++ b/crates/contracts/artifacts/CowProtocolToken.json @@ -1 +1,528 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"initialTokenHolder","type":"address"},{"internalType":"address","name":"cowDao","type":"address"},{"internalType":"uint256","name":"totalSupply","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInflated","type":"error"},{"inputs":[],"name":"ExceedingMintCap","type":"error"},{"inputs":[],"name":"OnlyCowDao","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_YEARLY_INFLATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIME_BETWEEN_MINTINGS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cowDao","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"getStorageAt","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateDelegatecall","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateDelegatecallInternal","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timestampLastMinting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x6101806040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c96101405260006006553480156200003c57600080fd5b5060405162002122380380620021228339810160408190526200005f916200035f565b8282826040518060400160405280601281526020017121b7ab90283937ba37b1b7b6102a37b5b2b760711b81525060405180604001604052806003815260200162434f5760e81b8152508180604051806040016040528060018152602001603160f81b81525084848160039080519060200190620000df9291906200029c565b508051620000f59060049060208401906200029c565b5050825160209384012082519284019290922060e08390526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810194909452608080850193909352308483018190528151808603909301835260c09485019091528151919096012090529290925261012052506200019590508584620001b4565b5050506001600160a01b03166101605250504260065550620004049050565b6001600160a01b0382166200020f5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620002239190620003a0565b90915550506001600160a01b0382166000908152602081905260408120805483929062000252908490620003a0565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620002aa90620003c7565b90600052602060002090601f016020900481019282620002ce576000855562000319565b82601f10620002e957805160ff191683800117855562000319565b8280016001018555821562000319579182015b8281111562000319578251825591602001919060010190620002fc565b50620003279291506200032b565b5090565b5b808211156200032757600081556001016200032c565b80516001600160a01b03811681146200035a57600080fd5b919050565b6000806000606084860312156200037557600080fd5b620003808462000342565b9250620003906020850162000342565b9150604084015190509250925092565b60008219821115620003c257634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680620003dc57607f821691505b60208210811415620003fe57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161016051611cb1620004716000396000818161033a01526105a10152600061096401526000611135015260006111840152600061115f015260006110b8015260006110e20152600061110c0152611cb16000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c806370a08231116100d8578063cd42dcbe1161008c578063e2d5148911610066578063e2d5148914610335578063f84436bd14610381578063fde9e07a1461039457600080fd5b8063cd42dcbe146102d1578063d505accf146102dc578063dd62ed3e146102ef57600080fd5b806395d89b41116100bd57806395d89b41146102a3578063a457c2d7146102ab578063a9059cbb146102be57600080fd5b806370a082311461025a5780637ecebe001461029057600080fd5b80633644e5151161013a57806343218e191161011457806343218e191461022c5780635624b25b1461023f5780635862bf3d1461025257600080fd5b80633644e515146101fc578063395093511461020457806340c10f191461021757600080fd5b806318160ddd1161016b57806318160ddd146101c857806323b872dd146101da578063313ce567146101ed57600080fd5b806306fdde0314610187578063095ea7b3146101a5575b600080fd5b61018f61039d565b60405161019c91906117aa565b60405180910390f35b6101b86101b33660046117ed565b61042f565b604051901515815260200161019c565b6002545b60405190815260200161019c565b6101b86101e8366004611817565b610446565b6040516012815260200161019c565b6101cc610531565b6101b86102123660046117ed565b610540565b61022a6102253660046117ed565b610589565b005b61018f61023a366004611882565b6106af565b61018f61024d366004611962565b610751565b6101cc600381565b6101cc610268366004611984565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101cc61029e366004611984565b6107d7565b61018f610802565b6101b86102b93660046117ed565b610811565b6101b86102cc3660046117ed565b6108e9565b6101cc6301e1338081565b61022a6102ea36600461199f565b6108f6565b6101cc6102fd366004611a12565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b61035c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019c565b61018f61038f366004611882565b610ab5565b6101cc60065481565b6060600380546103ac90611a45565b80601f01602080910402602001604051908101604052809291908181526020018280546103d890611a45565b80156104255780601f106103fa57610100808354040283529160200191610425565b820191906000526020600020905b81548152906001019060200180831161040857829003601f168201915b5050505050905090565b600061043c338484610c36565b5060015b92915050565b6000610453848484610de9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482811015610519576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105268533858403610c36565b506001949350505050565b600061053b61109e565b905090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161043c918590610584908690611ac2565b610c36565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105f8576040517ffe72c36e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6064600361060560025490565b61060f9190611ada565b6106199190611b17565b811115610652576040517f2c6af20800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b426301e133806006546106659190611ac2565b111561069d576040517f7b06471500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b426006556106ab82826111d2565b5050565b606060008373ffffffffffffffffffffffffffffffffffffffff16836040516106d89190611b52565b600060405180830381855af49150503d8060008114610713576040519150601f19603f3d011682016040523d82523d6000602084013e610718565b606091505b5060405190935090915061074a906107369084908490602001611b6e565b6040516020818303038152906040526112f2565b5092915050565b60606000610760836020611ada565b67ffffffffffffffff81111561077857610778611853565b6040519080825280601f01601f1916602001820160405280156107a2576020820181803683370190505b50905060005b838110156107cf5784810154602080830284010152806107c781611b96565b9150506107a8565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040812054610440565b6060600480546103ac90611a45565b33600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152812054828110156108d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610510565b6108df3385858403610c36565b5060019392505050565b600061043c338484610de9565b83421115610960576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610510565b60007f000000000000000000000000000000000000000000000000000000000000000088888861098f8c6112fa565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006109f78261132f565b90506000610a0782878787611398565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610510565b610aa98a8a8a610c36565b50505050505050505050565b606060006343218e1960e01b8484604051602401610ad4929190611bcf565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290519091503090610b63908390611b52565b6000604051808303816000865af19150503d8060008114610ba0576040519150601f19603f3d011682016040523d82523d6000602084013e610ba5565b606091505b5090508092505060008260018451610bbd9190611c06565b81518110610bcd57610bcd611c1d565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600160f81b149050610c188360018551610c149190611c06565b9052565b8015610c25575050610440565b610c2e836112f2565b505092915050565b73ffffffffffffffffffffffffffffffffffffffff8316610cd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff8216610d7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610e8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff8216610f2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290611029908490611ac2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161108f91815260200190565b60405180910390a35b50505050565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561110457507f000000000000000000000000000000000000000000000000000000000000000046145b1561112e57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b73ffffffffffffffffffffffffffffffffffffffff821661124f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610510565b80600260008282546112619190611ac2565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260408120805483929061129b908490611ac2565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b805160208201fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090208054600181018255905b50919050565b600061044061133c61109e565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006113a9878787876113c0565b915091506113b6816114d8565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113f757506000905060036114cf565b8460ff16601b1415801561140f57508460ff16601c14155b1561142057506000905060046114cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611474573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166114c8576000600192509250506114cf565b9150600090505b94509492505050565b60008160048111156114ec576114ec611c4c565b14156114f55750565b600181600481111561150957611509611c4c565b1415611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610510565b600281600481111561158557611585611c4c565b14156115ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610510565b600381600481111561160157611601611c4c565b141561168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610510565b60048160048111156116a3576116a3611c4c565b1415611731576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610510565b50565b60005b8381101561174f578181015183820152602001611737565b838111156110985750506000910152565b60008151808452611778816020860160208601611734565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006117bd6020830184611760565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146117e857600080fd5b919050565b6000806040838503121561180057600080fd5b611809836117c4565b946020939093013593505050565b60008060006060848603121561182c57600080fd5b611835846117c4565b9250611843602085016117c4565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806040838503121561189557600080fd5b61189e836117c4565b9150602083013567ffffffffffffffff808211156118bb57600080fd5b818501915085601f8301126118cf57600080fd5b8135818111156118e1576118e1611853565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561192757611927611853565b8160405282815288602084870101111561194057600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561197557600080fd5b50508035926020909101359150565b60006020828403121561199657600080fd5b6117bd826117c4565b600080600080600080600060e0888a0312156119ba57600080fd5b6119c3886117c4565b96506119d1602089016117c4565b95506040880135945060608801359350608088013560ff811681146119f557600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611a2557600080fd5b611a2e836117c4565b9150611a3c602084016117c4565b90509250929050565b600181811c90821680611a5957607f821691505b60208210811415611329577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611ad557611ad5611a93565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b1257611b12611a93565b500290565b600082611b4d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251611b64818460208701611734565b9190910192915050565b60008351611b80818460208801611734565b92151560f81b9190920190815260010192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611bc857611bc8611a93565b5060010190565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611bfe6040830184611760565b949350505050565b600082821015611c1857611c18611a93565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220530954a1b40a0e3c6d45330c16c5bf384a847ba06bf8ebbb9afdfb09ada68c0b64736f6c634300080a0033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialTokenHolder", + "type": "address" + }, + { + "internalType": "address", + "name": "cowDao", + "type": "address" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInflated", + "type": "error" + }, + { + "inputs": [], + "name": "ExceedingMintCap", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyCowDao", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_YEARLY_INFLATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TIME_BETWEEN_MINTINGS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cowDao", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "getStorageAt", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateDelegatecall", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateDelegatecallInternal", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "timestampLastMinting", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101806040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c96101405260006006553480156200003c57600080fd5b5060405162002122380380620021228339810160408190526200005f916200035f565b8282826040518060400160405280601281526020017121b7ab90283937ba37b1b7b6102a37b5b2b760711b81525060405180604001604052806003815260200162434f5760e81b8152508180604051806040016040528060018152602001603160f81b81525084848160039080519060200190620000df9291906200029c565b508051620000f59060049060208401906200029c565b5050825160209384012082519284019290922060e08390526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810194909452608080850193909352308483018190528151808603909301835260c09485019091528151919096012090529290925261012052506200019590508584620001b4565b5050506001600160a01b03166101605250504260065550620004049050565b6001600160a01b0382166200020f5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620002239190620003a0565b90915550506001600160a01b0382166000908152602081905260408120805483929062000252908490620003a0565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620002aa90620003c7565b90600052602060002090601f016020900481019282620002ce576000855562000319565b82601f10620002e957805160ff191683800117855562000319565b8280016001018555821562000319579182015b8281111562000319578251825591602001919060010190620002fc565b50620003279291506200032b565b5090565b5b808211156200032757600081556001016200032c565b80516001600160a01b03811681146200035a57600080fd5b919050565b6000806000606084860312156200037557600080fd5b620003808462000342565b9250620003906020850162000342565b9150604084015190509250925092565b60008219821115620003c257634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680620003dc57607f821691505b60208210811415620003fe57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161016051611cb1620004716000396000818161033a01526105a10152600061096401526000611135015260006111840152600061115f015260006110b8015260006110e20152600061110c0152611cb16000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c806370a08231116100d8578063cd42dcbe1161008c578063e2d5148911610066578063e2d5148914610335578063f84436bd14610381578063fde9e07a1461039457600080fd5b8063cd42dcbe146102d1578063d505accf146102dc578063dd62ed3e146102ef57600080fd5b806395d89b41116100bd57806395d89b41146102a3578063a457c2d7146102ab578063a9059cbb146102be57600080fd5b806370a082311461025a5780637ecebe001461029057600080fd5b80633644e5151161013a57806343218e191161011457806343218e191461022c5780635624b25b1461023f5780635862bf3d1461025257600080fd5b80633644e515146101fc578063395093511461020457806340c10f191461021757600080fd5b806318160ddd1161016b57806318160ddd146101c857806323b872dd146101da578063313ce567146101ed57600080fd5b806306fdde0314610187578063095ea7b3146101a5575b600080fd5b61018f61039d565b60405161019c91906117aa565b60405180910390f35b6101b86101b33660046117ed565b61042f565b604051901515815260200161019c565b6002545b60405190815260200161019c565b6101b86101e8366004611817565b610446565b6040516012815260200161019c565b6101cc610531565b6101b86102123660046117ed565b610540565b61022a6102253660046117ed565b610589565b005b61018f61023a366004611882565b6106af565b61018f61024d366004611962565b610751565b6101cc600381565b6101cc610268366004611984565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101cc61029e366004611984565b6107d7565b61018f610802565b6101b86102b93660046117ed565b610811565b6101b86102cc3660046117ed565b6108e9565b6101cc6301e1338081565b61022a6102ea36600461199f565b6108f6565b6101cc6102fd366004611a12565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b61035c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019c565b61018f61038f366004611882565b610ab5565b6101cc60065481565b6060600380546103ac90611a45565b80601f01602080910402602001604051908101604052809291908181526020018280546103d890611a45565b80156104255780601f106103fa57610100808354040283529160200191610425565b820191906000526020600020905b81548152906001019060200180831161040857829003601f168201915b5050505050905090565b600061043c338484610c36565b5060015b92915050565b6000610453848484610de9565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482811015610519576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105268533858403610c36565b506001949350505050565b600061053b61109e565b905090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909161043c918590610584908690611ac2565b610c36565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105f8576040517ffe72c36e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6064600361060560025490565b61060f9190611ada565b6106199190611b17565b811115610652576040517f2c6af20800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b426301e133806006546106659190611ac2565b111561069d576040517f7b06471500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b426006556106ab82826111d2565b5050565b606060008373ffffffffffffffffffffffffffffffffffffffff16836040516106d89190611b52565b600060405180830381855af49150503d8060008114610713576040519150601f19603f3d011682016040523d82523d6000602084013e610718565b606091505b5060405190935090915061074a906107369084908490602001611b6e565b6040516020818303038152906040526112f2565b5092915050565b60606000610760836020611ada565b67ffffffffffffffff81111561077857610778611853565b6040519080825280601f01601f1916602001820160405280156107a2576020820181803683370190505b50905060005b838110156107cf5784810154602080830284010152806107c781611b96565b9150506107a8565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260056020526040812054610440565b6060600480546103ac90611a45565b33600090815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152812054828110156108d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610510565b6108df3385858403610c36565b5060019392505050565b600061043c338484610de9565b83421115610960576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610510565b60007f000000000000000000000000000000000000000000000000000000000000000088888861098f8c6112fa565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006109f78261132f565b90506000610a0782878787611398565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610510565b610aa98a8a8a610c36565b50505050505050505050565b606060006343218e1960e01b8484604051602401610ad4929190611bcf565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290519091503090610b63908390611b52565b6000604051808303816000865af19150503d8060008114610ba0576040519150601f19603f3d011682016040523d82523d6000602084013e610ba5565b606091505b5090508092505060008260018451610bbd9190611c06565b81518110610bcd57610bcd611c1d565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600160f81b149050610c188360018551610c149190611c06565b9052565b8015610c25575050610440565b610c2e836112f2565b505092915050565b73ffffffffffffffffffffffffffffffffffffffff8316610cd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff8216610d7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610e8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff8216610f2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610510565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290611029908490611ac2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161108f91815260200190565b60405180910390a35b50505050565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561110457507f000000000000000000000000000000000000000000000000000000000000000046145b1561112e57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b73ffffffffffffffffffffffffffffffffffffffff821661124f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610510565b80600260008282546112619190611ac2565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260408120805483929061129b908490611ac2565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b805160208201fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604090208054600181018255905b50919050565b600061044061133c61109e565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006113a9878787876113c0565b915091506113b6816114d8565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113f757506000905060036114cf565b8460ff16601b1415801561140f57508460ff16601c14155b1561142057506000905060046114cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611474573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166114c8576000600192509250506114cf565b9150600090505b94509492505050565b60008160048111156114ec576114ec611c4c565b14156114f55750565b600181600481111561150957611509611c4c565b1415611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610510565b600281600481111561158557611585611c4c565b14156115ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610510565b600381600481111561160157611601611c4c565b141561168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610510565b60048160048111156116a3576116a3611c4c565b1415611731576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610510565b50565b60005b8381101561174f578181015183820152602001611737565b838111156110985750506000910152565b60008151808452611778816020860160208601611734565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006117bd6020830184611760565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146117e857600080fd5b919050565b6000806040838503121561180057600080fd5b611809836117c4565b946020939093013593505050565b60008060006060848603121561182c57600080fd5b611835846117c4565b9250611843602085016117c4565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806040838503121561189557600080fd5b61189e836117c4565b9150602083013567ffffffffffffffff808211156118bb57600080fd5b818501915085601f8301126118cf57600080fd5b8135818111156118e1576118e1611853565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561192757611927611853565b8160405282815288602084870101111561194057600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561197557600080fd5b50508035926020909101359150565b60006020828403121561199657600080fd5b6117bd826117c4565b600080600080600080600060e0888a0312156119ba57600080fd5b6119c3886117c4565b96506119d1602089016117c4565b95506040880135945060608801359350608088013560ff811681146119f557600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611a2557600080fd5b611a2e836117c4565b9150611a3c602084016117c4565b90509250929050565b600181811c90821680611a5957607f821691505b60208210811415611329577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611ad557611ad5611a93565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b1257611b12611a93565b500290565b600082611b4d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251611b64818460208701611734565b9190910192915050565b60008351611b80818460208801611734565b92151560f81b9190920190815260010192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611bc857611bc8611a93565b5060010190565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611bfe6040830184611760565b949350505050565b600082821015611c1857611c18611a93565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220530954a1b40a0e3c6d45330c16c5bf384a847ba06bf8ebbb9afdfb09ada68c0b64736f6c634300080a0033" +} diff --git a/crates/contracts/artifacts/ERC20.json b/crates/contracts/artifacts/ERC20.json index a8d67e629c..fcfdab8026 100644 --- a/crates/contracts/artifacts/ERC20.json +++ b/crates/contracts/artifacts/ERC20.json @@ -1 +1,290 @@ -{"abi":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/ERC20Mintable.json b/crates/contracts/artifacts/ERC20Mintable.json index 4238f568b6..2c0b0740c7 100644 --- a/crates/contracts/artifacts/ERC20Mintable.json +++ b/crates/contracts/artifacts/ERC20Mintable.json @@ -1 +1,349 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"MinterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"MinterRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addMinter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceMinter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405262000024620000186200002a60201b60201c565b6200003260201b60201c565b62000257565b600033905090565b6200004d8160036200009360201b620012a81790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b620000a582826200017760201b60201c565b1562000119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000200576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180620018506022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6115e980620002676000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146102e7578063986502751461032b578063a457c2d714610335578063a9059cbb1461039b578063aa271e1a14610401578063dd62ed3e1461045d576100b4565b8063095ea7b3146100b957806318160ddd1461011f57806323b872dd1461013d57806339509351146101c357806340c10f191461022957806370a082311461028f575b600080fd5b610105600480360360408110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d5565b604051808215151515815260200191505060405180910390f35b6101276104f3565b6040518082815260200191505060405180910390f35b6101a96004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104fd565b604051808215151515815260200191505060405180910390f35b61020f600480360360408110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105d6565b604051808215151515815260200191505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610689565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610704565b6040518082815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074c565b005b6103336107bd565b005b6103816004803603604081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b604051808215151515815260200191505060405180910390f35b6103e7600480360360408110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089c565b604051808215151515815260200191505060405180910390f35b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b6104bf6004803603604081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b6040518082815260200191505060405180910390f35b60006104e96104e261095e565b8484610966565b6001905092915050565b6000600254905090565b600061050a848484610b5d565b6105cb8461051661095e565b6105c6856040518060600160405280602881526020016114fd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061057c61095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b600190509392505050565b600061067f6105e361095e565b8461067a85600160006105f461095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b610966565b6001905092915050565b600061069b61069661095e565b6108ba565b6106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6106fa8383610f5b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61075c61075761095e565b6108ba565b6107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6107ba81611116565b50565b6107cd6107c861095e565b611170565b565b60006108926107dc61095e565b8461088d85604051806060016040528060258152602001611590602591396001600061080661095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b6001905092915050565b60006108b06108a961095e565b8484610b5d565b6001905092915050565b60006108d08260036111ca90919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061156c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114646022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114416023913960400191505060405180910390fd5b610cd481604051806060016040528060268152602001611486602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ec0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e85578082015181840152602081019050610e6a565b50505050905090810190601f168015610eb25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61101381600254610ed390919063ffffffff16565b60028190555061106a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61112a8160036112a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61118481600361138390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115256022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112b282826111ca565b15611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61138d82826111ca565b6113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806114dc6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582056e4b738cf76f0838e717d12794ecbbd6278399c81f9192ab9d5f01d5c4c3baf64736f6c63430005100032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373"} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceMinter", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405262000024620000186200002a60201b60201c565b6200003260201b60201c565b62000257565b600033905090565b6200004d8160036200009360201b620012a81790919060201c565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b620000a582826200017760201b60201c565b1562000119576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000200576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180620018506022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6115e980620002676000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063983b2d5611610071578063983b2d56146102e7578063986502751461032b578063a457c2d714610335578063a9059cbb1461039b578063aa271e1a14610401578063dd62ed3e1461045d576100b4565b8063095ea7b3146100b957806318160ddd1461011f57806323b872dd1461013d57806339509351146101c357806340c10f191461022957806370a082311461028f575b600080fd5b610105600480360360408110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104d5565b604051808215151515815260200191505060405180910390f35b6101276104f3565b6040518082815260200191505060405180910390f35b6101a96004803603606081101561015357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104fd565b604051808215151515815260200191505060405180910390f35b61020f600480360360408110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105d6565b604051808215151515815260200191505060405180910390f35b6102756004803603604081101561023f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610689565b604051808215151515815260200191505060405180910390f35b6102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610704565b6040518082815260200191505060405180910390f35b610329600480360360208110156102fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061074c565b005b6103336107bd565b005b6103816004803603604081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b604051808215151515815260200191505060405180910390f35b6103e7600480360360408110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089c565b604051808215151515815260200191505060405180910390f35b6104436004803603602081101561041757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b6104bf6004803603604081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d7565b6040518082815260200191505060405180910390f35b60006104e96104e261095e565b8484610966565b6001905092915050565b6000600254905090565b600061050a848484610b5d565b6105cb8461051661095e565b6105c6856040518060600160405280602881526020016114fd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061057c61095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b600190509392505050565b600061067f6105e361095e565b8461067a85600160006105f461095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b610966565b6001905092915050565b600061069b61069661095e565b6108ba565b6106f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6106fa8383610f5b565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61075c61075761095e565b6108ba565b6107b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806114ac6030913960400191505060405180910390fd5b6107ba81611116565b50565b6107cd6107c861095e565b611170565b565b60006108926107dc61095e565b8461088d85604051806060016040528060258152602001611590602591396001600061080661095e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b610966565b6001905092915050565b60006108b06108a961095e565b8484610b5d565b6001905092915050565b60006108d08260036111ca90919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061156c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806114646022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610be3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806115476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806114416023913960400191505060405180910390fd5b610cd481604051806060016040528060268152602001611486602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e139092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610ec0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e85578082015181840152602081019050610e6a565b50505050905090810190601f168015610eb25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015610f51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ffe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61101381600254610ed390919063ffffffff16565b60028190555061106a816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61112a8160036112a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61118481600361138390919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806115256022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112b282826111ca565b15611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61138d82826111ca565b6113e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806114dc6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582056e4b738cf76f0838e717d12794ecbbd6278399c81f9192ab9d5f01d5c4c3baf64736f6c63430005100032526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373" +} diff --git a/crates/contracts/artifacts/FlashLoanRouter.json b/crates/contracts/artifacts/FlashLoanRouter.json index 54780fe2d0..a4349a5917 100644 --- a/crates/contracts/artifacts/FlashLoanRouter.json +++ b/crates/contracts/artifacts/FlashLoanRouter.json @@ -1,2 +1,295 @@ - -{"abi":[{"type":"constructor","inputs":[{"name":"_settlementContract","type":"address","internalType":"contract ICowSettlement"}],"stateMutability":"nonpayable"},{"type":"function","name":"borrowerCallback","inputs":[{"name":"encodedLoansWithSettlement","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"flashLoanAndSettle","inputs":[{"name":"loans","type":"tuple[]","internalType":"struct LoanRequest.Data[]","components":[{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"borrower","type":"address","internalType":"contract IFlashLoanSolverWrapper"},{"name":"lender","type":"address","internalType":"address"},{"name":"token","type":"address","internalType":"contract IERC20"}]},{"name":"settlement","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"settlementAuthentication","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract ICowAuthentication"}],"stateMutability":"view"},{"type":"function","name":"settlementContract","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract ICowSettlement"}],"stateMutability":"view"}],"bytecode":"0x60c06040525f80546001600160a01b031916905534801561001e575f5ffd5b50604051610dc0380380610dc083398101604081905261003d916100d3565b6001600160a01b038116608081905260408051632335c76b60e01b81529051632335c76b9160048082019260209290919082900301815f875af1158015610086573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100aa91906100d3565b6001600160a01b031660a052506100f5565b6001600160a01b03811681146100d0575f5ffd5b50565b5f602082840312156100e3575f5ffd5b81516100ee816100bc565b9392505050565b60805160a051610c9e6101225f395f81816053015261026001525f818160cb01526106410152610c9e5ff3fe608060405234801561000f575f5ffd5b506004361061004a575f3560e01c806302ebcbea1461004e5780630efb1fb61461009e578063e7c438c9146100b3578063ea42418b146100c6575b5f5ffd5b6100757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b16100ac3660046108b0565b6100ed565b005b6100b16100c13660046109e5565b610232565b6100757f000000000000000000000000000000000000000000000000000000000000000081565b3373ffffffffffffffffffffffffffffffffffffffff5f5c1614610172576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c6520627920626f72726f7765720000000000000060448201526064015b60405180910390fd5b5f805473ffffffffffffffffffffffffffffffffffffffff16907fffffffffffffffffffffffff0000000000000000000000000000000000000000815c168217905d508051602082012060015c14610226576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616420646174612066726f6d20626f72726f776572000000000000000000006044820152606401610169565b61022f81610363565b50565b6040517f02cc250d0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906302cc250d90602401602060405180830381865afa1580156102ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102de9190610a80565b610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c65206279206120736f6c766572000000000000006044820152606401610169565b5f6103518585858561048d565b905061035c81610363565b5050505050565b60208101515f0361037f5761022f61037a82610549565b61058b565b5f61038982610731565b60208181015184519185019190912091925090815f805c7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905d50808060015d50604080518082018252606085015173ffffffffffffffffffffffffffffffffffffffff9081168252855160208301528583015192517fe0bbec7700000000000000000000000000000000000000000000000000000000815291929085169163e0bbec779161045991859087908b90600401610aa6565b5f604051808303815f87803b158015610470575f5ffd5b505af1158015610482573d5f5f3e3d5ffd5b505050505050505050565b60606104c461049d605c86610b72565b6104a8846020610b8f565b6104b29190610b8f565b60408051828152918201602001905290565b60208082018681529192506104d99082610b8f565b9050828482376104e98382610b8f565b9050845b801561053f57806104fd81610ba2565b915082905061052c88888481811061051757610517610bd6565b9050608002018261081890919063ffffffff16565b610537605c84610b8f565b9250506104ed565b5050949350505050565b60605f605c610559846020015190565b6105639190610b72565b602084516105719190610c03565b61057b9190610c03565b6020939093019283525090919050565b7f13d79a0b000000000000000000000000000000000000000000000000000000006105b582610867565b7fffffffff00000000000000000000000000000000000000000000000000000000161461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f6e6c7920736574746c65282920697320616c6c6f77656400000000000000006044820152606401610169565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16826040516106849190610c16565b5f604051808303815f865af19150503d805f81146106bd576040519150601f19603f3d011682016040523d82523d5f602084013e6106c2565b606091505b505090508061072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536574746c656d656e74207265766572746564000000000000000000000000006044820152606401610169565b5050565b604080516080810182525f8082526020820181905291810182905260608101829052906001610761846020015190565b61076b9190610c03565b90505f605c845161077c9190610c03565b9050602084015f61078d8383610b8f565b905082865283825261080e81604080516080810182525f80825260208201819052918101829052606081019190915250805160148201516028830151603c909301516040805160808101825293845273ffffffffffffffffffffffffffffffffffffffff928316602085015293821693830193909352909116606082015290565b9695505050505050565b80355f61082b6040840160208501610c4d565b90505f61083e6060850160408601610c4d565b90505f6108516080860160608701610c4d565b603c870152506028850152601484015290915250565b5f80602083019050600483511061087d57805191505b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156108c0575f5ffd5b813567ffffffffffffffff8111156108d6575f5ffd5b8201601f810184136108e6575f5ffd5b803567ffffffffffffffff81111561090057610900610883565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff8211171561096c5761096c610883565b604052818152828201602001861015610983575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f5f83601f8401126109b0575f5ffd5b50813567ffffffffffffffff8111156109c7575f5ffd5b6020830191508360208285010111156109de575f5ffd5b9250929050565b5f5f5f5f604085870312156109f8575f5ffd5b843567ffffffffffffffff811115610a0e575f5ffd5b8501601f81018713610a1e575f5ffd5b803567ffffffffffffffff811115610a34575f5ffd5b8760208260071b8401011115610a48575f5ffd5b60209182019550935085013567ffffffffffffffff811115610a68575f5ffd5b610a74878288016109a0565b95989497509550505050565b5f60208284031215610a90575f5ffd5b81518015158114610a9f575f5ffd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff84511660208201526020840151604082015282606082015260a060808201525f82518060a0840152806020850160c085015e5f60c0828501015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417610b8957610b89610b45565b92915050565b80820180821115610b8957610b89610b45565b5f81610bb057610bb0610b45565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115610b8957610b89610b45565b5f82518060208501845e5f920191825250919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461022f575f5ffd5b5f60208284031215610c5d575f5ffd5b8135610a9f81610c2c56fea264697066735822122040d837bb712363085fa15f0b290e54590843321342f61b2f21d52432d2dc8e7b64736f6c634300081c0033","deployedBytecode":"0x608060405234801561000f575f5ffd5b506004361061004a575f3560e01c806302ebcbea1461004e5780630efb1fb61461009e578063e7c438c9146100b3578063ea42418b146100c6575b5f5ffd5b6100757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b16100ac3660046108b0565b6100ed565b005b6100b16100c13660046109e5565b610232565b6100757f000000000000000000000000000000000000000000000000000000000000000081565b3373ffffffffffffffffffffffffffffffffffffffff5f5c1614610172576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c6520627920626f72726f7765720000000000000060448201526064015b60405180910390fd5b5f805473ffffffffffffffffffffffffffffffffffffffff16907fffffffffffffffffffffffff0000000000000000000000000000000000000000815c168217905d508051602082012060015c14610226576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616420646174612066726f6d20626f72726f776572000000000000000000006044820152606401610169565b61022f81610363565b50565b6040517f02cc250d0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906302cc250d90602401602060405180830381865afa1580156102ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102de9190610a80565b610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c65206279206120736f6c766572000000000000006044820152606401610169565b5f6103518585858561048d565b905061035c81610363565b5050505050565b60208101515f0361037f5761022f61037a82610549565b61058b565b5f61038982610731565b60208181015184519185019190912091925090815f805c7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905d50808060015d50604080518082018252606085015173ffffffffffffffffffffffffffffffffffffffff9081168252855160208301528583015192517fe0bbec7700000000000000000000000000000000000000000000000000000000815291929085169163e0bbec779161045991859087908b90600401610aa6565b5f604051808303815f87803b158015610470575f5ffd5b505af1158015610482573d5f5f3e3d5ffd5b505050505050505050565b60606104c461049d605c86610b72565b6104a8846020610b8f565b6104b29190610b8f565b60408051828152918201602001905290565b60208082018681529192506104d99082610b8f565b9050828482376104e98382610b8f565b9050845b801561053f57806104fd81610ba2565b915082905061052c88888481811061051757610517610bd6565b9050608002018261081890919063ffffffff16565b610537605c84610b8f565b9250506104ed565b5050949350505050565b60605f605c610559846020015190565b6105639190610b72565b602084516105719190610c03565b61057b9190610c03565b6020939093019283525090919050565b7f13d79a0b000000000000000000000000000000000000000000000000000000006105b582610867565b7fffffffff00000000000000000000000000000000000000000000000000000000161461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f6e6c7920736574746c65282920697320616c6c6f77656400000000000000006044820152606401610169565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16826040516106849190610c16565b5f604051808303815f865af19150503d805f81146106bd576040519150601f19603f3d011682016040523d82523d5f602084013e6106c2565b606091505b505090508061072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536574746c656d656e74207265766572746564000000000000000000000000006044820152606401610169565b5050565b604080516080810182525f8082526020820181905291810182905260608101829052906001610761846020015190565b61076b9190610c03565b90505f605c845161077c9190610c03565b9050602084015f61078d8383610b8f565b905082865283825261080e81604080516080810182525f80825260208201819052918101829052606081019190915250805160148201516028830151603c909301516040805160808101825293845273ffffffffffffffffffffffffffffffffffffffff928316602085015293821693830193909352909116606082015290565b9695505050505050565b80355f61082b6040840160208501610c4d565b90505f61083e6060850160408601610c4d565b90505f6108516080860160608701610c4d565b603c870152506028850152601484015290915250565b5f80602083019050600483511061087d57805191505b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156108c0575f5ffd5b813567ffffffffffffffff8111156108d6575f5ffd5b8201601f810184136108e6575f5ffd5b803567ffffffffffffffff81111561090057610900610883565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff8211171561096c5761096c610883565b604052818152828201602001861015610983575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f5f83601f8401126109b0575f5ffd5b50813567ffffffffffffffff8111156109c7575f5ffd5b6020830191508360208285010111156109de575f5ffd5b9250929050565b5f5f5f5f604085870312156109f8575f5ffd5b843567ffffffffffffffff811115610a0e575f5ffd5b8501601f81018713610a1e575f5ffd5b803567ffffffffffffffff811115610a34575f5ffd5b8760208260071b8401011115610a48575f5ffd5b60209182019550935085013567ffffffffffffffff811115610a68575f5ffd5b610a74878288016109a0565b95989497509550505050565b5f60208284031215610a90575f5ffd5b81518015158114610a9f575f5ffd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff84511660208201526020840151604082015282606082015260a060808201525f82518060a0840152806020850160c085015e5f60c0828501015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417610b8957610b89610b45565b92915050565b80820180821115610b8957610b89610b45565b5f81610bb057610bb0610b45565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115610b8957610b89610b45565b5f82518060208501845e5f920191825250919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461022f575f5ffd5b5f60208284031215610c5d575f5ffd5b8135610a9f81610c2c56fea264697066735822122040d837bb712363085fa15f0b290e54590843321342f61b2f21d52432d2dc8e7b64736f6c634300081c0033","methodIdentifiers":{"borrowerCallback(bytes)":"0efb1fb6","flashLoanAndSettle((uint256,address,address,address)[],bytes)":"e7c438c9","settlementAuthentication()":"02ebcbea","settlementContract()":"ea42418b"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ICowSettlement\",\"name\":\"_settlementContract\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedLoansWithSettlement\",\"type\":\"bytes\"}],\"name\":\"borrowerCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IFlashLoanSolverWrapper\",\"name\":\"borrower\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"lender\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"internalType\":\"struct LoanRequest.Data[]\",\"name\":\"loans\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"settlement\",\"type\":\"bytes\"}],\"name\":\"flashLoanAndSettle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settlementAuthentication\",\"outputs\":[{\"internalType\":\"contract ICowAuthentication\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settlementContract\",\"outputs\":[{\"internalType\":\"contract ICowSettlement\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"settlementAuthentication()\":{\"notice\":\"The contract responsible to determine which address is an authorized solver for CoW Protocol.\"},\"settlementContract()\":{\"notice\":\"The settlement contract that will be called when a settlement is executed after a flash loan.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/FlashLoanRouter.sol\":\"FlashLoanRouter\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/FlashLoanRouter.sol\":{\"keccak256\":\"0xa870f7b1e734d9c224414507ea794284b75fd8ff1a6ebf7083aa59e01a367333\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b062f5f6d48341eefb59897e86423e2d6002dd108e383c8df94e21e6c804693d\",\"dweb:/ipfs/QmUMNqbS4w2oDaS3nHeEjas9bpNE8wR2kiM7JzCmeFoyHo\"]},\"src/interface/ICowSettlement.sol\":{\"keccak256\":\"0x936d8038ce833e625c7c306b5890ba85c4e5bf8adc8b7e41227a680c4039e244\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://138b144cac2d5cd0b3bbd4b0f73817b1e611d90854734f64b98b15e709aa7b5e\",\"dweb:/ipfs/Qmf6rcxHBToX7Ym7zHXP8BRaWwD7DLptuZqYq3YDcd7jvJ\"]},\"src/interface/IFlashLoanRouter.sol\":{\"keccak256\":\"0x72bc1e822dbbe15f75cb7e437605242fd5e8421c3f4074ad7fa0d6ba0b7991de\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://63b29b2dbfe7b66d6390cd88e768b8bcc1805585eb4926102cc75a92dc2c36d5\",\"dweb:/ipfs/QmTXmGkN5CDbLAu8ykWJegZsHt9YY1MoUFWJBWPWjbYcht\"]},\"src/interface/IFlashLoanSolverWrapper.sol\":{\"keccak256\":\"0xcd22c2a72f4b0cb7a52c75d66ad801d2541a7117367ad7a9621e44aea9d0d051\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://76adab1e0be8d955ebde37a752ff1e38767cf64a2fbdcb95f1dd3b8dccd0a2b6\",\"dweb:/ipfs/QmfWgmUg7kCyHq66qYVvhZk4rb16xW7emWJ4otLMqGRQzY\"]},\"src/library/LoansWithSettlement.sol\":{\"keccak256\":\"0x0a2093a67a219184cb02a40217ed9d662da8562ac8625ee5f61b235608990a69\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6f8b14b11ae34e4aa574728fc64acdee55cdef5a222e228362b8d7d941494a66\",\"dweb:/ipfs/QmXsq4jejQGr1YtYppEnjUYRxYEv762b6HWhQ2ohpFhuzM\"]},\"src/vendored/ICowAuthentication.sol\":{\"keccak256\":\"0xc0b8ec08ce1e4ed2af4188ab08281b1a894d74b2dc69e045398e789f5a72d140\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://41917d1ba4f6846ddd52d7fe16189a14a836d62b255e3ad07ebbd46f33cdbfa4\",\"dweb:/ipfs/QmXTzjA9qoNX3aHehLJqMyx7qpZKitPE1Un3buB5QtKqfq\"]},\"src/vendored/IERC20.sol\":{\"keccak256\":\"0x1b72641f69f5a2156fc2319a6b08daa0c4b5b224d0a776b85a5fcae428af72c2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://261d26fbf99877e2d4b5a7e6b2b2defee5ba5cab5bfdfab231fb5f2e2dfb1fdb\",\"dweb:/ipfs/QmSpQuVkTHXzH1CNWmgtnCLz9CNEMD5g5sciiXRkrbYUJt\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.28+commit.7893614a"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"contract ICowSettlement","name":"_settlementContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"encodedLoansWithSettlement","type":"bytes"}],"stateMutability":"nonpayable","type":"function","name":"borrowerCallback"},{"inputs":[{"internalType":"struct LoanRequest.Data[]","name":"loans","type":"tuple[]","components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract IFlashLoanSolverWrapper","name":"borrower","type":"address"},{"internalType":"address","name":"lender","type":"address"},{"internalType":"contract IERC20","name":"token","type":"address"}]},{"internalType":"bytes","name":"settlement","type":"bytes"}],"stateMutability":"nonpayable","type":"function","name":"flashLoanAndSettle"},{"inputs":[],"stateMutability":"view","type":"function","name":"settlementAuthentication","outputs":[{"internalType":"contract ICowAuthentication","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"settlementContract","outputs":[{"internalType":"contract ICowSettlement","name":"","type":"address"}]}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{"settlementAuthentication()":{"notice":"The contract responsible to determine which address is an authorized solver for CoW Protocol."},"settlementContract()":{"notice":"The settlement contract that will be called when a settlement is executed after a flash loan."}},"version":1}},"settings":{"remappings":["forge-std/=lib/forge-std/src/"],"optimizer":{"enabled":true,"runs":1000000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/FlashLoanRouter.sol":"FlashLoanRouter"},"evmVersion":"cancun","libraries":{}},"sources":{"src/FlashLoanRouter.sol":{"keccak256":"0xa870f7b1e734d9c224414507ea794284b75fd8ff1a6ebf7083aa59e01a367333","urls":["bzz-raw://b062f5f6d48341eefb59897e86423e2d6002dd108e383c8df94e21e6c804693d","dweb:/ipfs/QmUMNqbS4w2oDaS3nHeEjas9bpNE8wR2kiM7JzCmeFoyHo"],"license":"GPL-3.0-or-later"},"src/interface/ICowSettlement.sol":{"keccak256":"0x936d8038ce833e625c7c306b5890ba85c4e5bf8adc8b7e41227a680c4039e244","urls":["bzz-raw://138b144cac2d5cd0b3bbd4b0f73817b1e611d90854734f64b98b15e709aa7b5e","dweb:/ipfs/Qmf6rcxHBToX7Ym7zHXP8BRaWwD7DLptuZqYq3YDcd7jvJ"],"license":"GPL-3.0-or-later"},"src/interface/IFlashLoanRouter.sol":{"keccak256":"0x72bc1e822dbbe15f75cb7e437605242fd5e8421c3f4074ad7fa0d6ba0b7991de","urls":["bzz-raw://63b29b2dbfe7b66d6390cd88e768b8bcc1805585eb4926102cc75a92dc2c36d5","dweb:/ipfs/QmTXmGkN5CDbLAu8ykWJegZsHt9YY1MoUFWJBWPWjbYcht"],"license":"GPL-3.0-or-later"},"src/interface/IFlashLoanSolverWrapper.sol":{"keccak256":"0xcd22c2a72f4b0cb7a52c75d66ad801d2541a7117367ad7a9621e44aea9d0d051","urls":["bzz-raw://76adab1e0be8d955ebde37a752ff1e38767cf64a2fbdcb95f1dd3b8dccd0a2b6","dweb:/ipfs/QmfWgmUg7kCyHq66qYVvhZk4rb16xW7emWJ4otLMqGRQzY"],"license":"GPL-3.0-or-later"},"src/library/LoansWithSettlement.sol":{"keccak256":"0x0a2093a67a219184cb02a40217ed9d662da8562ac8625ee5f61b235608990a69","urls":["bzz-raw://6f8b14b11ae34e4aa574728fc64acdee55cdef5a222e228362b8d7d941494a66","dweb:/ipfs/QmXsq4jejQGr1YtYppEnjUYRxYEv762b6HWhQ2ohpFhuzM"],"license":"GPL-3.0-or-later"},"src/vendored/ICowAuthentication.sol":{"keccak256":"0xc0b8ec08ce1e4ed2af4188ab08281b1a894d74b2dc69e045398e789f5a72d140","urls":["bzz-raw://41917d1ba4f6846ddd52d7fe16189a14a836d62b255e3ad07ebbd46f33cdbfa4","dweb:/ipfs/QmXTzjA9qoNX3aHehLJqMyx7qpZKitPE1Un3buB5QtKqfq"],"license":"LGPL-3.0-or-later"},"src/vendored/IERC20.sol":{"keccak256":"0x1b72641f69f5a2156fc2319a6b08daa0c4b5b224d0a776b85a5fcae428af72c2","urls":["bzz-raw://261d26fbf99877e2d4b5a7e6b2b2defee5ba5cab5bfdfab231fb5f2e2dfb1fdb","dweb:/ipfs/QmSpQuVkTHXzH1CNWmgtnCLz9CNEMD5g5sciiXRkrbYUJt"],"license":"MIT"}},"version":1},"id":27} +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "_settlementContract", + "type": "address", + "internalType": "contract ICowSettlement" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "borrowerCallback", + "inputs": [ + { + "name": "encodedLoansWithSettlement", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "flashLoanAndSettle", + "inputs": [ + { + "name": "loans", + "type": "tuple[]", + "internalType": "struct LoanRequest.Data[]", + "components": [ + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "borrower", + "type": "address", + "internalType": "contract IFlashLoanSolverWrapper" + }, + { + "name": "lender", + "type": "address", + "internalType": "address" + }, + { + "name": "token", + "type": "address", + "internalType": "contract IERC20" + } + ] + }, + { + "name": "settlement", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "settlementAuthentication", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ICowAuthentication" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "settlementContract", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ICowSettlement" + } + ], + "stateMutability": "view" + } + ], + "bytecode": "0x60c06040525f80546001600160a01b031916905534801561001e575f5ffd5b50604051610dc0380380610dc083398101604081905261003d916100d3565b6001600160a01b038116608081905260408051632335c76b60e01b81529051632335c76b9160048082019260209290919082900301815f875af1158015610086573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100aa91906100d3565b6001600160a01b031660a052506100f5565b6001600160a01b03811681146100d0575f5ffd5b50565b5f602082840312156100e3575f5ffd5b81516100ee816100bc565b9392505050565b60805160a051610c9e6101225f395f81816053015261026001525f818160cb01526106410152610c9e5ff3fe608060405234801561000f575f5ffd5b506004361061004a575f3560e01c806302ebcbea1461004e5780630efb1fb61461009e578063e7c438c9146100b3578063ea42418b146100c6575b5f5ffd5b6100757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b16100ac3660046108b0565b6100ed565b005b6100b16100c13660046109e5565b610232565b6100757f000000000000000000000000000000000000000000000000000000000000000081565b3373ffffffffffffffffffffffffffffffffffffffff5f5c1614610172576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c6520627920626f72726f7765720000000000000060448201526064015b60405180910390fd5b5f805473ffffffffffffffffffffffffffffffffffffffff16907fffffffffffffffffffffffff0000000000000000000000000000000000000000815c168217905d508051602082012060015c14610226576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616420646174612066726f6d20626f72726f776572000000000000000000006044820152606401610169565b61022f81610363565b50565b6040517f02cc250d0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906302cc250d90602401602060405180830381865afa1580156102ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102de9190610a80565b610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c65206279206120736f6c766572000000000000006044820152606401610169565b5f6103518585858561048d565b905061035c81610363565b5050505050565b60208101515f0361037f5761022f61037a82610549565b61058b565b5f61038982610731565b60208181015184519185019190912091925090815f805c7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905d50808060015d50604080518082018252606085015173ffffffffffffffffffffffffffffffffffffffff9081168252855160208301528583015192517fe0bbec7700000000000000000000000000000000000000000000000000000000815291929085169163e0bbec779161045991859087908b90600401610aa6565b5f604051808303815f87803b158015610470575f5ffd5b505af1158015610482573d5f5f3e3d5ffd5b505050505050505050565b60606104c461049d605c86610b72565b6104a8846020610b8f565b6104b29190610b8f565b60408051828152918201602001905290565b60208082018681529192506104d99082610b8f565b9050828482376104e98382610b8f565b9050845b801561053f57806104fd81610ba2565b915082905061052c88888481811061051757610517610bd6565b9050608002018261081890919063ffffffff16565b610537605c84610b8f565b9250506104ed565b5050949350505050565b60605f605c610559846020015190565b6105639190610b72565b602084516105719190610c03565b61057b9190610c03565b6020939093019283525090919050565b7f13d79a0b000000000000000000000000000000000000000000000000000000006105b582610867565b7fffffffff00000000000000000000000000000000000000000000000000000000161461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f6e6c7920736574746c65282920697320616c6c6f77656400000000000000006044820152606401610169565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16826040516106849190610c16565b5f604051808303815f865af19150503d805f81146106bd576040519150601f19603f3d011682016040523d82523d5f602084013e6106c2565b606091505b505090508061072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536574746c656d656e74207265766572746564000000000000000000000000006044820152606401610169565b5050565b604080516080810182525f8082526020820181905291810182905260608101829052906001610761846020015190565b61076b9190610c03565b90505f605c845161077c9190610c03565b9050602084015f61078d8383610b8f565b905082865283825261080e81604080516080810182525f80825260208201819052918101829052606081019190915250805160148201516028830151603c909301516040805160808101825293845273ffffffffffffffffffffffffffffffffffffffff928316602085015293821693830193909352909116606082015290565b9695505050505050565b80355f61082b6040840160208501610c4d565b90505f61083e6060850160408601610c4d565b90505f6108516080860160608701610c4d565b603c870152506028850152601484015290915250565b5f80602083019050600483511061087d57805191505b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156108c0575f5ffd5b813567ffffffffffffffff8111156108d6575f5ffd5b8201601f810184136108e6575f5ffd5b803567ffffffffffffffff81111561090057610900610883565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff8211171561096c5761096c610883565b604052818152828201602001861015610983575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f5f83601f8401126109b0575f5ffd5b50813567ffffffffffffffff8111156109c7575f5ffd5b6020830191508360208285010111156109de575f5ffd5b9250929050565b5f5f5f5f604085870312156109f8575f5ffd5b843567ffffffffffffffff811115610a0e575f5ffd5b8501601f81018713610a1e575f5ffd5b803567ffffffffffffffff811115610a34575f5ffd5b8760208260071b8401011115610a48575f5ffd5b60209182019550935085013567ffffffffffffffff811115610a68575f5ffd5b610a74878288016109a0565b95989497509550505050565b5f60208284031215610a90575f5ffd5b81518015158114610a9f575f5ffd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff84511660208201526020840151604082015282606082015260a060808201525f82518060a0840152806020850160c085015e5f60c0828501015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417610b8957610b89610b45565b92915050565b80820180821115610b8957610b89610b45565b5f81610bb057610bb0610b45565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115610b8957610b89610b45565b5f82518060208501845e5f920191825250919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461022f575f5ffd5b5f60208284031215610c5d575f5ffd5b8135610a9f81610c2c56fea264697066735822122040d837bb712363085fa15f0b290e54590843321342f61b2f21d52432d2dc8e7b64736f6c634300081c0033", + "deployedBytecode": "0x608060405234801561000f575f5ffd5b506004361061004a575f3560e01c806302ebcbea1461004e5780630efb1fb61461009e578063e7c438c9146100b3578063ea42418b146100c6575b5f5ffd5b6100757f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b16100ac3660046108b0565b6100ed565b005b6100b16100c13660046109e5565b610232565b6100757f000000000000000000000000000000000000000000000000000000000000000081565b3373ffffffffffffffffffffffffffffffffffffffff5f5c1614610172576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c6520627920626f72726f7765720000000000000060448201526064015b60405180910390fd5b5f805473ffffffffffffffffffffffffffffffffffffffff16907fffffffffffffffffffffffff0000000000000000000000000000000000000000815c168217905d508051602082012060015c14610226576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f42616420646174612066726f6d20626f72726f776572000000000000000000006044820152606401610169565b61022f81610363565b50565b6040517f02cc250d0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906302cc250d90602401602060405180830381865afa1580156102ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102de9190610a80565b610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4f6e6c792063616c6c61626c65206279206120736f6c766572000000000000006044820152606401610169565b5f6103518585858561048d565b905061035c81610363565b5050505050565b60208101515f0361037f5761022f61037a82610549565b61058b565b5f61038982610731565b60208181015184519185019190912091925090815f805c7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905d50808060015d50604080518082018252606085015173ffffffffffffffffffffffffffffffffffffffff9081168252855160208301528583015192517fe0bbec7700000000000000000000000000000000000000000000000000000000815291929085169163e0bbec779161045991859087908b90600401610aa6565b5f604051808303815f87803b158015610470575f5ffd5b505af1158015610482573d5f5f3e3d5ffd5b505050505050505050565b60606104c461049d605c86610b72565b6104a8846020610b8f565b6104b29190610b8f565b60408051828152918201602001905290565b60208082018681529192506104d99082610b8f565b9050828482376104e98382610b8f565b9050845b801561053f57806104fd81610ba2565b915082905061052c88888481811061051757610517610bd6565b9050608002018261081890919063ffffffff16565b610537605c84610b8f565b9250506104ed565b5050949350505050565b60605f605c610559846020015190565b6105639190610b72565b602084516105719190610c03565b61057b9190610c03565b6020939093019283525090919050565b7f13d79a0b000000000000000000000000000000000000000000000000000000006105b582610867565b7fffffffff00000000000000000000000000000000000000000000000000000000161461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4f6e6c7920736574746c65282920697320616c6c6f77656400000000000000006044820152606401610169565b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16826040516106849190610c16565b5f604051808303815f865af19150503d805f81146106bd576040519150601f19603f3d011682016040523d82523d5f602084013e6106c2565b606091505b505090508061072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536574746c656d656e74207265766572746564000000000000000000000000006044820152606401610169565b5050565b604080516080810182525f8082526020820181905291810182905260608101829052906001610761846020015190565b61076b9190610c03565b90505f605c845161077c9190610c03565b9050602084015f61078d8383610b8f565b905082865283825261080e81604080516080810182525f80825260208201819052918101829052606081019190915250805160148201516028830151603c909301516040805160808101825293845273ffffffffffffffffffffffffffffffffffffffff928316602085015293821693830193909352909116606082015290565b9695505050505050565b80355f61082b6040840160208501610c4d565b90505f61083e6060850160408601610c4d565b90505f6108516080860160608701610c4d565b603c870152506028850152601484015290915250565b5f80602083019050600483511061087d57805191505b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156108c0575f5ffd5b813567ffffffffffffffff8111156108d6575f5ffd5b8201601f810184136108e6575f5ffd5b803567ffffffffffffffff81111561090057610900610883565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff8211171561096c5761096c610883565b604052818152828201602001861015610983575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f5f83601f8401126109b0575f5ffd5b50813567ffffffffffffffff8111156109c7575f5ffd5b6020830191508360208285010111156109de575f5ffd5b9250929050565b5f5f5f5f604085870312156109f8575f5ffd5b843567ffffffffffffffff811115610a0e575f5ffd5b8501601f81018713610a1e575f5ffd5b803567ffffffffffffffff811115610a34575f5ffd5b8760208260071b8401011115610a48575f5ffd5b60209182019550935085013567ffffffffffffffff811115610a68575f5ffd5b610a74878288016109a0565b95989497509550505050565b5f60208284031215610a90575f5ffd5b81518015158114610a9f575f5ffd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8516815273ffffffffffffffffffffffffffffffffffffffff84511660208201526020840151604082015282606082015260a060808201525f82518060a0840152806020850160c085015e5f60c0828501015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417610b8957610b89610b45565b92915050565b80820180821115610b8957610b89610b45565b5f81610bb057610bb0610b45565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115610b8957610b89610b45565b5f82518060208501845e5f920191825250919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461022f575f5ffd5b5f60208284031215610c5d575f5ffd5b8135610a9f81610c2c56fea264697066735822122040d837bb712363085fa15f0b290e54590843321342f61b2f21d52432d2dc8e7b64736f6c634300081c0033", + "methodIdentifiers": { + "borrowerCallback(bytes)": "0efb1fb6", + "flashLoanAndSettle((uint256,address,address,address)[],bytes)": "e7c438c9", + "settlementAuthentication()": "02ebcbea", + "settlementContract()": "ea42418b" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ICowSettlement\",\"name\":\"_settlementContract\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedLoansWithSettlement\",\"type\":\"bytes\"}],\"name\":\"borrowerCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IFlashLoanSolverWrapper\",\"name\":\"borrower\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"lender\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"internalType\":\"struct LoanRequest.Data[]\",\"name\":\"loans\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"settlement\",\"type\":\"bytes\"}],\"name\":\"flashLoanAndSettle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settlementAuthentication\",\"outputs\":[{\"internalType\":\"contract ICowAuthentication\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settlementContract\",\"outputs\":[{\"internalType\":\"contract ICowSettlement\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"settlementAuthentication()\":{\"notice\":\"The contract responsible to determine which address is an authorized solver for CoW Protocol.\"},\"settlementContract()\":{\"notice\":\"The settlement contract that will be called when a settlement is executed after a flash loan.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/FlashLoanRouter.sol\":\"FlashLoanRouter\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/FlashLoanRouter.sol\":{\"keccak256\":\"0xa870f7b1e734d9c224414507ea794284b75fd8ff1a6ebf7083aa59e01a367333\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://b062f5f6d48341eefb59897e86423e2d6002dd108e383c8df94e21e6c804693d\",\"dweb:/ipfs/QmUMNqbS4w2oDaS3nHeEjas9bpNE8wR2kiM7JzCmeFoyHo\"]},\"src/interface/ICowSettlement.sol\":{\"keccak256\":\"0x936d8038ce833e625c7c306b5890ba85c4e5bf8adc8b7e41227a680c4039e244\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://138b144cac2d5cd0b3bbd4b0f73817b1e611d90854734f64b98b15e709aa7b5e\",\"dweb:/ipfs/Qmf6rcxHBToX7Ym7zHXP8BRaWwD7DLptuZqYq3YDcd7jvJ\"]},\"src/interface/IFlashLoanRouter.sol\":{\"keccak256\":\"0x72bc1e822dbbe15f75cb7e437605242fd5e8421c3f4074ad7fa0d6ba0b7991de\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://63b29b2dbfe7b66d6390cd88e768b8bcc1805585eb4926102cc75a92dc2c36d5\",\"dweb:/ipfs/QmTXmGkN5CDbLAu8ykWJegZsHt9YY1MoUFWJBWPWjbYcht\"]},\"src/interface/IFlashLoanSolverWrapper.sol\":{\"keccak256\":\"0xcd22c2a72f4b0cb7a52c75d66ad801d2541a7117367ad7a9621e44aea9d0d051\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://76adab1e0be8d955ebde37a752ff1e38767cf64a2fbdcb95f1dd3b8dccd0a2b6\",\"dweb:/ipfs/QmfWgmUg7kCyHq66qYVvhZk4rb16xW7emWJ4otLMqGRQzY\"]},\"src/library/LoansWithSettlement.sol\":{\"keccak256\":\"0x0a2093a67a219184cb02a40217ed9d662da8562ac8625ee5f61b235608990a69\",\"license\":\"GPL-3.0-or-later\",\"urls\":[\"bzz-raw://6f8b14b11ae34e4aa574728fc64acdee55cdef5a222e228362b8d7d941494a66\",\"dweb:/ipfs/QmXsq4jejQGr1YtYppEnjUYRxYEv762b6HWhQ2ohpFhuzM\"]},\"src/vendored/ICowAuthentication.sol\":{\"keccak256\":\"0xc0b8ec08ce1e4ed2af4188ab08281b1a894d74b2dc69e045398e789f5a72d140\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://41917d1ba4f6846ddd52d7fe16189a14a836d62b255e3ad07ebbd46f33cdbfa4\",\"dweb:/ipfs/QmXTzjA9qoNX3aHehLJqMyx7qpZKitPE1Un3buB5QtKqfq\"]},\"src/vendored/IERC20.sol\":{\"keccak256\":\"0x1b72641f69f5a2156fc2319a6b08daa0c4b5b224d0a776b85a5fcae428af72c2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://261d26fbf99877e2d4b5a7e6b2b2defee5ba5cab5bfdfab231fb5f2e2dfb1fdb\",\"dweb:/ipfs/QmSpQuVkTHXzH1CNWmgtnCLz9CNEMD5g5sciiXRkrbYUJt\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.28+commit.7893614a" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "contract ICowSettlement", + "name": "_settlementContract", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedLoansWithSettlement", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "borrowerCallback" + }, + { + "inputs": [ + { + "internalType": "struct LoanRequest.Data[]", + "name": "loans", + "type": "tuple[]", + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "contract IFlashLoanSolverWrapper", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "lender", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ] + }, + { + "internalType": "bytes", + "name": "settlement", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "flashLoanAndSettle" + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "settlementAuthentication", + "outputs": [ + { + "internalType": "contract ICowAuthentication", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "settlementContract", + "outputs": [ + { + "internalType": "contract ICowSettlement", + "name": "", + "type": "address" + } + ] + } + ], + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "settlementAuthentication()": { + "notice": "The contract responsible to determine which address is an authorized solver for CoW Protocol." + }, + "settlementContract()": { + "notice": "The settlement contract that will be called when a settlement is executed after a flash loan." + } + }, + "version": 1 + } + }, + "settings": { + "remappings": [ + "forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": true, + "runs": 1000000 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/FlashLoanRouter.sol": "FlashLoanRouter" + }, + "evmVersion": "cancun", + "libraries": {} + }, + "sources": { + "src/FlashLoanRouter.sol": { + "keccak256": "0xa870f7b1e734d9c224414507ea794284b75fd8ff1a6ebf7083aa59e01a367333", + "urls": [ + "bzz-raw://b062f5f6d48341eefb59897e86423e2d6002dd108e383c8df94e21e6c804693d", + "dweb:/ipfs/QmUMNqbS4w2oDaS3nHeEjas9bpNE8wR2kiM7JzCmeFoyHo" + ], + "license": "GPL-3.0-or-later" + }, + "src/interface/ICowSettlement.sol": { + "keccak256": "0x936d8038ce833e625c7c306b5890ba85c4e5bf8adc8b7e41227a680c4039e244", + "urls": [ + "bzz-raw://138b144cac2d5cd0b3bbd4b0f73817b1e611d90854734f64b98b15e709aa7b5e", + "dweb:/ipfs/Qmf6rcxHBToX7Ym7zHXP8BRaWwD7DLptuZqYq3YDcd7jvJ" + ], + "license": "GPL-3.0-or-later" + }, + "src/interface/IFlashLoanRouter.sol": { + "keccak256": "0x72bc1e822dbbe15f75cb7e437605242fd5e8421c3f4074ad7fa0d6ba0b7991de", + "urls": [ + "bzz-raw://63b29b2dbfe7b66d6390cd88e768b8bcc1805585eb4926102cc75a92dc2c36d5", + "dweb:/ipfs/QmTXmGkN5CDbLAu8ykWJegZsHt9YY1MoUFWJBWPWjbYcht" + ], + "license": "GPL-3.0-or-later" + }, + "src/interface/IFlashLoanSolverWrapper.sol": { + "keccak256": "0xcd22c2a72f4b0cb7a52c75d66ad801d2541a7117367ad7a9621e44aea9d0d051", + "urls": [ + "bzz-raw://76adab1e0be8d955ebde37a752ff1e38767cf64a2fbdcb95f1dd3b8dccd0a2b6", + "dweb:/ipfs/QmfWgmUg7kCyHq66qYVvhZk4rb16xW7emWJ4otLMqGRQzY" + ], + "license": "GPL-3.0-or-later" + }, + "src/library/LoansWithSettlement.sol": { + "keccak256": "0x0a2093a67a219184cb02a40217ed9d662da8562ac8625ee5f61b235608990a69", + "urls": [ + "bzz-raw://6f8b14b11ae34e4aa574728fc64acdee55cdef5a222e228362b8d7d941494a66", + "dweb:/ipfs/QmXsq4jejQGr1YtYppEnjUYRxYEv762b6HWhQ2ohpFhuzM" + ], + "license": "GPL-3.0-or-later" + }, + "src/vendored/ICowAuthentication.sol": { + "keccak256": "0xc0b8ec08ce1e4ed2af4188ab08281b1a894d74b2dc69e045398e789f5a72d140", + "urls": [ + "bzz-raw://41917d1ba4f6846ddd52d7fe16189a14a836d62b255e3ad07ebbd46f33cdbfa4", + "dweb:/ipfs/QmXTzjA9qoNX3aHehLJqMyx7qpZKitPE1Un3buB5QtKqfq" + ], + "license": "LGPL-3.0-or-later" + }, + "src/vendored/IERC20.sol": { + "keccak256": "0x1b72641f69f5a2156fc2319a6b08daa0c4b5b224d0a776b85a5fcae428af72c2", + "urls": [ + "bzz-raw://261d26fbf99877e2d4b5a7e6b2b2defee5ba5cab5bfdfab231fb5f2e2dfb1fdb", + "dweb:/ipfs/QmSpQuVkTHXzH1CNWmgtnCLz9CNEMD5g5sciiXRkrbYUJt" + ], + "license": "MIT" + } + }, + "version": 1 + }, + "id": 27 +} diff --git a/crates/contracts/artifacts/GPv2AllowListAuthentication.json b/crates/contracts/artifacts/GPv2AllowListAuthentication.json index f8e4e9ed98..84221396bd 100644 --- a/crates/contracts/artifacts/GPv2AllowListAuthentication.json +++ b/crates/contracts/artifacts/GPv2AllowListAuthentication.json @@ -1 +1,295 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newManager","type":"address"},{"indexed":false,"internalType":"address","name":"oldManager","type":"address"}],"name":"ManagerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"solver","type":"address"}],"name":"SolverAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"solver","type":"address"}],"name":"SolverRemoved","type":"event"},{"inputs":[{"internalType":"address","name":"solver","type":"address"}],"name":"addSolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"getStorageAt","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"manager_","type":"address"}],"name":"initializeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"prospectiveSolver","type":"address"}],"name":"isSolver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"solver","type":"address"}],"name":"removeSolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"manager_","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateDelegatecall","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateDelegatecallInternal","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610e10806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80637f7120fe11610076578063d0ebdbe71161005b578063d0ebdbe7146102e3578063ec58f4b814610316578063f84436bd14610349576100a3565b80637f7120fe1461027b5780638fd57b92146102b0576100a3565b806302cc250d146100a857806343218e19146100ef578063481c6a75146102275780635624b25b14610258575b600080fd5b6100db600480360360208110156100be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661040c565b604080519115158252519081900360200190f35b6101b26004803603604081101561010557600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561013d57600080fd5b82018360208201111561014f57600080fd5b8035906020019184600183028401116401000000008311171561017157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610437945050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ec5781810151838201526020016101d4565b50505050905090810190601f1680156102195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61022f6105af565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101b26004803603604081101561026e57600080fd5b50803590602001356105d1565b6102ae6004803603602081101561029157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610647565b005b6102ae600480360360208110156102c657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166107f8565b6102ae600480360360208110156102f957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610907565b6102ae6004803603602081101561032c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a47565b6101b26004803603604081101561035f57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561039757600080fd5b8201836020820111156103a957600080fd5b803590602001918460018302840111640100000000831117156103cb57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610b5a945050505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205460ff1690565b606060008373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106104a057805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610463565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610500576040519150601f19603f3d011682016040523d82523d6000602084013e610505565b606091505b5080935081925050506105a882826040516020018083805190602001908083835b6020831061056357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610526565b6001836020036101000a03801982511681845116808217855250505050505090500182151560f81b815260010192505050604051602081830303815290604052610da3565b5092915050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008260200267ffffffffffffffff811180156105ef57600080fd5b506040519080825280601f01601f19166020018201604052801561061a576020820181803683370190505b50905060005b8381101561063d5784810154602080830284010152600101610620565b5090505b92915050565b600054610100900460ff16806106605750610660610dab565b8061066e575060005460ff16155b6106d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e697469616c697a61626c653a20696e697469616c697a6564000000000000604482015290519081900360640190fd5b600054610100900460ff1615801561073f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff851690810291909117825560408051918252602082019290925281517f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a4350929181900390910190a180156107f457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b5050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff16331461088457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f475076323a2063616c6c6572206e6f74206d616e616765720000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055815192835290517f640e18a2587e1d83e4fdabf70257d0a800ca4b2c1aaad1dfc485a4ad8bbbd6c69281900390910190a150565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633148061094f575033610937610db1565b73ffffffffffffffffffffffffffffffffffffffff16145b6109ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f475076323a206e6f7420617574686f72697a6564000000000000000000000000604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff838116620100008181027fffffffffffffffffffff0000000000000000000000000000000000000000ffff85161790945560408051918252939092041660208201819052825190927f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a4350928290030190a15050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff163314610ad357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f475076323a2063616c6c6572206e6f74206d616e616765720000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526001602081815260409283902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909217909155815192835290517f41f9d09dd5159251f8a8e482bbe097b7c01a5e6f70c5a0ddb494906464fc9dd79281900390910190a150565b606060006343218e1960e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bc4578181015183820152602001610bac565b50505050905090810190601f168015610bf15780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909816979097178752518151919750309688965090945084935091508083835b60208310610cc257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c85565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610d24576040519150601f19603f3d011682016040523d82523d6000602084013e610d29565b606091505b50905080925050600082600184510381518110610d4257fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600160f81b149050610d85836001855103610dd6565b8015610d92575050610641565b610d9b83610da3565b505092915050565b805160208201fd5b303b1590565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b905256fea26469706673582212207106ba36b2d518d89a5ce88705dd7f52d98f3a8c838b8bb7ad9cdaa5b4254ab164736f6c63430007060033","devdoc":{"author":"Gnosis Developers","events":{"ManagerChanged(address,address)":{"details":"Event emitted when the manager changes."},"SolverAdded(address)":{"details":"Event emitted when a solver gets added."},"SolverRemoved(address)":{"details":"Event emitted when a solver gets removed."}},"kind":"dev","methods":{"addSolver(address)":{"details":"Add an address to the set of allowed solvers. This method can only be called by the contract manager. This function is idempotent.","params":{"solver":"The solver address to add."}},"getStorageAt(uint256,uint256)":{"details":"Reads `length` bytes of storage in the currents contract","params":{"length":"- the number of words (32 bytes) of data to read","offset":"- the offset in the current contract's storage in words to start reading from"},"returns":{"_0":"the bytes that were read."}},"initializeManager(address)":{"details":"Initialize the manager to a value. This method is a contract initializer that is called exactly once after creation. An initializer is used instead of a constructor so that this contract can be used behind a proxy. This initializer is idempotent.","params":{"manager_":"The manager to initialize the contract with."}},"isSolver(address)":{"details":"determines whether the provided address is an authenticated solver.","params":{"prospectiveSolver":"the address of prospective solver."},"returns":{"_0":"true when prospectiveSolver is an authenticated solver, otherwise false."}},"removeSolver(address)":{"details":"Removes an address to the set of allowed solvers. This method can only be called by the contract manager. This function is idempotent.","params":{"solver":"The solver address to remove."}},"setManager(address)":{"details":"Set the manager for this contract. This method can be called by the current manager (if they want to to reliquish the role and give it to another address) or the contract owner (i.e. the proxy admin).","params":{"manager_":"The new contract manager address."}},"simulateDelegatecall(address,bytes)":{"details":"Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.","params":{"calldataPayload":"Calldata that should be sent to the target contract (encoded method name and arguments).","targetContract":"Address of the contract containing the code to execute."}},"simulateDelegatecallInternal(address,bytes)":{"details":"Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Returns encoded result as revert message concatenated with the success flag of the inner call as a last byte.","params":{"calldataPayload":"Calldata that should be sent to the target contract (encoded method name and arguments).","targetContract":"Address of the contract containing the code to execute."}}},"stateVariables":{"manager":{"details":"The address of the manager that has permissions to add and remove solvers."},"solvers":{"details":"The set of allowed solvers. Allowed solvers have a value of `true` in this mapping."}},"title":"Gnosis Protocol v2 Access Control Contract","version":1},"userdoc":{"kind":"user","methods":{},"version":1}} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldManager", + "type": "address" + } + ], + "name": "ManagerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "solver", + "type": "address" + } + ], + "name": "SolverAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "solver", + "type": "address" + } + ], + "name": "SolverRemoved", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "solver", + "type": "address" + } + ], + "name": "addSolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "getStorageAt", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "manager_", + "type": "address" + } + ], + "name": "initializeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prospectiveSolver", + "type": "address" + } + ], + "name": "isSolver", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "solver", + "type": "address" + } + ], + "name": "removeSolver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "manager_", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateDelegatecall", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateDelegatecallInternal", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610e10806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80637f7120fe11610076578063d0ebdbe71161005b578063d0ebdbe7146102e3578063ec58f4b814610316578063f84436bd14610349576100a3565b80637f7120fe1461027b5780638fd57b92146102b0576100a3565b806302cc250d146100a857806343218e19146100ef578063481c6a75146102275780635624b25b14610258575b600080fd5b6100db600480360360208110156100be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661040c565b604080519115158252519081900360200190f35b6101b26004803603604081101561010557600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561013d57600080fd5b82018360208201111561014f57600080fd5b8035906020019184600183028401116401000000008311171561017157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610437945050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ec5781810151838201526020016101d4565b50505050905090810190601f1680156102195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61022f6105af565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101b26004803603604081101561026e57600080fd5b50803590602001356105d1565b6102ae6004803603602081101561029157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610647565b005b6102ae600480360360208110156102c657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166107f8565b6102ae600480360360208110156102f957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610907565b6102ae6004803603602081101561032c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a47565b6101b26004803603604081101561035f57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561039757600080fd5b8201836020820111156103a957600080fd5b803590602001918460018302840111640100000000831117156103cb57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610b5a945050505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205460ff1690565b606060008373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106104a057805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610463565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610500576040519150601f19603f3d011682016040523d82523d6000602084013e610505565b606091505b5080935081925050506105a882826040516020018083805190602001908083835b6020831061056357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610526565b6001836020036101000a03801982511681845116808217855250505050505090500182151560f81b815260010192505050604051602081830303815290604052610da3565b5092915050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008260200267ffffffffffffffff811180156105ef57600080fd5b506040519080825280601f01601f19166020018201604052801561061a576020820181803683370190505b50905060005b8381101561063d5784810154602080830284010152600101610620565b5090505b92915050565b600054610100900460ff16806106605750610660610dab565b8061066e575060005460ff16155b6106d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e697469616c697a61626c653a20696e697469616c697a6564000000000000604482015290519081900360640190fd5b600054610100900460ff1615801561073f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff851690810291909117825560408051918252602082019290925281517f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a4350929181900390910190a180156107f457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b5050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff16331461088457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f475076323a2063616c6c6572206e6f74206d616e616765720000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526001602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055815192835290517f640e18a2587e1d83e4fdabf70257d0a800ca4b2c1aaad1dfc485a4ad8bbbd6c69281900390910190a150565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633148061094f575033610937610db1565b73ffffffffffffffffffffffffffffffffffffffff16145b6109ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f475076323a206e6f7420617574686f72697a6564000000000000000000000000604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff838116620100008181027fffffffffffffffffffff0000000000000000000000000000000000000000ffff85161790945560408051918252939092041660208201819052825190927f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a4350928290030190a15050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff163314610ad357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f475076323a2063616c6c6572206e6f74206d616e616765720000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526001602081815260409283902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909217909155815192835290517f41f9d09dd5159251f8a8e482bbe097b7c01a5e6f70c5a0ddb494906464fc9dd79281900390910190a150565b606060006343218e1960e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bc4578181015183820152602001610bac565b50505050905090810190601f168015610bf15780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909816979097178752518151919750309688965090945084935091508083835b60208310610cc257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c85565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610d24576040519150601f19603f3d011682016040523d82523d6000602084013e610d29565b606091505b50905080925050600082600184510381518110610d4257fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600160f81b149050610d85836001855103610dd6565b8015610d92575050610641565b610d9b83610da3565b505092915050565b805160208201fd5b303b1590565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b905256fea26469706673582212207106ba36b2d518d89a5ce88705dd7f52d98f3a8c838b8bb7ad9cdaa5b4254ab164736f6c63430007060033", + "devdoc": { + "author": "Gnosis Developers", + "events": { + "ManagerChanged(address,address)": { + "details": "Event emitted when the manager changes." + }, + "SolverAdded(address)": { + "details": "Event emitted when a solver gets added." + }, + "SolverRemoved(address)": { + "details": "Event emitted when a solver gets removed." + } + }, + "kind": "dev", + "methods": { + "addSolver(address)": { + "details": "Add an address to the set of allowed solvers. This method can only be called by the contract manager. This function is idempotent.", + "params": { + "solver": "The solver address to add." + } + }, + "getStorageAt(uint256,uint256)": { + "details": "Reads `length` bytes of storage in the currents contract", + "params": { + "length": "- the number of words (32 bytes) of data to read", + "offset": "- the offset in the current contract's storage in words to start reading from" + }, + "returns": { + "_0": "the bytes that were read." + } + }, + "initializeManager(address)": { + "details": "Initialize the manager to a value. This method is a contract initializer that is called exactly once after creation. An initializer is used instead of a constructor so that this contract can be used behind a proxy. This initializer is idempotent.", + "params": { + "manager_": "The manager to initialize the contract with." + } + }, + "isSolver(address)": { + "details": "determines whether the provided address is an authenticated solver.", + "params": { + "prospectiveSolver": "the address of prospective solver." + }, + "returns": { + "_0": "true when prospectiveSolver is an authenticated solver, otherwise false." + } + }, + "removeSolver(address)": { + "details": "Removes an address to the set of allowed solvers. This method can only be called by the contract manager. This function is idempotent.", + "params": { + "solver": "The solver address to remove." + } + }, + "setManager(address)": { + "details": "Set the manager for this contract. This method can be called by the current manager (if they want to to reliquish the role and give it to another address) or the contract owner (i.e. the proxy admin).", + "params": { + "manager_": "The new contract manager address." + } + }, + "simulateDelegatecall(address,bytes)": { + "details": "Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.", + "params": { + "calldataPayload": "Calldata that should be sent to the target contract (encoded method name and arguments).", + "targetContract": "Address of the contract containing the code to execute." + } + }, + "simulateDelegatecallInternal(address,bytes)": { + "details": "Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Returns encoded result as revert message concatenated with the success flag of the inner call as a last byte.", + "params": { + "calldataPayload": "Calldata that should be sent to the target contract (encoded method name and arguments).", + "targetContract": "Address of the contract containing the code to execute." + } + } + }, + "stateVariables": { + "manager": { + "details": "The address of the manager that has permissions to add and remove solvers." + }, + "solvers": { + "details": "The set of allowed solvers. Allowed solvers have a value of `true` in this mapping." + } + }, + "title": "Gnosis Protocol v2 Access Control Contract", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } +} diff --git a/crates/contracts/artifacts/GPv2Settlement.json b/crates/contracts/artifacts/GPv2Settlement.json index be3cf152d5..8d3a2c65a3 100644 --- a/crates/contracts/artifacts/GPv2Settlement.json +++ b/crates/contracts/artifacts/GPv2Settlement.json @@ -1 +1,690 @@ -{"abi":[{"inputs":[{"internalType":"contract GPv2Authentication","name":"authenticator_","type":"address"},{"internalType":"contract IVault","name":"vault_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"Interaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes","name":"orderUid","type":"bytes"}],"name":"OrderInvalidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes","name":"orderUid","type":"bytes"},{"indexed":false,"internalType":"bool","name":"signed","type":"bool"}],"name":"PreSignature","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"solver","type":"address"}],"name":"Settlement","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"sellToken","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"buyToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"sellAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buyAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"orderUid","type":"bytes"}],"name":"Trade","type":"event"},{"inputs":[],"name":"authenticator","outputs":[{"internalType":"contract GPv2Authentication","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"filledAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"orderUids","type":"bytes[]"}],"name":"freeFilledAmountStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"orderUids","type":"bytes[]"}],"name":"freePreSignatureStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"getStorageAt","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"orderUid","type":"bytes"}],"name":"invalidateOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"preSignature","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"orderUid","type":"bytes"},{"internalType":"bool","name":"signed","type":"bool"}],"name":"setPreSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"clearingPrices","type":"uint256[]"},{"components":[{"internalType":"uint256","name":"sellTokenIndex","type":"uint256"},{"internalType":"uint256","name":"buyTokenIndex","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"uint256","name":"executedAmount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct GPv2Trade.Data[]","name":"trades","type":"tuple[]"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct GPv2Interaction.Data[][3]","name":"interactions","type":"tuple[][3]"}],"name":"settle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateDelegatecall","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateDelegatecallInternal","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"assetInIndex","type":"uint256"},{"internalType":"uint256","name":"assetOutIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"userData","type":"bytes"}],"internalType":"struct IVault.BatchSwapStep[]","name":"swaps","type":"tuple[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"components":[{"internalType":"uint256","name":"sellTokenIndex","type":"uint256"},{"internalType":"uint256","name":"buyTokenIndex","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"buyAmount","type":"uint256"},{"internalType":"uint32","name":"validTo","type":"uint32"},{"internalType":"bytes32","name":"appData","type":"bytes32"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"uint256","name":"executedAmount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct GPv2Trade.Data","name":"trade","type":"tuple"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultRelayer","outputs":[{"internalType":"contract GPv2VaultRelayer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"0x6101006040523480156200001257600080fd5b50604051620053eb380380620053eb83398101604081905262000035916200015b565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f6c85c0337eba1661327f94f3bf46c8a7f9311a563f4d5c948362567f5d8ed60c828401527ff9446b8e937d86f0bc87cac73923491692b123ca5f8761908494703758206adf606080840191909152466080808501919091523060a08086019190915285518086038201815260c09586019687905280519401939093209052600180556001600160601b031986821b811690925284901b16905281906200010a906200014d565b62000116919062000199565b604051809103906000f08015801562000133573d6000803e3d6000fd5b5060601b6001600160601b03191660e05250620001c69050565b61129e806200414d83390190565b600080604083850312156200016e578182fd5b82516200017b81620001ad565b60208401519092506200018e81620001ad565b809150509250929050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114620001c357600080fd5b50565b60805160a05160601c60c05160601c60e05160601c613f2562000228600039806104c55280610d61528061109052806115f0525080610556528061158b52508061039252806106bc528061099d52508061131e52806123df5250613f256000f3fe6080604052600436106100ec5760003560e01c80639b552cc21161008a578063ed9f35ce11610059578063ed9f35ce14610274578063f698da2514610294578063f84436bd146102a9578063fbfa77cf146102c9576100f3565b80639b552cc2146101ff578063a2a7d51b14610214578063d08d33d114610234578063ec6cb13f14610254576100f3565b80632479fb6e116100c65780632479fb6e1461016557806343218e19146101925780635624b25b146101bf578063845a101f146101df576100f3565b806313d79a0b146100f857806315337bc01461011a5780632335c76b1461013a576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061011861011336600461322e565b6102de565b005b34801561012657600080fd5b50610118610135366004613441565b6105c1565b34801561014657600080fd5b5061014f6106ba565b60405161015c91906136ee565b60405180910390f35b34801561017157600080fd5b506101856101803660046134ca565b6106de565b60405161015c91906137f0565b34801561019e57600080fd5b506101b26101ad3660046131a0565b6106fb565b60405161015c919061380d565b3480156101cb57600080fd5b506101b26101da3660046134fd565b610873565b3480156101eb57600080fd5b506101186101fa36600461338e565b6108e9565b34801561020b57600080fd5b5061014f61108e565b34801561022057600080fd5b5061011861022f3660046131ee565b6110b2565b34801561024057600080fd5b5061018561024f3660046134ca565b6110fb565b34801561026057600080fd5b5061011861026f366004613475565b611118565b34801561028057600080fd5b5061011861028f3660046131ee565b6112d7565b3480156102a057600080fd5b5061018561131c565b3480156102b557600080fd5b506101b26102c43660046131a0565b611340565b3480156102d557600080fd5b5061014f611589565b6002600154141561035057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556040517f02cc250d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906302cc250d906103c79033906004016136ee565b60206040518083038186803b1580156103df57600080fd5b505afa1580156103f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104179190613425565b610456576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c78565b60405180910390fd5b6104728160005b60200281019061046d9190613d16565b6115ad565b6000806104838989898989896116ea565b6040517f7d10d11f000000000000000000000000000000000000000000000000000000008152919350915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690637d10d11f906104fa90859060040161370f565b600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b5050505061053c8360016003811061045d57fe5b61057c73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001682611851565b61058783600261045d565b60405133907f40338ce1a7c49204f0099533b1e9a7ee0a3d261f84974ab7af36105b8c4e9db490600090a250506001805550505050505050565b60006105cd8383611b2f565b5091505073ffffffffffffffffffffffffffffffffffffffff81163314610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613a1b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600284846040516106539291906136c2565b9081526020016040518091039020819055508073ffffffffffffffffffffffffffffffffffffffff167f875b6cb035bbd4ac6500fabc6d1e4ca5bdc58a3e2b424ccb5c24cdbebeb009a984846040516106ad9291906137f9565b60405180910390a2505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b805160208183018101805160028252928201919093012091525481565b606060008373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061076457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610727565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146107c4576040519150601f19603f3d011682016040523d82523d6000602084013e6107c9565b606091505b50809350819250505061086c82826040516020018083805190602001908083835b6020831061082757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016107ea565b6001836020036101000a03801982511681845116808217855250505050505090500182151560f81b815260010192505050604051602081830303815290604052611bbd565b5092915050565b606060008260200267ffffffffffffffff8111801561089157600080fd5b506040519080825280601f01601f1916602001820160405280156108bc576020820181803683370190505b50905060005b838110156108df57848101546020808302840101526001016108c2565b5090505b92915050565b6002600154141561095b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556040517f02cc250d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906302cc250d906109d29033906004016136ee565b60206040518083038186803b1580156109ea57600080fd5b505afa1580156109fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a229190613425565b610a58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c78565b6000610a62611bc5565b8051909150610a7382868686611bf2565b60007ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677582610100015114610aa8576001610aab565b60005b9050610ab5612f90565b60408085015173ffffffffffffffffffffffffffffffffffffffff90811683526101408501517f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce9081146020850152606080880151909216928401929092526101608501519091149082015260008667ffffffffffffffff81118015610b3a57600080fd5b50604051908082528060200260200182016040528015610b64578160200160208202803683370190505b50610100850151909150610120870135907ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee3467751415610c30578460800151811015610bda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c41565b610be78560600151611c90565b82886000013581518110610bf757fe5b602002602001018181525050610c0c81611c90565b60000382886020013581518110610c1f57fe5b602002602001018181525050610cc0565b8460600151811115610c6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b9c565b610c7781611c90565b82886000013581518110610c8757fe5b602002602001018181525050610ca08560800151611c90565b60000382886020013581518110610cb357fe5b6020026020010181815250505b610cc8612f90565b8660400151816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508560000151816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508560e0015181604001818152505085610140015181606001818152505060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634817a286878f8f8f8f8b8b8f60a001518b6040518a63ffffffff1660e01b8152600401610dcc99989796959493929190613877565b600060405180830381600087803b158015610de657600080fd5b505af1158015610dfa573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610e4091908101906132ed565b90506000886020015190506000610e6d838c6000013581518110610e6057fe5b6020026020010151611d25565b90506000610e94848d6020013581518110610e8457fe5b6020026020010151600003611d25565b9050600283604051610ea691906136d2565b908152602001604051809103902054600014610eee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613bd3565b7ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee3467758a61010001511415610f825789606001518214610f58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613ac0565b8960600151600284604051610f6d91906136d2565b90815260405190819003602001902055610fe5565b89608001518114610fbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613af7565b8960800151600284604051610fd491906136d2565b908152604051908190036020019020555b8a6040015173ffffffffffffffffffffffffffffffffffffffff167fa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc178b600001518c6020015185858f60e001518960405161104596959493929190613820565b60405180910390a260405133907f40338ce1a7c49204f0099533b1e9a7ee0a3d261f84974ab7af36105b8c4e9db490600090a25050600180555050505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b3033146110eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b65565b6110f760008383611d96565b5050565b805160208183018101805160008252928201919093012091525481565b60006111248484611b2f565b5091505073ffffffffffffffffffffffffffffffffffffffff811633146111ac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f475076323a2063616e6e6f74207072657369676e206f72646572000000000000604482015290519081900360640190fd5b8115611206577ff59c009283ff87aa78203fc4d9c2df025ee851130fb69cc3e068941f6b5e2d6f60001c60008585604051808383808284378083019250505092505050908152602001604051809103902081905550611232565b600080858560405180838380828437919091019485525050604051928390036020019092209290925550505b8073ffffffffffffffffffffffffffffffffffffffff167f01bf7c8b0ca55deecbea89d7e58295b7ffbf685fd0d96801034ba8c6ffe1c68d858585604051808060200183151581526020018281038252858582818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201829003965090945050505050a250505050565b303314611310576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b65565b6110f760028383611d96565b7f000000000000000000000000000000000000000000000000000000000000000081565b606060006343218e1960e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113aa578181015183820152602001611392565b50505050905090810190601f1680156113d75780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909816979097178752518151919750309688965090945084935091508083835b602083106114a857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161146b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461150a576040519150601f19603f3d011682016040523d82523d6000602084013e61150f565b606091505b5090508092505060008260018451038151811061152857fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600160f81b14905061156b836001855103611e46565b80156115785750506108e3565b61158183611bbd565b505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60005b818110156116e557368383838181106115c557fe5b90506020028101906115d79190613dde565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001661161d6020830183613184565b73ffffffffffffffffffffffffffffffffffffffff16141561166b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613caf565b61167481611e4a565b6116816020820182613184565b73ffffffffffffffffffffffffffffffffffffffff167fed99827efb37016f2275f98c4bcf71c7551c75d59e9b450f79fa32e60be672c282602001356116c684611ea1565b6040516116d4929190613ce6565b60405180910390a2506001016115b0565b505050565b60608060006116f7611bc5565b90508367ffffffffffffffff8111801561171057600080fd5b5060405190808252806020026020018201604052801561174a57816020015b611737612f90565b81526020019060019003908161172f5790505b5092508367ffffffffffffffff8111801561176457600080fd5b5060405190808252806020026020018201604052801561179e57816020015b61178b612f90565b8152602001906001900390816117835790505b50915060005b8481101561184457368686838181106117b957fe5b90506020028101906117cb9190613e11565b90506117d9838c8c84611bf2565b61183b838a8a84358181106117ea57fe5b905060200201358b8b856020013581811061180157fe5b9050602002013584610120013589878151811061181a57fe5b602002602001015189888151811061182e57fe5b6020026020010151611ecb565b506001016117a4565b5050965096945050505050565b6000815167ffffffffffffffff8111801561186b57600080fd5b506040519080825280602002602001820160405280156118a557816020015b611892612fb7565b81526020019060019003908161188a5790505b5090506000805b8351811015611a935760008482815181106118c357fe5b6020026020010151905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614156119c7577f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce81606001511415611977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b2e565b8051604080830151905173ffffffffffffffffffffffffffffffffffffffff9092169181156108fc0291906000818181858888f193505050501580156119c1573d6000803e3d6000fd5b50611a8a565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981606001511415611a2657805160408201516020830151611a219273ffffffffffffffffffffffffffffffffffffffff90911691612216565b611a8a565b6000848480600101955081518110611a3a57fe5b602090810291909101810151600081528382015173ffffffffffffffffffffffffffffffffffffffff90811692820192909252604080850151908201523060608201528351909116608090910152505b506001016118ac565b508015611b2957611aa48282611e46565b6040517f0e8e3e8400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690630e8e3e8490611af690859060040161375d565b600060405180830381600087803b158015611b1057600080fd5b505af1158015611b24573d6000803e3d6000fd5b505050505b50505050565b6000808060388414611ba257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f475076323a20696e76616c696420756964000000000000000000000000000000604482015290519081900360640190fd5b5050823593602084013560601c936034013560e01c92509050565b805160208201fd5b611bcd612fe7565b6040805160388082526060820190925290602082018180368337505050602082015290565b83516000611c02838686856122ee565b9050600080611c1f8484611c1a610140890189613d7b565b6123d6565b91509150611c4282828660a001518b60200151612485909392919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff81166040890152611c688482612507565b73ffffffffffffffffffffffffffffffffffffffff1660609098019790975250505050505050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115611d2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f53616665436173743a20696e74323536206f766572666c6f7700000000000000604482015290519081900360640190fd5b5090565b600080821215611d2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f53616665436173743a206e6f7420706f73697469766500000000000000000000604482015290519081900360640190fd5b60005b81811015611b2957366000848484818110611db057fe5b9050602002810190611dc29190613d7b565b915091506000611dd28383611b2f565b92505050428163ffffffff1610611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c0a565b6000878484604051611e289291906136c2565b90815260405190819003602001902055505060019091019050611d99565b9052565b73ffffffffffffffffffffffffffffffffffffffff8135166020820135366000611e776040860186613d7b565b9150915060405181838237600080838387895af1611e99573d6000803e3d6000fd5b505050505050565b60003681611eb26040850185613d7b565b909250905060048110611ec457813592505b5050919050565b8551602087015160a08201514263ffffffff9091161015611f18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613a52565b6080820151611f279087612539565b6060830151611f369089612539565b1015611f6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613a89565b6000806000807ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775866101000151141561206f5785610120015115611fdb57889350611fd48660600151611fce868960e0015161253990919063ffffffff16565b906125c9565b9150611fea565b856060015193508560e0015191505b611ffe8a611ff8868e612539565b9061264a565b925061202a8460028760405161201491906136d2565b90815260405190819003602001902054906126e8565b9050856060015181111561206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613bd3565b612116565b856101200151156120a35788925061209c8660800151611fce858960e0015161253990919063ffffffff16565b91506120b2565b856080015192508560e0015191505b6120c08b611fce858d612539565b93506120d68360028760405161201491906136d2565b90508560800151811115612116576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613bd3565b61212084836126e8565b93508060028660405161213391906136d2565b9081526020016040518091039020819055508b6040015173ffffffffffffffffffffffffffffffffffffffff167fa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc17876000015188602001518787878b6040516121a196959493929190613820565b60405180910390a250506040808b015173ffffffffffffffffffffffffffffffffffffffff9081168852855181166020808a0191909152888301949094526101408601516060988901529a8701518b16865282850151909a169185019190915297830197909752610160015191015250505050565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff84166004830152602482018390529060008060448382895af1612279573d6000803e3d6000fd5b506122838461275c565b611b2957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f475076323a206661696c6564207472616e736665720000000000000000000000604482015290519081900360640190fd5b6000838386358181106122fd57fe5b6020908102929092013573ffffffffffffffffffffffffffffffffffffffff168452508490849087013581811061233057fe5b73ffffffffffffffffffffffffffffffffffffffff602091820293909301358316908501525060408087013590911690830152606080860135908301526080808601359083015263ffffffff60a080870135919091169083015260c0808601359083015260e080860135908301526123ac610100860135612826565b61016087019190915261014086019190915290151561012085015261010090930152509392505050565b600080612403867f000000000000000000000000000000000000000000000000000000000000000061297b565b9150600085600381111561241357fe5b141561242b57612424828585612a05565b905061247c565b600185600381111561243957fe5b141561244a57612424828585612a1a565b600285600381111561245857fe5b141561246957612424828585612a82565b6124798285858960a00151612c20565b90505b94509492505050565b60388451146124f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a2075696420627566666572206f766572666c6f7700000000000000604482015290519081900360640190fd5b60388401526034830152602090910152565b604082015160009073ffffffffffffffffffffffffffffffffffffffff166125305750806108e3565b50506040015190565b600082612548575060006108e3565b8282028284828161255557fe5b04146125c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f536166654d6174683a206d756c206f766572666c6f7700000000000000000000604482015290519081900360640190fd5b9392505050565b600080821161263957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f536166654d6174683a206469766973696f6e2062792030000000000000000000604482015290519081900360640190fd5b81838161264257fe5b049392505050565b60008082116126ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f536166654d6174683a206365696c696e67206469766973696f6e206279203000604482015290519081900360640190fd5b8183816126c357fe5b06156126d05760016126d3565b60005b60ff168284816126df57fe5b04019392505050565b6000828201838110156125c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061279a565b7f08c379a0000000000000000000000000000000000000000000000000000000006000526020600452806024528160445260646000fd5b3d80156127d95760208114612813576127d47f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f612763565b612820565b823b61280a5761280a7f475076323a206e6f74206120636f6e74726163740000000000000000000000006014612763565b60019150612820565b3d6000803e600051151591505b50919050565b6000808080806001861661285c577ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee3467759450612880565b7f6ed88e868af0a1983e3886d5f3e95a2fafbd6c3450bc229e27342283dc429ccc94505b6002861615159350600886166128b8577f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9925061290c565b600486166128e8577fabee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea0632925061290c565b7f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce92505b6010861661293c577f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc99150612960565b7f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce91505b600586901c600381111561297057fe5b905091939590929450565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b6000612a12848484612de5565b949350505050565b6000808460405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050612a79818585612de5565b95945050505050565b813560601c366000612a978460148188613e68565b604080517f1626ba7e00000000000000000000000000000000000000000000000000000000808252600482018b81526024830193845260448301859052949650929450919273ffffffffffffffffffffffffffffffffffffffff871692631626ba7e928b928892889290606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015612b5d57600080fd5b505afa158015612b71573d6000803e3d6000fd5b505050506040513d6020811015612b8757600080fd5b50517fffffffff000000000000000000000000000000000000000000000000000000001614612c1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f475076323a20696e76616c69642065697031323731207369676e617475726500604482015290519081900360640190fd5b50509392505050565b600060148314612c9157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f475076323a206d616c666f726d6564207072657369676e617475726500000000604482015290519081900360640190fd5b506040805160388082526060828101909352853590921c9160009190602082018180368337019050509050612cc881878486612485565b7ff59c009283ff87aa78203fc4d9c2df025ee851130fb69cc3e068941f6b5e2d6f60001c6000826040518082805190602001908083835b60208310612d3c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612cff565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390205414612ddc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206f72646572206e6f74207072657369676e656400000000000000604482015290519081900360640190fd5b50949350505050565b600060418214612e5657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f475076323a206d616c666f726d6564206563647361207369676e617475726500604482015290519081900360640190fd5b604080516000815260208181018084528790528286013560f81c82840181905286356060840181905282880135608085018190529451909493919260019260a0808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015612ed9573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015194505073ffffffffffffffffffffffffffffffffffffffff8416612f8657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f475076323a20696e76616c6964206563647361207369676e6174757265000000604482015290519081900360640190fd5b5050509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040805160a081019091528060008152600060208201819052604082018190526060820181905260809091015290565b6040518060800160405280612ffa613014565b815260606020820181905260006040830181905291015290565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101829052610140810182905261016081019190915290565b60008083601f840112613089578182fd5b50813567ffffffffffffffff8111156130a0578182fd5b60208301915083602080830285010111156130ba57600080fd5b9250929050565b60008083601f8401126130d2578182fd5b50813567ffffffffffffffff8111156130e9578182fd5b6020830191508360208285010111156130ba57600080fd5b600082601f830112613111578081fd5b813567ffffffffffffffff81111561312557fe5b61315660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613e44565b81815284602083860101111561316a578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215613195578081fd5b81356125c281613ebc565b600080604083850312156131b2578081fd5b82356131bd81613ebc565b9150602083013567ffffffffffffffff8111156131d8578182fd5b6131e485828601613101565b9150509250929050565b60008060208385031215613200578182fd5b823567ffffffffffffffff811115613216578283fd5b61322285828601613078565b90969095509350505050565b60008060008060008060006080888a031215613248578283fd5b873567ffffffffffffffff8082111561325f578485fd5b61326b8b838c01613078565b909950975060208a0135915080821115613283578485fd5b61328f8b838c01613078565b909750955060408a01359150808211156132a7578485fd5b6132b38b838c01613078565b909550935060608a01359150808211156132cb578283fd5b508801606081018a10156132dd578182fd5b8091505092959891949750929550565b600060208083850312156132ff578182fd5b825167ffffffffffffffff80821115613316578384fd5b818501915085601f830112613329578384fd5b81518181111561333557fe5b8381029150613345848301613e44565b8181528481019084860184860187018a101561335f578788fd5b8795505b83861015613381578051835260019590950194918601918601613363565b5098975050505050505050565b6000806000806000606086880312156133a5578081fd5b853567ffffffffffffffff808211156133bc578283fd5b6133c889838a01613078565b909750955060208801359150808211156133e0578283fd5b6133ec89838a01613078565b90955093506040880135915080821115613404578283fd5b5086016101608189031215613417578182fd5b809150509295509295909350565b600060208284031215613436578081fd5b81516125c281613ee1565b60008060208385031215613453578182fd5b823567ffffffffffffffff811115613469578283fd5b613222858286016130c1565b600080600060408486031215613489578081fd5b833567ffffffffffffffff81111561349f578182fd5b6134ab868287016130c1565b90945092505060208401356134bf81613ee1565b809150509250925092565b6000602082840312156134db578081fd5b813567ffffffffffffffff8111156134f1578182fd5b612a1284828501613101565b6000806040838503121561350f578182fd5b50508035926020909101359150565b60008284526020808501945082825b8581101561356857813561354081613ebc565b73ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161352d565b509495945050505050565b6000815180845260208085019450808401835b8381101561356857815187529582019590820190600101613586565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b60008151808452613602816020860160208601613e90565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401525060408101516040830152606081015160608301525050565b73ffffffffffffffffffffffffffffffffffffffff808251168352602082015115156020840152806040830151166040840152506060810151151560608301525050565b63ffffffff169052565b6000828483379101908152919050565b600082516136e4818460208701613e90565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156137515761373e838551613634565b928401926080929092019160010161372b565b50909695505050505050565b602080825282518282018190526000919060409081850190868401855b828110156137e357815180516004811061379057fe5b85528087015173ffffffffffffffffffffffffffffffffffffffff908116888701528682015187870152606080830151821690870152608091820151169085015260a0909301929085019060010161377a565b5091979650505050505050565b90815260200190565b600060208252612a126020830184866135a2565b6000602082526125c260208301846135ea565b600073ffffffffffffffffffffffffffffffffffffffff808916835280881660208401525085604083015284606083015283608083015260c060a083015261386b60c08301846135ea565b98975050505050505050565b60006101a0820160028c1061388857fe5b8b835260206101a081850152818b83526101c0850190506101c0828d0286010192508c845b8d8110156139b6577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe408786030183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618f36030182351261390c578586fd5b8e823501803586528481013585870152604081013560408701526060810135606087015260808101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1823603018112613964578788fd5b8101803567ffffffffffffffff81111561397c578889fd5b80360383131561398a578889fd5b60a060808901526139a160a08901828985016135a2565b975050509284019250908301906001016138ad565b5050505082810360408401526139cd81898b61351e565b90506139dc6060840188613674565b82810360e08401526139ee8187613573565b9150506139ff6101008301856136b8565b613a0d610120830184613634565b9a9950505050505050505050565b6020808252601f908201527f475076323a2063616c6c657220646f6573206e6f74206f776e206f7264657200604082015260600190565b60208082526013908201527f475076323a206f72646572206578706972656400000000000000000000000000604082015260600190565b6020808252601f908201527f475076323a206c696d6974207072696365206e6f742072657370656374656400604082015260600190565b6020808252601f908201527f475076323a2073656c6c20616d6f756e74206e6f742072657370656374656400604082015260600190565b6020808252601e908201527f475076323a2062757920616d6f756e74206e6f74207265737065637465640000604082015260600190565b6020808252601e908201527f475076323a20756e737570706f7274656420696e7465726e616c204554480000604082015260600190565b60208082526018908201527f475076323a206e6f7420616e20696e746572616374696f6e0000000000000000604082015260600190565b60208082526014908201527f475076323a206c696d697420746f6f2068696768000000000000000000000000604082015260600190565b60208082526012908201527f475076323a206f726465722066696c6c65640000000000000000000000000000604082015260600190565b60208082526017908201527f475076323a206f72646572207374696c6c2076616c6964000000000000000000604082015260600190565b60208082526013908201527f475076323a206c696d697420746f6f206c6f7700000000000000000000000000604082015260600190565b60208082526012908201527f475076323a206e6f74206120736f6c7665720000000000000000000000000000604082015260600190565b6020808252601b908201527f475076323a20666f7262696464656e20696e746572616374696f6e0000000000604082015260600190565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260400190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613d4a578283fd5b83018035915067ffffffffffffffff821115613d64578283fd5b60209081019250810236038213156130ba57600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613daf578283fd5b83018035915067ffffffffffffffff821115613dc9578283fd5b6020019150368190038213156130ba57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126136e4578182fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea18336030181126136e4578182fd5b60405181810167ffffffffffffffff81118282101715613e6057fe5b604052919050565b60008085851115613e77578182fd5b83861115613e83578182fd5b5050820193919092039150565b60005b83811015613eab578181015183820152602001613e93565b83811115611b295750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114613ede57600080fd5b50565b8015158114613ede57600080fdfea2646970667358221220de5e493c48a3b42da03a5db89085177b8d8ccec6e9bf6e8e48b3809343624c8f64736f6c6343000706003360c060405234801561001057600080fd5b5060405161129e38038061129e83398101604081905261002f9161004b565b33606090811b6080521b6001600160601b03191660a052610079565b60006020828403121561005c578081fd5b81516001600160a01b0381168114610072578182fd5b9392505050565b60805160601c60a05160601c6111ee6100b060003980610130528061020152806102bd5250806093528061024c52506111ee6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634817a2861461003b5780637d10d11f14610064575b600080fd5b61004e610049366004610cd9565b610079565b60405161005b9190610eb3565b60405180910390f35b610077610072366004610c69565b610234565b005b60603373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146100f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea906110e5565b60405180910390fd5b6040517f945bcec900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063945bcec990610171908c908c908c908c908c908c908c90600401610f59565b600060405180830381600087803b15801561018b57600080fd5b505af115801561019f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526101e59190810190610bd9565b905061022873ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001683336102e9565b98975050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146102a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea906110e5565b6102e573ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016838333610551565b5050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61030e6040840160208501610bb6565b73ffffffffffffffffffffffffffffffffffffffff16141561035c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea9061111c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9826060013514156103d0576103cb6103986020840184610bb6565b82604085018035906103ad9060208801610bb6565b73ffffffffffffffffffffffffffffffffffffffff16929190610816565b61054c565b604080516001808252818301909252600091816020015b6103ef6109cb565b8152602001906001900390816103e757905050905060008160008151811061041357fe5b602002602001015190507fabee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea063284606001351461044f576002610452565b60035b8190600381111561045f57fe5b9081600381111561046c57fe5b90525061047f6040850160208601610bb6565b73ffffffffffffffffffffffffffffffffffffffff16602080830191909152604080860135908301526104b490850185610bb6565b73ffffffffffffffffffffffffffffffffffffffff908116606083015283811660808301526040517f0e8e3e8400000000000000000000000000000000000000000000000000000000815290861690630e8e3e8490610517908590600401610ec6565b600060405180830381600087803b15801561053157600080fd5b505af1158015610545573d6000803e3d6000fd5b5050505050505b505050565b60008267ffffffffffffffff8111801561056a57600080fd5b506040519080825280602002602001820160405280156105a457816020015b6105916109cb565b8152602001906001900390816105895790505b5090506000805b8481101561077857368686838181106105c057fe5b60800291909101915073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90506105f06040830160208401610bb6565b73ffffffffffffffffffffffffffffffffffffffff16141561063e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea9061111c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9816060013514156106945761068f61067a6020830183610bb6565b86604084018035906103ad9060208701610bb6565b61076f565b60008484806001019550815181106106a857fe5b602002602001015190507fabee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea06328260600135146106e45760016106e7565b60035b819060038111156106f457fe5b9081600381111561070157fe5b9052506107146040830160208401610bb6565b73ffffffffffffffffffffffffffffffffffffffff166020808301919091526040808401359083015261074990830183610bb6565b73ffffffffffffffffffffffffffffffffffffffff908116606083015286166080909101525b506001016105ab565b50801561080e5761078982826108fd565b6040517f0e8e3e8400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff871690630e8e3e84906107db908590600401610ec6565b600060405180830381600087803b1580156107f557600080fd5b505af1158015610809573d6000803e3d6000fd5b505050505b505050505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8581166004840152841660248301526044820183905290600080606483828a5af1610881573d6000803e3d6000fd5b5061088b85610901565b6108f657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206661696c6564207472616e7366657246726f6d00000000000000604482015290519081900360640190fd5b5050505050565b9052565b600061093f565b7f08c379a0000000000000000000000000000000000000000000000000000000006000526020600452806024528160445260646000fd5b3d801561097e57602081146109b8576109797f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f610908565b6109c5565b823b6109af576109af7f475076323a206e6f74206120636f6e74726163740000000000000000000000006014610908565b600191506109c5565b3d6000803e600051151591505b50919050565b6040805160a081019091528060008152600060208201819052604082018190526060820181905260809091015290565b600082601f830112610a0b578081fd5b81356020610a20610a1b83611175565b611151565b8281528181019085830183850287018401881015610a3c578586fd5b855b85811015610a63578135610a5181611193565b84529284019290840190600101610a3e565b5090979650505050505050565b600082601f830112610a80578081fd5b81356020610a90610a1b83611175565b8281528181019085830183850287018401881015610aac578586fd5b855b85811015610a6357813584529284019290840190600101610aae565b60008083601f840112610adb578182fd5b50813567ffffffffffffffff811115610af2578182fd5b6020830191508360208083028501011115610b0c57600080fd5b9250929050565b80358015158114610b2357600080fd5b919050565b6000608082840312156109c5578081fd5b600060808284031215610b4a578081fd5b6040516080810181811067ffffffffffffffff82111715610b6757fe5b6040529050808235610b7881611193565b8152610b8660208401610b13565b60208201526040830135610b9981611193565b6040820152610baa60608401610b13565b60608201525092915050565b600060208284031215610bc7578081fd5b8135610bd281611193565b9392505050565b60006020808385031215610beb578182fd5b825167ffffffffffffffff811115610c01578283fd5b8301601f81018513610c11578283fd5b8051610c1f610a1b82611175565b8181528381019083850185840285018601891015610c3b578687fd5b8694505b83851015610c5d578051835260019490940193918501918501610c3f565b50979650505050505050565b60008060208385031215610c7b578081fd5b823567ffffffffffffffff80821115610c92578283fd5b818501915085601f830112610ca5578283fd5b813581811115610cb3578384fd5b866020608083028501011115610cc7578384fd5b60209290920196919550909350505050565b6000806000806000806000806101a0898b031215610cf5578384fd5b883560028110610d03578485fd5b9750602089013567ffffffffffffffff80821115610d1f578586fd5b610d2b8c838d01610aca565b909950975060408b0135915080821115610d43578586fd5b610d4f8c838d016109fb565b9650610d5e8c60608d01610b39565b955060e08b0135915080821115610d73578485fd5b50610d808b828c01610a70565b9350506101008901359150610d998a6101208b01610b28565b90509295985092959890939650565b6000815180845260208085019450808401835b83811015610ded57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101610dbb565b509495945050505050565b6000815180845260208085019450808401835b83811015610ded57815187529582019590820190600101610e0b565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b73ffffffffffffffffffffffffffffffffffffffff808251168352602082015115156020840152806040830151166040840152506060810151151560608301525050565b600060208252610bd26020830184610df8565b602080825282518282018190526000919060409081850190868401855b82811015610f4c578151805160048110610ef957fe5b85528087015173ffffffffffffffffffffffffffffffffffffffff908116888701528682015187870152606080830151821690870152608091820151169085015260a09093019290850190600101610ee3565b5091979650505050505050565b600061012080830160028b10610f6b57fe5b8a8452602080850192909252889052610140808401918981028501909101908a845b8b811015611098577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec087850301855281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618e3603018112610fed578687fd5b8d01803585528381013584860152604080820135908601526060808201359086015260a0608080830135368490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe101811261104757898afd5b8301803567ffffffffffffffff81111561105f578a8bfd5b80360385131561106d578a8bfd5b83838a0152611081848a01828a8501610e27565b998801999850505093850193505050600101610f8d565b50505083810360408501526110ad8189610da8565b9150506110bd6060840187610e6f565b82810360e08401526110cf8186610df8565b9150508261010083015298975050505050505050565b60208082526011908201527f475076323a206e6f742063726561746f72000000000000000000000000000000604082015260600190565b6020808252818101527f475076323a2063616e6e6f74207472616e73666572206e617469766520455448604082015260600190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b5060209081020190565b73ffffffffffffffffffffffffffffffffffffffff811681146111b557600080fd5b5056fea2646970667358221220364a6941bea69620b7dc3a957d0ab4cbf3bfc459c7ad3924d220620aca9202fc64736f6c63430007060033","devdoc":{"author":"Gnosis Developers","events":{"Interaction(address,uint256,bytes4)":{"details":"Event emitted for each executed interaction. For gas effeciency, only the interaction calldata selector (first 4 bytes) is included in the event. For interactions without calldata or whose calldata is shorter than 4 bytes, the selector will be `0`."},"OrderInvalidated(address,bytes)":{"details":"Event emitted when an order is invalidated."},"Settlement(address)":{"details":"Event emitted when a settlement complets"},"Trade(address,address,address,uint256,uint256,uint256,bytes)":{"details":"Event emitted for each executed trade."}},"kind":"dev","methods":{"freeFilledAmountStorage(bytes[])":{"details":"Free storage from the filled amounts of **expired** orders to claim a gas refund. This method can only be called as an interaction.","params":{"orderUids":"The unique identifiers of the expired order to free storage for."}},"freePreSignatureStorage(bytes[])":{"details":"Free storage from the pre signatures of **expired** orders to claim a gas refund. This method can only be called as an interaction.","params":{"orderUids":"The unique identifiers of the expired order to free storage for."}},"getStorageAt(uint256,uint256)":{"details":"Reads `length` bytes of storage in the currents contract","params":{"length":"- the number of words (32 bytes) of data to read","offset":"- the offset in the current contract's storage in words to start reading from"},"returns":{"_0":"the bytes that were read."}},"invalidateOrder(bytes)":{"details":"Invalidate onchain an order that has been signed offline.","params":{"orderUid":"The unique identifier of the order that is to be made invalid after calling this function. The user that created the order must be the the sender of this message. See [`extractOrderUidParams`] for details on orderUid."}},"setPreSignature(bytes,bool)":{"details":"Sets a presignature for the specified order UID.","params":{"orderUid":"The unique identifier of the order to pre-sign."}},"settle(address[],uint256[],(uint256,uint256,address,uint256,uint256,uint32,bytes32,uint256,uint256,uint256,bytes)[],(address,uint256,bytes)[][3])":{"details":"Settle the specified orders at a clearing price. Note that it is the responsibility of the caller to ensure that all GPv2 invariants are upheld for the input settlement, otherwise this call will revert. Namely: - All orders are valid and signed - Accounts have sufficient balance and approval. - Settlement contract has sufficient balance to execute trades. Note this implies that the accumulated fees held in the contract can also be used for settlement. This is OK since: - Solvers need to be authorized - Misbehaving solvers will be slashed for abusing accumulated fees for settlement - Critically, user orders are entirely protected","params":{"clearingPrices":"An array of clearing prices where the `i`-th price is for the `i`-th token in the [`tokens`] array.","interactions":"Smart contract interactions split into three separate lists to be run before the settlement, during the settlement and after the settlement respectively.","tokens":"An array of ERC20 tokens to be traded in the settlement. Trades encode tokens as indices into this array.","trades":"Trades for signed orders."}},"simulateDelegatecall(address,bytes)":{"details":"Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.","params":{"calldataPayload":"Calldata that should be sent to the target contract (encoded method name and arguments).","targetContract":"Address of the contract containing the code to execute."}},"simulateDelegatecallInternal(address,bytes)":{"details":"Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Returns encoded result as revert message concatenated with the success flag of the inner call as a last byte.","params":{"calldataPayload":"Calldata that should be sent to the target contract (encoded method name and arguments).","targetContract":"Address of the contract containing the code to execute."}},"swap((bytes32,uint256,uint256,uint256,bytes)[],address[],(uint256,uint256,address,uint256,uint256,uint32,bytes32,uint256,uint256,uint256,bytes))":{"details":"Settle an order directly against Balancer V2 pools.","params":{"swaps":"The Balancer V2 swap steps to use for trading.","tokens":"An array of ERC20 tokens to be traded in the settlement. Swaps and the trade encode tokens as indices into this array.","trade":"The trade to match directly against Balancer liquidity. The order will always be fully executed, so the trade's `executedAmount` field is used to represent a swap limit amount."}}},"stateVariables":{"authenticator":{"details":"The authenticator is used to determine who can call the settle function. That is, only authorised solvers have the ability to invoke settlements. Any valid authenticator implements an isSolver method called by the onlySolver modifier below."},"filledAmount":{"details":"Map each user order by UID to the amount that has been filled so far. If this amount is larger than or equal to the amount traded in the order (amount sold for sell orders, amount bought for buy orders) then the order cannot be traded anymore. If the order is fill or kill, then this value is only used to determine whether the order has already been executed."},"vault":{"details":"The Balancer Vault the protocol uses for managing user funds."},"vaultRelayer":{"details":"The Balancer Vault relayer which can interact on behalf of users. This contract is created during deployment"}},"title":"Gnosis Protocol v2 Settlement Contract","version":1},"userdoc":{"kind":"user","methods":{},"version":1}} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract GPv2Authentication", + "name": "authenticator_", + "type": "address" + }, + { + "internalType": "contract IVault", + "name": "vault_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "Interaction", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + } + ], + "name": "OrderInvalidated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bool", + "name": "signed", + "type": "bool" + } + ], + "name": "PreSignature", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "solver", + "type": "address" + } + ], + "name": "Settlement", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "sellToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IERC20", + "name": "buyToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + } + ], + "name": "Trade", + "type": "event" + }, + { + "inputs": [], + "name": "authenticator", + "outputs": [ + { + "internalType": "contract GPv2Authentication", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "filledAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "orderUids", + "type": "bytes[]" + } + ], + "name": "freeFilledAmountStorage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "orderUids", + "type": "bytes[]" + } + ], + "name": "freePreSignatureStorage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "getStorageAt", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + } + ], + "name": "invalidateOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "preSignature", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "orderUid", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "signed", + "type": "bool" + } + ], + "name": "setPreSignature", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "clearingPrices", + "type": "uint256[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sellTokenIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyTokenIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "flags", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executedAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct GPv2Trade.Data[]", + "name": "trades", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct GPv2Interaction.Data[][3]", + "name": "interactions", + "type": "tuple[][3]" + } + ], + "name": "settle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateDelegatecall", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateDelegatecallInternal", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "assetInIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetOutIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.BatchSwapStep[]", + "name": "swaps", + "type": "tuple[]" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sellTokenIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyTokenIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "validTo", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "appData", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "flags", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executedAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct GPv2Trade.Data", + "name": "trade", + "type": "tuple" + } + ], + "name": "swap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaultRelayer", + "outputs": [ + { + "internalType": "contract GPv2VaultRelayer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x6101006040523480156200001257600080fd5b50604051620053eb380380620053eb83398101604081905262000035916200015b565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f6c85c0337eba1661327f94f3bf46c8a7f9311a563f4d5c948362567f5d8ed60c828401527ff9446b8e937d86f0bc87cac73923491692b123ca5f8761908494703758206adf606080840191909152466080808501919091523060a08086019190915285518086038201815260c09586019687905280519401939093209052600180556001600160601b031986821b811690925284901b16905281906200010a906200014d565b62000116919062000199565b604051809103906000f08015801562000133573d6000803e3d6000fd5b5060601b6001600160601b03191660e05250620001c69050565b61129e806200414d83390190565b600080604083850312156200016e578182fd5b82516200017b81620001ad565b60208401519092506200018e81620001ad565b809150509250929050565b6001600160a01b0391909116815260200190565b6001600160a01b0381168114620001c357600080fd5b50565b60805160a05160601c60c05160601c60e05160601c613f2562000228600039806104c55280610d61528061109052806115f0525080610556528061158b52508061039252806106bc528061099d52508061131e52806123df5250613f256000f3fe6080604052600436106100ec5760003560e01c80639b552cc21161008a578063ed9f35ce11610059578063ed9f35ce14610274578063f698da2514610294578063f84436bd146102a9578063fbfa77cf146102c9576100f3565b80639b552cc2146101ff578063a2a7d51b14610214578063d08d33d114610234578063ec6cb13f14610254576100f3565b80632479fb6e116100c65780632479fb6e1461016557806343218e19146101925780635624b25b146101bf578063845a101f146101df576100f3565b806313d79a0b146100f857806315337bc01461011a5780632335c76b1461013a576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061011861011336600461322e565b6102de565b005b34801561012657600080fd5b50610118610135366004613441565b6105c1565b34801561014657600080fd5b5061014f6106ba565b60405161015c91906136ee565b60405180910390f35b34801561017157600080fd5b506101856101803660046134ca565b6106de565b60405161015c91906137f0565b34801561019e57600080fd5b506101b26101ad3660046131a0565b6106fb565b60405161015c919061380d565b3480156101cb57600080fd5b506101b26101da3660046134fd565b610873565b3480156101eb57600080fd5b506101186101fa36600461338e565b6108e9565b34801561020b57600080fd5b5061014f61108e565b34801561022057600080fd5b5061011861022f3660046131ee565b6110b2565b34801561024057600080fd5b5061018561024f3660046134ca565b6110fb565b34801561026057600080fd5b5061011861026f366004613475565b611118565b34801561028057600080fd5b5061011861028f3660046131ee565b6112d7565b3480156102a057600080fd5b5061018561131c565b3480156102b557600080fd5b506101b26102c43660046131a0565b611340565b3480156102d557600080fd5b5061014f611589565b6002600154141561035057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556040517f02cc250d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906302cc250d906103c79033906004016136ee565b60206040518083038186803b1580156103df57600080fd5b505afa1580156103f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104179190613425565b610456576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c78565b60405180910390fd5b6104728160005b60200281019061046d9190613d16565b6115ad565b6000806104838989898989896116ea565b6040517f7d10d11f000000000000000000000000000000000000000000000000000000008152919350915073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690637d10d11f906104fa90859060040161370f565b600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b5050505061053c8360016003811061045d57fe5b61057c73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001682611851565b61058783600261045d565b60405133907f40338ce1a7c49204f0099533b1e9a7ee0a3d261f84974ab7af36105b8c4e9db490600090a250506001805550505050505050565b60006105cd8383611b2f565b5091505073ffffffffffffffffffffffffffffffffffffffff81163314610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613a1b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600284846040516106539291906136c2565b9081526020016040518091039020819055508073ffffffffffffffffffffffffffffffffffffffff167f875b6cb035bbd4ac6500fabc6d1e4ca5bdc58a3e2b424ccb5c24cdbebeb009a984846040516106ad9291906137f9565b60405180910390a2505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b805160208183018101805160028252928201919093012091525481565b606060008373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061076457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610727565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146107c4576040519150601f19603f3d011682016040523d82523d6000602084013e6107c9565b606091505b50809350819250505061086c82826040516020018083805190602001908083835b6020831061082757805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016107ea565b6001836020036101000a03801982511681845116808217855250505050505090500182151560f81b815260010192505050604051602081830303815290604052611bbd565b5092915050565b606060008260200267ffffffffffffffff8111801561089157600080fd5b506040519080825280601f01601f1916602001820160405280156108bc576020820181803683370190505b50905060005b838110156108df57848101546020808302840101526001016108c2565b5090505b92915050565b6002600154141561095b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556040517f02cc250d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906302cc250d906109d29033906004016136ee565b60206040518083038186803b1580156109ea57600080fd5b505afa1580156109fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a229190613425565b610a58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c78565b6000610a62611bc5565b8051909150610a7382868686611bf2565b60007ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee34677582610100015114610aa8576001610aab565b60005b9050610ab5612f90565b60408085015173ffffffffffffffffffffffffffffffffffffffff90811683526101408501517f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce9081146020850152606080880151909216928401929092526101608501519091149082015260008667ffffffffffffffff81118015610b3a57600080fd5b50604051908082528060200260200182016040528015610b64578160200160208202803683370190505b50610100850151909150610120870135907ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee3467751415610c30578460800151811015610bda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c41565b610be78560600151611c90565b82886000013581518110610bf757fe5b602002602001018181525050610c0c81611c90565b60000382886020013581518110610c1f57fe5b602002602001018181525050610cc0565b8460600151811115610c6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b9c565b610c7781611c90565b82886000013581518110610c8757fe5b602002602001018181525050610ca08560800151611c90565b60000382886020013581518110610cb357fe5b6020026020010181815250505b610cc8612f90565b8660400151816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508560000151816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508560e0015181604001818152505085610140015181606001818152505060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634817a286878f8f8f8f8b8b8f60a001518b6040518a63ffffffff1660e01b8152600401610dcc99989796959493929190613877565b600060405180830381600087803b158015610de657600080fd5b505af1158015610dfa573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610e4091908101906132ed565b90506000886020015190506000610e6d838c6000013581518110610e6057fe5b6020026020010151611d25565b90506000610e94848d6020013581518110610e8457fe5b6020026020010151600003611d25565b9050600283604051610ea691906136d2565b908152602001604051809103902054600014610eee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613bd3565b7ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee3467758a61010001511415610f825789606001518214610f58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613ac0565b8960600151600284604051610f6d91906136d2565b90815260405190819003602001902055610fe5565b89608001518114610fbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613af7565b8960800151600284604051610fd491906136d2565b908152604051908190036020019020555b8a6040015173ffffffffffffffffffffffffffffffffffffffff167fa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc178b600001518c6020015185858f60e001518960405161104596959493929190613820565b60405180910390a260405133907f40338ce1a7c49204f0099533b1e9a7ee0a3d261f84974ab7af36105b8c4e9db490600090a25050600180555050505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b3033146110eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b65565b6110f760008383611d96565b5050565b805160208183018101805160008252928201919093012091525481565b60006111248484611b2f565b5091505073ffffffffffffffffffffffffffffffffffffffff811633146111ac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f475076323a2063616e6e6f74207072657369676e206f72646572000000000000604482015290519081900360640190fd5b8115611206577ff59c009283ff87aa78203fc4d9c2df025ee851130fb69cc3e068941f6b5e2d6f60001c60008585604051808383808284378083019250505092505050908152602001604051809103902081905550611232565b600080858560405180838380828437919091019485525050604051928390036020019092209290925550505b8073ffffffffffffffffffffffffffffffffffffffff167f01bf7c8b0ca55deecbea89d7e58295b7ffbf685fd0d96801034ba8c6ffe1c68d858585604051808060200183151581526020018281038252858582818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201829003965090945050505050a250505050565b303314611310576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b65565b6110f760028383611d96565b7f000000000000000000000000000000000000000000000000000000000000000081565b606060006343218e1960e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113aa578181015183820152602001611392565b50505050905090810190601f1680156113d75780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909816979097178752518151919750309688965090945084935091508083835b602083106114a857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161146b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461150a576040519150601f19603f3d011682016040523d82523d6000602084013e61150f565b606091505b5090508092505060008260018451038151811061152857fe5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600160f81b14905061156b836001855103611e46565b80156115785750506108e3565b61158183611bbd565b505092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60005b818110156116e557368383838181106115c557fe5b90506020028101906115d79190613dde565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001661161d6020830183613184565b73ffffffffffffffffffffffffffffffffffffffff16141561166b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613caf565b61167481611e4a565b6116816020820182613184565b73ffffffffffffffffffffffffffffffffffffffff167fed99827efb37016f2275f98c4bcf71c7551c75d59e9b450f79fa32e60be672c282602001356116c684611ea1565b6040516116d4929190613ce6565b60405180910390a2506001016115b0565b505050565b60608060006116f7611bc5565b90508367ffffffffffffffff8111801561171057600080fd5b5060405190808252806020026020018201604052801561174a57816020015b611737612f90565b81526020019060019003908161172f5790505b5092508367ffffffffffffffff8111801561176457600080fd5b5060405190808252806020026020018201604052801561179e57816020015b61178b612f90565b8152602001906001900390816117835790505b50915060005b8481101561184457368686838181106117b957fe5b90506020028101906117cb9190613e11565b90506117d9838c8c84611bf2565b61183b838a8a84358181106117ea57fe5b905060200201358b8b856020013581811061180157fe5b9050602002013584610120013589878151811061181a57fe5b602002602001015189888151811061182e57fe5b6020026020010151611ecb565b506001016117a4565b5050965096945050505050565b6000815167ffffffffffffffff8111801561186b57600080fd5b506040519080825280602002602001820160405280156118a557816020015b611892612fb7565b81526020019060019003908161188a5790505b5090506000805b8351811015611a935760008482815181106118c357fe5b6020026020010151905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614156119c7577f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce81606001511415611977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613b2e565b8051604080830151905173ffffffffffffffffffffffffffffffffffffffff9092169181156108fc0291906000818181858888f193505050501580156119c1573d6000803e3d6000fd5b50611a8a565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc981606001511415611a2657805160408201516020830151611a219273ffffffffffffffffffffffffffffffffffffffff90911691612216565b611a8a565b6000848480600101955081518110611a3a57fe5b602090810291909101810151600081528382015173ffffffffffffffffffffffffffffffffffffffff90811692820192909252604080850151908201523060608201528351909116608090910152505b506001016118ac565b508015611b2957611aa48282611e46565b6040517f0e8e3e8400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851690630e8e3e8490611af690859060040161375d565b600060405180830381600087803b158015611b1057600080fd5b505af1158015611b24573d6000803e3d6000fd5b505050505b50505050565b6000808060388414611ba257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f475076323a20696e76616c696420756964000000000000000000000000000000604482015290519081900360640190fd5b5050823593602084013560601c936034013560e01c92509050565b805160208201fd5b611bcd612fe7565b6040805160388082526060820190925290602082018180368337505050602082015290565b83516000611c02838686856122ee565b9050600080611c1f8484611c1a610140890189613d7b565b6123d6565b91509150611c4282828660a001518b60200151612485909392919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff81166040890152611c688482612507565b73ffffffffffffffffffffffffffffffffffffffff1660609098019790975250505050505050565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115611d2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f53616665436173743a20696e74323536206f766572666c6f7700000000000000604482015290519081900360640190fd5b5090565b600080821215611d2157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f53616665436173743a206e6f7420706f73697469766500000000000000000000604482015290519081900360640190fd5b60005b81811015611b2957366000848484818110611db057fe5b9050602002810190611dc29190613d7b565b915091506000611dd28383611b2f565b92505050428163ffffffff1610611e15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613c0a565b6000878484604051611e289291906136c2565b90815260405190819003602001902055505060019091019050611d99565b9052565b73ffffffffffffffffffffffffffffffffffffffff8135166020820135366000611e776040860186613d7b565b9150915060405181838237600080838387895af1611e99573d6000803e3d6000fd5b505050505050565b60003681611eb26040850185613d7b565b909250905060048110611ec457813592505b5050919050565b8551602087015160a08201514263ffffffff9091161015611f18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613a52565b6080820151611f279087612539565b6060830151611f369089612539565b1015611f6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613a89565b6000806000807ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775866101000151141561206f5785610120015115611fdb57889350611fd48660600151611fce868960e0015161253990919063ffffffff16565b906125c9565b9150611fea565b856060015193508560e0015191505b611ffe8a611ff8868e612539565b9061264a565b925061202a8460028760405161201491906136d2565b90815260405190819003602001902054906126e8565b9050856060015181111561206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613bd3565b612116565b856101200151156120a35788925061209c8660800151611fce858960e0015161253990919063ffffffff16565b91506120b2565b856080015192508560e0015191505b6120c08b611fce858d612539565b93506120d68360028760405161201491906136d2565b90508560800151811115612116576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044d90613bd3565b61212084836126e8565b93508060028660405161213391906136d2565b9081526020016040518091039020819055508b6040015173ffffffffffffffffffffffffffffffffffffffff167fa07a543ab8a018198e99ca0184c93fe9050a79400a0a723441f84de1d972cc17876000015188602001518787878b6040516121a196959493929190613820565b60405180910390a250506040808b015173ffffffffffffffffffffffffffffffffffffffff9081168852855181166020808a0191909152888301949094526101408601516060988901529a8701518b16865282850151909a169185019190915297830197909752610160015191015250505050565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff84166004830152602482018390529060008060448382895af1612279573d6000803e3d6000fd5b506122838461275c565b611b2957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f475076323a206661696c6564207472616e736665720000000000000000000000604482015290519081900360640190fd5b6000838386358181106122fd57fe5b6020908102929092013573ffffffffffffffffffffffffffffffffffffffff168452508490849087013581811061233057fe5b73ffffffffffffffffffffffffffffffffffffffff602091820293909301358316908501525060408087013590911690830152606080860135908301526080808601359083015263ffffffff60a080870135919091169083015260c0808601359083015260e080860135908301526123ac610100860135612826565b61016087019190915261014086019190915290151561012085015261010090930152509392505050565b600080612403867f000000000000000000000000000000000000000000000000000000000000000061297b565b9150600085600381111561241357fe5b141561242b57612424828585612a05565b905061247c565b600185600381111561243957fe5b141561244a57612424828585612a1a565b600285600381111561245857fe5b141561246957612424828585612a82565b6124798285858960a00151612c20565b90505b94509492505050565b60388451146124f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a2075696420627566666572206f766572666c6f7700000000000000604482015290519081900360640190fd5b60388401526034830152602090910152565b604082015160009073ffffffffffffffffffffffffffffffffffffffff166125305750806108e3565b50506040015190565b600082612548575060006108e3565b8282028284828161255557fe5b04146125c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f536166654d6174683a206d756c206f766572666c6f7700000000000000000000604482015290519081900360640190fd5b9392505050565b600080821161263957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f536166654d6174683a206469766973696f6e2062792030000000000000000000604482015290519081900360640190fd5b81838161264257fe5b049392505050565b60008082116126ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f536166654d6174683a206365696c696e67206469766973696f6e206279203000604482015290519081900360640190fd5b8183816126c357fe5b06156126d05760016126d3565b60005b60ff168284816126df57fe5b04019392505050565b6000828201838110156125c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061279a565b7f08c379a0000000000000000000000000000000000000000000000000000000006000526020600452806024528160445260646000fd5b3d80156127d95760208114612813576127d47f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f612763565b612820565b823b61280a5761280a7f475076323a206e6f74206120636f6e74726163740000000000000000000000006014612763565b60019150612820565b3d6000803e600051151591505b50919050565b6000808080806001861661285c577ff3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee3467759450612880565b7f6ed88e868af0a1983e3886d5f3e95a2fafbd6c3450bc229e27342283dc429ccc94505b6002861615159350600886166128b8577f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9925061290c565b600486166128e8577fabee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea0632925061290c565b7f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce92505b6010861661293c577f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc99150612960565b7f4ac99ace14ee0a5ef932dc609df0943ab7ac16b7583634612f8dc35a4289a6ce91505b600586901c600381111561297057fe5b905091939590929450565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090910180517fd5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e48982526101a0822091526040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b6000612a12848484612de5565b949350505050565b6000808460405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050612a79818585612de5565b95945050505050565b813560601c366000612a978460148188613e68565b604080517f1626ba7e00000000000000000000000000000000000000000000000000000000808252600482018b81526024830193845260448301859052949650929450919273ffffffffffffffffffffffffffffffffffffffff871692631626ba7e928b928892889290606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015612b5d57600080fd5b505afa158015612b71573d6000803e3d6000fd5b505050506040513d6020811015612b8757600080fd5b50517fffffffff000000000000000000000000000000000000000000000000000000001614612c1757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f475076323a20696e76616c69642065697031323731207369676e617475726500604482015290519081900360640190fd5b50509392505050565b600060148314612c9157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f475076323a206d616c666f726d6564207072657369676e617475726500000000604482015290519081900360640190fd5b506040805160388082526060828101909352853590921c9160009190602082018180368337019050509050612cc881878486612485565b7ff59c009283ff87aa78203fc4d9c2df025ee851130fb69cc3e068941f6b5e2d6f60001c6000826040518082805190602001908083835b60208310612d3c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612cff565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390205414612ddc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206f72646572206e6f74207072657369676e656400000000000000604482015290519081900360640190fd5b50949350505050565b600060418214612e5657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f475076323a206d616c666f726d6564206563647361207369676e617475726500604482015290519081900360640190fd5b604080516000815260208181018084528790528286013560f81c82840181905286356060840181905282880135608085018190529451909493919260019260a0808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015612ed9573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015194505073ffffffffffffffffffffffffffffffffffffffff8416612f8657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f475076323a20696e76616c6964206563647361207369676e6174757265000000604482015290519081900360640190fd5b5050509392505050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040805160a081019091528060008152600060208201819052604082018190526060820181905260809091015290565b6040518060800160405280612ffa613014565b815260606020820181905260006040830181905291015290565b6040805161018081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101829052610140810182905261016081019190915290565b60008083601f840112613089578182fd5b50813567ffffffffffffffff8111156130a0578182fd5b60208301915083602080830285010111156130ba57600080fd5b9250929050565b60008083601f8401126130d2578182fd5b50813567ffffffffffffffff8111156130e9578182fd5b6020830191508360208285010111156130ba57600080fd5b600082601f830112613111578081fd5b813567ffffffffffffffff81111561312557fe5b61315660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613e44565b81815284602083860101111561316a578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215613195578081fd5b81356125c281613ebc565b600080604083850312156131b2578081fd5b82356131bd81613ebc565b9150602083013567ffffffffffffffff8111156131d8578182fd5b6131e485828601613101565b9150509250929050565b60008060208385031215613200578182fd5b823567ffffffffffffffff811115613216578283fd5b61322285828601613078565b90969095509350505050565b60008060008060008060006080888a031215613248578283fd5b873567ffffffffffffffff8082111561325f578485fd5b61326b8b838c01613078565b909950975060208a0135915080821115613283578485fd5b61328f8b838c01613078565b909750955060408a01359150808211156132a7578485fd5b6132b38b838c01613078565b909550935060608a01359150808211156132cb578283fd5b508801606081018a10156132dd578182fd5b8091505092959891949750929550565b600060208083850312156132ff578182fd5b825167ffffffffffffffff80821115613316578384fd5b818501915085601f830112613329578384fd5b81518181111561333557fe5b8381029150613345848301613e44565b8181528481019084860184860187018a101561335f578788fd5b8795505b83861015613381578051835260019590950194918601918601613363565b5098975050505050505050565b6000806000806000606086880312156133a5578081fd5b853567ffffffffffffffff808211156133bc578283fd5b6133c889838a01613078565b909750955060208801359150808211156133e0578283fd5b6133ec89838a01613078565b90955093506040880135915080821115613404578283fd5b5086016101608189031215613417578182fd5b809150509295509295909350565b600060208284031215613436578081fd5b81516125c281613ee1565b60008060208385031215613453578182fd5b823567ffffffffffffffff811115613469578283fd5b613222858286016130c1565b600080600060408486031215613489578081fd5b833567ffffffffffffffff81111561349f578182fd5b6134ab868287016130c1565b90945092505060208401356134bf81613ee1565b809150509250925092565b6000602082840312156134db578081fd5b813567ffffffffffffffff8111156134f1578182fd5b612a1284828501613101565b6000806040838503121561350f578182fd5b50508035926020909101359150565b60008284526020808501945082825b8581101561356857813561354081613ebc565b73ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161352d565b509495945050505050565b6000815180845260208085019450808401835b8381101561356857815187529582019590820190600101613586565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b60008151808452613602816020860160208601613e90565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8082511683528060208301511660208401525060408101516040830152606081015160608301525050565b73ffffffffffffffffffffffffffffffffffffffff808251168352602082015115156020840152806040830151166040840152506060810151151560608301525050565b63ffffffff169052565b6000828483379101908152919050565b600082516136e4818460208701613e90565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156137515761373e838551613634565b928401926080929092019160010161372b565b50909695505050505050565b602080825282518282018190526000919060409081850190868401855b828110156137e357815180516004811061379057fe5b85528087015173ffffffffffffffffffffffffffffffffffffffff908116888701528682015187870152606080830151821690870152608091820151169085015260a0909301929085019060010161377a565b5091979650505050505050565b90815260200190565b600060208252612a126020830184866135a2565b6000602082526125c260208301846135ea565b600073ffffffffffffffffffffffffffffffffffffffff808916835280881660208401525085604083015284606083015283608083015260c060a083015261386b60c08301846135ea565b98975050505050505050565b60006101a0820160028c1061388857fe5b8b835260206101a081850152818b83526101c0850190506101c0828d0286010192508c845b8d8110156139b6577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe408786030183527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618f36030182351261390c578586fd5b8e823501803586528481013585870152604081013560408701526060810135606087015260808101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1823603018112613964578788fd5b8101803567ffffffffffffffff81111561397c578889fd5b80360383131561398a578889fd5b60a060808901526139a160a08901828985016135a2565b975050509284019250908301906001016138ad565b5050505082810360408401526139cd81898b61351e565b90506139dc6060840188613674565b82810360e08401526139ee8187613573565b9150506139ff6101008301856136b8565b613a0d610120830184613634565b9a9950505050505050505050565b6020808252601f908201527f475076323a2063616c6c657220646f6573206e6f74206f776e206f7264657200604082015260600190565b60208082526013908201527f475076323a206f72646572206578706972656400000000000000000000000000604082015260600190565b6020808252601f908201527f475076323a206c696d6974207072696365206e6f742072657370656374656400604082015260600190565b6020808252601f908201527f475076323a2073656c6c20616d6f756e74206e6f742072657370656374656400604082015260600190565b6020808252601e908201527f475076323a2062757920616d6f756e74206e6f74207265737065637465640000604082015260600190565b6020808252601e908201527f475076323a20756e737570706f7274656420696e7465726e616c204554480000604082015260600190565b60208082526018908201527f475076323a206e6f7420616e20696e746572616374696f6e0000000000000000604082015260600190565b60208082526014908201527f475076323a206c696d697420746f6f2068696768000000000000000000000000604082015260600190565b60208082526012908201527f475076323a206f726465722066696c6c65640000000000000000000000000000604082015260600190565b60208082526017908201527f475076323a206f72646572207374696c6c2076616c6964000000000000000000604082015260600190565b60208082526013908201527f475076323a206c696d697420746f6f206c6f7700000000000000000000000000604082015260600190565b60208082526012908201527f475076323a206e6f74206120736f6c7665720000000000000000000000000000604082015260600190565b6020808252601b908201527f475076323a20666f7262696464656e20696e746572616374696f6e0000000000604082015260600190565b9182527fffffffff0000000000000000000000000000000000000000000000000000000016602082015260400190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613d4a578283fd5b83018035915067ffffffffffffffff821115613d64578283fd5b60209081019250810236038213156130ba57600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613daf578283fd5b83018035915067ffffffffffffffff821115613dc9578283fd5b6020019150368190038213156130ba57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa18336030181126136e4578182fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffea18336030181126136e4578182fd5b60405181810167ffffffffffffffff81118282101715613e6057fe5b604052919050565b60008085851115613e77578182fd5b83861115613e83578182fd5b5050820193919092039150565b60005b83811015613eab578181015183820152602001613e93565b83811115611b295750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114613ede57600080fd5b50565b8015158114613ede57600080fdfea2646970667358221220de5e493c48a3b42da03a5db89085177b8d8ccec6e9bf6e8e48b3809343624c8f64736f6c6343000706003360c060405234801561001057600080fd5b5060405161129e38038061129e83398101604081905261002f9161004b565b33606090811b6080521b6001600160601b03191660a052610079565b60006020828403121561005c578081fd5b81516001600160a01b0381168114610072578182fd5b9392505050565b60805160601c60a05160601c6111ee6100b060003980610130528061020152806102bd5250806093528061024c52506111ee6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634817a2861461003b5780637d10d11f14610064575b600080fd5b61004e610049366004610cd9565b610079565b60405161005b9190610eb3565b60405180910390f35b610077610072366004610c69565b610234565b005b60603373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146100f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea906110e5565b60405180910390fd5b6040517f945bcec900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063945bcec990610171908c908c908c908c908c908c908c90600401610f59565b600060405180830381600087803b15801561018b57600080fd5b505af115801561019f573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526101e59190810190610bd9565b905061022873ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001683336102e9565b98975050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146102a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea906110e5565b6102e573ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016838333610551565b5050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61030e6040840160208501610bb6565b73ffffffffffffffffffffffffffffffffffffffff16141561035c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea9061111c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9826060013514156103d0576103cb6103986020840184610bb6565b82604085018035906103ad9060208801610bb6565b73ffffffffffffffffffffffffffffffffffffffff16929190610816565b61054c565b604080516001808252818301909252600091816020015b6103ef6109cb565b8152602001906001900390816103e757905050905060008160008151811061041357fe5b602002602001015190507fabee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea063284606001351461044f576002610452565b60035b8190600381111561045f57fe5b9081600381111561046c57fe5b90525061047f6040850160208601610bb6565b73ffffffffffffffffffffffffffffffffffffffff16602080830191909152604080860135908301526104b490850185610bb6565b73ffffffffffffffffffffffffffffffffffffffff908116606083015283811660808301526040517f0e8e3e8400000000000000000000000000000000000000000000000000000000815290861690630e8e3e8490610517908590600401610ec6565b600060405180830381600087803b15801561053157600080fd5b505af1158015610545573d6000803e3d6000fd5b5050505050505b505050565b60008267ffffffffffffffff8111801561056a57600080fd5b506040519080825280602002602001820160405280156105a457816020015b6105916109cb565b8152602001906001900390816105895790505b5090506000805b8481101561077857368686838181106105c057fe5b60800291909101915073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90506105f06040830160208401610bb6565b73ffffffffffffffffffffffffffffffffffffffff16141561063e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ea9061111c565b7f5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9816060013514156106945761068f61067a6020830183610bb6565b86604084018035906103ad9060208701610bb6565b61076f565b60008484806001019550815181106106a857fe5b602002602001015190507fabee3b73373acd583a130924aad6dc38cfdc44ba0555ba94ce2ff63980ea06328260600135146106e45760016106e7565b60035b819060038111156106f457fe5b9081600381111561070157fe5b9052506107146040830160208401610bb6565b73ffffffffffffffffffffffffffffffffffffffff166020808301919091526040808401359083015261074990830183610bb6565b73ffffffffffffffffffffffffffffffffffffffff908116606083015286166080909101525b506001016105ab565b50801561080e5761078982826108fd565b6040517f0e8e3e8400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff871690630e8e3e84906107db908590600401610ec6565b600060405180830381600087803b1580156107f557600080fd5b505af1158015610809573d6000803e3d6000fd5b505050505b505050505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8581166004840152841660248301526044820183905290600080606483828a5af1610881573d6000803e3d6000fd5b5061088b85610901565b6108f657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f475076323a206661696c6564207472616e7366657246726f6d00000000000000604482015290519081900360640190fd5b5050505050565b9052565b600061093f565b7f08c379a0000000000000000000000000000000000000000000000000000000006000526020600452806024528160445260646000fd5b3d801561097e57602081146109b8576109797f475076323a206d616c666f726d6564207472616e7366657220726573756c7400601f610908565b6109c5565b823b6109af576109af7f475076323a206e6f74206120636f6e74726163740000000000000000000000006014610908565b600191506109c5565b3d6000803e600051151591505b50919050565b6040805160a081019091528060008152600060208201819052604082018190526060820181905260809091015290565b600082601f830112610a0b578081fd5b81356020610a20610a1b83611175565b611151565b8281528181019085830183850287018401881015610a3c578586fd5b855b85811015610a63578135610a5181611193565b84529284019290840190600101610a3e565b5090979650505050505050565b600082601f830112610a80578081fd5b81356020610a90610a1b83611175565b8281528181019085830183850287018401881015610aac578586fd5b855b85811015610a6357813584529284019290840190600101610aae565b60008083601f840112610adb578182fd5b50813567ffffffffffffffff811115610af2578182fd5b6020830191508360208083028501011115610b0c57600080fd5b9250929050565b80358015158114610b2357600080fd5b919050565b6000608082840312156109c5578081fd5b600060808284031215610b4a578081fd5b6040516080810181811067ffffffffffffffff82111715610b6757fe5b6040529050808235610b7881611193565b8152610b8660208401610b13565b60208201526040830135610b9981611193565b6040820152610baa60608401610b13565b60608201525092915050565b600060208284031215610bc7578081fd5b8135610bd281611193565b9392505050565b60006020808385031215610beb578182fd5b825167ffffffffffffffff811115610c01578283fd5b8301601f81018513610c11578283fd5b8051610c1f610a1b82611175565b8181528381019083850185840285018601891015610c3b578687fd5b8694505b83851015610c5d578051835260019490940193918501918501610c3f565b50979650505050505050565b60008060208385031215610c7b578081fd5b823567ffffffffffffffff80821115610c92578283fd5b818501915085601f830112610ca5578283fd5b813581811115610cb3578384fd5b866020608083028501011115610cc7578384fd5b60209290920196919550909350505050565b6000806000806000806000806101a0898b031215610cf5578384fd5b883560028110610d03578485fd5b9750602089013567ffffffffffffffff80821115610d1f578586fd5b610d2b8c838d01610aca565b909950975060408b0135915080821115610d43578586fd5b610d4f8c838d016109fb565b9650610d5e8c60608d01610b39565b955060e08b0135915080821115610d73578485fd5b50610d808b828c01610a70565b9350506101008901359150610d998a6101208b01610b28565b90509295985092959890939650565b6000815180845260208085019450808401835b83811015610ded57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101610dbb565b509495945050505050565b6000815180845260208085019450808401835b83811015610ded57815187529582019590820190600101610e0b565b600082845282826020860137806020848601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011685010190509392505050565b73ffffffffffffffffffffffffffffffffffffffff808251168352602082015115156020840152806040830151166040840152506060810151151560608301525050565b600060208252610bd26020830184610df8565b602080825282518282018190526000919060409081850190868401855b82811015610f4c578151805160048110610ef957fe5b85528087015173ffffffffffffffffffffffffffffffffffffffff908116888701528682015187870152606080830151821690870152608091820151169085015260a09093019290850190600101610ee3565b5091979650505050505050565b600061012080830160028b10610f6b57fe5b8a8452602080850192909252889052610140808401918981028501909101908a845b8b811015611098577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec087850301855281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618e3603018112610fed578687fd5b8d01803585528381013584860152604080820135908601526060808201359086015260a0608080830135368490037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe101811261104757898afd5b8301803567ffffffffffffffff81111561105f578a8bfd5b80360385131561106d578a8bfd5b83838a0152611081848a01828a8501610e27565b998801999850505093850193505050600101610f8d565b50505083810360408501526110ad8189610da8565b9150506110bd6060840187610e6f565b82810360e08401526110cf8186610df8565b9150508261010083015298975050505050505050565b60208082526011908201527f475076323a206e6f742063726561746f72000000000000000000000000000000604082015260600190565b6020808252818101527f475076323a2063616e6e6f74207472616e73666572206e617469766520455448604082015260600190565b60405181810167ffffffffffffffff8111828210171561116d57fe5b604052919050565b600067ffffffffffffffff82111561118957fe5b5060209081020190565b73ffffffffffffffffffffffffffffffffffffffff811681146111b557600080fd5b5056fea2646970667358221220364a6941bea69620b7dc3a957d0ab4cbf3bfc459c7ad3924d220620aca9202fc64736f6c63430007060033", + "devdoc": { + "author": "Gnosis Developers", + "events": { + "Interaction(address,uint256,bytes4)": { + "details": "Event emitted for each executed interaction. For gas effeciency, only the interaction calldata selector (first 4 bytes) is included in the event. For interactions without calldata or whose calldata is shorter than 4 bytes, the selector will be `0`." + }, + "OrderInvalidated(address,bytes)": { + "details": "Event emitted when an order is invalidated." + }, + "Settlement(address)": { + "details": "Event emitted when a settlement complets" + }, + "Trade(address,address,address,uint256,uint256,uint256,bytes)": { + "details": "Event emitted for each executed trade." + } + }, + "kind": "dev", + "methods": { + "freeFilledAmountStorage(bytes[])": { + "details": "Free storage from the filled amounts of **expired** orders to claim a gas refund. This method can only be called as an interaction.", + "params": { + "orderUids": "The unique identifiers of the expired order to free storage for." + } + }, + "freePreSignatureStorage(bytes[])": { + "details": "Free storage from the pre signatures of **expired** orders to claim a gas refund. This method can only be called as an interaction.", + "params": { + "orderUids": "The unique identifiers of the expired order to free storage for." + } + }, + "getStorageAt(uint256,uint256)": { + "details": "Reads `length` bytes of storage in the currents contract", + "params": { + "length": "- the number of words (32 bytes) of data to read", + "offset": "- the offset in the current contract's storage in words to start reading from" + }, + "returns": { + "_0": "the bytes that were read." + } + }, + "invalidateOrder(bytes)": { + "details": "Invalidate onchain an order that has been signed offline.", + "params": { + "orderUid": "The unique identifier of the order that is to be made invalid after calling this function. The user that created the order must be the the sender of this message. See [`extractOrderUidParams`] for details on orderUid." + } + }, + "setPreSignature(bytes,bool)": { + "details": "Sets a presignature for the specified order UID.", + "params": { + "orderUid": "The unique identifier of the order to pre-sign." + } + }, + "settle(address[],uint256[],(uint256,uint256,address,uint256,uint256,uint32,bytes32,uint256,uint256,uint256,bytes)[],(address,uint256,bytes)[][3])": { + "details": "Settle the specified orders at a clearing price. Note that it is the responsibility of the caller to ensure that all GPv2 invariants are upheld for the input settlement, otherwise this call will revert. Namely: - All orders are valid and signed - Accounts have sufficient balance and approval. - Settlement contract has sufficient balance to execute trades. Note this implies that the accumulated fees held in the contract can also be used for settlement. This is OK since: - Solvers need to be authorized - Misbehaving solvers will be slashed for abusing accumulated fees for settlement - Critically, user orders are entirely protected", + "params": { + "clearingPrices": "An array of clearing prices where the `i`-th price is for the `i`-th token in the [`tokens`] array.", + "interactions": "Smart contract interactions split into three separate lists to be run before the settlement, during the settlement and after the settlement respectively.", + "tokens": "An array of ERC20 tokens to be traded in the settlement. Trades encode tokens as indices into this array.", + "trades": "Trades for signed orders." + } + }, + "simulateDelegatecall(address,bytes)": { + "details": "Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.", + "params": { + "calldataPayload": "Calldata that should be sent to the target contract (encoded method name and arguments).", + "targetContract": "Address of the contract containing the code to execute." + } + }, + "simulateDelegatecallInternal(address,bytes)": { + "details": "Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Returns encoded result as revert message concatenated with the success flag of the inner call as a last byte.", + "params": { + "calldataPayload": "Calldata that should be sent to the target contract (encoded method name and arguments).", + "targetContract": "Address of the contract containing the code to execute." + } + }, + "swap((bytes32,uint256,uint256,uint256,bytes)[],address[],(uint256,uint256,address,uint256,uint256,uint32,bytes32,uint256,uint256,uint256,bytes))": { + "details": "Settle an order directly against Balancer V2 pools.", + "params": { + "swaps": "The Balancer V2 swap steps to use for trading.", + "tokens": "An array of ERC20 tokens to be traded in the settlement. Swaps and the trade encode tokens as indices into this array.", + "trade": "The trade to match directly against Balancer liquidity. The order will always be fully executed, so the trade's `executedAmount` field is used to represent a swap limit amount." + } + } + }, + "stateVariables": { + "authenticator": { + "details": "The authenticator is used to determine who can call the settle function. That is, only authorised solvers have the ability to invoke settlements. Any valid authenticator implements an isSolver method called by the onlySolver modifier below." + }, + "filledAmount": { + "details": "Map each user order by UID to the amount that has been filled so far. If this amount is larger than or equal to the amount traded in the order (amount sold for sell orders, amount bought for buy orders) then the order cannot be traded anymore. If the order is fill or kill, then this value is only used to determine whether the order has already been executed." + }, + "vault": { + "details": "The Balancer Vault the protocol uses for managing user funds." + }, + "vaultRelayer": { + "details": "The Balancer Vault relayer which can interact on behalf of users. This contract is created during deployment" + } + }, + "title": "Gnosis Protocol v2 Settlement Contract", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } +} diff --git a/crates/contracts/artifacts/GasHog.json b/crates/contracts/artifacts/GasHog.json index 7cce24e6d4..ce586fb433 100644 --- a/crates/contracts/artifacts/GasHog.json +++ b/crates/contracts/artifacts/GasHog.json @@ -1 +1,59 @@ -{"abi":[{"inputs":[{"internalType":"contract ERC20","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"order","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610318806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e1f21c6714610083575b600080fd5b61004e6100493660046101d0565b610098565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b610096610091366004610271565b610143565b005b6000805a905060006100ac848601866102b2565b90507fce7d7369855be79904099402d83db6d6ab8840dcd5c086e062cd1ca0c8111dfc5b815a6100dc90856102cb565b101561010b576040805160208101839052016040516020818303038152906040528051906020012090506100d0565b86810361011757600080fd5b507f1626ba7e000000000000000000000000000000000000000000000000000000009695505050505050565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b390604401600060405180830381600087803b1580156101b357600080fd5b505af11580156101c7573d6000803e3d6000fd5b50505050505050565b6000806000604084860312156101e557600080fd5b83359250602084013567ffffffffffffffff8082111561020457600080fd5b818601915086601f83011261021857600080fd5b81358181111561022757600080fd5b87602082850101111561023957600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff8116811461026e57600080fd5b50565b60008060006060848603121561028657600080fd5b83356102918161024c565b925060208401356102a18161024c565b929592945050506040919091013590565b6000602082840312156102c457600080fd5b5035919050565b81810381811115610305577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000811000a","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e1f21c6714610083575b600080fd5b61004e6100493660046101d0565b610098565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b610096610091366004610271565b610143565b005b6000805a905060006100ac848601866102b2565b90507fce7d7369855be79904099402d83db6d6ab8840dcd5c086e062cd1ca0c8111dfc5b815a6100dc90856102cb565b101561010b576040805160208101839052016040516020818303038152906040528051906020012090506100d0565b86810361011757600080fd5b507f1626ba7e000000000000000000000000000000000000000000000000000000009695505050505050565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b390604401600060405180830381600087803b1580156101b357600080fd5b505af11580156101c7573d6000803e3d6000fd5b50505050505050565b6000806000604084860312156101e557600080fd5b83359250602084013567ffffffffffffffff8082111561020457600080fd5b818601915086601f83011261021857600080fd5b81358181111561022757600080fd5b87602082850101111561023957600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff8116811461026e57600080fd5b50565b60008060006060848603121561028657600080fd5b83356102918161024c565b925060208401356102a18161024c565b929592945050506040919091013590565b6000602082840312156102c457600080fd5b5035919050565b81810381811115610305577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000811000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "order", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610318806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e1f21c6714610083575b600080fd5b61004e6100493660046101d0565b610098565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b610096610091366004610271565b610143565b005b6000805a905060006100ac848601866102b2565b90507fce7d7369855be79904099402d83db6d6ab8840dcd5c086e062cd1ca0c8111dfc5b815a6100dc90856102cb565b101561010b576040805160208101839052016040516020818303038152906040528051906020012090506100d0565b86810361011757600080fd5b507f1626ba7e000000000000000000000000000000000000000000000000000000009695505050505050565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b390604401600060405180830381600087803b1580156101b357600080fd5b505af11580156101c7573d6000803e3d6000fd5b50505050505050565b6000806000604084860312156101e557600080fd5b83359250602084013567ffffffffffffffff8082111561020457600080fd5b818601915086601f83011261021857600080fd5b81358181111561022757600080fd5b87602082850101111561023957600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff8116811461026e57600080fd5b50565b60008060006060848603121561028657600080fd5b83356102918161024c565b925060208401356102a18161024c565b929592945050506040919091013590565b6000602082840312156102c457600080fd5b5035919050565b81810381811115610305577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000811000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e1f21c6714610083575b600080fd5b61004e6100493660046101d0565b610098565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b610096610091366004610271565b610143565b005b6000805a905060006100ac848601866102b2565b90507fce7d7369855be79904099402d83db6d6ab8840dcd5c086e062cd1ca0c8111dfc5b815a6100dc90856102cb565b101561010b576040805160208101839052016040516020818303038152906040528051906020012090506100d0565b86810361011757600080fd5b507f1626ba7e000000000000000000000000000000000000000000000000000000009695505050505050565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b390604401600060405180830381600087803b1580156101b357600080fd5b505af11580156101c7573d6000803e3d6000fd5b50505050505050565b6000806000604084860312156101e557600080fd5b83359250602084013567ffffffffffffffff8082111561020457600080fd5b818601915086601f83011261021857600080fd5b81358181111561022757600080fd5b87602082850101111561023957600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff8116811461026e57600080fd5b50565b60008060006060848603121561028657600080fd5b83356102918161024c565b925060208401356102a18161024c565b929592945050506040919091013590565b6000602082840312156102c457600080fd5b5035919050565b81810381811115610305577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea164736f6c6343000811000a", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/artifacts/GnosisSafe.json b/crates/contracts/artifacts/GnosisSafe.json index 4947c19f05..95d2b91459 100644 --- a/crates/contracts/artifacts/GnosisSafe.json +++ b/crates/contracts/artifacts/GnosisSafe.json @@ -1 +1,1036 @@ -{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"AddedOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"approvedHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"ApproveHash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"handler","type":"address"}],"name":"ChangedFallbackHandler","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"guard","type":"address"}],"name":"ChangedGuard","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"}],"name":"ChangedThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"DisabledModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"EnabledModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"txHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"}],"name":"ExecutionFailure","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"module","type":"address"}],"name":"ExecutionFromModuleFailure","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"module","type":"address"}],"name":"ExecutionFromModuleSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"txHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"}],"name":"ExecutionSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"RemovedOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"initiator","type":"address"},{"indexed":false,"internalType":"address[]","name":"owners","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"},{"indexed":false,"internalType":"address","name":"initializer","type":"address"},{"indexed":false,"internalType":"address","name":"fallbackHandler","type":"address"}],"name":"SafeSetup","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"msgHash","type":"bytes32"}],"name":"SignMsg","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"_threshold","type":"uint256"}],"name":"addOwnerWithThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hashToApprove","type":"bytes32"}],"name":"approveHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"approvedHashes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_threshold","type":"uint256"}],"name":"changeThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dataHash","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes","name":"signatures","type":"bytes"},{"internalType":"uint256","name":"requiredSignatures","type":"uint256"}],"name":"checkNSignatures","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dataHash","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes","name":"signatures","type":"bytes"}],"name":"checkSignatures","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"prevModule","type":"address"},{"internalType":"address","name":"module","type":"address"}],"name":"disableModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"enableModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"},{"internalType":"uint256","name":"safeTxGas","type":"uint256"},{"internalType":"uint256","name":"baseGas","type":"uint256"},{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"address","name":"gasToken","type":"address"},{"internalType":"address","name":"refundReceiver","type":"address"},{"internalType":"uint256","name":"_nonce","type":"uint256"}],"name":"encodeTransactionData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"},{"internalType":"uint256","name":"safeTxGas","type":"uint256"},{"internalType":"uint256","name":"baseGas","type":"uint256"},{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"address","name":"gasToken","type":"address"},{"internalType":"address payable","name":"refundReceiver","type":"address"},{"internalType":"bytes","name":"signatures","type":"bytes"}],"name":"execTransaction","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"}],"name":"execTransactionFromModule","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"}],"name":"execTransactionFromModuleReturnData","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"start","type":"address"},{"internalType":"uint256","name":"pageSize","type":"uint256"}],"name":"getModulesPaginated","outputs":[{"internalType":"address[]","name":"array","type":"address[]"},{"internalType":"address","name":"next","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"length","type":"uint256"}],"name":"getStorageAt","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"},{"internalType":"uint256","name":"safeTxGas","type":"uint256"},{"internalType":"uint256","name":"baseGas","type":"uint256"},{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"address","name":"gasToken","type":"address"},{"internalType":"address","name":"refundReceiver","type":"address"},{"internalType":"uint256","name":"_nonce","type":"uint256"}],"name":"getTransactionHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"isModuleEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"prevOwner","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"_threshold","type":"uint256"}],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"operation","type":"uint8"}],"name":"requiredTxGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"handler","type":"address"}],"name":"setFallbackHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"guard","type":"address"}],"name":"setGuard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256","name":"_threshold","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"fallbackHandler","type":"address"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"payment","type":"uint256"},{"internalType":"address payable","name":"paymentReceiver","type":"address"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"signedMessages","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulateAndRevert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"prevOwner","type":"address"},{"internalType":"address","name":"oldOwner","type":"address"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"swapOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"0x608060405234801561001057600080fd5b5060016004819055506159ae80620000296000396000f3fe6080604052600436106101dc5760003560e01c8063affed0e011610102578063e19a9dd911610095578063f08a032311610064578063f08a032314611647578063f698da2514611698578063f8dc5dd9146116c3578063ffa1ad741461173e57610231565b8063e19a9dd91461139b578063e318b52b146113ec578063e75235b81461147d578063e86637db146114a857610231565b8063cc2f8452116100d1578063cc2f8452146110e8578063d4d9bdcd146111b5578063d8d11f78146111f0578063e009cfde1461132a57610231565b8063affed0e014610d94578063b4faba0914610dbf578063b63e800d14610ea7578063c4ca3a9c1461101757610231565b80635624b25b1161017a5780636a761202116101495780636a761202146109945780637d83297414610b50578063934f3a1114610bbf578063a0e67e2b14610d2857610231565b80635624b25b146107fb5780635ae6bd37146108b9578063610b592514610908578063694e80c31461095957610231565b80632f54bf6e116101b65780632f54bf6e146104d35780633408e4701461053a578063468721a7146105655780635229073f1461067a57610231565b80630d582f131461029e57806312fb68e0146102f95780632d9ad53d1461046c57610231565b36610231573373ffffffffffffffffffffffffffffffffffffffff167f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d346040518082815260200191505060405180910390a2005b34801561023d57600080fd5b5060007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b905080548061027257600080f35b36600080373360601b365260008060143601600080855af13d6000803e80610299573d6000fd5b3d6000f35b3480156102aa57600080fd5b506102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117ce565b005b34801561030557600080fd5b5061046a6004803603608081101561031c57600080fd5b81019080803590602001909291908035906020019064010000000081111561034357600080fd5b82018360208201111561035557600080fd5b8035906020019184600183028401116401000000008311171561037757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156103da57600080fd5b8201836020820111156103ec57600080fd5b8035906020019184600183028401116401000000008311171561040e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611bbe565b005b34801561047857600080fd5b506104bb6004803603602081101561048f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612440565b60405180821515815260200191505060405180910390f35b3480156104df57600080fd5b50610522600480360360208110156104f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612512565b60405180821515815260200191505060405180910390f35b34801561054657600080fd5b5061054f6125e4565b6040518082815260200191505060405180910390f35b34801561057157600080fd5b506106626004803603608081101561058857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105cf57600080fd5b8201836020820111156105e157600080fd5b8035906020019184600183028401116401000000008311171561060357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506125f1565b60405180821515815260200191505060405180910390f35b34801561068657600080fd5b506107776004803603608081101561069d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e457600080fd5b8201836020820111156106f657600080fd5b8035906020019184600183028401116401000000008311171561071857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506127d7565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b838110156107bf5780820151818401526020810190506107a4565b50505050905090810190601f1680156107ec5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561080757600080fd5b5061083e6004803603604081101561081e57600080fd5b81019080803590602001909291908035906020019092919050505061280d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561087e578082015181840152602081019050610863565b50505050905090810190601f1680156108ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108c557600080fd5b506108f2600480360360208110156108dc57600080fd5b8101908080359060200190929190505050612894565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128ac565b005b34801561096557600080fd5b506109926004803603602081101561097c57600080fd5b8101908080359060200190929190505050612c3e565b005b610b3860048036036101408110156109ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109f257600080fd5b820183602082011115610a0457600080fd5b80359060200191846001830284011164010000000083111715610a2657600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610ab257600080fd5b820183602082011115610ac457600080fd5b80359060200191846001830284011164010000000083111715610ae657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612d78565b60405180821515815260200191505060405180910390f35b348015610b5c57600080fd5b50610ba960048036036040811015610b7357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506132b5565b6040518082815260200191505060405180910390f35b348015610bcb57600080fd5b50610d2660048036036060811015610be257600080fd5b810190808035906020019092919080359060200190640100000000811115610c0957600080fd5b820183602082011115610c1b57600080fd5b80359060200191846001830284011164010000000083111715610c3d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610ca057600080fd5b820183602082011115610cb257600080fd5b80359060200191846001830284011164010000000083111715610cd457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506132da565b005b348015610d3457600080fd5b50610d3d613369565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610d80578082015181840152602081019050610d65565b505050509050019250505060405180910390f35b348015610da057600080fd5b50610da9613512565b6040518082815260200191505060405180910390f35b348015610dcb57600080fd5b50610ea560048036036040811015610de257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610e1f57600080fd5b820183602082011115610e3157600080fd5b80359060200191846001830284011164010000000083111715610e5357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050613518565b005b348015610eb357600080fd5b506110156004803603610100811015610ecb57600080fd5b8101908080359060200190640100000000811115610ee857600080fd5b820183602082011115610efa57600080fd5b80359060200191846020830284011164010000000083111715610f1c57600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610f6757600080fd5b820183602082011115610f7957600080fd5b80359060200191846001830284011164010000000083111715610f9b57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061353a565b005b34801561102357600080fd5b506110d26004803603608081101561103a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561108157600080fd5b82018360208201111561109357600080fd5b803590602001918460018302840111640100000000831117156110b557600080fd5b9091929391929390803560ff1690602001909291905050506136f8565b6040518082815260200191505060405180910390f35b3480156110f457600080fd5b506111416004803603604081101561110b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613820565b60405180806020018373ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b838110156111a0578082015181840152602081019050611185565b50505050905001935050505060405180910390f35b3480156111c157600080fd5b506111ee600480360360208110156111d857600080fd5b8101908080359060200190929190505050613a12565b005b3480156111fc57600080fd5b50611314600480360361014081101561121457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561125b57600080fd5b82018360208201111561126d57600080fd5b8035906020019184600183028401116401000000008311171561128f57600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613bb1565b6040518082815260200191505060405180910390f35b34801561133657600080fd5b506113996004803603604081101561134d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613bde565b005b3480156113a757600080fd5b506113ea600480360360208110156113be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613f6f565b005b3480156113f857600080fd5b5061147b6004803603606081101561140f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613ff3565b005b34801561148957600080fd5b50611492614665565b6040518082815260200191505060405180910390f35b3480156114b457600080fd5b506115cc60048036036101408110156114cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561151357600080fd5b82018360208201111561152557600080fd5b8035906020019184600183028401116401000000008311171561154757600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061466f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561160c5780820151818401526020810190506115f1565b50505050905090810190601f1680156116395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561165357600080fd5b506116966004803603602081101561166a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614817565b005b3480156116a457600080fd5b506116ad614878565b6040518082815260200191505060405180910390f35b3480156116cf57600080fd5b5061173c600480360360608110156116e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506148f6565b005b34801561174a57600080fd5b50611753614d29565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611793578082015181840152602081019050611778565b50505050905090810190601f1680156117c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6117d6614d62565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156118405750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561187857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003600081548092919060010191905055507f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2682604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414611bba57611bb981612c3e565b5b5050565b611bd2604182614e0590919063ffffffff16565b82511015611c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000808060008060005b8681101561243457611c648882614e3f565b80945081955082965050505060008460ff16141561206d578260001c9450611c96604188614e0590919063ffffffff16565b8260001c1015611d0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8751611d2760208460001c614e6e90919063ffffffff16565b1115611d9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006020838a01015190508851611dd182611dc360208760001c614e6e90919063ffffffff16565b614e6e90919063ffffffff16565b1115611e45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606020848b010190506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168773ffffffffffffffffffffffffffffffffffffffff166320c13b0b8d846040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b83811015611ee7578082015181840152602081019050611ecc565b50505050905090810190601f168015611f145780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611f4d578082015181840152602081019050611f32565b50505050905090810190601f168015611f7a5780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b158015611f9957600080fd5b505afa158015611fad573d6000803e3d6000fd5b505050506040513d6020811015611fc357600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612066576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b50506122b2565b60018460ff161415612181578260001c94508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061210a57506000600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c81526020019081526020016000205414155b61217c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6122b1565b601e8460ff1611156122495760018a60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048603858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612238573d6000803e3d6000fd5b5050506020604051035194506122b0565b60018a85858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156122a3573d6000803e3d6000fd5b5050506020604051035194505b5b5b8573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161180156123795750600073ffffffffffffffffffffffffffffffffffffffff16600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80156123b25750600173ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b612424576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323600000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8495508080600101915050611c52565b50505050505050505050565b60008173ffffffffffffffffffffffffffffffffffffffff16600173ffffffffffffffffffffffffffffffffffffffff161415801561250b5750600073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156125dd5750600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000804690508091505090565b6000600173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126bc5750600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b61272e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61273b858585855a614e8d565b9050801561278b573373ffffffffffffffffffffffffffffffffffffffff167f6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb860405160405180910390a26127cf565b3373ffffffffffffffffffffffffffffffffffffffff167facd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd37560405160405180910390a25b949350505050565b600060606127e7868686866125f1565b915060405160203d0181016040523d81523d6000602083013e8091505094509492505050565b606060006020830267ffffffffffffffff8111801561282b57600080fd5b506040519080825280601f01601f19166020018201604052801561285e5781602001600182028036833780820191505090505b50905060005b8381101561288957808501548060208302602085010152508080600101915050612864565b508091505092915050565b60076020528060005260406000206000915090505481565b6128b4614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561291e5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b612990576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f844081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b612c46614d62565b600354811115612cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001811015612d35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806004819055507f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c936004546040518082815260200191505060405180910390a150565b6000806000612d928e8e8e8e8e8e8e8e8e8e60055461466f565b905060056000815480929190600101919050555080805190602001209150612dbb8282866132da565b506000612dc6614ed9565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612fac578073ffffffffffffffffffffffffffffffffffffffff166375f0bb528f8f8f8f8f8f8f8f8f8f8f336040518d63ffffffff1660e01b8152600401808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001806020018a6001811115612e6957fe5b81526020018981526020018881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001806020018473ffffffffffffffffffffffffffffffffffffffff16815260200183810383528d8d82818152602001925080828437600081840152601f19601f820116905080830192505050838103825285818151815260200191508051906020019080838360005b83811015612f3b578082015181840152602081019050612f20565b50505050905090810190601f168015612f685780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b158015612f9357600080fd5b505af1158015612fa7573d6000803e3d6000fd5b505050505b6101f4612fd36109c48b01603f60408d0281612fc457fe5b04614f0a90919063ffffffff16565b015a1015613049576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005a90506130b28f8f8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e60008d146130a7578e6130ad565b6109c45a035b614e8d565b93506130c75a82614f2490919063ffffffff16565b905083806130d6575060008a14155b806130e2575060008814155b613154576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008089111561316e5761316b828b8b8b8b614f44565b90505b84156131b8577f442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e8482604051808381526020018281526020019250505060405180910390a16131f8565b7f23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d238482604051808381526020018281526020019250505060405180910390a15b5050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146132a4578073ffffffffffffffffffffffffffffffffffffffff16639327136883856040518363ffffffff1660e01b815260040180838152602001821515815260200192505050600060405180830381600087803b15801561328b57600080fd5b505af115801561329f573d6000803e3d6000fd5b505050505b50509b9a5050505050505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b6000600454905060008111613357576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61336384848484611bbe565b50505050565b6060600060035467ffffffffffffffff8111801561338657600080fd5b506040519080825280602002602001820160405280156133b55781602001602082028036833780820191505090505b50905060008060026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613509578083838151811061346057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050818060010192505061341f565b82935050505090565b60055481565b600080825160208401855af4806000523d6020523d600060403e60403d016000fd5b6135858a8a80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508961514a565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146135c3576135c28461564a565b5b6136118787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050615679565b600082111561362b5761362982600060018685614f44565b505b3373ffffffffffffffffffffffffffffffffffffffff167f141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a88b8b8b8b8960405180806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281038252878782818152602001925060200280828437600081840152601f19601f820116905080830192505050965050505050505060405180910390a250505050505050505050565b6000805a905061374f878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050865a614e8d565b61375857600080fd5b60005a8203905080604051602001808281526020019150506040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137e55780820151818401526020810190506137ca565b50505050905090810190601f1680156138125780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b606060008267ffffffffffffffff8111801561383b57600080fd5b5060405190808252806020026020018201604052801561386a5781602001602082028036833780820191505090505b509150600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561393d5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561394857508482105b15613a03578084838151811061395a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081806001019250506138d3565b80925081845250509250929050565b600073ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613b14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16817ff2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c60405160405180910390a350565b6000613bc68c8c8c8c8c8c8c8c8c8c8c61466f565b8051906020012090509b9a5050505050505050505050565b613be6614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613c505750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b613cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613dc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507faab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace405427681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613f77614d62565b60007f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b90508181557f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa282604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613ffb614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156140655750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561409d57503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b61410f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614210576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561427a5750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6142ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146143ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a17f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1505050565b6000600454905090565b606060007fbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d860001b8d8d8d8d60405180838380828437808301925050509250505060405180910390208c8c8c8c8c8c8c604051602001808c81526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a815260200189815260200188600181111561470057fe5b81526020018781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019b505050505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b61478c614878565b8360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040529150509b9a5050505050505050505050565b61481f614d62565b6148288161564a565b7f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b6148a66125e4565b30604051602001808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405160208183030381529060405280519060200120905090565b6148fe614d62565b806001600354031015614979576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156149e35750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b614a55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360008154809291906001900391905055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414614d2457614d2381612c3e565b5b505050565b6040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614614e03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b565b600080831415614e185760009050614e39565b6000828402905082848281614e2957fe5b0414614e3457600080fd5b809150505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b600080828401905083811015614e8357600080fd5b8091505092915050565b6000600180811115614e9b57fe5b836001811115614ea757fe5b1415614ec0576000808551602087018986f49050614ed0565b600080855160208701888a87f190505b95945050505050565b6000807f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b9050805491505090565b600081831015614f1a5781614f1c565b825b905092915050565b600082821115614f3357600080fd5b600082840390508091505092915050565b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614614f815782614f83565b325b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561509b57614fed3a8610614fca573a614fcc565b855b614fdf888a614e6e90919063ffffffff16565b614e0590919063ffffffff16565b91508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050615096576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b615140565b6150c0856150b2888a614e6e90919063ffffffff16565b614e0590919063ffffffff16565b91506150cd8482846158b4565b61513f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5095945050505050565b6000600454146151c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8151811115615239576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018110156152b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006001905060005b83518110156155b65760008482815181106152d057fe5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156153445750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561537c57503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b80156153b457508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b615426576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614615527576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508092505080806001019150506152b9565b506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825160038190555081600481905550505050565b60007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b90508181555050565b600073ffffffffffffffffffffffffffffffffffffffff1660016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461577b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001806000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146158b05761583d8260008360015a614e8d565b6158af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5050565b60008063a9059cbb8484604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050602060008251602084016000896127105a03f13d6000811461595b5760208114615963576000935061596e565b81935061596e565b600051158215171593505b505050939250505056fea26469706673582212203874bcf92e1722cc7bfa0cef1a0985cf0dc3485ba0663db3747ccdf1605df53464736f6c63430007060033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "AddedOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "approvedHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ApproveHash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "handler", + "type": "address" + } + ], + "name": "ChangedFallbackHandler", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + } + ], + "name": "ChangedThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "DisabledModule", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "EnabledModule", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "payment", + "type": "uint256" + } + ], + "name": "ExecutionFailure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "ExecutionFromModuleFailure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "ExecutionFromModuleSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "payment", + "type": "uint256" + } + ], + "name": "ExecutionSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "RemovedOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "owners", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "initializer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "fallbackHandler", + "type": "address" + } + ], + "name": "SafeSetup", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "msgHash", + "type": "bytes32" + } + ], + "name": "SignMsg", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "addOwnerWithThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashToApprove", + "type": "bytes32" + } + ], + "name": "approveHash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "approvedHashes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "changeThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "requiredSignatures", + "type": "uint256" + } + ], + "name": "checkNSignatures", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "checkSignatures", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevModule", + "type": "address" + }, + { + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "disableModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "enableModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "safeTxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "gasToken", + "type": "address" + }, + { + "internalType": "address", + "name": "refundReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "encodeTransactionData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "safeTxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "gasToken", + "type": "address" + }, + { + "internalType": "address payable", + "name": "refundReceiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "execTransaction", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + } + ], + "name": "execTransactionFromModule", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + } + ], + "name": "execTransactionFromModuleReturnData", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "start", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getModulesPaginated", + "outputs": [ + { + "internalType": "address[]", + "name": "array", + "type": "address[]" + }, + { + "internalType": "address", + "name": "next", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwners", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "getStorageAt", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "safeTxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "gasToken", + "type": "address" + }, + { + "internalType": "address", + "name": "refundReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "getTransactionHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "isModuleEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "removeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + } + ], + "name": "requiredTxGas", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "handler", + "type": "address" + } + ], + "name": "setFallbackHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_owners", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "fallbackHandler", + "type": "address" + }, + { + "internalType": "address", + "name": "paymentToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "payment", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "paymentReceiver", + "type": "address" + } + ], + "name": "setup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "signedMessages", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateAndRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "swapOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5060016004819055506159ae80620000296000396000f3fe6080604052600436106101dc5760003560e01c8063affed0e011610102578063e19a9dd911610095578063f08a032311610064578063f08a032314611647578063f698da2514611698578063f8dc5dd9146116c3578063ffa1ad741461173e57610231565b8063e19a9dd91461139b578063e318b52b146113ec578063e75235b81461147d578063e86637db146114a857610231565b8063cc2f8452116100d1578063cc2f8452146110e8578063d4d9bdcd146111b5578063d8d11f78146111f0578063e009cfde1461132a57610231565b8063affed0e014610d94578063b4faba0914610dbf578063b63e800d14610ea7578063c4ca3a9c1461101757610231565b80635624b25b1161017a5780636a761202116101495780636a761202146109945780637d83297414610b50578063934f3a1114610bbf578063a0e67e2b14610d2857610231565b80635624b25b146107fb5780635ae6bd37146108b9578063610b592514610908578063694e80c31461095957610231565b80632f54bf6e116101b65780632f54bf6e146104d35780633408e4701461053a578063468721a7146105655780635229073f1461067a57610231565b80630d582f131461029e57806312fb68e0146102f95780632d9ad53d1461046c57610231565b36610231573373ffffffffffffffffffffffffffffffffffffffff167f3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d346040518082815260200191505060405180910390a2005b34801561023d57600080fd5b5060007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b905080548061027257600080f35b36600080373360601b365260008060143601600080855af13d6000803e80610299573d6000fd5b3d6000f35b3480156102aa57600080fd5b506102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117ce565b005b34801561030557600080fd5b5061046a6004803603608081101561031c57600080fd5b81019080803590602001909291908035906020019064010000000081111561034357600080fd5b82018360208201111561035557600080fd5b8035906020019184600183028401116401000000008311171561037757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156103da57600080fd5b8201836020820111156103ec57600080fd5b8035906020019184600183028401116401000000008311171561040e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611bbe565b005b34801561047857600080fd5b506104bb6004803603602081101561048f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612440565b60405180821515815260200191505060405180910390f35b3480156104df57600080fd5b50610522600480360360208110156104f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612512565b60405180821515815260200191505060405180910390f35b34801561054657600080fd5b5061054f6125e4565b6040518082815260200191505060405180910390f35b34801561057157600080fd5b506106626004803603608081101561058857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105cf57600080fd5b8201836020820111156105e157600080fd5b8035906020019184600183028401116401000000008311171561060357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506125f1565b60405180821515815260200191505060405180910390f35b34801561068657600080fd5b506107776004803603608081101561069d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156106e457600080fd5b8201836020820111156106f657600080fd5b8035906020019184600183028401116401000000008311171561071857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803560ff1690602001909291905050506127d7565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b838110156107bf5780820151818401526020810190506107a4565b50505050905090810190601f1680156107ec5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561080757600080fd5b5061083e6004803603604081101561081e57600080fd5b81019080803590602001909291908035906020019092919050505061280d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561087e578082015181840152602081019050610863565b50505050905090810190601f1680156108ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108c557600080fd5b506108f2600480360360208110156108dc57600080fd5b8101908080359060200190929190505050612894565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128ac565b005b34801561096557600080fd5b506109926004803603602081101561097c57600080fd5b8101908080359060200190929190505050612c3e565b005b610b3860048036036101408110156109ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156109f257600080fd5b820183602082011115610a0457600080fd5b80359060200191846001830284011164010000000083111715610a2657600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610ab257600080fd5b820183602082011115610ac457600080fd5b80359060200191846001830284011164010000000083111715610ae657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612d78565b60405180821515815260200191505060405180910390f35b348015610b5c57600080fd5b50610ba960048036036040811015610b7357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506132b5565b6040518082815260200191505060405180910390f35b348015610bcb57600080fd5b50610d2660048036036060811015610be257600080fd5b810190808035906020019092919080359060200190640100000000811115610c0957600080fd5b820183602082011115610c1b57600080fd5b80359060200191846001830284011164010000000083111715610c3d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610ca057600080fd5b820183602082011115610cb257600080fd5b80359060200191846001830284011164010000000083111715610cd457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506132da565b005b348015610d3457600080fd5b50610d3d613369565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610d80578082015181840152602081019050610d65565b505050509050019250505060405180910390f35b348015610da057600080fd5b50610da9613512565b6040518082815260200191505060405180910390f35b348015610dcb57600080fd5b50610ea560048036036040811015610de257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610e1f57600080fd5b820183602082011115610e3157600080fd5b80359060200191846001830284011164010000000083111715610e5357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050613518565b005b348015610eb357600080fd5b506110156004803603610100811015610ecb57600080fd5b8101908080359060200190640100000000811115610ee857600080fd5b820183602082011115610efa57600080fd5b80359060200191846020830284011164010000000083111715610f1c57600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610f6757600080fd5b820183602082011115610f7957600080fd5b80359060200191846001830284011164010000000083111715610f9b57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061353a565b005b34801561102357600080fd5b506110d26004803603608081101561103a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561108157600080fd5b82018360208201111561109357600080fd5b803590602001918460018302840111640100000000831117156110b557600080fd5b9091929391929390803560ff1690602001909291905050506136f8565b6040518082815260200191505060405180910390f35b3480156110f457600080fd5b506111416004803603604081101561110b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613820565b60405180806020018373ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019060200280838360005b838110156111a0578082015181840152602081019050611185565b50505050905001935050505060405180910390f35b3480156111c157600080fd5b506111ee600480360360208110156111d857600080fd5b8101908080359060200190929190505050613a12565b005b3480156111fc57600080fd5b50611314600480360361014081101561121457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561125b57600080fd5b82018360208201111561126d57600080fd5b8035906020019184600183028401116401000000008311171561128f57600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613bb1565b6040518082815260200191505060405180910390f35b34801561133657600080fd5b506113996004803603604081101561134d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613bde565b005b3480156113a757600080fd5b506113ea600480360360208110156113be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613f6f565b005b3480156113f857600080fd5b5061147b6004803603606081101561140f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613ff3565b005b34801561148957600080fd5b50611492614665565b6040518082815260200191505060405180910390f35b3480156114b457600080fd5b506115cc60048036036101408110156114cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561151357600080fd5b82018360208201111561152557600080fd5b8035906020019184600183028401116401000000008311171561154757600080fd5b9091929391929390803560ff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061466f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561160c5780820151818401526020810190506115f1565b50505050905090810190601f1680156116395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561165357600080fd5b506116966004803603602081101561166a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614817565b005b3480156116a457600080fd5b506116ad614878565b6040518082815260200191505060405180910390f35b3480156116cf57600080fd5b5061173c600480360360608110156116e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506148f6565b005b34801561174a57600080fd5b50611753614d29565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611793578082015181840152602081019050611778565b50505050905090810190601f1680156117c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6117d6614d62565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156118405750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561187857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6118ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003600081548092919060010191905055507f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2682604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414611bba57611bb981612c3e565b5b5050565b611bd2604182614e0590919063ffffffff16565b82511015611c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000808060008060005b8681101561243457611c648882614e3f565b80945081955082965050505060008460ff16141561206d578260001c9450611c96604188614e0590919063ffffffff16565b8260001c1015611d0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8751611d2760208460001c614e6e90919063ffffffff16565b1115611d9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006020838a01015190508851611dd182611dc360208760001c614e6e90919063ffffffff16565b614e6e90919063ffffffff16565b1115611e45576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606020848b010190506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168773ffffffffffffffffffffffffffffffffffffffff166320c13b0b8d846040518363ffffffff1660e01b8152600401808060200180602001838103835285818151815260200191508051906020019080838360005b83811015611ee7578082015181840152602081019050611ecc565b50505050905090810190601f168015611f145780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611f4d578082015181840152602081019050611f32565b50505050905090810190601f168015611f7a5780820380516001836020036101000a031916815260200191505b5094505050505060206040518083038186803b158015611f9957600080fd5b505afa158015611fad573d6000803e3d6000fd5b505050506040513d6020811015611fc357600080fd5b81019080805190602001909291905050507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612066576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b50506122b2565b60018460ff161415612181578260001c94508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061210a57506000600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c81526020019081526020016000205414155b61217c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6122b1565b601e8460ff1611156122495760018a60405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c018281526020019150506040516020818303038152906040528051906020012060048603858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015612238573d6000803e3d6000fd5b5050506020604051035194506122b0565b60018a85858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156122a3573d6000803e3d6000fd5b5050506020604051035194505b5b5b8573ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161180156123795750600073ffffffffffffffffffffffffffffffffffffffff16600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80156123b25750600173ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b612424576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330323600000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8495508080600101915050611c52565b50505050505050505050565b60008173ffffffffffffffffffffffffffffffffffffffff16600173ffffffffffffffffffffffffffffffffffffffff161415801561250b5750600073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156125dd5750600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000804690508091505090565b6000600173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156126bc5750600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b61272e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61273b858585855a614e8d565b9050801561278b573373ffffffffffffffffffffffffffffffffffffffff167f6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb860405160405180910390a26127cf565b3373ffffffffffffffffffffffffffffffffffffffff167facd2c8702804128fdb0db2bb49f6d127dd0181c13fd45dbfe16de0930e2bd37560405160405180910390a25b949350505050565b600060606127e7868686866125f1565b915060405160203d0181016040523d81523d6000602083013e8091505094509492505050565b606060006020830267ffffffffffffffff8111801561282b57600080fd5b506040519080825280601f01601f19166020018201604052801561285e5781602001600182028036833780820191505090505b50905060005b8381101561288957808501548060208302602085010152508080600101915050612864565b508091505092915050565b60076020528060005260406000206000915090505481565b6128b4614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561291e5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b612990576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fecdf3a3effea5783a3c4c2140e677577666428d44ed9d474a0b3a4c9943f844081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b612c46614d62565b600354811115612cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001811015612d35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806004819055507f610f7ff2b304ae8903c3de74c60c6ab1f7d6226b3f52c5161905bb5ad4039c936004546040518082815260200191505060405180910390a150565b6000806000612d928e8e8e8e8e8e8e8e8e8e60055461466f565b905060056000815480929190600101919050555080805190602001209150612dbb8282866132da565b506000612dc6614ed9565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612fac578073ffffffffffffffffffffffffffffffffffffffff166375f0bb528f8f8f8f8f8f8f8f8f8f8f336040518d63ffffffff1660e01b8152600401808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c8152602001806020018a6001811115612e6957fe5b81526020018981526020018881526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001806020018473ffffffffffffffffffffffffffffffffffffffff16815260200183810383528d8d82818152602001925080828437600081840152601f19601f820116905080830192505050838103825285818151815260200191508051906020019080838360005b83811015612f3b578082015181840152602081019050612f20565b50505050905090810190601f168015612f685780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b158015612f9357600080fd5b505af1158015612fa7573d6000803e3d6000fd5b505050505b6101f4612fd36109c48b01603f60408d0281612fc457fe5b04614f0a90919063ffffffff16565b015a1015613049576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005a90506130b28f8f8f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508e60008d146130a7578e6130ad565b6109c45a035b614e8d565b93506130c75a82614f2490919063ffffffff16565b905083806130d6575060008a14155b806130e2575060008814155b613154576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008089111561316e5761316b828b8b8b8b614f44565b90505b84156131b8577f442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e8482604051808381526020018281526020019250505060405180910390a16131f8565b7f23428b18acfb3ea64b08dc0c1d296ea9c09702c09083ca5272e64d115b687d238482604051808381526020018281526020019250505060405180910390a15b5050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146132a4578073ffffffffffffffffffffffffffffffffffffffff16639327136883856040518363ffffffff1660e01b815260040180838152602001821515815260200192505050600060405180830381600087803b15801561328b57600080fd5b505af115801561329f573d6000803e3d6000fd5b505050505b50509b9a5050505050505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b6000600454905060008111613357576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61336384848484611bbe565b50505050565b6060600060035467ffffffffffffffff8111801561338657600080fd5b506040519080825280602002602001820160405280156133b55781602001602082028036833780820191505090505b50905060008060026000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613509578083838151811061346057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050818060010192505061341f565b82935050505090565b60055481565b600080825160208401855af4806000523d6020523d600060403e60403d016000fd5b6135858a8a80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508961514a565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146135c3576135c28461564a565b5b6136118787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050615679565b600082111561362b5761362982600060018685614f44565b505b3373ffffffffffffffffffffffffffffffffffffffff167f141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a88b8b8b8b8960405180806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281038252878782818152602001925060200280828437600081840152601f19601f820116905080830192505050965050505050505060405180910390a250505050505050505050565b6000805a905061374f878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050865a614e8d565b61375857600080fd5b60005a8203905080604051602001808281526020019150506040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137e55780820151818401526020810190506137ca565b50505050905090810190601f1680156138125780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b606060008267ffffffffffffffff8111801561383b57600080fd5b5060405190808252806020026020018201604052801561386a5781602001602082028036833780820191505090505b509150600080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561393d5750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561394857508482105b15613a03578084838151811061395a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081806001019250506138d3565b80925081845250509250929050565b600073ffffffffffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613b14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16817ff2a0eb156472d1440255b0d7c1e19cc07115d1051fe605b0dce69acfec884d9c60405160405180910390a350565b6000613bc68c8c8c8c8c8c8c8c8c8c8c61466f565b8051906020012090509b9a5050505050505050505050565b613be6614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613c505750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b613cc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613dc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507faab4fa2b463f581b2b32cb3b7e3b704b9ce37cc209b5fb4d77e593ace405427681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613f77614d62565b60007f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b90508181557f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa282604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b613ffb614d62565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156140655750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561409d57503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b61410f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614210576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561427a5750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6142ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146143ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a17f9465fa0c962cc76958e6373a993326400c1c94f8be2fe3a952adfa7f60b2ea2681604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1505050565b6000600454905090565b606060007fbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d860001b8d8d8d8d60405180838380828437808301925050509250505060405180910390208c8c8c8c8c8c8c604051602001808c81526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a815260200189815260200188600181111561470057fe5b81526020018781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019b505050505050505050505050604051602081830303815290604052805190602001209050601960f81b600160f81b61478c614878565b8360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040529150509b9a5050505050505050505050565b61481f614d62565b6148288161564a565b7f5ac6c46c93c8d0e53714ba3b53db3e7c046da994313d7ed0d192028bc7c228b081604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60007f47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a7946921860001b6148a66125e4565b30604051602001808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405160208183030381529060405280519060200120905090565b6148fe614d62565b806001600354031015614979576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156149e35750600173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b614a55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614614b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303500000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360008154809291906001900391905055507ff8d49fc529812e9a7c5c50e69c20f0dccc0db8fa95c98bc58cc9a4f1c1299eaf82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18060045414614d2457614d2381612c3e565b5b505050565b6040518060400160405280600581526020017f312e332e3000000000000000000000000000000000000000000000000000000081525081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614614e03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330333100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b565b600080831415614e185760009050614e39565b6000828402905082848281614e2957fe5b0414614e3457600080fd5b809150505b92915050565b60008060008360410260208101860151925060408101860151915060ff60418201870151169350509250925092565b600080828401905083811015614e8357600080fd5b8091505092915050565b6000600180811115614e9b57fe5b836001811115614ea757fe5b1415614ec0576000808551602087018986f49050614ed0565b600080855160208701888a87f190505b95945050505050565b6000807f4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c860001b9050805491505090565b600081831015614f1a5781614f1c565b825b905092915050565b600082821115614f3357600080fd5b600082840390508091505092915050565b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614614f815782614f83565b325b9050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561509b57614fed3a8610614fca573a614fcc565b855b614fdf888a614e6e90919063ffffffff16565b614e0590919063ffffffff16565b91508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050615096576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b615140565b6150c0856150b2888a614e6e90919063ffffffff16565b614e0590919063ffffffff16565b91506150cd8482846158b4565b61513f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330313200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5095945050505050565b6000600454146151c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8151811115615239576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303100000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018110156152b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303200000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006001905060005b83518110156155b65760008482815181106152d057fe5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156153445750600173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561537c57503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b80156153b457508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b615426576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303300000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614615527576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475332303400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508092505080806001019150506152b9565b506001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825160038190555081600481905550505050565b60007f6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d560001b90508181555050565b600073ffffffffffffffffffffffffffffffffffffffff1660016000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461577b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475331303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001806000600173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146158b05761583d8260008360015a614e8d565b6158af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f475330303000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b5050565b60008063a9059cbb8484604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050602060008251602084016000896127105a03f13d6000811461595b5760208114615963576000935061596e565b81935061596e565b600051158215171593505b505050939250505056fea26469706673582212203874bcf92e1722cc7bfa0cef1a0985cf0dc3485ba0663db3747ccdf1605df53464736f6c63430007060033" +} diff --git a/crates/contracts/artifacts/GnosisSafeCompatibilityFallbackHandler.json b/crates/contracts/artifacts/GnosisSafeCompatibilityFallbackHandler.json index 42cc91ae14..e0372bb975 100644 --- a/crates/contracts/artifacts/GnosisSafeCompatibilityFallbackHandler.json +++ b/crates/contracts/artifacts/GnosisSafeCompatibilityFallbackHandler.json @@ -1 +1,328 @@ -{"abi":[{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"message","type":"bytes"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract GnosisSafe","name":"safe","type":"address"},{"internalType":"bytes","name":"message","type":"bytes"}],"name":"getMessageHashForSafe","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getModules","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_dataHash","type":"bytes32"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"targetContract","type":"address"},{"internalType":"bytes","name":"calldataPayload","type":"bytes"}],"name":"simulate","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"tokensReceived","outputs":[],"stateMutability":"pure","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50611574806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ce5760003560e01c80636ac247841161008c578063bc197c8111610066578063bc197c81146107bb578063bd61951d14610951578063f23a6e6114610a63578063ffa1ad7414610b63576100ce565b80636ac24784146105ea578063a3f4df7e146106d9578063b2494df31461075c576100ce565b806223de29146100d357806301ffc9a71461020b5780630a1028c41461026e578063150b7a021461033d5780631626ba7e1461043357806320c13b0b146104e9575b600080fd5b610209600480360360c08110156100e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561017057600080fd5b82018360208201111561018257600080fd5b803590602001918460018302840111640100000000831117156101a457600080fd5b9091929391929390803590602001906401000000008111156101c557600080fd5b8201836020820111156101d757600080fd5b803590602001918460018302840111640100000000831117156101f957600080fd5b9091929391929390505050610be6565b005b6102566004803603602081101561022157600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610bf0565b60405180821515815260200191505060405180910390f35b6103276004803603602081101561028457600080fd5b81019080803590602001906401000000008111156102a157600080fd5b8201836020820111156102b357600080fd5b803590602001918460018302840111640100000000831117156102d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610d2a565b6040518082815260200191505060405180910390f35b6103fe6004803603608081101561035357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ba57600080fd5b8201836020820111156103cc57600080fd5b803590602001918460018302840111640100000000831117156103ee57600080fd5b9091929391929390505050610d3d565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6104b46004803603604081101561044957600080fd5b81019080803590602001909291908035906020019064010000000081111561047057600080fd5b82018360208201111561048257600080fd5b803590602001918460018302840111640100000000831117156104a457600080fd5b9091929391929390505050610d52565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6105b5600480360360408110156104ff57600080fd5b810190808035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293908035906020019064010000000081111561057157600080fd5b82018360208201111561058357600080fd5b803590602001918460018302840111640100000000831117156105a557600080fd5b9091929391929390505050610f0a565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6106c36004803603604081101561060057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561063d57600080fd5b82018360208201111561064f57600080fd5b8035906020019184600183028401116401000000008311171561067157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061115b565b6040518082815260200191505060405180910390f35b6106e16112cd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610721578082015181840152602081019050610706565b50505050905090810190601f16801561074e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610764611306565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107a757808201518184015260208101905061078c565b505050509050019250505060405180910390f35b61091c600480360360a08110156107d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561082e57600080fd5b82018360208201111561084057600080fd5b8035906020019184602083028401116401000000008311171561086257600080fd5b90919293919293908035906020019064010000000081111561088357600080fd5b82018360208201111561089557600080fd5b803590602001918460208302840111640100000000831117156108b757600080fd5b9091929391929390803590602001906401000000008111156108d857600080fd5b8201836020820111156108ea57600080fd5b8035906020019184600183028401116401000000008311171561090c57600080fd5b909192939192939050505061146d565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6109e86004803603604081101561096757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156109a457600080fd5b8201836020820111156109b657600080fd5b803590602001918460018302840111640100000000831117156109d857600080fd5b9091929391929390505050611485565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a28578082015181840152602081019050610a0d565b50505050905090810190601f168015610a555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610b2e600480360360a0811015610a7957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190640100000000811115610aea57600080fd5b820183602082011115610afc57600080fd5b80359060200191846001830284011164010000000083111715610b1e57600080fd5b90919293919293905050506114ef565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b610b6b611505565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bab578082015181840152602081019050610b90565b50505050905090810190601f168015610bd85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b5050505050505050565b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610cbb57507f150b7a02000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610d2357507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b6000610d36338361115b565b9050919050565b600063150b7a0260e01b905095945050505050565b60008033905060008173ffffffffffffffffffffffffffffffffffffffff166320c13b0b876040516020018082815260200191505060405160208183030381529060405287876040518463ffffffff1660e01b8152600401808060200180602001838103835286818151815260200191508051906020019080838360005b83811015610deb578082015181840152602081019050610dd0565b50505050905090810190601f168015610e185780820380516001836020036101000a031916815260200191505b508381038252858582818152602001925080828437600081840152601f19601f8201169050808301925050509550505050505060206040518083038186803b158015610e6357600080fd5b505afa158015610e77573d6000803e3d6000fd5b505050506040513d6020811015610e8d57600080fd5b810190808051906020019092919050505090506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614610ef657600060e01b610eff565b631626ba7e60e01b5b925050509392505050565b6000803390506000610f608288888080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061115b565b905060008585905014156110755760008273ffffffffffffffffffffffffffffffffffffffff16635ae6bd37836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610fc157600080fd5b505afa158015610fd5573d6000803e3d6000fd5b505050506040513d6020811015610feb57600080fd5b81019080805190602001909291905050501415611070576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f48617368206e6f7420617070726f76656400000000000000000000000000000081525060200191505060405180910390fd5b611147565b8173ffffffffffffffffffffffffffffffffffffffff1663934f3a1182898989896040518663ffffffff1660e01b81526004018086815260200180602001806020018381038352878782818152602001925080828437600081840152601f19601f8201169050808301925050508381038252858582818152602001925080828437600081840152601f19601f82011690508083019250505097505050505050505060006040518083038186803b15801561112e57600080fd5b505afa158015611142573d6000803e3d6000fd5b505050505b6320c13b0b60e01b92505050949350505050565b6000807f60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca60001b83805190602001206040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209050601960f81b600160f81b8573ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b815260040160206040518083038186803b15801561120957600080fd5b505afa15801561121d573d6000803e3d6000fd5b505050506040513d602081101561123357600080fd5b81019080805190602001909291905050508360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040528051906020012091505092915050565b6040518060400160405280601881526020017f44656661756c742043616c6c6261636b2048616e646c6572000000000000000081525081565b6060600033905060008173ffffffffffffffffffffffffffffffffffffffff1663cc2f84526001600a6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060006040518083038186803b15801561138057600080fd5b505afa158015611394573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060408110156113be57600080fd5b81019080805160405193929190846401000000008211156113de57600080fd5b838201915060208201858111156113f457600080fd5b825186602082028301116401000000008211171561141157600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561144857808201518184015260208101905061142d565b5050505090500160405260200180519060200190929190505050509050809250505090565b600063bc197c8160e01b905098975050505050505050565b60606040517fb4faba09000000000000000000000000000000000000000000000000000000008152600436036004808301376020600036836000335af15060203d036040519250808301604052806020843e6000516114e657825160208401fd5b50509392505050565b600063f23a6e6160e01b90509695505050505050565b6040518060400160405280600581526020017f312e302e300000000000000000000000000000000000000000000000000000008152508156fea26469706673582212204251d58f2a197439239faafa82818b7696d25bb75655794a81cc773a0e39ed2b64736f6c63430007060033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [], + "name": "NAME", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "getMessageHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract GnosisSafe", + "name": "safe", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "getMessageHashForSafe", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getModules", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_dataHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_signature", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_signature", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulate", + "outputs": [ + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "tokensReceived", + "outputs": [], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50611574806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ce5760003560e01c80636ac247841161008c578063bc197c8111610066578063bc197c81146107bb578063bd61951d14610951578063f23a6e6114610a63578063ffa1ad7414610b63576100ce565b80636ac24784146105ea578063a3f4df7e146106d9578063b2494df31461075c576100ce565b806223de29146100d357806301ffc9a71461020b5780630a1028c41461026e578063150b7a021461033d5780631626ba7e1461043357806320c13b0b146104e9575b600080fd5b610209600480360360c08110156100e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561017057600080fd5b82018360208201111561018257600080fd5b803590602001918460018302840111640100000000831117156101a457600080fd5b9091929391929390803590602001906401000000008111156101c557600080fd5b8201836020820111156101d757600080fd5b803590602001918460018302840111640100000000831117156101f957600080fd5b9091929391929390505050610be6565b005b6102566004803603602081101561022157600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610bf0565b60405180821515815260200191505060405180910390f35b6103276004803603602081101561028457600080fd5b81019080803590602001906401000000008111156102a157600080fd5b8201836020820111156102b357600080fd5b803590602001918460018302840111640100000000831117156102d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610d2a565b6040518082815260200191505060405180910390f35b6103fe6004803603608081101561035357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ba57600080fd5b8201836020820111156103cc57600080fd5b803590602001918460018302840111640100000000831117156103ee57600080fd5b9091929391929390505050610d3d565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6104b46004803603604081101561044957600080fd5b81019080803590602001909291908035906020019064010000000081111561047057600080fd5b82018360208201111561048257600080fd5b803590602001918460018302840111640100000000831117156104a457600080fd5b9091929391929390505050610d52565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6105b5600480360360408110156104ff57600080fd5b810190808035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293908035906020019064010000000081111561057157600080fd5b82018360208201111561058357600080fd5b803590602001918460018302840111640100000000831117156105a557600080fd5b9091929391929390505050610f0a565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6106c36004803603604081101561060057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561063d57600080fd5b82018360208201111561064f57600080fd5b8035906020019184600183028401116401000000008311171561067157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061115b565b6040518082815260200191505060405180910390f35b6106e16112cd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610721578082015181840152602081019050610706565b50505050905090810190601f16801561074e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610764611306565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107a757808201518184015260208101905061078c565b505050509050019250505060405180910390f35b61091c600480360360a08110156107d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561082e57600080fd5b82018360208201111561084057600080fd5b8035906020019184602083028401116401000000008311171561086257600080fd5b90919293919293908035906020019064010000000081111561088357600080fd5b82018360208201111561089557600080fd5b803590602001918460208302840111640100000000831117156108b757600080fd5b9091929391929390803590602001906401000000008111156108d857600080fd5b8201836020820111156108ea57600080fd5b8035906020019184600183028401116401000000008311171561090c57600080fd5b909192939192939050505061146d565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b6109e86004803603604081101561096757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156109a457600080fd5b8201836020820111156109b657600080fd5b803590602001918460018302840111640100000000831117156109d857600080fd5b9091929391929390505050611485565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a28578082015181840152602081019050610a0d565b50505050905090810190601f168015610a555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610b2e600480360360a0811015610a7957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190640100000000811115610aea57600080fd5b820183602082011115610afc57600080fd5b80359060200191846001830284011164010000000083111715610b1e57600080fd5b90919293919293905050506114ef565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b610b6b611505565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bab578082015181840152602081019050610b90565b50505050905090810190601f168015610bd85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b5050505050505050565b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610cbb57507f150b7a02000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610d2357507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b6000610d36338361115b565b9050919050565b600063150b7a0260e01b905095945050505050565b60008033905060008173ffffffffffffffffffffffffffffffffffffffff166320c13b0b876040516020018082815260200191505060405160208183030381529060405287876040518463ffffffff1660e01b8152600401808060200180602001838103835286818151815260200191508051906020019080838360005b83811015610deb578082015181840152602081019050610dd0565b50505050905090810190601f168015610e185780820380516001836020036101000a031916815260200191505b508381038252858582818152602001925080828437600081840152601f19601f8201169050808301925050509550505050505060206040518083038186803b158015610e6357600080fd5b505afa158015610e77573d6000803e3d6000fd5b505050506040513d6020811015610e8d57600080fd5b810190808051906020019092919050505090506320c13b0b60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614610ef657600060e01b610eff565b631626ba7e60e01b5b925050509392505050565b6000803390506000610f608288888080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061115b565b905060008585905014156110755760008273ffffffffffffffffffffffffffffffffffffffff16635ae6bd37836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610fc157600080fd5b505afa158015610fd5573d6000803e3d6000fd5b505050506040513d6020811015610feb57600080fd5b81019080805190602001909291905050501415611070576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f48617368206e6f7420617070726f76656400000000000000000000000000000081525060200191505060405180910390fd5b611147565b8173ffffffffffffffffffffffffffffffffffffffff1663934f3a1182898989896040518663ffffffff1660e01b81526004018086815260200180602001806020018381038352878782818152602001925080828437600081840152601f19601f8201169050808301925050508381038252858582818152602001925080828437600081840152601f19601f82011690508083019250505097505050505050505060006040518083038186803b15801561112e57600080fd5b505afa158015611142573d6000803e3d6000fd5b505050505b6320c13b0b60e01b92505050949350505050565b6000807f60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca60001b83805190602001206040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209050601960f81b600160f81b8573ffffffffffffffffffffffffffffffffffffffff1663f698da256040518163ffffffff1660e01b815260040160206040518083038186803b15801561120957600080fd5b505afa15801561121d573d6000803e3d6000fd5b505050506040513d602081101561123357600080fd5b81019080805190602001909291905050508360405160200180857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152600101847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526001018381526020018281526020019450505050506040516020818303038152906040528051906020012091505092915050565b6040518060400160405280601881526020017f44656661756c742043616c6c6261636b2048616e646c6572000000000000000081525081565b6060600033905060008173ffffffffffffffffffffffffffffffffffffffff1663cc2f84526001600a6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060006040518083038186803b15801561138057600080fd5b505afa158015611394573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060408110156113be57600080fd5b81019080805160405193929190846401000000008211156113de57600080fd5b838201915060208201858111156113f457600080fd5b825186602082028301116401000000008211171561141157600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561144857808201518184015260208101905061142d565b5050505090500160405260200180519060200190929190505050509050809250505090565b600063bc197c8160e01b905098975050505050505050565b60606040517fb4faba09000000000000000000000000000000000000000000000000000000008152600436036004808301376020600036836000335af15060203d036040519250808301604052806020843e6000516114e657825160208401fd5b50509392505050565b600063f23a6e6160e01b90509695505050505050565b6040518060400160405280600581526020017f312e302e300000000000000000000000000000000000000000000000000000008152508156fea26469706673582212204251d58f2a197439239faafa82818b7696d25bb75655794a81cc773a0e39ed2b64736f6c63430007060033" +} diff --git a/crates/contracts/artifacts/GnosisSafeProxy.json b/crates/contracts/artifacts/GnosisSafeProxy.json index d36f6a4cc9..f5c664f184 100644 --- a/crates/contracts/artifacts/GnosisSafeProxy.json +++ b/crates/contracts/artifacts/GnosisSafeProxy.json @@ -1 +1,20 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"_singleton","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"}],"bytecode":"0x608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564" +} diff --git a/crates/contracts/artifacts/GnosisSafeProxyFactory.json b/crates/contracts/artifacts/GnosisSafeProxyFactory.json index 1383ed8ddb..352bef478c 100644 --- a/crates/contracts/artifacts/GnosisSafeProxyFactory.json +++ b/crates/contracts/artifacts/GnosisSafeProxyFactory.json @@ -1 +1,166 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract GnosisSafeProxy","name":"proxy","type":"address"},{"indexed":false,"internalType":"address","name":"singleton","type":"address"}],"name":"ProxyCreation","type":"event"},{"inputs":[{"internalType":"address","name":"_singleton","type":"address"},{"internalType":"bytes","name":"initializer","type":"bytes"},{"internalType":"uint256","name":"saltNonce","type":"uint256"}],"name":"calculateCreateProxyWithNonceAddress","outputs":[{"internalType":"contract GnosisSafeProxy","name":"proxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"singleton","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"createProxy","outputs":[{"internalType":"contract GnosisSafeProxy","name":"proxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_singleton","type":"address"},{"internalType":"bytes","name":"initializer","type":"bytes"},{"internalType":"uint256","name":"saltNonce","type":"uint256"},{"internalType":"contract IProxyCreationCallback","name":"callback","type":"address"}],"name":"createProxyWithCallback","outputs":[{"internalType":"contract GnosisSafeProxy","name":"proxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_singleton","type":"address"},{"internalType":"bytes","name":"initializer","type":"bytes"},{"internalType":"uint256","name":"saltNonce","type":"uint256"}],"name":"createProxyWithNonce","outputs":[{"internalType":"contract GnosisSafeProxy","name":"proxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"proxyCreationCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"proxyRuntimeCode","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610ebe806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80631688f0b9146100675780632500510e1461017657806353e5d9351461024357806361b69abd146102c6578063addacc0f146103cb578063d18af54d1461044e575b600080fd5b61014a6004803603606081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100ba57600080fd5b8201836020820111156100cc57600080fd5b803590602001918460018302840111640100000000831117156100ee57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061057d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102176004803603606081101561018c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156101c957600080fd5b8201836020820111156101db57600080fd5b803590602001918460018302840111640100000000831117156101fd57600080fd5b909192939192939080359060200190929190505050610624565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61024b610751565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028b578082015181840152602081019050610270565b50505050905090810190601f1680156102b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61039f600480360360408110156102dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561031957600080fd5b82018360208201111561032b57600080fd5b8035906020019184600183028401116401000000008311171561034d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061077c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103d3610861565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104135780820151818401526020810190506103f8565b50505050905090810190601f1680156104405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105516004803603608081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104a157600080fd5b8201836020820111156104b357600080fd5b803590602001918460018302840111640100000000831117156104d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061088c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600061058a848484610a3b565b90506000835111156105b25760008060008551602087016000865af114156105b157600080fd5b5b7f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e2358185604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a19392505050565b60006106758585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a3b565b905080604051602001808273ffffffffffffffffffffffffffffffffffffffff1660601b81526014019150506040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107165780820151818401526020810190506106fb565b50505050905090810190601f1680156107435780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60606040518060200161076390610bde565b6020820181038252601f19601f82011660405250905090565b60008260405161078b90610bde565b808273ffffffffffffffffffffffffffffffffffffffff168152602001915050604051809103906000f0801580156107c7573d6000803e3d6000fd5b5090506000825111156107f05760008060008451602086016000865af114156107ef57600080fd5b5b7f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e2358184604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a192915050565b60606040518060200161087390610beb565b6020820181038252601f19601f82011660405250905090565b6000808383604051602001808381526020018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060001c90506108e786868361057d565b9150600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610a32578273ffffffffffffffffffffffffffffffffffffffff16631e52b518838888886040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156109ca5780820151818401526020810190506109af565b50505050905090810190601f1680156109f75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a1957600080fd5b505af1158015610a2d573d6000803e3d6000fd5b505050505b50949350505050565b6000808380519060200120836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209050600060405180602001610a8890610bde565b6020820181038252601f19601f820116604052508673ffffffffffffffffffffffffffffffffffffffff166040516020018083805190602001908083835b60208310610ae95780518252602082019150602081019050602083039250610ac6565b6001836020036101000a038019825116818451168082178552505050505050905001828152602001925050506040516020818303038152906040529050818151826020016000f59250600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f437265617465322063616c6c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b50509392505050565b6101e680610bf883390190565b60ab80610dde8339019056fe608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033a26469706673582212200c75fe2196b9f752c82794253f2ebce0d821afef5997e1d5a35ec316ce592f6664736f6c63430007060033"} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "singleton", + "type": "address" + } + ], + "name": "ProxyCreation", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initializer", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "name": "calculateCreateProxyWithNonceAddress", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "createProxy", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initializer", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "contract IProxyCreationCallback", + "name": "callback", + "type": "address" + } + ], + "name": "createProxyWithCallback", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initializer", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "name": "createProxyWithNonce", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxyCreationCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "proxyRuntimeCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610ebe806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80631688f0b9146100675780632500510e1461017657806353e5d9351461024357806361b69abd146102c6578063addacc0f146103cb578063d18af54d1461044e575b600080fd5b61014a6004803603606081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156100ba57600080fd5b8201836020820111156100cc57600080fd5b803590602001918460018302840111640100000000831117156100ee57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061057d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102176004803603606081101561018c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156101c957600080fd5b8201836020820111156101db57600080fd5b803590602001918460018302840111640100000000831117156101fd57600080fd5b909192939192939080359060200190929190505050610624565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61024b610751565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028b578082015181840152602081019050610270565b50505050905090810190601f1680156102b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61039f600480360360408110156102dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561031957600080fd5b82018360208201111561032b57600080fd5b8035906020019184600183028401116401000000008311171561034d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061077c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103d3610861565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104135780820151818401526020810190506103f8565b50505050905090810190601f1680156104405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105516004803603608081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104a157600080fd5b8201836020820111156104b357600080fd5b803590602001918460018302840111640100000000831117156104d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061088c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600061058a848484610a3b565b90506000835111156105b25760008060008551602087016000865af114156105b157600080fd5b5b7f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e2358185604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a19392505050565b60006106758585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505084610a3b565b905080604051602001808273ffffffffffffffffffffffffffffffffffffffff1660601b81526014019150506040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107165780820151818401526020810190506106fb565b50505050905090810190601f1680156107435780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60606040518060200161076390610bde565b6020820181038252601f19601f82011660405250905090565b60008260405161078b90610bde565b808273ffffffffffffffffffffffffffffffffffffffff168152602001915050604051809103906000f0801580156107c7573d6000803e3d6000fd5b5090506000825111156107f05760008060008451602086016000865af114156107ef57600080fd5b5b7f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e2358184604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a192915050565b60606040518060200161087390610beb565b6020820181038252601f19601f82011660405250905090565b6000808383604051602001808381526020018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060001c90506108e786868361057d565b9150600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610a32578273ffffffffffffffffffffffffffffffffffffffff16631e52b518838888886040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156109ca5780820151818401526020810190506109af565b50505050905090810190601f1680156109f75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a1957600080fd5b505af1158015610a2d573d6000803e3d6000fd5b505050505b50949350505050565b6000808380519060200120836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209050600060405180602001610a8890610bde565b6020820181038252601f19601f820116604052508673ffffffffffffffffffffffffffffffffffffffff166040516020018083805190602001908083835b60208310610ae95780518252602082019150602081019050602083039250610ac6565b6001836020036101000a038019825116818451168082178552505050505050905001828152602001925050506040516020818303038152906040529050818151826020016000f59250600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bd5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f437265617465322063616c6c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b50509392505050565b6101e680610bf883390190565b60ab80610dde8339019056fe608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033a26469706673582212200c75fe2196b9f752c82794253f2ebce0d821afef5997e1d5a35ec316ce592f6664736f6c63430007060033" +} diff --git a/crates/contracts/artifacts/ISwaprPair.json b/crates/contracts/artifacts/ISwaprPair.json index 7f304bfa26..9d1df4c75a 100644 --- a/crates/contracts/artifacts/ISwaprPair.json +++ b/crates/contracts/artifacts/ISwaprPair.json @@ -1 +1,739 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"reserve0","type":"uint112"},{"internalType":"uint112","name":"reserve1","type":"uint112"},{"internalType":"uint32","name":"blockTimestampLast","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"setSwapFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"swapFee","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"sync","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint112", + "name": "reserve0", + "type": "uint112" + }, + { + "indexed": false, + "internalType": "uint112", + "name": "reserve1", + "type": "uint112" + } + ], + "name": "Sync", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MINIMUM_LIQUIDITY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getReserves", + "outputs": [ + { + "internalType": "uint112", + "name": "reserve0", + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "reserve1", + "type": "uint112" + }, + { + "internalType": "uint32", + "name": "blockTimestampLast", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "price0CumulativeLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "price1CumulativeLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "setSwapFee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "skim", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "swap", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "swapFee", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "sync", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "token0", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "token1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/IUniswapLikePair.json b/crates/contracts/artifacts/IUniswapLikePair.json index 1351119ad7..7acd690da5 100644 --- a/crates/contracts/artifacts/IUniswapLikePair.json +++ b/crates/contracts/artifacts/IUniswapLikePair.json @@ -1 +1,655 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"reserve0","type":"uint112"},{"internalType":"uint112","name":"reserve1","type":"uint112"},{"internalType":"uint32","name":"blockTimestampLast","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint112", + "name": "reserve0", + "type": "uint112" + }, + { + "indexed": false, + "internalType": "uint112", + "name": "reserve1", + "type": "uint112" + } + ], + "name": "Sync", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINIMUM_LIQUIDITY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReserves", + "outputs": [ + { + "internalType": "uint112", + "name": "reserve0", + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "reserve1", + "type": "uint112" + }, + { + "internalType": "uint32", + "name": "blockTimestampLast", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "kLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "price0CumulativeLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "price1CumulativeLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "skim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "swap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "sync", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token0", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/IUniswapLikeRouter.json b/crates/contracts/artifacts/IUniswapLikeRouter.json index d803003922..588a76b5d4 100644 --- a/crates/contracts/artifacts/IUniswapLikeRouter.json +++ b/crates/contracts/artifacts/IUniswapLikeRouter.json @@ -1 +1,955 @@ -{"abi":[{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETHSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermit","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityWithPermit","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapETHForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETHSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [], + "name": "WETH", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountADesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBDesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "addLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountTokenDesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "addLiquidityETH", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveB", + "type": "uint256" + } + ], + "name": "quote", + "outputs": [ + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidityETH", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidityETHSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityETHWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapETHForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactETHForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactETHForTokensSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForETH", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForETHSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactETH", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/IUniswapV3Factory.json b/crates/contracts/artifacts/IUniswapV3Factory.json index c3e33878ac..d23387dcc8 100644 --- a/crates/contracts/artifacts/IUniswapV3Factory.json +++ b/crates/contracts/artifacts/IUniswapV3Factory.json @@ -1 +1,200 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint24","name":"fee","type":"uint24"},{"indexed":true,"internalType":"int24","name":"tickSpacing","type":"int24"}],"name":"FeeAmountEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":true,"internalType":"uint24","name":"fee","type":"uint24"},{"indexed":false,"internalType":"int24","name":"tickSpacing","type":"int24"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"createPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"}],"name":"enableFeeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"feeAmountTickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"getPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickSpacing", + "type": "int24" + } + ], + "name": "FeeAmountEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "indexed": false, + "internalType": "int24", + "name": "tickSpacing", + "type": "int24" + }, + { + "indexed": false, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "int24", + "name": "tickSpacing", + "type": "int24" + } + ], + "name": "enableFeeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + } + ], + "name": "feeAmountTickSpacing", + "outputs": [ + { + "internalType": "int24", + "name": "", + "type": "int24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + } + ], + "name": "getPool", + "outputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/IZeroex.json b/crates/contracts/artifacts/IZeroex.json index 160b352e4e..74e5708e40 100644 --- a/crates/contracts/artifacts/IZeroex.json +++ b/crates/contracts/artifacts/IZeroex.json @@ -1 +1,9056 @@ -{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"ERC1155OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc20FillAmount","type":"uint256"},{"indexed":false,"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"erc1155FillAmount","type":"uint128"},{"indexed":false,"internalType":"address","name":"matcher","type":"address"}],"name":"ERC1155OrderFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"expiry","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"indexed":false,"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"indexed":false,"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"indexed":false,"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"indexed":false,"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"name":"ERC1155OrderPreSigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"ERC721OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"indexed":false,"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"matcher","type":"address"}],"name":"ERC721OrderFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"expiry","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"indexed":false,"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"indexed":false,"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"indexed":false,"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"name":"ERC721OrderPreSigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"address","name":"feeRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"makerToken","type":"address"},{"indexed":false,"internalType":"address","name":"takerToken","type":"address"},{"indexed":false,"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"takerTokenFeeFilledAmount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"protocolFeePaid","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"pool","type":"bytes32"}],"name":"LimitOrderFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20TokenV06","name":"inputToken","type":"address"},{"indexed":false,"internalType":"contract IERC20TokenV06","name":"outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"inputTokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"outputTokenAmount","type":"uint256"},{"indexed":false,"internalType":"contract ILiquidityProvider","name":"provider","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"LiquidityProviderSwap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":true,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"MetaTransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"migrator","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"Migrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"maker","type":"address"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"OrderSignerRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"address","name":"makerToken","type":"address"},{"indexed":false,"internalType":"address","name":"takerToken","type":"address"},{"indexed":false,"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"name":"OtcOrderFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"makerToken","type":"address"},{"indexed":false,"internalType":"address","name":"takerToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"minValidSalt","type":"uint256"}],"name":"PairCancelledLimitOrders","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"makerToken","type":"address"},{"indexed":false,"internalType":"address","name":"takerToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"minValidSalt","type":"uint256"}],"name":"PairCancelledRfqOrders","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"address","name":"oldImpl","type":"address"},{"indexed":false,"internalType":"address","name":"newImpl","type":"address"}],"name":"ProxyFunctionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"quoteSigner","type":"address"}],"name":"QuoteSignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"address","name":"makerToken","type":"address"},{"indexed":false,"internalType":"address","name":"takerToken","type":"address"},{"indexed":false,"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"},{"indexed":false,"internalType":"bytes32","name":"pool","type":"bytes32"}],"name":"RfqOrderFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"origin","type":"address"},{"indexed":false,"internalType":"address[]","name":"addrs","type":"address[]"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"RfqOrderOriginsAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"address","name":"inputToken","type":"address"},{"indexed":false,"internalType":"address","name":"outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"inputTokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"outputTokenAmount","type":"uint256"}],"name":"TransformedERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"transformerDeployer","type":"address"}],"name":"TransformerDeployerUpdated","type":"event"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"}],"name":"_fillLimitOrder","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"makerSignature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"bool","name":"useSelfBalance","type":"bool"},{"internalType":"address","name":"recipient","type":"address"}],"name":"_fillOtcOrder","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"bool","name":"useSelfBalance","type":"bool"},{"internalType":"address","name":"recipient","type":"address"}],"name":"_fillRfqOrder","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedPath","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"_sellHeldTokenForTokenToUniswapV3","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address payable","name":"taker","type":"address"},{"internalType":"contract IERC20TokenV06","name":"inputToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputTokenAmount","type":"uint256"},{"internalType":"uint256","name":"minOutputTokenAmount","type":"uint256"},{"components":[{"internalType":"uint32","name":"deploymentNonce","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ITransformERC20Feature.Transformation[]","name":"transformations","type":"tuple[]"},{"internalType":"bool","name":"useSelfBalance","type":"bool"},{"internalType":"address payable","name":"recipient","type":"address"}],"internalType":"struct ITransformERC20Feature.TransformERC20Args","name":"args","type":"tuple"}],"name":"_transformERC20","outputs":[{"internalType":"uint256","name":"outputTokenAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order[]","name":"sellOrders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"},{"internalType":"uint128[]","name":"erc1155TokenAmounts","type":"uint128[]"},{"internalType":"bytes[]","name":"callbackData","type":"bytes[]"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"name":"batchBuyERC1155s","outputs":[{"internalType":"bool[]","name":"successes","type":"bool[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order[]","name":"sellOrders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"},{"internalType":"bytes[]","name":"callbackData","type":"bytes[]"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"name":"batchBuyERC721s","outputs":[{"internalType":"bool[]","name":"successes","type":"bool[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"orderNonces","type":"uint256[]"}],"name":"batchCancelERC1155Orders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"orderNonces","type":"uint256[]"}],"name":"batchCancelERC721Orders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder[]","name":"orders","type":"tuple[]"}],"name":"batchCancelLimitOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06[]","name":"makerTokens","type":"address[]"},{"internalType":"contract IERC20TokenV06[]","name":"takerTokens","type":"address[]"},{"internalType":"uint256[]","name":"minValidSalts","type":"uint256[]"}],"name":"batchCancelPairLimitOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"contract IERC20TokenV06[]","name":"makerTokens","type":"address[]"},{"internalType":"contract IERC20TokenV06[]","name":"takerTokens","type":"address[]"},{"internalType":"uint256[]","name":"minValidSalts","type":"uint256[]"}],"name":"batchCancelPairLimitOrdersWithSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06[]","name":"makerTokens","type":"address[]"},{"internalType":"contract IERC20TokenV06[]","name":"takerTokens","type":"address[]"},{"internalType":"uint256[]","name":"minValidSalts","type":"uint256[]"}],"name":"batchCancelPairRfqOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"contract IERC20TokenV06[]","name":"makerTokens","type":"address[]"},{"internalType":"contract IERC20TokenV06[]","name":"takerTokens","type":"address[]"},{"internalType":"uint256[]","name":"minValidSalts","type":"uint256[]"}],"name":"batchCancelPairRfqOrdersWithSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder[]","name":"orders","type":"tuple[]"}],"name":"batchCancelRfqOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address payable","name":"signer","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"minGasPrice","type":"uint256"},{"internalType":"uint256","name":"maxGasPrice","type":"uint256"},{"internalType":"uint256","name":"expirationTimeSeconds","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"feeToken","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"internalType":"struct IMetaTransactionsFeature.MetaTransactionData[]","name":"mtxs","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"}],"name":"batchExecuteMetaTransactions","outputs":[{"internalType":"bytes[]","name":"returnResults","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"},{"internalType":"uint128[]","name":"takerTokenFillAmounts","type":"uint128[]"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"name":"batchFillLimitOrders","outputs":[{"internalType":"uint128[]","name":"takerTokenFilledAmounts","type":"uint128[]"},{"internalType":"uint128[]","name":"makerTokenFilledAmounts","type":"uint128[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"},{"internalType":"uint128[]","name":"takerTokenFillAmounts","type":"uint128[]"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"name":"batchFillRfqOrders","outputs":[{"internalType":"uint128[]","name":"takerTokenFilledAmounts","type":"uint128[]"},{"internalType":"uint128[]","name":"makerTokenFilledAmounts","type":"uint128[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"makerSignatures","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"takerSignatures","type":"tuple[]"},{"internalType":"bool[]","name":"unwrapWeth","type":"bool[]"}],"name":"batchFillTakerSignedOtcOrders","outputs":[{"internalType":"bool[]","name":"successes","type":"bool[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"}],"name":"batchGetLimitOrderRelevantStates","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"internalType":"struct LibNativeOrder.OrderInfo[]","name":"orderInfos","type":"tuple[]"},{"internalType":"uint128[]","name":"actualFillableTakerTokenAmounts","type":"uint128[]"},{"internalType":"bool[]","name":"isSignatureValids","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"signatures","type":"tuple[]"}],"name":"batchGetRfqOrderRelevantStates","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"internalType":"struct LibNativeOrder.OrderInfo[]","name":"orderInfos","type":"tuple[]"},{"internalType":"uint128[]","name":"actualFillableTakerTokenAmounts","type":"uint128[]"},{"internalType":"bool[]","name":"isSignatureValids","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order[]","name":"sellOrders","type":"tuple[]"},{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order[]","name":"buyOrders","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"sellOrderSignatures","type":"tuple[]"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature[]","name":"buyOrderSignatures","type":"tuple[]"}],"name":"batchMatchERC721Orders","outputs":[{"internalType":"uint256[]","name":"profits","type":"uint256[]"},{"internalType":"bool[]","name":"successes","type":"bool[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"sellOrder","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"erc1155BuyAmount","type":"uint128"},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"name":"buyERC1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"sellOrder","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"name":"buyERC721","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderNonce","type":"uint256"}],"name":"cancelERC1155Order","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderNonce","type":"uint256"}],"name":"cancelERC721Order","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"}],"name":"cancelLimitOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint256","name":"minValidSalt","type":"uint256"}],"name":"cancelPairLimitOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint256","name":"minValidSalt","type":"uint256"}],"name":"cancelPairLimitOrdersWithSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint256","name":"minValidSalt","type":"uint256"}],"name":"cancelPairRfqOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint256","name":"minValidSalt","type":"uint256"}],"name":"cancelPairRfqOrdersWithSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"}],"name":"cancelRfqOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createTransformWallet","outputs":[{"internalType":"contract IFlashWallet","name":"wallet","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address payable","name":"signer","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"minGasPrice","type":"uint256"},{"internalType":"uint256","name":"maxGasPrice","type":"uint256"},{"internalType":"uint256","name":"expirationTimeSeconds","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"feeToken","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"internalType":"struct IMetaTransactionsFeature.MetaTransactionData","name":"mtx","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"returnResult","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"},{"internalType":"address","name":"impl","type":"address"}],"name":"extend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"}],"name":"fillLimitOrder","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"}],"name":"fillOrKillLimitOrder","outputs":[{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"}],"name":"fillOrKillRfqOrder","outputs":[{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"makerSignature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"}],"name":"fillOtcOrder","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"makerSignature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"}],"name":"fillOtcOrderForEth","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"makerSignature","type":"tuple"}],"name":"fillOtcOrderWithEth","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"takerTokenFillAmount","type":"uint128"}],"name":"fillRfqOrder","outputs":[{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"},{"internalType":"uint128","name":"makerTokenFilledAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"makerSignature","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"takerSignature","type":"tuple"}],"name":"fillTakerSignedOtcOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"makerSignature","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"takerSignature","type":"tuple"}],"name":"fillTakerSignedOtcOrderForEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"order","type":"tuple"}],"name":"getERC1155OrderHash","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"order","type":"tuple"}],"name":"getERC1155OrderInfo","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNFTOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"orderAmount","type":"uint128"},{"internalType":"uint128","name":"remainingAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.OrderInfo","name":"orderInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"order","type":"tuple"}],"name":"getERC721OrderHash","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"order","type":"tuple"}],"name":"getERC721OrderStatus","outputs":[{"internalType":"enum LibNFTOrder.OrderStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"uint248","name":"nonceRange","type":"uint248"}],"name":"getERC721OrderStatusBitVector","outputs":[{"internalType":"uint256","name":"bitVector","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"}],"name":"getLimitOrderHash","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"}],"name":"getLimitOrderInfo","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"internalType":"struct LibNativeOrder.OrderInfo","name":"orderInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"uint128","name":"takerTokenFeeAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.LimitOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"}],"name":"getLimitOrderRelevantState","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"internalType":"struct LibNativeOrder.OrderInfo","name":"orderInfo","type":"tuple"},{"internalType":"uint128","name":"actualFillableTakerTokenAmount","type":"uint128"},{"internalType":"bool","name":"isSignatureValid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address payable","name":"signer","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"minGasPrice","type":"uint256"},{"internalType":"uint256","name":"maxGasPrice","type":"uint256"},{"internalType":"uint256","name":"expirationTimeSeconds","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"feeToken","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"internalType":"struct IMetaTransactionsFeature.MetaTransactionData","name":"mtx","type":"tuple"}],"name":"getMetaTransactionExecutedBlock","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address payable","name":"signer","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"minGasPrice","type":"uint256"},{"internalType":"uint256","name":"maxGasPrice","type":"uint256"},{"internalType":"uint256","name":"expirationTimeSeconds","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"feeToken","type":"address"},{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"internalType":"struct IMetaTransactionsFeature.MetaTransactionData","name":"mtx","type":"tuple"}],"name":"getMetaTransactionHash","outputs":[{"internalType":"bytes32","name":"mtxHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"mtxHash","type":"bytes32"}],"name":"getMetaTransactionHashExecutedBlock","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"}],"name":"getOtcOrderHash","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint256","name":"expiryAndNonce","type":"uint256"}],"internalType":"struct LibNativeOrder.OtcOrder","name":"order","type":"tuple"}],"name":"getOtcOrderInfo","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"}],"internalType":"struct LibNativeOrder.OtcOrderInfo","name":"orderInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolFeeMultiplier","outputs":[{"internalType":"uint32","name":"multiplier","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getQuoteSigner","outputs":[{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"}],"name":"getRfqOrderHash","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"}],"name":"getRfqOrderInfo","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"internalType":"struct LibNativeOrder.OrderInfo","name":"orderInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20TokenV06","name":"makerToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"takerToken","type":"address"},{"internalType":"uint128","name":"makerAmount","type":"uint128"},{"internalType":"uint128","name":"takerAmount","type":"uint128"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"bytes32","name":"pool","type":"bytes32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct LibNativeOrder.RfqOrder","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"}],"name":"getRfqOrderRelevantState","outputs":[{"components":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum LibNativeOrder.OrderStatus","name":"status","type":"uint8"},{"internalType":"uint128","name":"takerTokenFilledAmount","type":"uint128"}],"internalType":"struct LibNativeOrder.OrderInfo","name":"orderInfo","type":"tuple"},{"internalType":"uint128","name":"actualFillableTakerTokenAmount","type":"uint128"},{"internalType":"bool","name":"isSignatureValid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"},{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getRollbackEntryAtIndex","outputs":[{"internalType":"address","name":"impl","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"getRollbackLength","outputs":[{"internalType":"uint256","name":"rollbackLength","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransformWallet","outputs":[{"internalType":"contract IFlashWallet","name":"wallet","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransformerDeployer","outputs":[{"internalType":"address","name":"deployer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"signer","type":"address"}],"name":"isValidOrderSigner","outputs":[{"internalType":"bool","name":"isAllowed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"txOrigin","type":"address"},{"internalType":"uint64","name":"nonceBucket","type":"uint64"}],"name":"lastOtcTxOriginNonce","outputs":[{"internalType":"uint128","name":"lastNonce","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"sellOrder","type":"tuple"},{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"buyOrder","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"sellOrderSignature","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"buyOrderSignature","type":"tuple"}],"name":"matchERC721Orders","outputs":[{"internalType":"uint256","name":"profit","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"outputToken","type":"address"},{"components":[{"internalType":"enum IMultiplexFeature.MultiplexSubcall","name":"id","type":"uint8"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMultiplexFeature.BatchSellSubcall[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"multiplexBatchSellEthForToken","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"inputToken","type":"address"},{"components":[{"internalType":"enum IMultiplexFeature.MultiplexSubcall","name":"id","type":"uint8"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMultiplexFeature.BatchSellSubcall[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"multiplexBatchSellTokenForEth","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"inputToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"outputToken","type":"address"},{"components":[{"internalType":"enum IMultiplexFeature.MultiplexSubcall","name":"id","type":"uint8"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMultiplexFeature.BatchSellSubcall[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"multiplexBatchSellTokenForToken","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"components":[{"internalType":"enum IMultiplexFeature.MultiplexSubcall","name":"id","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMultiplexFeature.MultiHopSellSubcall[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"multiplexMultiHopSellEthForToken","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"components":[{"internalType":"enum IMultiplexFeature.MultiplexSubcall","name":"id","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMultiplexFeature.MultiHopSellSubcall[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"multiplexMultiHopSellTokenForEth","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"components":[{"internalType":"enum IMultiplexFeature.MultiplexSubcall","name":"id","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IMultiplexFeature.MultiHopSellSubcall[]","name":"calls","type":"tuple[]"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"}],"name":"multiplexMultiHopSellTokenForToken","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"success","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"success","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"ownerAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"order","type":"tuple"}],"name":"preSignERC1155Order","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"order","type":"tuple"}],"name":"preSignERC721Order","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"registerAllowedOrderSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"origins","type":"address[]"},{"internalType":"bool","name":"allowed","type":"bool"}],"name":"registerAllowedRfqOrigins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"},{"internalType":"address","name":"targetImpl","type":"address"}],"name":"rollback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"buyOrder","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"internalType":"uint128","name":"erc1155SellAmount","type":"uint128"},{"internalType":"bool","name":"unwrapNativeToken","type":"bool"},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"name":"sellERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"buyOrder","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"internalType":"bool","name":"unwrapNativeToken","type":"bool"},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"name":"sellERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedPath","type":"bytes"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sellEthForTokenToUniswapV3","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"inputToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"outputToken","type":"address"},{"internalType":"contract ILiquidityProvider","name":"provider","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"sellToLiquidityProvider","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"enum IPancakeSwapFeature.ProtocolFork","name":"fork","type":"uint8"}],"name":"sellToPancakeSwap","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"bool","name":"isSushi","type":"bool"}],"name":"sellToUniswap","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedPath","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"}],"name":"sellTokenForEthToUniswapV3","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"encodedPath","type":"bytes"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"minBuyAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sellTokenForTokenToUniswapV3","outputs":[{"internalType":"uint256","name":"buyAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"quoteSigner","type":"address"}],"name":"setQuoteSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transformerDeployer","type":"address"}],"name":"setTransformerDeployer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportInterface","outputs":[{"internalType":"bool","name":"isSupported","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"poolIds","type":"bytes32[]"}],"name":"transferProtocolFeesForPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"erc20","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address payable","name":"recipientWallet","type":"address"}],"name":"transferTrappedTokensTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20TokenV06","name":"inputToken","type":"address"},{"internalType":"contract IERC20TokenV06","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputTokenAmount","type":"uint256"},{"internalType":"uint256","name":"minOutputTokenAmount","type":"uint256"},{"components":[{"internalType":"uint32","name":"deploymentNonce","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ITransformERC20Feature.Transformation[]","name":"transformations","type":"tuple[]"}],"name":"transformERC20","outputs":[{"internalType":"uint256","name":"outputTokenAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"order","type":"tuple"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"}],"name":"validateERC1155OrderProperties","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155Token","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct LibNFTOrder.ERC1155Order","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"}],"name":"validateERC1155OrderSignature","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"order","type":"tuple"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"}],"name":"validateERC721OrderProperties","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum LibNFTOrder.TradeDirection","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20TokenV06","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct LibNFTOrder.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721Token","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"contract IPropertyValidator","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct LibNFTOrder.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct LibNFTOrder.ERC721Order","name":"order","type":"tuple"},{"components":[{"internalType":"enum LibSignature.SignatureType","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct LibSignature.Signature","name":"signature","type":"tuple"}],"name":"validateERC721OrderSignature","outputs":[],"stateMutability":"view","type":"function"}],"devdoc":{"details":"Interface for a fully featured Exchange Proxy.","kind":"dev","methods":{"_fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,address)":{"details":"Fill a limit order. Internal variant. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to `msg.sender` (not `sender`).","params":{"order":"The limit order.","sender":"The order sender.","signature":"The order signature.","taker":"The order taker.","takerTokenFillAmount":"Maximum taker token to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much maker token was filled."}},"_fillOtcOrder((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,bool,address)":{"details":"Fill an OTC order for up to `takerTokenFillAmount` taker tokens. Internal variant.","params":{"makerSignature":"The order signature from the maker.","order":"The OTC order.","recipient":"The recipient of the bought maker tokens.","taker":"The address to fill the order in the context of.","takerTokenFillAmount":"Maximum taker token amount to fill this order with.","useSelfBalance":"Whether to use the Exchange Proxy's balance of input tokens."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much taker token was filled."}},"_fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,bool,address)":{"details":"Fill an RFQ order. Internal variant.","params":{"order":"The RFQ order.","recipient":"The recipient of the maker tokens.","signature":"The order signature.","taker":"The order taker.","takerTokenFillAmount":"Maximum taker token to fill this order with.","useSelfBalance":"Whether to use the ExchangeProxy's transient balance of taker tokens to fill the order."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much maker token was filled."}},"_sellHeldTokenForTokenToUniswapV3(bytes,uint256,uint256,address)":{"details":"Sell a token for another token directly against uniswap v3. Private variant, uses tokens held by `address(this)`.","params":{"encodedPath":"Uniswap-encoded path.","minBuyAmount":"Minimum amount of the last token in the path to buy.","recipient":"The recipient of the bought tokens. Can be zero for sender.","sellAmount":"amount of the first token in the path to sell."},"returns":{"buyAmount":"Amount of the last token in the path bought."}},"_transformERC20((address,address,address,uint256,uint256,(uint32,bytes)[],bool,address))":{"details":"Internal version of `transformERC20()`. Only callable from within.","params":{"args":"A `TransformERC20Args` struct."},"returns":{"outputTokenAmount":"The amount of `outputToken` received by the taker."}},"batchBuyERC1155s((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128)[],(uint8,uint8,bytes32,bytes32)[],uint128[],bytes[],bool)":{"details":"Buys multiple ERC1155 assets by filling the given orders.","params":{"callbackData":"The data (if any) to pass to the taker callback for each order. Refer to the `callbackData` parameter to for `buyERC1155`.","erc1155TokenAmounts":"The amounts of the ERC1155 assets to buy for each order.","revertIfIncomplete":"If true, reverts if this function fails to fill any individual order.","sellOrders":"The ERC1155 sell orders.","signatures":"The order signatures."},"returns":{"successes":"An array of booleans corresponding to whether each order in `orders` was successfully filled."}},"batchBuyERC721s((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[])[],(uint8,uint8,bytes32,bytes32)[],bytes[],bool)":{"details":"Buys multiple ERC721 assets by filling the given orders.","params":{"callbackData":"The data (if any) to pass to the taker callback for each order. Refer to the `callbackData` parameter to for `buyERC721`.","revertIfIncomplete":"If true, reverts if this function fails to fill any individual order.","sellOrders":"The ERC721 sell orders.","signatures":"The order signatures."},"returns":{"successes":"An array of booleans corresponding to whether each order in `orders` was successfully filled."}},"batchCancelERC1155Orders(uint256[])":{"details":"Cancel multiple ERC1155 orders by their nonces. The caller should be the maker of the orders. Silently succeeds if an order with the same nonce has already been filled or cancelled.","params":{"orderNonces":"The order nonces."}},"batchCancelERC721Orders(uint256[])":{"details":"Cancel multiple ERC721 orders by their nonces. The caller should be the maker of the orders. Silently succeeds if an order with the same nonce has already been filled or cancelled.","params":{"orderNonces":"The order nonces."}},"batchCancelLimitOrders((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[])":{"details":"Cancel multiple limit orders. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.","params":{"orders":"The limit orders."}},"batchCancelPairLimitOrders(address[],address[],uint256[])":{"details":"Cancel all limit orders for a given maker and pairs with salts less than the values provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.","params":{"makerTokens":"The maker tokens.","minValidSalts":"The new minimum valid salts.","takerTokens":"The taker tokens."}},"batchCancelPairLimitOrdersWithSigner(address,address[],address[],uint256[])":{"details":"Cancel all limit orders for a given maker and pairs with salts less than the values provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.","params":{"maker":"The maker for which to cancel.","makerTokens":"The maker tokens.","minValidSalts":"The new minimum valid salts.","takerTokens":"The taker tokens."}},"batchCancelPairRfqOrders(address[],address[],uint256[])":{"details":"Cancel all RFQ orders for a given maker and pairs with salts less than the values provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.","params":{"makerTokens":"The maker tokens.","minValidSalts":"The new minimum valid salts.","takerTokens":"The taker tokens."}},"batchCancelPairRfqOrdersWithSigner(address,address[],address[],uint256[])":{"details":"Cancel all RFQ orders for a given maker and pairs with salts less than the values provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.","params":{"maker":"The maker for which to cancel.","makerTokens":"The maker tokens.","minValidSalts":"The new minimum valid salts.","takerTokens":"The taker tokens."}},"batchCancelRfqOrders((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[])":{"details":"Cancel multiple RFQ orders. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.","params":{"orders":"The RFQ orders."}},"batchExecuteMetaTransactions((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256)[],(uint8,uint8,bytes32,bytes32)[])":{"details":"Execute multiple meta-transactions.","params":{"mtxs":"The meta-transactions.","signatures":"The signature by each respective `mtx.signer`."},"returns":{"returnResults":"The ABI-encoded results of the underlying calls."}},"batchFillLimitOrders((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[],uint128[],bool)":{"details":"Fills multiple limit orders.","params":{"orders":"Array of limit orders.","revertIfIncomplete":"If true, reverts if this function fails to fill the full fill amount for any individual order.","signatures":"Array of signatures corresponding to each order.","takerTokenFillAmounts":"Array of desired amounts to fill each order."},"returns":{"makerTokenFilledAmounts":"Array of amounts filled, in maker token.","takerTokenFilledAmounts":"Array of amounts filled, in taker token."}},"batchFillRfqOrders((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[],uint128[],bool)":{"details":"Fills multiple RFQ orders.","params":{"orders":"Array of RFQ orders.","revertIfIncomplete":"If true, reverts if this function fails to fill the full fill amount for any individual order.","signatures":"Array of signatures corresponding to each order.","takerTokenFillAmounts":"Array of desired amounts to fill each order."},"returns":{"makerTokenFilledAmounts":"Array of amounts filled, in maker token.","takerTokenFilledAmounts":"Array of amounts filled, in taker token."}},"batchFillTakerSignedOtcOrders((address,address,uint128,uint128,address,address,address,uint256)[],(uint8,uint8,bytes32,bytes32)[],(uint8,uint8,bytes32,bytes32)[],bool[])":{"details":"Fills multiple taker-signed OTC orders.","params":{"makerSignatures":"Array of maker signatures for each order.","orders":"Array of OTC orders.","takerSignatures":"Array of taker signatures for each order.","unwrapWeth":"Array of booleans representing whether or not to unwrap bought WETH into ETH for each order. Should be set to false if the maker token is not WETH."},"returns":{"successes":"Array of booleans representing whether or not each order in `orders` was filled successfully."}},"batchGetLimitOrderRelevantStates((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])":{"details":"Batch version of `getLimitOrderRelevantState()`, without reverting. Orders that would normally cause `getLimitOrderRelevantState()` to revert will have empty results.","params":{"orders":"The limit orders.","signatures":"The order signatures."},"returns":{"actualFillableTakerTokenAmounts":"How much of each order is fillable based on maker funds, in taker tokens.","isSignatureValids":"Whether each signature is valid for the order.","orderInfos":"Info about the orders."}},"batchGetRfqOrderRelevantStates((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])":{"details":"Batch version of `getRfqOrderRelevantState()`, without reverting. Orders that would normally cause `getRfqOrderRelevantState()` to revert will have empty results.","params":{"orders":"The RFQ orders.","signatures":"The order signatures."},"returns":{"actualFillableTakerTokenAmounts":"How much of each order is fillable based on maker funds, in taker tokens.","isSignatureValids":"Whether each signature is valid for the order.","orderInfos":"Info about the orders."}},"batchMatchERC721Orders((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[])[],(uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[])[],(uint8,uint8,bytes32,bytes32)[],(uint8,uint8,bytes32,bytes32)[])":{"details":"Matches pairs of complementary orders that have non-negative spreads. Each order is filled at their respective price, and the matcher receives a profit denominated in the ERC20 token.","params":{"buyOrderSignatures":"Signatures for the buy orders.","buyOrders":"Orders buying ERC721 assets.","sellOrderSignatures":"Signatures for the sell orders.","sellOrders":"Orders selling ERC721 assets."},"returns":{"profits":"The amount of profit earned by the caller of this function for each pair of matched orders (denominated in the ERC20 token of the order pair).","successes":"An array of booleans corresponding to whether each pair of orders was successfully matched."}},"buyERC1155((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),(uint8,uint8,bytes32,bytes32),uint128,bytes)":{"details":"Buys an ERC1155 asset by filling the given order.","params":{"callbackData":"If this parameter is non-zero, invokes `zeroExERC1155OrderCallback` on `msg.sender` after the ERC1155 asset has been transferred to `msg.sender` but before transferring the ERC20 tokens to the seller. Native tokens acquired during the callback can be used to fill the order.","erc1155BuyAmount":"The amount of the ERC1155 asset to buy.","sellOrder":"The ERC1155 sell order.","signature":"The order signature."}},"buyERC721((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32),bytes)":{"details":"Buys an ERC721 asset by filling the given order.","params":{"callbackData":"If this parameter is non-zero, invokes `zeroExERC721OrderCallback` on `msg.sender` after the ERC721 asset has been transferred to `msg.sender` but before transferring the ERC20 tokens to the seller. Native tokens acquired during the callback can be used to fill the order.","sellOrder":"The ERC721 sell order.","signature":"The order signature."}},"cancelERC1155Order(uint256)":{"details":"Cancel a single ERC1155 order by its nonce. The caller should be the maker of the order. Silently succeeds if an order with the same nonce has already been filled or cancelled.","params":{"orderNonce":"The order nonce."}},"cancelERC721Order(uint256)":{"details":"Cancel a single ERC721 order by its nonce. The caller should be the maker of the order. Silently succeeds if an order with the same nonce has already been filled or cancelled.","params":{"orderNonce":"The order nonce."}},"cancelLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))":{"details":"Cancel a single limit order. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.","params":{"order":"The limit order."}},"cancelPairLimitOrders(address,address,uint256)":{"details":"Cancel all limit orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.","params":{"makerToken":"The maker token.","minValidSalt":"The new minimum valid salt.","takerToken":"The taker token."}},"cancelPairLimitOrdersWithSigner(address,address,address,uint256)":{"details":"Cancel all limit orders for a given maker and pair with a salt less than the value provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.","params":{"maker":"The maker for which to cancel.","makerToken":"The maker token.","minValidSalt":"The new minimum valid salt.","takerToken":"The taker token."}},"cancelPairRfqOrders(address,address,uint256)":{"details":"Cancel all RFQ orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.","params":{"makerToken":"The maker token.","minValidSalt":"The new minimum valid salt.","takerToken":"The taker token."}},"cancelPairRfqOrdersWithSigner(address,address,address,uint256)":{"details":"Cancel all RFQ orders for a given maker and pair with a salt less than the value provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.","params":{"maker":"The maker for which to cancel.","makerToken":"The maker token.","minValidSalt":"The new minimum valid salt.","takerToken":"The taker token."}},"cancelRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))":{"details":"Cancel a single RFQ order. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.","params":{"order":"The RFQ order."}},"createTransformWallet()":{"details":"Deploy a new flash wallet instance and replace the current one with it. Useful if we somehow break the current wallet instance. Only callable by the owner.","returns":{"wallet":"The new wallet instance."}},"executeMetaTransaction((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256),(uint8,uint8,bytes32,bytes32))":{"details":"Execute a single meta-transaction.","params":{"mtx":"The meta-transaction.","signature":"The signature by `mtx.signer`."},"returns":{"returnResult":"The ABI-encoded result of the underlying call."}},"extend(bytes4,address)":{"details":"Register or replace a function.","params":{"impl":"The implementation contract for the function.","selector":"The function selector."}},"fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)":{"details":"Fill a limit order. The taker and sender will be the caller.","params":{"order":"The limit order. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to the caller.","signature":"The order signature.","takerTokenFillAmount":"Maximum taker token amount to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much maker token was filled."}},"fillOrKillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)":{"details":"Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens. The taker will be the caller. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to the caller.","params":{"order":"The limit order.","signature":"The order signature.","takerTokenFillAmount":"How much taker token to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled."}},"fillOrKillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)":{"details":"Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens. The taker will be the caller.","params":{"order":"The RFQ order.","signature":"The order signature.","takerTokenFillAmount":"How much taker token to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled."}},"fillOtcOrder((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),uint128)":{"details":"Fill an OTC order for up to `takerTokenFillAmount` taker tokens.","params":{"makerSignature":"The order signature from the maker.","order":"The OTC order.","takerTokenFillAmount":"Maximum taker token amount to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much taker token was filled."}},"fillOtcOrderForEth((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),uint128)":{"details":"Fill an OTC order for up to `takerTokenFillAmount` taker tokens. Unwraps bought WETH into ETH before sending it to the taker.","params":{"makerSignature":"The order signature from the maker.","order":"The OTC order.","takerTokenFillAmount":"Maximum taker token amount to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much taker token was filled."}},"fillOtcOrderWithEth((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32))":{"details":"Fill an OTC order whose taker token is WETH for up to `msg.value`.","params":{"makerSignature":"The order signature from the maker.","order":"The OTC order."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much taker token was filled."}},"fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)":{"details":"Fill an RFQ order for up to `takerTokenFillAmount` taker tokens. The taker will be the caller.","params":{"order":"The RFQ order.","signature":"The order signature.","takerTokenFillAmount":"Maximum taker token amount to fill this order with."},"returns":{"makerTokenFilledAmount":"How much maker token was filled.","takerTokenFilledAmount":"How much maker token was filled."}},"fillTakerSignedOtcOrder((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),(uint8,uint8,bytes32,bytes32))":{"details":"Fully fill an OTC order. \"Meta-transaction\" variant, requires order to be signed by both maker and taker.","params":{"makerSignature":"The order signature from the maker.","order":"The OTC order.","takerSignature":"The order signature from the taker."}},"fillTakerSignedOtcOrderForEth((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),(uint8,uint8,bytes32,bytes32))":{"details":"Fully fill an OTC order. \"Meta-transaction\" variant, requires order to be signed by both maker and taker. Unwraps bought WETH into ETH before sending it to the taker.","params":{"makerSignature":"The order signature from the maker.","order":"The OTC order.","takerSignature":"The order signature from the taker."}},"getERC1155OrderHash((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128))":{"details":"Get the EIP-712 hash of an ERC1155 order.","params":{"order":"The ERC1155 order."},"returns":{"orderHash":"The order hash."}},"getERC1155OrderInfo((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128))":{"details":"Get the order info for an ERC1155 order.","params":{"order":"The ERC1155 order."},"returns":{"orderInfo":"Infor about the order."}},"getERC721OrderHash((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]))":{"details":"Get the EIP-712 hash of an ERC721 order.","params":{"order":"The ERC721 order."},"returns":{"orderHash":"The order hash."}},"getERC721OrderStatus((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]))":{"details":"Get the current status of an ERC721 order.","params":{"order":"The ERC721 order."},"returns":{"status":"The status of the order."}},"getERC721OrderStatusBitVector(address,uint248)":{"details":"Get the order status bit vector for the given maker address and nonce range.","params":{"maker":"The maker of the order.","nonceRange":"Order status bit vectors are indexed by maker address and the upper 248 bits of the order nonce. We define `nonceRange` to be these 248 bits."},"returns":{"bitVector":"The order status bit vector for the given maker and nonce range."}},"getLimitOrderHash((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))":{"details":"Get the canonical hash of a limit order.","params":{"order":"The limit order."},"returns":{"orderHash":"The order hash."}},"getLimitOrderInfo((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))":{"details":"Get the order info for a limit order.","params":{"order":"The limit order."},"returns":{"orderInfo":"Info about the order."}},"getLimitOrderRelevantState((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))":{"details":"Get order info, fillable amount, and signature validity for a limit order. Fillable amount is determined using balances and allowances of the maker.","params":{"order":"The limit order.","signature":"The order signature."},"returns":{"actualFillableTakerTokenAmount":"How much of the order is fillable based on maker funds, in taker tokens.","isSignatureValid":"Whether the signature is valid.","orderInfo":"Info about the order."}},"getMetaTransactionExecutedBlock((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256))":{"details":"Get the block at which a meta-transaction has been executed.","params":{"mtx":"The meta-transaction."},"returns":{"blockNumber":"The block height when the meta-transactioin was executed."}},"getMetaTransactionHash((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256))":{"details":"Get the EIP712 hash of a meta-transaction.","params":{"mtx":"The meta-transaction."},"returns":{"mtxHash":"The EIP712 hash of `mtx`."}},"getMetaTransactionHashExecutedBlock(bytes32)":{"details":"Get the block at which a meta-transaction hash has been executed.","params":{"mtxHash":"The meta-transaction hash."},"returns":{"blockNumber":"The block height when the meta-transactioin was executed."}},"getOtcOrderHash((address,address,uint128,uint128,address,address,address,uint256))":{"details":"Get the canonical hash of an OTC order.","params":{"order":"The OTC order."},"returns":{"orderHash":"The order hash."}},"getOtcOrderInfo((address,address,uint128,uint128,address,address,address,uint256))":{"details":"Get the order info for an OTC order.","params":{"order":"The OTC order."},"returns":{"orderInfo":"Info about the order."}},"getProtocolFeeMultiplier()":{"details":"Get the protocol fee multiplier. This should be multiplied by the gas price to arrive at the required protocol fee to fill a native order.","returns":{"multiplier":"The protocol fee multiplier."}},"getQuoteSigner()":{"details":"Return the optional signer for `transformERC20()` calldata.","returns":{"signer":"The transform deployer address."}},"getRfqOrderHash((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))":{"details":"Get the canonical hash of an RFQ order.","params":{"order":"The RFQ order."},"returns":{"orderHash":"The order hash."}},"getRfqOrderInfo((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))":{"details":"Get the order info for an RFQ order.","params":{"order":"The RFQ order."},"returns":{"orderInfo":"Info about the order."}},"getRfqOrderRelevantState((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))":{"details":"Get order info, fillable amount, and signature validity for an RFQ order. Fillable amount is determined using balances and allowances of the maker.","params":{"order":"The RFQ order.","signature":"The order signature."},"returns":{"actualFillableTakerTokenAmount":"How much of the order is fillable based on maker funds, in taker tokens.","isSignatureValid":"Whether the signature is valid.","orderInfo":"Info about the order."}},"getRollbackEntryAtIndex(bytes4,uint256)":{"details":"Retrieve an entry in the rollback history for a function.","params":{"idx":"The index in the rollback history.","selector":"The function selector."},"returns":{"impl":"An implementation address for the function at index `idx`."}},"getRollbackLength(bytes4)":{"details":"Retrieve the length of the rollback history for a function.","params":{"selector":"The function selector."},"returns":{"rollbackLength":"The number of items in the rollback history for the function."}},"getTransformWallet()":{"details":"Return the current wallet instance that will serve as the execution context for transformations.","returns":{"wallet":"The wallet instance."}},"getTransformerDeployer()":{"details":"Return the allowed deployer for transformers.","returns":{"deployer":"The transform deployer address."}},"isValidOrderSigner(address,address)":{"details":"checks if a given address is registered to sign on behalf of a maker address","params":{"maker":"The maker address encoded in an order (can be a contract)","signer":"The address that is providing a signature"}},"lastOtcTxOriginNonce(address,uint64)":{"details":"Get the last nonce used for a particular tx.origin address and nonce bucket.","params":{"nonceBucket":"The nonce bucket index.","txOrigin":"The address."},"returns":{"lastNonce":"The last nonce value used."}},"matchERC721Orders((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32),(uint8,uint8,bytes32,bytes32))":{"details":"Matches a pair of complementary orders that have a non-negative spread. Each order is filled at their respective price, and the matcher receives a profit denominated in the ERC20 token.","params":{"buyOrder":"Order buying an ERC721 asset.","buyOrderSignature":"Signature for the buy order.","sellOrder":"Order selling an ERC721 asset.","sellOrderSignature":"Signature for the sell order."},"returns":{"profit":"The amount of profit earned by the caller of this function (denominated in the ERC20 token of the matched orders)."}},"migrate(address,bytes,address)":{"details":"Execute a migration function in the context of the ZeroEx contract. The result of the function being called should be the magic bytes 0x2c64c5ef (`keccack('MIGRATE_SUCCESS')`). Only callable by the owner. The owner will be temporarily set to `address(this)` inside the call. Before returning, the owner will be set to `newOwner`.","params":{"data":"The call data.","newOwner":"The address of the new owner.","target":"The migrator contract address."}},"multiplexBatchSellEthForToken(address,(uint8,uint256,bytes)[],uint256)":{"details":"Sells attached ETH for `outputToken` using the provided calls.","params":{"calls":"The calls to use to sell the attached ETH.","minBuyAmount":"The minimum amount of `outputToken` that must be bought for this function to not revert.","outputToken":"The token to buy."},"returns":{"boughtAmount":"The amount of `outputToken` bought."}},"multiplexBatchSellTokenForEth(address,(uint8,uint256,bytes)[],uint256,uint256)":{"details":"Sells `sellAmount` of the given `inputToken` for ETH using the provided calls.","params":{"calls":"The calls to use to sell the input tokens.","inputToken":"The token to sell.","minBuyAmount":"The minimum amount of ETH that must be bought for this function to not revert.","sellAmount":"The amount of `inputToken` to sell."},"returns":{"boughtAmount":"The amount of ETH bought."}},"multiplexBatchSellTokenForToken(address,address,(uint8,uint256,bytes)[],uint256,uint256)":{"details":"Sells `sellAmount` of the given `inputToken` for `outputToken` using the provided calls.","params":{"calls":"The calls to use to sell the input tokens.","inputToken":"The token to sell.","minBuyAmount":"The minimum amount of `outputToken` that must be bought for this function to not revert.","outputToken":"The token to buy.","sellAmount":"The amount of `inputToken` to sell."},"returns":{"boughtAmount":"The amount of `outputToken` bought."}},"multiplexMultiHopSellEthForToken(address[],(uint8,bytes)[],uint256)":{"details":"Sells attached ETH via the given sequence of tokens and calls. `tokens[0]` must be WETH. The last token in `tokens` is the output token that will ultimately be sent to `msg.sender`","params":{"calls":"The sequence of calls to use for the sell.","minBuyAmount":"The minimum amount of output tokens that must be bought for this function to not revert.","tokens":"The sequence of tokens to use for the sell, i.e. `tokens[i]` will be sold for `tokens[i+1]` via `calls[i]`."},"returns":{"boughtAmount":"The amount of output tokens bought."}},"multiplexMultiHopSellTokenForEth(address[],(uint8,bytes)[],uint256,uint256)":{"details":"Sells `sellAmount` of the input token (`tokens[0]`) for ETH via the given sequence of tokens and calls. The last token in `tokens` must be WETH.","params":{"calls":"The sequence of calls to use for the sell.","minBuyAmount":"The minimum amount of ETH that must be bought for this function to not revert.","tokens":"The sequence of tokens to use for the sell, i.e. `tokens[i]` will be sold for `tokens[i+1]` via `calls[i]`."},"returns":{"boughtAmount":"The amount of ETH bought."}},"multiplexMultiHopSellTokenForToken(address[],(uint8,bytes)[],uint256,uint256)":{"details":"Sells `sellAmount` of the input token (`tokens[0]`) via the given sequence of tokens and calls. The last token in `tokens` is the output token that will ultimately be sent to `msg.sender`","params":{"calls":"The sequence of calls to use for the sell.","minBuyAmount":"The minimum amount of output tokens that must be bought for this function to not revert.","tokens":"The sequence of tokens to use for the sell, i.e. `tokens[i]` will be sold for `tokens[i+1]` via `calls[i]`."},"returns":{"boughtAmount":"The amount of output tokens bought."}},"onERC1155Received(address,address,uint256,uint256,bytes)":{"details":"Callback for the ERC1155 `safeTransferFrom` function. This callback can be used to sell an ERC1155 asset if a valid ERC1155 order, signature and `unwrapNativeToken` are encoded in `data`. This allows takers to sell their ERC1155 asset without first calling `setApprovalForAll`.","params":{"data":"Additional data with no specified format. If a valid ERC1155 order, signature and `unwrapNativeToken` are encoded in `data`, this function will try to fill the order using the received asset.","from":"The address which previously owned the token.","operator":"The address which called `safeTransferFrom`.","tokenId":"The ID of the asset being transferred.","value":"The amount being transferred."},"returns":{"success":"The selector of this function (0xf23a6e61), indicating that the callback succeeded."}},"onERC721Received(address,address,uint256,bytes)":{"details":"Callback for the ERC721 `safeTransferFrom` function. This callback can be used to sell an ERC721 asset if a valid ERC721 order, signature and `unwrapNativeToken` are encoded in `data`. This allows takers to sell their ERC721 asset without first calling `setApprovalForAll`.","params":{"data":"Additional data with no specified format. If a valid ERC721 order, signature and `unwrapNativeToken` are encoded in `data`, this function will try to fill the order using the received asset.","from":"The address which previously owned the token.","operator":"The address which called `safeTransferFrom`.","tokenId":"The ID of the asset being transferred."},"returns":{"success":"The selector of this function (0x150b7a02), indicating that the callback succeeded."}},"owner()":{"details":"The owner of this contract.","returns":{"ownerAddress":"The owner address."}},"preSignERC1155Order((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128))":{"details":"Approves an ERC1155 order on-chain. After pre-signing the order, the `PRESIGNED` signature type will become valid for that order and signer.","params":{"order":"An ERC1155 order."}},"preSignERC721Order((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]))":{"details":"Approves an ERC721 order on-chain. After pre-signing the order, the `PRESIGNED` signature type will become valid for that order and signer.","params":{"order":"An ERC721 order."}},"registerAllowedOrderSigner(address,bool)":{"details":"Register a signer who can sign on behalf of msg.sender This allows one to sign on behalf of a contract that calls this function","params":{"allowed":"True to register, false to unregister.","signer":"The address from which you plan to generate signatures"}},"registerAllowedRfqOrigins(address[],bool)":{"details":"Mark what tx.origin addresses are allowed to fill an order that specifies the message sender as its txOrigin.","params":{"allowed":"True to register, false to unregister.","origins":"An array of origin addresses to update."}},"rollback(bytes4,address)":{"details":"Roll back to a prior implementation of a function.","params":{"selector":"The function selector.","targetImpl":"The address of an older implementation of the function."}},"sellERC1155((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),(uint8,uint8,bytes32,bytes32),uint256,uint128,bool,bytes)":{"details":"Sells an ERC1155 asset to fill the given order.","params":{"buyOrder":"The ERC1155 buy order.","callbackData":"If this parameter is non-zero, invokes `zeroExERC1155OrderCallback` on `msg.sender` after the ERC20 tokens have been transferred to `msg.sender` but before transferring the ERC1155 asset to the buyer.","erc1155SellAmount":"The amount of the ERC1155 asset to sell.","erc1155TokenId":"The ID of the ERC1155 asset being sold. If the given order specifies properties, the asset must satisfy those properties. Otherwise, it must equal the tokenId in the order.","signature":"The order signature from the maker.","unwrapNativeToken":"If this parameter is true and the ERC20 token of the order is e.g. WETH, unwraps the token before transferring it to the taker."}},"sellERC721((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32),uint256,bool,bytes)":{"details":"Sells an ERC721 asset to fill the given order.","params":{"buyOrder":"The ERC721 buy order.","callbackData":"If this parameter is non-zero, invokes `zeroExERC721OrderCallback` on `msg.sender` after the ERC20 tokens have been transferred to `msg.sender` but before transferring the ERC721 asset to the buyer.","erc721TokenId":"The ID of the ERC721 asset being sold. If the given order specifies properties, the asset must satisfy those properties. Otherwise, it must equal the tokenId in the order.","signature":"The order signature from the maker.","unwrapNativeToken":"If this parameter is true and the ERC20 token of the order is e.g. WETH, unwraps the token before transferring it to the taker."}},"sellEthForTokenToUniswapV3(bytes,uint256,address)":{"details":"Sell attached ETH directly against uniswap v3.","params":{"encodedPath":"Uniswap-encoded path, where the first token is WETH.","minBuyAmount":"Minimum amount of the last token in the path to buy.","recipient":"The recipient of the bought tokens. Can be zero for sender."},"returns":{"buyAmount":"Amount of the last token in the path bought."}},"sellToLiquidityProvider(address,address,address,address,uint256,uint256,bytes)":{"details":"Sells `sellAmount` of `inputToken` to the liquidity provider at the given `provider` address.","params":{"auxiliaryData":"Auxiliary data supplied to the `provider` contract.","inputToken":"The token being sold.","minBuyAmount":"The minimum acceptable amount of `outputToken` to buy. Reverts if this amount is not satisfied.","outputToken":"The token being bought.","provider":"The address of the on-chain liquidity provider to trade with.","recipient":"The recipient of the bought tokens. If equal to address(0), `msg.sender` is assumed to be the recipient.","sellAmount":"The amount of `inputToken` to sell."},"returns":{"boughtAmount":"The amount of `outputToken` bought."}},"sellToPancakeSwap(address[],uint256,uint256,uint8)":{"details":"Efficiently sell directly to PancakeSwap (and forks).","params":{"fork":"The protocol fork to use.","minBuyAmount":"Minimum amount of `tokens[-1]` to buy.","sellAmount":"of `tokens[0]` Amount to sell.","tokens":"Sell path."},"returns":{"buyAmount":"Amount of `tokens[-1]` bought."}},"sellToUniswap(address[],uint256,uint256,bool)":{"details":"Efficiently sell directly to uniswap/sushiswap.","params":{"isSushi":"Use sushiswap if true.","minBuyAmount":"Minimum amount of `tokens[-1]` to buy.","sellAmount":"of `tokens[0]` Amount to sell.","tokens":"Sell path."},"returns":{"buyAmount":"Amount of `tokens[-1]` bought."}},"sellTokenForEthToUniswapV3(bytes,uint256,uint256,address)":{"details":"Sell a token for ETH directly against uniswap v3.","params":{"encodedPath":"Uniswap-encoded path, where the last token is WETH.","minBuyAmount":"Minimum amount of ETH to buy.","recipient":"The recipient of the bought tokens. Can be zero for sender.","sellAmount":"amount of the first token in the path to sell."},"returns":{"buyAmount":"Amount of ETH bought."}},"sellTokenForTokenToUniswapV3(bytes,uint256,uint256,address)":{"details":"Sell a token for another token directly against uniswap v3.","params":{"encodedPath":"Uniswap-encoded path.","minBuyAmount":"Minimum amount of the last token in the path to buy.","recipient":"The recipient of the bought tokens. Can be zero for sender.","sellAmount":"amount of the first token in the path to sell."},"returns":{"buyAmount":"Amount of the last token in the path bought."}},"setQuoteSigner(address)":{"details":"Replace the optional signer for `transformERC20()` calldata. Only callable by the owner.","params":{"quoteSigner":"The address of the new calldata signer."}},"setTransformerDeployer(address)":{"details":"Replace the allowed deployer for transformers. Only callable by the owner.","params":{"transformerDeployer":"The address of the new trusted deployer for transformers."}},"supportInterface(bytes4)":{"details":"Indicates whether the 0x Exchange Proxy implements a particular ERC165 interface. This function should use at most 30,000 gas.","params":{"interfaceId":"The interface identifier, as specified in ERC165."},"returns":{"isSupported":"Whether the given interface is supported by the 0x Exchange Proxy."}},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new address.","params":{"newOwner":"The address that will become the owner."}},"transferProtocolFeesForPools(bytes32[])":{"details":"Transfers protocol fees from the `FeeCollector` pools into the staking contract.","params":{"poolIds":"Staking pool IDs"}},"transferTrappedTokensTo(address,uint256,address)":{"details":"calledFrom FundRecoveryFeature.transferTrappedTokensTo() This will be delegatecalled in the context of the Exchange Proxy instance being used.","params":{"amountOut":"Amount of tokens to withdraw.","erc20":"ERC20 Token Address.","recipientWallet":"Recipient wallet address."}},"transformERC20(address,address,uint256,uint256,(uint32,bytes)[])":{"details":"Executes a series of transformations to convert an ERC20 `inputToken` to an ERC20 `outputToken`.","params":{"inputToken":"The token being provided by the sender. If `0xeee...`, ETH is implied and should be provided with the call.`","inputTokenAmount":"The amount of `inputToken` to take from the sender.","minOutputTokenAmount":"The minimum amount of `outputToken` the sender must receive for the entire transformation to succeed.","outputToken":"The token to be acquired by the sender. `0xeee...` implies ETH.","transformations":"The transformations to execute on the token balance(s) in sequence."},"returns":{"outputTokenAmount":"The amount of `outputToken` received by the sender."}},"uniswapV3SwapCallback(int256,int256,bytes)":{"details":"The UniswapV3 pool swap callback which pays the funds requested by the caller/pool to the pool. Can only be called by a valid UniswapV3 pool.","params":{"amount0Delta":"Token0 amount owed.","amount1Delta":"Token1 amount owed.","data":"Arbitrary data forwarded from swap() caller. An ABI-encoded struct of: inputToken, outputToken, fee, payer"}},"validateERC1155OrderProperties((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),uint256)":{"details":"If the given order is buying an ERC1155 asset, checks whether or not the given token ID satisfies the required properties specified in the order. If the order does not specify any properties, this function instead checks whether the given token ID matches the ID in the order. Reverts if any checks fail, or if the order is selling an ERC1155 asset.","params":{"erc1155TokenId":"The ID of the ERC1155 asset.","order":"The ERC1155 order."}},"validateERC1155OrderSignature((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),(uint8,uint8,bytes32,bytes32))":{"details":"Checks whether the given signature is valid for the the given ERC1155 order. Reverts if not.","params":{"order":"The ERC1155 order.","signature":"The signature to validate."}},"validateERC721OrderProperties((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),uint256)":{"details":"If the given order is buying an ERC721 asset, checks whether or not the given token ID satisfies the required properties specified in the order. If the order does not specify any properties, this function instead checks whether the given token ID matches the ID in the order. Reverts if any checks fail, or if the order is selling an ERC721 asset.","params":{"erc721TokenId":"The ID of the ERC721 asset.","order":"The ERC721 order."}},"validateERC721OrderSignature((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32))":{"details":"Checks whether the given signature is valid for the the given ERC721 order. Reverts if not.","params":{"order":"The ERC721 order.","signature":"The signature to validate."}}},"version":1}} \ No newline at end of file +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ERC1155OrderCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc20FillAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "erc1155FillAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "address", + "name": "matcher", + "type": "address" + } + ], + "name": "ERC1155OrderFilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "name": "ERC1155OrderPreSigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ERC721OrderCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "matcher", + "type": "address" + } + ], + "name": "ERC721OrderFilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "name": "ERC721OrderPreSigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "makerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "takerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "takerTokenFeeFilledAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "protocolFeePaid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + } + ], + "name": "LimitOrderFilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IERC20TokenV06", + "name": "inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IERC20TokenV06", + "name": "outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "inputTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "outputTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "contract ILiquidityProvider", + "name": "provider", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "LiquidityProviderSwap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "MetaTransactionExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "migrator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "Migrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + } + ], + "name": "OrderCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OrderSignerRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "makerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "takerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "name": "OtcOrderFilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "makerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "takerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minValidSalt", + "type": "uint256" + } + ], + "name": "PairCancelledLimitOrders", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "makerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "takerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minValidSalt", + "type": "uint256" + } + ], + "name": "PairCancelledRfqOrders", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldImpl", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newImpl", + "type": "address" + } + ], + "name": "ProxyFunctionUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "quoteSigner", + "type": "address" + } + ], + "name": "QuoteSignerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "makerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "takerToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + } + ], + "name": "RfqOrderFilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "origin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "addrs", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "RfqOrderOriginsAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "inputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "outputToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "inputTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "outputTokenAmount", + "type": "uint256" + } + ], + "name": "TransformedERC20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "transformerDeployer", + "type": "address" + } + ], + "name": "TransformerDeployerUpdated", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "_fillLimitOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "makerSignature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "bool", + "name": "useSelfBalance", + "type": "bool" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "_fillOtcOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "bool", + "name": "useSelfBalance", + "type": "bool" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "_fillRfqOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPath", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "_sellHeldTokenForTokenToUniswapV3", + "outputs": [ + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "taker", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "inputToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "inputTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "deploymentNonce", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct ITransformERC20Feature.Transformation[]", + "name": "transformations", + "type": "tuple[]" + }, + { + "internalType": "bool", + "name": "useSelfBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + } + ], + "internalType": "struct ITransformERC20Feature.TransformERC20Args", + "name": "args", + "type": "tuple" + } + ], + "name": "_transformERC20", + "outputs": [ + { + "internalType": "uint256", + "name": "outputTokenAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order[]", + "name": "sellOrders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + }, + { + "internalType": "uint128[]", + "name": "erc1155TokenAmounts", + "type": "uint128[]" + }, + { + "internalType": "bytes[]", + "name": "callbackData", + "type": "bytes[]" + }, + { + "internalType": "bool", + "name": "revertIfIncomplete", + "type": "bool" + } + ], + "name": "batchBuyERC1155s", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order[]", + "name": "sellOrders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + }, + { + "internalType": "bytes[]", + "name": "callbackData", + "type": "bytes[]" + }, + { + "internalType": "bool", + "name": "revertIfIncomplete", + "type": "bool" + } + ], + "name": "batchBuyERC721s", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "orderNonces", + "type": "uint256[]" + } + ], + "name": "batchCancelERC1155Orders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "orderNonces", + "type": "uint256[]" + } + ], + "name": "batchCancelERC721Orders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "batchCancelLimitOrders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06[]", + "name": "makerTokens", + "type": "address[]" + }, + { + "internalType": "contract IERC20TokenV06[]", + "name": "takerTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minValidSalts", + "type": "uint256[]" + } + ], + "name": "batchCancelPairLimitOrders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06[]", + "name": "makerTokens", + "type": "address[]" + }, + { + "internalType": "contract IERC20TokenV06[]", + "name": "takerTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minValidSalts", + "type": "uint256[]" + } + ], + "name": "batchCancelPairLimitOrdersWithSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06[]", + "name": "makerTokens", + "type": "address[]" + }, + { + "internalType": "contract IERC20TokenV06[]", + "name": "takerTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minValidSalts", + "type": "uint256[]" + } + ], + "name": "batchCancelPairRfqOrders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06[]", + "name": "makerTokens", + "type": "address[]" + }, + { + "internalType": "contract IERC20TokenV06[]", + "name": "takerTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minValidSalts", + "type": "uint256[]" + } + ], + "name": "batchCancelPairRfqOrdersWithSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "batchCancelRfqOrders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationTimeSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "internalType": "struct IMetaTransactionsFeature.MetaTransactionData[]", + "name": "mtxs", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "batchExecuteMetaTransactions", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returnResults", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder[]", + "name": "orders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + }, + { + "internalType": "uint128[]", + "name": "takerTokenFillAmounts", + "type": "uint128[]" + }, + { + "internalType": "bool", + "name": "revertIfIncomplete", + "type": "bool" + } + ], + "name": "batchFillLimitOrders", + "outputs": [ + { + "internalType": "uint128[]", + "name": "takerTokenFilledAmounts", + "type": "uint128[]" + }, + { + "internalType": "uint128[]", + "name": "makerTokenFilledAmounts", + "type": "uint128[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder[]", + "name": "orders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + }, + { + "internalType": "uint128[]", + "name": "takerTokenFillAmounts", + "type": "uint128[]" + }, + { + "internalType": "bool", + "name": "revertIfIncomplete", + "type": "bool" + } + ], + "name": "batchFillRfqOrders", + "outputs": [ + { + "internalType": "uint128[]", + "name": "takerTokenFilledAmounts", + "type": "uint128[]" + }, + { + "internalType": "uint128[]", + "name": "makerTokenFilledAmounts", + "type": "uint128[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder[]", + "name": "orders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "makerSignatures", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "takerSignatures", + "type": "tuple[]" + }, + { + "internalType": "bool[]", + "name": "unwrapWeth", + "type": "bool[]" + } + ], + "name": "batchFillTakerSignedOtcOrders", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder[]", + "name": "orders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "batchGetLimitOrderRelevantStates", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNativeOrder.OrderInfo[]", + "name": "orderInfos", + "type": "tuple[]" + }, + { + "internalType": "uint128[]", + "name": "actualFillableTakerTokenAmounts", + "type": "uint128[]" + }, + { + "internalType": "bool[]", + "name": "isSignatureValids", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder[]", + "name": "orders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "signatures", + "type": "tuple[]" + } + ], + "name": "batchGetRfqOrderRelevantStates", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNativeOrder.OrderInfo[]", + "name": "orderInfos", + "type": "tuple[]" + }, + { + "internalType": "uint128[]", + "name": "actualFillableTakerTokenAmounts", + "type": "uint128[]" + }, + { + "internalType": "bool[]", + "name": "isSignatureValids", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order[]", + "name": "sellOrders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order[]", + "name": "buyOrders", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "sellOrderSignatures", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature[]", + "name": "buyOrderSignatures", + "type": "tuple[]" + } + ], + "name": "batchMatchERC721Orders", + "outputs": [ + { + "internalType": "uint256[]", + "name": "profits", + "type": "uint256[]" + }, + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "sellOrder", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "erc1155BuyAmount", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "buyERC1155", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "sellOrder", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "buyERC721", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderNonce", + "type": "uint256" + } + ], + "name": "cancelERC1155Order", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderNonce", + "type": "uint256" + } + ], + "name": "cancelERC721Order", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "cancelLimitOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minValidSalt", + "type": "uint256" + } + ], + "name": "cancelPairLimitOrders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minValidSalt", + "type": "uint256" + } + ], + "name": "cancelPairLimitOrdersWithSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minValidSalt", + "type": "uint256" + } + ], + "name": "cancelPairRfqOrders", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minValidSalt", + "type": "uint256" + } + ], + "name": "cancelPairRfqOrdersWithSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "cancelRfqOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "createTransformWallet", + "outputs": [ + { + "internalType": "contract IFlashWallet", + "name": "wallet", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationTimeSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "internalType": "struct IMetaTransactionsFeature.MetaTransactionData", + "name": "mtx", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "executeMetaTransaction", + "outputs": [ + { + "internalType": "bytes", + "name": "returnResult", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + }, + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "name": "extend", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + } + ], + "name": "fillLimitOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + } + ], + "name": "fillOrKillLimitOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + } + ], + "name": "fillOrKillRfqOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "makerSignature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + } + ], + "name": "fillOtcOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "makerSignature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + } + ], + "name": "fillOtcOrderForEth", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "makerSignature", + "type": "tuple" + } + ], + "name": "fillOtcOrderWithEth", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "takerTokenFillAmount", + "type": "uint128" + } + ], + "name": "fillRfqOrder", + "outputs": [ + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "makerTokenFilledAmount", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "makerSignature", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "takerSignature", + "type": "tuple" + } + ], + "name": "fillTakerSignedOtcOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "makerSignature", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "takerSignature", + "type": "tuple" + } + ], + "name": "fillTakerSignedOtcOrderForEth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "order", + "type": "tuple" + } + ], + "name": "getERC1155OrderHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "order", + "type": "tuple" + } + ], + "name": "getERC1155OrderInfo", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNFTOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "orderAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "remainingAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.OrderInfo", + "name": "orderInfo", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "order", + "type": "tuple" + } + ], + "name": "getERC721OrderHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "order", + "type": "tuple" + } + ], + "name": "getERC721OrderStatus", + "outputs": [ + { + "internalType": "enum LibNFTOrder.OrderStatus", + "name": "status", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "uint248", + "name": "nonceRange", + "type": "uint248" + } + ], + "name": "getERC721OrderStatusBitVector", + "outputs": [ + { + "internalType": "uint256", + "name": "bitVector", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "getLimitOrderHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "getLimitOrderInfo", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNativeOrder.OrderInfo", + "name": "orderInfo", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerTokenFeeAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.LimitOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "getLimitOrderRelevantState", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNativeOrder.OrderInfo", + "name": "orderInfo", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "actualFillableTakerTokenAmount", + "type": "uint128" + }, + { + "internalType": "bool", + "name": "isSignatureValid", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationTimeSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "internalType": "struct IMetaTransactionsFeature.MetaTransactionData", + "name": "mtx", + "type": "tuple" + } + ], + "name": "getMetaTransactionExecutedBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address payable", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxGasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirationTimeSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "internalType": "struct IMetaTransactionsFeature.MetaTransactionData", + "name": "mtx", + "type": "tuple" + } + ], + "name": "getMetaTransactionHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "mtxHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "mtxHash", + "type": "bytes32" + } + ], + "name": "getMetaTransactionHashExecutedBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "getOtcOrderHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiryAndNonce", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.OtcOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "getOtcOrderInfo", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + } + ], + "internalType": "struct LibNativeOrder.OtcOrderInfo", + "name": "orderInfo", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeeMultiplier", + "outputs": [ + { + "internalType": "uint32", + "name": "multiplier", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getQuoteSigner", + "outputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "getRfqOrderHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + } + ], + "name": "getRfqOrderInfo", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNativeOrder.OrderInfo", + "name": "orderInfo", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "contract IERC20TokenV06", + "name": "makerToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "takerToken", + "type": "address" + }, + { + "internalType": "uint128", + "name": "makerAmount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "takerAmount", + "type": "uint128" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "pool", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "expiry", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "salt", + "type": "uint256" + } + ], + "internalType": "struct LibNativeOrder.RfqOrder", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "getRfqOrderRelevantState", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "orderHash", + "type": "bytes32" + }, + { + "internalType": "enum LibNativeOrder.OrderStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "takerTokenFilledAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNativeOrder.OrderInfo", + "name": "orderInfo", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "actualFillableTakerTokenAmount", + "type": "uint128" + }, + { + "internalType": "bool", + "name": "isSignatureValid", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + }, + { + "internalType": "uint256", + "name": "idx", + "type": "uint256" + } + ], + "name": "getRollbackEntryAtIndex", + "outputs": [ + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getRollbackLength", + "outputs": [ + { + "internalType": "uint256", + "name": "rollbackLength", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTransformWallet", + "outputs": [ + { + "internalType": "contract IFlashWallet", + "name": "wallet", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTransformerDeployer", + "outputs": [ + { + "internalType": "address", + "name": "deployer", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + } + ], + "name": "isValidOrderSigner", + "outputs": [ + { + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "txOrigin", + "type": "address" + }, + { + "internalType": "uint64", + "name": "nonceBucket", + "type": "uint64" + } + ], + "name": "lastOtcTxOriginNonce", + "outputs": [ + { + "internalType": "uint128", + "name": "lastNonce", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "sellOrder", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "buyOrder", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "sellOrderSignature", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "buyOrderSignature", + "type": "tuple" + } + ], + "name": "matchERC721Orders", + "outputs": [ + { + "internalType": "uint256", + "name": "profit", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "migrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "outputToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "enum IMultiplexFeature.MultiplexSubcall", + "name": "id", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMultiplexFeature.BatchSellSubcall[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + } + ], + "name": "multiplexBatchSellEthForToken", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "inputToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "enum IMultiplexFeature.MultiplexSubcall", + "name": "id", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMultiplexFeature.BatchSellSubcall[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + } + ], + "name": "multiplexBatchSellTokenForEth", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "inputToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "outputToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "enum IMultiplexFeature.MultiplexSubcall", + "name": "id", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMultiplexFeature.BatchSellSubcall[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + } + ], + "name": "multiplexBatchSellTokenForToken", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "enum IMultiplexFeature.MultiplexSubcall", + "name": "id", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMultiplexFeature.MultiHopSellSubcall[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + } + ], + "name": "multiplexMultiHopSellEthForToken", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "enum IMultiplexFeature.MultiplexSubcall", + "name": "id", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMultiplexFeature.MultiHopSellSubcall[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + } + ], + "name": "multiplexMultiHopSellTokenForEth", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "enum IMultiplexFeature.MultiplexSubcall", + "name": "id", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IMultiplexFeature.MultiHopSellSubcall[]", + "name": "calls", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + } + ], + "name": "multiplexMultiHopSellTokenForToken", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "success", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "success", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "ownerAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "order", + "type": "tuple" + } + ], + "name": "preSignERC1155Order", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "order", + "type": "tuple" + } + ], + "name": "preSignERC721Order", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "registerAllowedOrderSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "origins", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "registerAllowedRfqOrigins", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + }, + { + "internalType": "address", + "name": "targetImpl", + "type": "address" + } + ], + "name": "rollback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "buyOrder", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "erc1155SellAmount", + "type": "uint128" + }, + { + "internalType": "bool", + "name": "unwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "sellERC1155", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "buyOrder", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "unwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "sellERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPath", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "sellEthForTokenToUniswapV3", + "outputs": [ + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "inputToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "outputToken", + "type": "address" + }, + { + "internalType": "contract ILiquidityProvider", + "name": "provider", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "auxiliaryData", + "type": "bytes" + } + ], + "name": "sellToLiquidityProvider", + "outputs": [ + { + "internalType": "uint256", + "name": "boughtAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "enum IPancakeSwapFeature.ProtocolFork", + "name": "fork", + "type": "uint8" + } + ], + "name": "sellToPancakeSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isSushi", + "type": "bool" + } + ], + "name": "sellToUniswap", + "outputs": [ + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPath", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + } + ], + "name": "sellTokenForEthToUniswapV3", + "outputs": [ + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedPath", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBuyAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "sellTokenForTokenToUniswapV3", + "outputs": [ + { + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "quoteSigner", + "type": "address" + } + ], + "name": "setQuoteSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "transformerDeployer", + "type": "address" + } + ], + "name": "setTransformerDeployer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportInterface", + "outputs": [ + { + "internalType": "bool", + "name": "isSupported", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + } + ], + "name": "transferProtocolFeesForPools", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "erc20", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "recipientWallet", + "type": "address" + } + ], + "name": "transferTrappedTokensTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20TokenV06", + "name": "inputToken", + "type": "address" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "outputToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "inputTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputTokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "deploymentNonce", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct ITransformERC20Feature.Transformation[]", + "name": "transformations", + "type": "tuple[]" + } + ], + "name": "transformERC20", + "outputs": [ + { + "internalType": "uint256", + "name": "outputTokenAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amount0Delta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "amount1Delta", + "type": "int256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "uniswapV3SwapCallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "order", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + } + ], + "name": "validateERC1155OrderProperties", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC1155Token", + "name": "erc1155Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc1155TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc1155TokenProperties", + "type": "tuple[]" + }, + { + "internalType": "uint128", + "name": "erc1155TokenAmount", + "type": "uint128" + } + ], + "internalType": "struct LibNFTOrder.ERC1155Order", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "validateERC1155OrderSignature", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "order", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + } + ], + "name": "validateERC721OrderProperties", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum LibNFTOrder.TradeDirection", + "name": "direction", + "type": "uint8" + }, + { + "internalType": "address", + "name": "maker", + "type": "address" + }, + { + "internalType": "address", + "name": "taker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "contract IERC20TokenV06", + "name": "erc20Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc20TokenAmount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "feeData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Fee[]", + "name": "fees", + "type": "tuple[]" + }, + { + "internalType": "contract IERC721Token", + "name": "erc721Token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "erc721TokenId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "contract IPropertyValidator", + "name": "propertyValidator", + "type": "address" + }, + { + "internalType": "bytes", + "name": "propertyData", + "type": "bytes" + } + ], + "internalType": "struct LibNFTOrder.Property[]", + "name": "erc721TokenProperties", + "type": "tuple[]" + } + ], + "internalType": "struct LibNFTOrder.ERC721Order", + "name": "order", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum LibSignature.SignatureType", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct LibSignature.Signature", + "name": "signature", + "type": "tuple" + } + ], + "name": "validateERC721OrderSignature", + "outputs": [], + "stateMutability": "view", + "type": "function" + } + ], + "devdoc": { + "details": "Interface for a fully featured Exchange Proxy.", + "kind": "dev", + "methods": { + "_fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,address)": { + "details": "Fill a limit order. Internal variant. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to `msg.sender` (not `sender`).", + "params": { + "order": "The limit order.", + "sender": "The order sender.", + "signature": "The order signature.", + "taker": "The order taker.", + "takerTokenFillAmount": "Maximum taker token to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much maker token was filled." + } + }, + "_fillOtcOrder((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,bool,address)": { + "details": "Fill an OTC order for up to `takerTokenFillAmount` taker tokens. Internal variant.", + "params": { + "makerSignature": "The order signature from the maker.", + "order": "The OTC order.", + "recipient": "The recipient of the bought maker tokens.", + "taker": "The address to fill the order in the context of.", + "takerTokenFillAmount": "Maximum taker token amount to fill this order with.", + "useSelfBalance": "Whether to use the Exchange Proxy's balance of input tokens." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much taker token was filled." + } + }, + "_fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,bool,address)": { + "details": "Fill an RFQ order. Internal variant.", + "params": { + "order": "The RFQ order.", + "recipient": "The recipient of the maker tokens.", + "signature": "The order signature.", + "taker": "The order taker.", + "takerTokenFillAmount": "Maximum taker token to fill this order with.", + "useSelfBalance": "Whether to use the ExchangeProxy's transient balance of taker tokens to fill the order." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much maker token was filled." + } + }, + "_sellHeldTokenForTokenToUniswapV3(bytes,uint256,uint256,address)": { + "details": "Sell a token for another token directly against uniswap v3. Private variant, uses tokens held by `address(this)`.", + "params": { + "encodedPath": "Uniswap-encoded path.", + "minBuyAmount": "Minimum amount of the last token in the path to buy.", + "recipient": "The recipient of the bought tokens. Can be zero for sender.", + "sellAmount": "amount of the first token in the path to sell." + }, + "returns": { + "buyAmount": "Amount of the last token in the path bought." + } + }, + "_transformERC20((address,address,address,uint256,uint256,(uint32,bytes)[],bool,address))": { + "details": "Internal version of `transformERC20()`. Only callable from within.", + "params": { + "args": "A `TransformERC20Args` struct." + }, + "returns": { + "outputTokenAmount": "The amount of `outputToken` received by the taker." + } + }, + "batchBuyERC1155s((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128)[],(uint8,uint8,bytes32,bytes32)[],uint128[],bytes[],bool)": { + "details": "Buys multiple ERC1155 assets by filling the given orders.", + "params": { + "callbackData": "The data (if any) to pass to the taker callback for each order. Refer to the `callbackData` parameter to for `buyERC1155`.", + "erc1155TokenAmounts": "The amounts of the ERC1155 assets to buy for each order.", + "revertIfIncomplete": "If true, reverts if this function fails to fill any individual order.", + "sellOrders": "The ERC1155 sell orders.", + "signatures": "The order signatures." + }, + "returns": { + "successes": "An array of booleans corresponding to whether each order in `orders` was successfully filled." + } + }, + "batchBuyERC721s((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[])[],(uint8,uint8,bytes32,bytes32)[],bytes[],bool)": { + "details": "Buys multiple ERC721 assets by filling the given orders.", + "params": { + "callbackData": "The data (if any) to pass to the taker callback for each order. Refer to the `callbackData` parameter to for `buyERC721`.", + "revertIfIncomplete": "If true, reverts if this function fails to fill any individual order.", + "sellOrders": "The ERC721 sell orders.", + "signatures": "The order signatures." + }, + "returns": { + "successes": "An array of booleans corresponding to whether each order in `orders` was successfully filled." + } + }, + "batchCancelERC1155Orders(uint256[])": { + "details": "Cancel multiple ERC1155 orders by their nonces. The caller should be the maker of the orders. Silently succeeds if an order with the same nonce has already been filled or cancelled.", + "params": { + "orderNonces": "The order nonces." + } + }, + "batchCancelERC721Orders(uint256[])": { + "details": "Cancel multiple ERC721 orders by their nonces. The caller should be the maker of the orders. Silently succeeds if an order with the same nonce has already been filled or cancelled.", + "params": { + "orderNonces": "The order nonces." + } + }, + "batchCancelLimitOrders((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[])": { + "details": "Cancel multiple limit orders. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.", + "params": { + "orders": "The limit orders." + } + }, + "batchCancelPairLimitOrders(address[],address[],uint256[])": { + "details": "Cancel all limit orders for a given maker and pairs with salts less than the values provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.", + "params": { + "makerTokens": "The maker tokens.", + "minValidSalts": "The new minimum valid salts.", + "takerTokens": "The taker tokens." + } + }, + "batchCancelPairLimitOrdersWithSigner(address,address[],address[],uint256[])": { + "details": "Cancel all limit orders for a given maker and pairs with salts less than the values provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.", + "params": { + "maker": "The maker for which to cancel.", + "makerTokens": "The maker tokens.", + "minValidSalts": "The new minimum valid salts.", + "takerTokens": "The taker tokens." + } + }, + "batchCancelPairRfqOrders(address[],address[],uint256[])": { + "details": "Cancel all RFQ orders for a given maker and pairs with salts less than the values provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.", + "params": { + "makerTokens": "The maker tokens.", + "minValidSalts": "The new minimum valid salts.", + "takerTokens": "The taker tokens." + } + }, + "batchCancelPairRfqOrdersWithSigner(address,address[],address[],uint256[])": { + "details": "Cancel all RFQ orders for a given maker and pairs with salts less than the values provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.", + "params": { + "maker": "The maker for which to cancel.", + "makerTokens": "The maker tokens.", + "minValidSalts": "The new minimum valid salts.", + "takerTokens": "The taker tokens." + } + }, + "batchCancelRfqOrders((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[])": { + "details": "Cancel multiple RFQ orders. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.", + "params": { + "orders": "The RFQ orders." + } + }, + "batchExecuteMetaTransactions((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256)[],(uint8,uint8,bytes32,bytes32)[])": { + "details": "Execute multiple meta-transactions.", + "params": { + "mtxs": "The meta-transactions.", + "signatures": "The signature by each respective `mtx.signer`." + }, + "returns": { + "returnResults": "The ABI-encoded results of the underlying calls." + } + }, + "batchFillLimitOrders((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[],uint128[],bool)": { + "details": "Fills multiple limit orders.", + "params": { + "orders": "Array of limit orders.", + "revertIfIncomplete": "If true, reverts if this function fails to fill the full fill amount for any individual order.", + "signatures": "Array of signatures corresponding to each order.", + "takerTokenFillAmounts": "Array of desired amounts to fill each order." + }, + "returns": { + "makerTokenFilledAmounts": "Array of amounts filled, in maker token.", + "takerTokenFilledAmounts": "Array of amounts filled, in taker token." + } + }, + "batchFillRfqOrders((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[],uint128[],bool)": { + "details": "Fills multiple RFQ orders.", + "params": { + "orders": "Array of RFQ orders.", + "revertIfIncomplete": "If true, reverts if this function fails to fill the full fill amount for any individual order.", + "signatures": "Array of signatures corresponding to each order.", + "takerTokenFillAmounts": "Array of desired amounts to fill each order." + }, + "returns": { + "makerTokenFilledAmounts": "Array of amounts filled, in maker token.", + "takerTokenFilledAmounts": "Array of amounts filled, in taker token." + } + }, + "batchFillTakerSignedOtcOrders((address,address,uint128,uint128,address,address,address,uint256)[],(uint8,uint8,bytes32,bytes32)[],(uint8,uint8,bytes32,bytes32)[],bool[])": { + "details": "Fills multiple taker-signed OTC orders.", + "params": { + "makerSignatures": "Array of maker signatures for each order.", + "orders": "Array of OTC orders.", + "takerSignatures": "Array of taker signatures for each order.", + "unwrapWeth": "Array of booleans representing whether or not to unwrap bought WETH into ETH for each order. Should be set to false if the maker token is not WETH." + }, + "returns": { + "successes": "Array of booleans representing whether or not each order in `orders` was filled successfully." + } + }, + "batchGetLimitOrderRelevantStates((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])": { + "details": "Batch version of `getLimitOrderRelevantState()`, without reverting. Orders that would normally cause `getLimitOrderRelevantState()` to revert will have empty results.", + "params": { + "orders": "The limit orders.", + "signatures": "The order signatures." + }, + "returns": { + "actualFillableTakerTokenAmounts": "How much of each order is fillable based on maker funds, in taker tokens.", + "isSignatureValids": "Whether each signature is valid for the order.", + "orderInfos": "Info about the orders." + } + }, + "batchGetRfqOrderRelevantStates((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])": { + "details": "Batch version of `getRfqOrderRelevantState()`, without reverting. Orders that would normally cause `getRfqOrderRelevantState()` to revert will have empty results.", + "params": { + "orders": "The RFQ orders.", + "signatures": "The order signatures." + }, + "returns": { + "actualFillableTakerTokenAmounts": "How much of each order is fillable based on maker funds, in taker tokens.", + "isSignatureValids": "Whether each signature is valid for the order.", + "orderInfos": "Info about the orders." + } + }, + "batchMatchERC721Orders((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[])[],(uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[])[],(uint8,uint8,bytes32,bytes32)[],(uint8,uint8,bytes32,bytes32)[])": { + "details": "Matches pairs of complementary orders that have non-negative spreads. Each order is filled at their respective price, and the matcher receives a profit denominated in the ERC20 token.", + "params": { + "buyOrderSignatures": "Signatures for the buy orders.", + "buyOrders": "Orders buying ERC721 assets.", + "sellOrderSignatures": "Signatures for the sell orders.", + "sellOrders": "Orders selling ERC721 assets." + }, + "returns": { + "profits": "The amount of profit earned by the caller of this function for each pair of matched orders (denominated in the ERC20 token of the order pair).", + "successes": "An array of booleans corresponding to whether each pair of orders was successfully matched." + } + }, + "buyERC1155((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),(uint8,uint8,bytes32,bytes32),uint128,bytes)": { + "details": "Buys an ERC1155 asset by filling the given order.", + "params": { + "callbackData": "If this parameter is non-zero, invokes `zeroExERC1155OrderCallback` on `msg.sender` after the ERC1155 asset has been transferred to `msg.sender` but before transferring the ERC20 tokens to the seller. Native tokens acquired during the callback can be used to fill the order.", + "erc1155BuyAmount": "The amount of the ERC1155 asset to buy.", + "sellOrder": "The ERC1155 sell order.", + "signature": "The order signature." + } + }, + "buyERC721((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32),bytes)": { + "details": "Buys an ERC721 asset by filling the given order.", + "params": { + "callbackData": "If this parameter is non-zero, invokes `zeroExERC721OrderCallback` on `msg.sender` after the ERC721 asset has been transferred to `msg.sender` but before transferring the ERC20 tokens to the seller. Native tokens acquired during the callback can be used to fill the order.", + "sellOrder": "The ERC721 sell order.", + "signature": "The order signature." + } + }, + "cancelERC1155Order(uint256)": { + "details": "Cancel a single ERC1155 order by its nonce. The caller should be the maker of the order. Silently succeeds if an order with the same nonce has already been filled or cancelled.", + "params": { + "orderNonce": "The order nonce." + } + }, + "cancelERC721Order(uint256)": { + "details": "Cancel a single ERC721 order by its nonce. The caller should be the maker of the order. Silently succeeds if an order with the same nonce has already been filled or cancelled.", + "params": { + "orderNonce": "The order nonce." + } + }, + "cancelLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": { + "details": "Cancel a single limit order. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.", + "params": { + "order": "The limit order." + } + }, + "cancelPairLimitOrders(address,address,uint256)": { + "details": "Cancel all limit orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.", + "params": { + "makerToken": "The maker token.", + "minValidSalt": "The new minimum valid salt.", + "takerToken": "The taker token." + } + }, + "cancelPairLimitOrdersWithSigner(address,address,address,uint256)": { + "details": "Cancel all limit orders for a given maker and pair with a salt less than the value provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.", + "params": { + "maker": "The maker for which to cancel.", + "makerToken": "The maker token.", + "minValidSalt": "The new minimum valid salt.", + "takerToken": "The taker token." + } + }, + "cancelPairRfqOrders(address,address,uint256)": { + "details": "Cancel all RFQ orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.", + "params": { + "makerToken": "The maker token.", + "minValidSalt": "The new minimum valid salt.", + "takerToken": "The taker token." + } + }, + "cancelPairRfqOrdersWithSigner(address,address,address,uint256)": { + "details": "Cancel all RFQ orders for a given maker and pair with a salt less than the value provided. The caller must be a signer registered to the maker. Subsequent calls to this function with the same maker and pair require the new salt to be >= the old salt.", + "params": { + "maker": "The maker for which to cancel.", + "makerToken": "The maker token.", + "minValidSalt": "The new minimum valid salt.", + "takerToken": "The taker token." + } + }, + "cancelRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": { + "details": "Cancel a single RFQ order. The caller must be the maker or a valid order signer. Silently succeeds if the order has already been cancelled.", + "params": { + "order": "The RFQ order." + } + }, + "createTransformWallet()": { + "details": "Deploy a new flash wallet instance and replace the current one with it. Useful if we somehow break the current wallet instance. Only callable by the owner.", + "returns": { + "wallet": "The new wallet instance." + } + }, + "executeMetaTransaction((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256),(uint8,uint8,bytes32,bytes32))": { + "details": "Execute a single meta-transaction.", + "params": { + "mtx": "The meta-transaction.", + "signature": "The signature by `mtx.signer`." + }, + "returns": { + "returnResult": "The ABI-encoded result of the underlying call." + } + }, + "extend(bytes4,address)": { + "details": "Register or replace a function.", + "params": { + "impl": "The implementation contract for the function.", + "selector": "The function selector." + } + }, + "fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": { + "details": "Fill a limit order. The taker and sender will be the caller.", + "params": { + "order": "The limit order. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to the caller.", + "signature": "The order signature.", + "takerTokenFillAmount": "Maximum taker token amount to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much maker token was filled." + } + }, + "fillOrKillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": { + "details": "Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens. The taker will be the caller. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to the caller.", + "params": { + "order": "The limit order.", + "signature": "The order signature.", + "takerTokenFillAmount": "How much taker token to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled." + } + }, + "fillOrKillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": { + "details": "Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens. The taker will be the caller.", + "params": { + "order": "The RFQ order.", + "signature": "The order signature.", + "takerTokenFillAmount": "How much taker token to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled." + } + }, + "fillOtcOrder((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),uint128)": { + "details": "Fill an OTC order for up to `takerTokenFillAmount` taker tokens.", + "params": { + "makerSignature": "The order signature from the maker.", + "order": "The OTC order.", + "takerTokenFillAmount": "Maximum taker token amount to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much taker token was filled." + } + }, + "fillOtcOrderForEth((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),uint128)": { + "details": "Fill an OTC order for up to `takerTokenFillAmount` taker tokens. Unwraps bought WETH into ETH before sending it to the taker.", + "params": { + "makerSignature": "The order signature from the maker.", + "order": "The OTC order.", + "takerTokenFillAmount": "Maximum taker token amount to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much taker token was filled." + } + }, + "fillOtcOrderWithEth((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32))": { + "details": "Fill an OTC order whose taker token is WETH for up to `msg.value`.", + "params": { + "makerSignature": "The order signature from the maker.", + "order": "The OTC order." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much taker token was filled." + } + }, + "fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": { + "details": "Fill an RFQ order for up to `takerTokenFillAmount` taker tokens. The taker will be the caller.", + "params": { + "order": "The RFQ order.", + "signature": "The order signature.", + "takerTokenFillAmount": "Maximum taker token amount to fill this order with." + }, + "returns": { + "makerTokenFilledAmount": "How much maker token was filled.", + "takerTokenFilledAmount": "How much maker token was filled." + } + }, + "fillTakerSignedOtcOrder((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),(uint8,uint8,bytes32,bytes32))": { + "details": "Fully fill an OTC order. \"Meta-transaction\" variant, requires order to be signed by both maker and taker.", + "params": { + "makerSignature": "The order signature from the maker.", + "order": "The OTC order.", + "takerSignature": "The order signature from the taker." + } + }, + "fillTakerSignedOtcOrderForEth((address,address,uint128,uint128,address,address,address,uint256),(uint8,uint8,bytes32,bytes32),(uint8,uint8,bytes32,bytes32))": { + "details": "Fully fill an OTC order. \"Meta-transaction\" variant, requires order to be signed by both maker and taker. Unwraps bought WETH into ETH before sending it to the taker.", + "params": { + "makerSignature": "The order signature from the maker.", + "order": "The OTC order.", + "takerSignature": "The order signature from the taker." + } + }, + "getERC1155OrderHash((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128))": { + "details": "Get the EIP-712 hash of an ERC1155 order.", + "params": { + "order": "The ERC1155 order." + }, + "returns": { + "orderHash": "The order hash." + } + }, + "getERC1155OrderInfo((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128))": { + "details": "Get the order info for an ERC1155 order.", + "params": { + "order": "The ERC1155 order." + }, + "returns": { + "orderInfo": "Infor about the order." + } + }, + "getERC721OrderHash((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]))": { + "details": "Get the EIP-712 hash of an ERC721 order.", + "params": { + "order": "The ERC721 order." + }, + "returns": { + "orderHash": "The order hash." + } + }, + "getERC721OrderStatus((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]))": { + "details": "Get the current status of an ERC721 order.", + "params": { + "order": "The ERC721 order." + }, + "returns": { + "status": "The status of the order." + } + }, + "getERC721OrderStatusBitVector(address,uint248)": { + "details": "Get the order status bit vector for the given maker address and nonce range.", + "params": { + "maker": "The maker of the order.", + "nonceRange": "Order status bit vectors are indexed by maker address and the upper 248 bits of the order nonce. We define `nonceRange` to be these 248 bits." + }, + "returns": { + "bitVector": "The order status bit vector for the given maker and nonce range." + } + }, + "getLimitOrderHash((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": { + "details": "Get the canonical hash of a limit order.", + "params": { + "order": "The limit order." + }, + "returns": { + "orderHash": "The order hash." + } + }, + "getLimitOrderInfo((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": { + "details": "Get the order info for a limit order.", + "params": { + "order": "The limit order." + }, + "returns": { + "orderInfo": "Info about the order." + } + }, + "getLimitOrderRelevantState((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))": { + "details": "Get order info, fillable amount, and signature validity for a limit order. Fillable amount is determined using balances and allowances of the maker.", + "params": { + "order": "The limit order.", + "signature": "The order signature." + }, + "returns": { + "actualFillableTakerTokenAmount": "How much of the order is fillable based on maker funds, in taker tokens.", + "isSignatureValid": "Whether the signature is valid.", + "orderInfo": "Info about the order." + } + }, + "getMetaTransactionExecutedBlock((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256))": { + "details": "Get the block at which a meta-transaction has been executed.", + "params": { + "mtx": "The meta-transaction." + }, + "returns": { + "blockNumber": "The block height when the meta-transactioin was executed." + } + }, + "getMetaTransactionHash((address,address,uint256,uint256,uint256,uint256,bytes,uint256,address,uint256))": { + "details": "Get the EIP712 hash of a meta-transaction.", + "params": { + "mtx": "The meta-transaction." + }, + "returns": { + "mtxHash": "The EIP712 hash of `mtx`." + } + }, + "getMetaTransactionHashExecutedBlock(bytes32)": { + "details": "Get the block at which a meta-transaction hash has been executed.", + "params": { + "mtxHash": "The meta-transaction hash." + }, + "returns": { + "blockNumber": "The block height when the meta-transactioin was executed." + } + }, + "getOtcOrderHash((address,address,uint128,uint128,address,address,address,uint256))": { + "details": "Get the canonical hash of an OTC order.", + "params": { + "order": "The OTC order." + }, + "returns": { + "orderHash": "The order hash." + } + }, + "getOtcOrderInfo((address,address,uint128,uint128,address,address,address,uint256))": { + "details": "Get the order info for an OTC order.", + "params": { + "order": "The OTC order." + }, + "returns": { + "orderInfo": "Info about the order." + } + }, + "getProtocolFeeMultiplier()": { + "details": "Get the protocol fee multiplier. This should be multiplied by the gas price to arrive at the required protocol fee to fill a native order.", + "returns": { + "multiplier": "The protocol fee multiplier." + } + }, + "getQuoteSigner()": { + "details": "Return the optional signer for `transformERC20()` calldata.", + "returns": { + "signer": "The transform deployer address." + } + }, + "getRfqOrderHash((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": { + "details": "Get the canonical hash of an RFQ order.", + "params": { + "order": "The RFQ order." + }, + "returns": { + "orderHash": "The order hash." + } + }, + "getRfqOrderInfo((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": { + "details": "Get the order info for an RFQ order.", + "params": { + "order": "The RFQ order." + }, + "returns": { + "orderInfo": "Info about the order." + } + }, + "getRfqOrderRelevantState((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))": { + "details": "Get order info, fillable amount, and signature validity for an RFQ order. Fillable amount is determined using balances and allowances of the maker.", + "params": { + "order": "The RFQ order.", + "signature": "The order signature." + }, + "returns": { + "actualFillableTakerTokenAmount": "How much of the order is fillable based on maker funds, in taker tokens.", + "isSignatureValid": "Whether the signature is valid.", + "orderInfo": "Info about the order." + } + }, + "getRollbackEntryAtIndex(bytes4,uint256)": { + "details": "Retrieve an entry in the rollback history for a function.", + "params": { + "idx": "The index in the rollback history.", + "selector": "The function selector." + }, + "returns": { + "impl": "An implementation address for the function at index `idx`." + } + }, + "getRollbackLength(bytes4)": { + "details": "Retrieve the length of the rollback history for a function.", + "params": { + "selector": "The function selector." + }, + "returns": { + "rollbackLength": "The number of items in the rollback history for the function." + } + }, + "getTransformWallet()": { + "details": "Return the current wallet instance that will serve as the execution context for transformations.", + "returns": { + "wallet": "The wallet instance." + } + }, + "getTransformerDeployer()": { + "details": "Return the allowed deployer for transformers.", + "returns": { + "deployer": "The transform deployer address." + } + }, + "isValidOrderSigner(address,address)": { + "details": "checks if a given address is registered to sign on behalf of a maker address", + "params": { + "maker": "The maker address encoded in an order (can be a contract)", + "signer": "The address that is providing a signature" + } + }, + "lastOtcTxOriginNonce(address,uint64)": { + "details": "Get the last nonce used for a particular tx.origin address and nonce bucket.", + "params": { + "nonceBucket": "The nonce bucket index.", + "txOrigin": "The address." + }, + "returns": { + "lastNonce": "The last nonce value used." + } + }, + "matchERC721Orders((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32),(uint8,uint8,bytes32,bytes32))": { + "details": "Matches a pair of complementary orders that have a non-negative spread. Each order is filled at their respective price, and the matcher receives a profit denominated in the ERC20 token.", + "params": { + "buyOrder": "Order buying an ERC721 asset.", + "buyOrderSignature": "Signature for the buy order.", + "sellOrder": "Order selling an ERC721 asset.", + "sellOrderSignature": "Signature for the sell order." + }, + "returns": { + "profit": "The amount of profit earned by the caller of this function (denominated in the ERC20 token of the matched orders)." + } + }, + "migrate(address,bytes,address)": { + "details": "Execute a migration function in the context of the ZeroEx contract. The result of the function being called should be the magic bytes 0x2c64c5ef (`keccack('MIGRATE_SUCCESS')`). Only callable by the owner. The owner will be temporarily set to `address(this)` inside the call. Before returning, the owner will be set to `newOwner`.", + "params": { + "data": "The call data.", + "newOwner": "The address of the new owner.", + "target": "The migrator contract address." + } + }, + "multiplexBatchSellEthForToken(address,(uint8,uint256,bytes)[],uint256)": { + "details": "Sells attached ETH for `outputToken` using the provided calls.", + "params": { + "calls": "The calls to use to sell the attached ETH.", + "minBuyAmount": "The minimum amount of `outputToken` that must be bought for this function to not revert.", + "outputToken": "The token to buy." + }, + "returns": { + "boughtAmount": "The amount of `outputToken` bought." + } + }, + "multiplexBatchSellTokenForEth(address,(uint8,uint256,bytes)[],uint256,uint256)": { + "details": "Sells `sellAmount` of the given `inputToken` for ETH using the provided calls.", + "params": { + "calls": "The calls to use to sell the input tokens.", + "inputToken": "The token to sell.", + "minBuyAmount": "The minimum amount of ETH that must be bought for this function to not revert.", + "sellAmount": "The amount of `inputToken` to sell." + }, + "returns": { + "boughtAmount": "The amount of ETH bought." + } + }, + "multiplexBatchSellTokenForToken(address,address,(uint8,uint256,bytes)[],uint256,uint256)": { + "details": "Sells `sellAmount` of the given `inputToken` for `outputToken` using the provided calls.", + "params": { + "calls": "The calls to use to sell the input tokens.", + "inputToken": "The token to sell.", + "minBuyAmount": "The minimum amount of `outputToken` that must be bought for this function to not revert.", + "outputToken": "The token to buy.", + "sellAmount": "The amount of `inputToken` to sell." + }, + "returns": { + "boughtAmount": "The amount of `outputToken` bought." + } + }, + "multiplexMultiHopSellEthForToken(address[],(uint8,bytes)[],uint256)": { + "details": "Sells attached ETH via the given sequence of tokens and calls. `tokens[0]` must be WETH. The last token in `tokens` is the output token that will ultimately be sent to `msg.sender`", + "params": { + "calls": "The sequence of calls to use for the sell.", + "minBuyAmount": "The minimum amount of output tokens that must be bought for this function to not revert.", + "tokens": "The sequence of tokens to use for the sell, i.e. `tokens[i]` will be sold for `tokens[i+1]` via `calls[i]`." + }, + "returns": { + "boughtAmount": "The amount of output tokens bought." + } + }, + "multiplexMultiHopSellTokenForEth(address[],(uint8,bytes)[],uint256,uint256)": { + "details": "Sells `sellAmount` of the input token (`tokens[0]`) for ETH via the given sequence of tokens and calls. The last token in `tokens` must be WETH.", + "params": { + "calls": "The sequence of calls to use for the sell.", + "minBuyAmount": "The minimum amount of ETH that must be bought for this function to not revert.", + "tokens": "The sequence of tokens to use for the sell, i.e. `tokens[i]` will be sold for `tokens[i+1]` via `calls[i]`." + }, + "returns": { + "boughtAmount": "The amount of ETH bought." + } + }, + "multiplexMultiHopSellTokenForToken(address[],(uint8,bytes)[],uint256,uint256)": { + "details": "Sells `sellAmount` of the input token (`tokens[0]`) via the given sequence of tokens and calls. The last token in `tokens` is the output token that will ultimately be sent to `msg.sender`", + "params": { + "calls": "The sequence of calls to use for the sell.", + "minBuyAmount": "The minimum amount of output tokens that must be bought for this function to not revert.", + "tokens": "The sequence of tokens to use for the sell, i.e. `tokens[i]` will be sold for `tokens[i+1]` via `calls[i]`." + }, + "returns": { + "boughtAmount": "The amount of output tokens bought." + } + }, + "onERC1155Received(address,address,uint256,uint256,bytes)": { + "details": "Callback for the ERC1155 `safeTransferFrom` function. This callback can be used to sell an ERC1155 asset if a valid ERC1155 order, signature and `unwrapNativeToken` are encoded in `data`. This allows takers to sell their ERC1155 asset without first calling `setApprovalForAll`.", + "params": { + "data": "Additional data with no specified format. If a valid ERC1155 order, signature and `unwrapNativeToken` are encoded in `data`, this function will try to fill the order using the received asset.", + "from": "The address which previously owned the token.", + "operator": "The address which called `safeTransferFrom`.", + "tokenId": "The ID of the asset being transferred.", + "value": "The amount being transferred." + }, + "returns": { + "success": "The selector of this function (0xf23a6e61), indicating that the callback succeeded." + } + }, + "onERC721Received(address,address,uint256,bytes)": { + "details": "Callback for the ERC721 `safeTransferFrom` function. This callback can be used to sell an ERC721 asset if a valid ERC721 order, signature and `unwrapNativeToken` are encoded in `data`. This allows takers to sell their ERC721 asset without first calling `setApprovalForAll`.", + "params": { + "data": "Additional data with no specified format. If a valid ERC721 order, signature and `unwrapNativeToken` are encoded in `data`, this function will try to fill the order using the received asset.", + "from": "The address which previously owned the token.", + "operator": "The address which called `safeTransferFrom`.", + "tokenId": "The ID of the asset being transferred." + }, + "returns": { + "success": "The selector of this function (0x150b7a02), indicating that the callback succeeded." + } + }, + "owner()": { + "details": "The owner of this contract.", + "returns": { + "ownerAddress": "The owner address." + } + }, + "preSignERC1155Order((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128))": { + "details": "Approves an ERC1155 order on-chain. After pre-signing the order, the `PRESIGNED` signature type will become valid for that order and signer.", + "params": { + "order": "An ERC1155 order." + } + }, + "preSignERC721Order((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]))": { + "details": "Approves an ERC721 order on-chain. After pre-signing the order, the `PRESIGNED` signature type will become valid for that order and signer.", + "params": { + "order": "An ERC721 order." + } + }, + "registerAllowedOrderSigner(address,bool)": { + "details": "Register a signer who can sign on behalf of msg.sender This allows one to sign on behalf of a contract that calls this function", + "params": { + "allowed": "True to register, false to unregister.", + "signer": "The address from which you plan to generate signatures" + } + }, + "registerAllowedRfqOrigins(address[],bool)": { + "details": "Mark what tx.origin addresses are allowed to fill an order that specifies the message sender as its txOrigin.", + "params": { + "allowed": "True to register, false to unregister.", + "origins": "An array of origin addresses to update." + } + }, + "rollback(bytes4,address)": { + "details": "Roll back to a prior implementation of a function.", + "params": { + "selector": "The function selector.", + "targetImpl": "The address of an older implementation of the function." + } + }, + "sellERC1155((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),(uint8,uint8,bytes32,bytes32),uint256,uint128,bool,bytes)": { + "details": "Sells an ERC1155 asset to fill the given order.", + "params": { + "buyOrder": "The ERC1155 buy order.", + "callbackData": "If this parameter is non-zero, invokes `zeroExERC1155OrderCallback` on `msg.sender` after the ERC20 tokens have been transferred to `msg.sender` but before transferring the ERC1155 asset to the buyer.", + "erc1155SellAmount": "The amount of the ERC1155 asset to sell.", + "erc1155TokenId": "The ID of the ERC1155 asset being sold. If the given order specifies properties, the asset must satisfy those properties. Otherwise, it must equal the tokenId in the order.", + "signature": "The order signature from the maker.", + "unwrapNativeToken": "If this parameter is true and the ERC20 token of the order is e.g. WETH, unwraps the token before transferring it to the taker." + } + }, + "sellERC721((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32),uint256,bool,bytes)": { + "details": "Sells an ERC721 asset to fill the given order.", + "params": { + "buyOrder": "The ERC721 buy order.", + "callbackData": "If this parameter is non-zero, invokes `zeroExERC721OrderCallback` on `msg.sender` after the ERC20 tokens have been transferred to `msg.sender` but before transferring the ERC721 asset to the buyer.", + "erc721TokenId": "The ID of the ERC721 asset being sold. If the given order specifies properties, the asset must satisfy those properties. Otherwise, it must equal the tokenId in the order.", + "signature": "The order signature from the maker.", + "unwrapNativeToken": "If this parameter is true and the ERC20 token of the order is e.g. WETH, unwraps the token before transferring it to the taker." + } + }, + "sellEthForTokenToUniswapV3(bytes,uint256,address)": { + "details": "Sell attached ETH directly against uniswap v3.", + "params": { + "encodedPath": "Uniswap-encoded path, where the first token is WETH.", + "minBuyAmount": "Minimum amount of the last token in the path to buy.", + "recipient": "The recipient of the bought tokens. Can be zero for sender." + }, + "returns": { + "buyAmount": "Amount of the last token in the path bought." + } + }, + "sellToLiquidityProvider(address,address,address,address,uint256,uint256,bytes)": { + "details": "Sells `sellAmount` of `inputToken` to the liquidity provider at the given `provider` address.", + "params": { + "auxiliaryData": "Auxiliary data supplied to the `provider` contract.", + "inputToken": "The token being sold.", + "minBuyAmount": "The minimum acceptable amount of `outputToken` to buy. Reverts if this amount is not satisfied.", + "outputToken": "The token being bought.", + "provider": "The address of the on-chain liquidity provider to trade with.", + "recipient": "The recipient of the bought tokens. If equal to address(0), `msg.sender` is assumed to be the recipient.", + "sellAmount": "The amount of `inputToken` to sell." + }, + "returns": { + "boughtAmount": "The amount of `outputToken` bought." + } + }, + "sellToPancakeSwap(address[],uint256,uint256,uint8)": { + "details": "Efficiently sell directly to PancakeSwap (and forks).", + "params": { + "fork": "The protocol fork to use.", + "minBuyAmount": "Minimum amount of `tokens[-1]` to buy.", + "sellAmount": "of `tokens[0]` Amount to sell.", + "tokens": "Sell path." + }, + "returns": { + "buyAmount": "Amount of `tokens[-1]` bought." + } + }, + "sellToUniswap(address[],uint256,uint256,bool)": { + "details": "Efficiently sell directly to uniswap/sushiswap.", + "params": { + "isSushi": "Use sushiswap if true.", + "minBuyAmount": "Minimum amount of `tokens[-1]` to buy.", + "sellAmount": "of `tokens[0]` Amount to sell.", + "tokens": "Sell path." + }, + "returns": { + "buyAmount": "Amount of `tokens[-1]` bought." + } + }, + "sellTokenForEthToUniswapV3(bytes,uint256,uint256,address)": { + "details": "Sell a token for ETH directly against uniswap v3.", + "params": { + "encodedPath": "Uniswap-encoded path, where the last token is WETH.", + "minBuyAmount": "Minimum amount of ETH to buy.", + "recipient": "The recipient of the bought tokens. Can be zero for sender.", + "sellAmount": "amount of the first token in the path to sell." + }, + "returns": { + "buyAmount": "Amount of ETH bought." + } + }, + "sellTokenForTokenToUniswapV3(bytes,uint256,uint256,address)": { + "details": "Sell a token for another token directly against uniswap v3.", + "params": { + "encodedPath": "Uniswap-encoded path.", + "minBuyAmount": "Minimum amount of the last token in the path to buy.", + "recipient": "The recipient of the bought tokens. Can be zero for sender.", + "sellAmount": "amount of the first token in the path to sell." + }, + "returns": { + "buyAmount": "Amount of the last token in the path bought." + } + }, + "setQuoteSigner(address)": { + "details": "Replace the optional signer for `transformERC20()` calldata. Only callable by the owner.", + "params": { + "quoteSigner": "The address of the new calldata signer." + } + }, + "setTransformerDeployer(address)": { + "details": "Replace the allowed deployer for transformers. Only callable by the owner.", + "params": { + "transformerDeployer": "The address of the new trusted deployer for transformers." + } + }, + "supportInterface(bytes4)": { + "details": "Indicates whether the 0x Exchange Proxy implements a particular ERC165 interface. This function should use at most 30,000 gas.", + "params": { + "interfaceId": "The interface identifier, as specified in ERC165." + }, + "returns": { + "isSupported": "Whether the given interface is supported by the 0x Exchange Proxy." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new address.", + "params": { + "newOwner": "The address that will become the owner." + } + }, + "transferProtocolFeesForPools(bytes32[])": { + "details": "Transfers protocol fees from the `FeeCollector` pools into the staking contract.", + "params": { + "poolIds": "Staking pool IDs" + } + }, + "transferTrappedTokensTo(address,uint256,address)": { + "details": "calledFrom FundRecoveryFeature.transferTrappedTokensTo() This will be delegatecalled in the context of the Exchange Proxy instance being used.", + "params": { + "amountOut": "Amount of tokens to withdraw.", + "erc20": "ERC20 Token Address.", + "recipientWallet": "Recipient wallet address." + } + }, + "transformERC20(address,address,uint256,uint256,(uint32,bytes)[])": { + "details": "Executes a series of transformations to convert an ERC20 `inputToken` to an ERC20 `outputToken`.", + "params": { + "inputToken": "The token being provided by the sender. If `0xeee...`, ETH is implied and should be provided with the call.`", + "inputTokenAmount": "The amount of `inputToken` to take from the sender.", + "minOutputTokenAmount": "The minimum amount of `outputToken` the sender must receive for the entire transformation to succeed.", + "outputToken": "The token to be acquired by the sender. `0xeee...` implies ETH.", + "transformations": "The transformations to execute on the token balance(s) in sequence." + }, + "returns": { + "outputTokenAmount": "The amount of `outputToken` received by the sender." + } + }, + "uniswapV3SwapCallback(int256,int256,bytes)": { + "details": "The UniswapV3 pool swap callback which pays the funds requested by the caller/pool to the pool. Can only be called by a valid UniswapV3 pool.", + "params": { + "amount0Delta": "Token0 amount owed.", + "amount1Delta": "Token1 amount owed.", + "data": "Arbitrary data forwarded from swap() caller. An ABI-encoded struct of: inputToken, outputToken, fee, payer" + } + }, + "validateERC1155OrderProperties((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),uint256)": { + "details": "If the given order is buying an ERC1155 asset, checks whether or not the given token ID satisfies the required properties specified in the order. If the order does not specify any properties, this function instead checks whether the given token ID matches the ID in the order. Reverts if any checks fail, or if the order is selling an ERC1155 asset.", + "params": { + "erc1155TokenId": "The ID of the ERC1155 asset.", + "order": "The ERC1155 order." + } + }, + "validateERC1155OrderSignature((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[],uint128),(uint8,uint8,bytes32,bytes32))": { + "details": "Checks whether the given signature is valid for the the given ERC1155 order. Reverts if not.", + "params": { + "order": "The ERC1155 order.", + "signature": "The signature to validate." + } + }, + "validateERC721OrderProperties((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),uint256)": { + "details": "If the given order is buying an ERC721 asset, checks whether or not the given token ID satisfies the required properties specified in the order. If the order does not specify any properties, this function instead checks whether the given token ID matches the ID in the order. Reverts if any checks fail, or if the order is selling an ERC721 asset.", + "params": { + "erc721TokenId": "The ID of the ERC721 asset.", + "order": "The ERC721 order." + } + }, + "validateERC721OrderSignature((uint8,address,address,uint256,uint256,address,uint256,(address,uint256,bytes)[],address,uint256,(address,bytes)[]),(uint8,uint8,bytes32,bytes32))": { + "details": "Checks whether the given signature is valid for the the given ERC721 order. Reverts if not.", + "params": { + "order": "The ERC721 order.", + "signature": "The signature to validate." + } + } + }, + "version": 1 + } +} diff --git a/crates/contracts/artifacts/Solver.json b/crates/contracts/artifacts/Solver.json index 209e189854..94ba3bd7da 100644 --- a/crates/contracts/artifacts/Solver.json +++ b/crates/contracts/artifacts/Solver.json @@ -1 +1,112 @@ -{"abi":[{"inputs":[{"internalType":"contract Trader","name":"trader","type":"address"},{"internalType":"contract ISettlement","name":"settlementContract","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"address","name":"nativeToken","type":"address"},{"internalType":"address","name":"spardose","type":"address"}],"name":"ensureTradePreconditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"countGas","type":"bool"}],"name":"storeBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISettlement","name":"settlementContract","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"bytes","name":"settlementCall","type":"bytes"}],"name":"swap","outputs":[{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"uint256[]","name":"queriedBalances","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x6080604052348015600e575f5ffd5b506109c58061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80631d47e7f4146100435780632582edb41461006d5780633bbb2e1d14610082575b5f5ffd5b610056610051366004610702565b610095565b6040516100649291906107c6565b60405180910390f35b61008061007b366004610813565b610229565b005b610080610090366004610888565b61031e565b5f606033301461012b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f6f6e6c792073696d756c6174696f6e206c6f67696320697320616c6c6f77656460448201527f20746f2063616c6c202773776170272066756e6374696f6e0000000000000000606482015260840160405180910390fd5b5f8573ffffffffffffffffffffffffffffffffffffffff165f6040515f6040518083038185875af1925050503d805f8114610181576040519150601f19603f3d011682016040523d82523d5f602084013e610186565b606091505b505090505061019687878a61048d565b6101a1888585610557565b91506101ae87878a61048d565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c80548060200260200160405190810160405280929190818152602001828054801561021757602002820191905f5260205f20905b815481526020019060010190808311610203575b50505050509050965096945050505050565b5f5a6040517f542eb77d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152878116602483015260448201879052858116606483015284811660848301529192509088169063542eb77d9060a4015f604051808303815f87803b1580156102b4575f5ffd5b505af11580156102c6573d5f5f3e3d5ffd5b505050505a6102d59082610901565b6102e19061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610310919061091a565b909155505050505050505050565b5f5a90507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff861614610407576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528616906370a0823190602401602060405180830381865afa1580156103de573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610402919061092d565b610420565b8373ffffffffffffffffffffffffffffffffffffffff16315b81546001810183555f9283526020909220909101558115610487575a6104469082610901565b6104529061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610481919061091a565b90915550505b50505050565b5f5b828110156104875730633bbb2e1d8585848181106104af576104af610944565b90506020020160208101906104c49190610971565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff918216600482015290851660248201525f60448201526064015f604051808303815f87803b158015610535575f5ffd5b505af1158015610547573d5f5f3e3d5ffd5b50506001909201915061048f9050565b5f5f5a90506105b284848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505073ffffffffffffffffffffffffffffffffffffffff8916929150506105f3565b507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b545a6105e09083610901565b6105ea9190610901565b95945050505050565b6060610600835f84610607565b9392505050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610630919061098c565b5f6040518083038185875af1925050503d805f811461066a576040519150601f19603f3d011682016040523d82523d5f602084013e61066f565b606091505b50925090508061068157815160208301fd5b509392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146106aa575f5ffd5b50565b80356106b881610689565b919050565b5f5f83601f8401126106cd575f5ffd5b50813567ffffffffffffffff8111156106e4575f5ffd5b6020830191508360208285010111156106fb575f5ffd5b9250929050565b5f5f5f5f5f5f60808789031215610717575f5ffd5b863561072281610689565b9550602087013567ffffffffffffffff81111561073d575f5ffd5b8701601f8101891361074d575f5ffd5b803567ffffffffffffffff811115610763575f5ffd5b8960208260051b8401011115610777575f5ffd5b6020919091019550935061078d604088016106ad565b9250606087013567ffffffffffffffff8111156107a8575f5ffd5b6107b489828a016106bd565b979a9699509497509295939492505050565b5f60408201848352604060208401528084518083526060850191506020860192505f5b818110156108075783518352602093840193909201916001016107e9565b50909695505050505050565b5f5f5f5f5f5f60c08789031215610828575f5ffd5b863561083381610689565b9550602087013561084381610689565b9450604087013561085381610689565b935060608701359250608087013561086a81610689565b915060a087013561087a81610689565b809150509295509295509295565b5f5f5f6060848603121561089a575f5ffd5b83356108a581610689565b925060208401356108b581610689565b9150604084013580151581146108c9575f5ffd5b809150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b81810381811115610914576109146108d4565b92915050565b80820180821115610914576109146108d4565b5f6020828403121561093d575f5ffd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610981575f5ffd5b813561060081610689565b5f82515f5b818110156109ab5760208186018101518583015201610991565b505f92019182525091905056fea164736f6c634300081e000a","deployedBytecode":"0x608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80631d47e7f4146100435780632582edb41461006d5780633bbb2e1d14610082575b5f5ffd5b610056610051366004610702565b610095565b6040516100649291906107c6565b60405180910390f35b61008061007b366004610813565b610229565b005b610080610090366004610888565b61031e565b5f606033301461012b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f6f6e6c792073696d756c6174696f6e206c6f67696320697320616c6c6f77656460448201527f20746f2063616c6c202773776170272066756e6374696f6e0000000000000000606482015260840160405180910390fd5b5f8573ffffffffffffffffffffffffffffffffffffffff165f6040515f6040518083038185875af1925050503d805f8114610181576040519150601f19603f3d011682016040523d82523d5f602084013e610186565b606091505b505090505061019687878a61048d565b6101a1888585610557565b91506101ae87878a61048d565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c80548060200260200160405190810160405280929190818152602001828054801561021757602002820191905f5260205f20905b815481526020019060010190808311610203575b50505050509050965096945050505050565b5f5a6040517f542eb77d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152878116602483015260448201879052858116606483015284811660848301529192509088169063542eb77d9060a4015f604051808303815f87803b1580156102b4575f5ffd5b505af11580156102c6573d5f5f3e3d5ffd5b505050505a6102d59082610901565b6102e19061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610310919061091a565b909155505050505050505050565b5f5a90507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff861614610407576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528616906370a0823190602401602060405180830381865afa1580156103de573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610402919061092d565b610420565b8373ffffffffffffffffffffffffffffffffffffffff16315b81546001810183555f9283526020909220909101558115610487575a6104469082610901565b6104529061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610481919061091a565b90915550505b50505050565b5f5b828110156104875730633bbb2e1d8585848181106104af576104af610944565b90506020020160208101906104c49190610971565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff918216600482015290851660248201525f60448201526064015f604051808303815f87803b158015610535575f5ffd5b505af1158015610547573d5f5f3e3d5ffd5b50506001909201915061048f9050565b5f5f5a90506105b284848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505073ffffffffffffffffffffffffffffffffffffffff8916929150506105f3565b507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b545a6105e09083610901565b6105ea9190610901565b95945050505050565b6060610600835f84610607565b9392505050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610630919061098c565b5f6040518083038185875af1925050503d805f811461066a576040519150601f19603f3d011682016040523d82523d5f602084013e61066f565b606091505b50925090508061068157815160208301fd5b509392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146106aa575f5ffd5b50565b80356106b881610689565b919050565b5f5f83601f8401126106cd575f5ffd5b50813567ffffffffffffffff8111156106e4575f5ffd5b6020830191508360208285010111156106fb575f5ffd5b9250929050565b5f5f5f5f5f5f60808789031215610717575f5ffd5b863561072281610689565b9550602087013567ffffffffffffffff81111561073d575f5ffd5b8701601f8101891361074d575f5ffd5b803567ffffffffffffffff811115610763575f5ffd5b8960208260051b8401011115610777575f5ffd5b6020919091019550935061078d604088016106ad565b9250606087013567ffffffffffffffff8111156107a8575f5ffd5b6107b489828a016106bd565b979a9699509497509295939492505050565b5f60408201848352604060208401528084518083526060850191506020860192505f5b818110156108075783518352602093840193909201916001016107e9565b50909695505050505050565b5f5f5f5f5f5f60c08789031215610828575f5ffd5b863561083381610689565b9550602087013561084381610689565b9450604087013561085381610689565b935060608701359250608087013561086a81610689565b915060a087013561087a81610689565b809150509295509295509295565b5f5f5f6060848603121561089a575f5ffd5b83356108a581610689565b925060208401356108b581610689565b9150604084013580151581146108c9575f5ffd5b809150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b81810381811115610914576109146108d4565b92915050565b80820180821115610914576109146108d4565b5f6020828403121561093d575f5ffd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610981575f5ffd5b813561060081610689565b5f82515f5b818110156109ab5760208186018101518583015201610991565b505f92019182525091905056fea164736f6c634300081e000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract Trader", + "name": "trader", + "type": "address" + }, + { + "internalType": "contract ISettlement", + "name": "settlementContract", + "type": "address" + }, + { + "internalType": "address", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "nativeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "spardose", + "type": "address" + } + ], + "name": "ensureTradePreconditions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "bool", + "name": "countGas", + "type": "bool" + } + ], + "name": "storeBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISettlement", + "name": "settlementContract", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address payable", + "name": "receiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "settlementCall", + "type": "bytes" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "gasUsed", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "queriedBalances", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6080604052348015600e575f5ffd5b506109c58061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80631d47e7f4146100435780632582edb41461006d5780633bbb2e1d14610082575b5f5ffd5b610056610051366004610702565b610095565b6040516100649291906107c6565b60405180910390f35b61008061007b366004610813565b610229565b005b610080610090366004610888565b61031e565b5f606033301461012b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f6f6e6c792073696d756c6174696f6e206c6f67696320697320616c6c6f77656460448201527f20746f2063616c6c202773776170272066756e6374696f6e0000000000000000606482015260840160405180910390fd5b5f8573ffffffffffffffffffffffffffffffffffffffff165f6040515f6040518083038185875af1925050503d805f8114610181576040519150601f19603f3d011682016040523d82523d5f602084013e610186565b606091505b505090505061019687878a61048d565b6101a1888585610557565b91506101ae87878a61048d565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c80548060200260200160405190810160405280929190818152602001828054801561021757602002820191905f5260205f20905b815481526020019060010190808311610203575b50505050509050965096945050505050565b5f5a6040517f542eb77d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152878116602483015260448201879052858116606483015284811660848301529192509088169063542eb77d9060a4015f604051808303815f87803b1580156102b4575f5ffd5b505af11580156102c6573d5f5f3e3d5ffd5b505050505a6102d59082610901565b6102e19061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610310919061091a565b909155505050505050505050565b5f5a90507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff861614610407576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528616906370a0823190602401602060405180830381865afa1580156103de573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610402919061092d565b610420565b8373ffffffffffffffffffffffffffffffffffffffff16315b81546001810183555f9283526020909220909101558115610487575a6104469082610901565b6104529061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610481919061091a565b90915550505b50505050565b5f5b828110156104875730633bbb2e1d8585848181106104af576104af610944565b90506020020160208101906104c49190610971565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff918216600482015290851660248201525f60448201526064015f604051808303815f87803b158015610535575f5ffd5b505af1158015610547573d5f5f3e3d5ffd5b50506001909201915061048f9050565b5f5f5a90506105b284848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505073ffffffffffffffffffffffffffffffffffffffff8916929150506105f3565b507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b545a6105e09083610901565b6105ea9190610901565b95945050505050565b6060610600835f84610607565b9392505050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610630919061098c565b5f6040518083038185875af1925050503d805f811461066a576040519150601f19603f3d011682016040523d82523d5f602084013e61066f565b606091505b50925090508061068157815160208301fd5b509392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146106aa575f5ffd5b50565b80356106b881610689565b919050565b5f5f83601f8401126106cd575f5ffd5b50813567ffffffffffffffff8111156106e4575f5ffd5b6020830191508360208285010111156106fb575f5ffd5b9250929050565b5f5f5f5f5f5f60808789031215610717575f5ffd5b863561072281610689565b9550602087013567ffffffffffffffff81111561073d575f5ffd5b8701601f8101891361074d575f5ffd5b803567ffffffffffffffff811115610763575f5ffd5b8960208260051b8401011115610777575f5ffd5b6020919091019550935061078d604088016106ad565b9250606087013567ffffffffffffffff8111156107a8575f5ffd5b6107b489828a016106bd565b979a9699509497509295939492505050565b5f60408201848352604060208401528084518083526060850191506020860192505f5b818110156108075783518352602093840193909201916001016107e9565b50909695505050505050565b5f5f5f5f5f5f60c08789031215610828575f5ffd5b863561083381610689565b9550602087013561084381610689565b9450604087013561085381610689565b935060608701359250608087013561086a81610689565b915060a087013561087a81610689565b809150509295509295509295565b5f5f5f6060848603121561089a575f5ffd5b83356108a581610689565b925060208401356108b581610689565b9150604084013580151581146108c9575f5ffd5b809150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b81810381811115610914576109146108d4565b92915050565b80820180821115610914576109146108d4565b5f6020828403121561093d575f5ffd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610981575f5ffd5b813561060081610689565b5f82515f5b818110156109ab5760208186018101518583015201610991565b505f92019182525091905056fea164736f6c634300081e000a", + "deployedBytecode": "0x608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80631d47e7f4146100435780632582edb41461006d5780633bbb2e1d14610082575b5f5ffd5b610056610051366004610702565b610095565b6040516100649291906107c6565b60405180910390f35b61008061007b366004610813565b610229565b005b610080610090366004610888565b61031e565b5f606033301461012b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f6f6e6c792073696d756c6174696f6e206c6f67696320697320616c6c6f77656460448201527f20746f2063616c6c202773776170272066756e6374696f6e0000000000000000606482015260840160405180910390fd5b5f8573ffffffffffffffffffffffffffffffffffffffff165f6040515f6040518083038185875af1925050503d805f8114610181576040519150601f19603f3d011682016040523d82523d5f602084013e610186565b606091505b505090505061019687878a61048d565b6101a1888585610557565b91506101ae87878a61048d565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c80548060200260200160405190810160405280929190818152602001828054801561021757602002820191905f5260205f20905b815481526020019060010190808311610203575b50505050509050965096945050505050565b5f5a6040517f542eb77d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152878116602483015260448201879052858116606483015284811660848301529192509088169063542eb77d9060a4015f604051808303815f87803b1580156102b4575f5ffd5b505af11580156102c6573d5f5f3e3d5ffd5b505050505a6102d59082610901565b6102e19061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610310919061091a565b909155505050505050505050565b5f5a90507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff861614610407576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528616906370a0823190602401602060405180830381865afa1580156103de573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610402919061092d565b610420565b8373ffffffffffffffffffffffffffffffffffffffff16315b81546001810183555f9283526020909220909101558115610487575a6104469082610901565b6104529061116c61091a565b7f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b5f828254610481919061091a565b90915550505b50505050565b5f5b828110156104875730633bbb2e1d8585848181106104af576104af610944565b90506020020160208101906104c49190610971565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff918216600482015290851660248201525f60448201526064015f604051808303815f87803b158015610535575f5ffd5b505af1158015610547573d5f5f3e3d5ffd5b50506001909201915061048f9050565b5f5f5a90506105b284848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505073ffffffffffffffffffffffffffffffffffffffff8916929150506105f3565b507f14f5b2c185fc03c75c787d1f0e10ea137cc6d235a0047448eff18c9a173a722b545a6105e09083610901565b6105ea9190610901565b95945050505050565b6060610600835f84610607565b9392505050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610630919061098c565b5f6040518083038185875af1925050503d805f811461066a576040519150601f19603f3d011682016040523d82523d5f602084013e61066f565b606091505b50925090508061068157815160208301fd5b509392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146106aa575f5ffd5b50565b80356106b881610689565b919050565b5f5f83601f8401126106cd575f5ffd5b50813567ffffffffffffffff8111156106e4575f5ffd5b6020830191508360208285010111156106fb575f5ffd5b9250929050565b5f5f5f5f5f5f60808789031215610717575f5ffd5b863561072281610689565b9550602087013567ffffffffffffffff81111561073d575f5ffd5b8701601f8101891361074d575f5ffd5b803567ffffffffffffffff811115610763575f5ffd5b8960208260051b8401011115610777575f5ffd5b6020919091019550935061078d604088016106ad565b9250606087013567ffffffffffffffff8111156107a8575f5ffd5b6107b489828a016106bd565b979a9699509497509295939492505050565b5f60408201848352604060208401528084518083526060850191506020860192505f5b818110156108075783518352602093840193909201916001016107e9565b50909695505050505050565b5f5f5f5f5f5f60c08789031215610828575f5ffd5b863561083381610689565b9550602087013561084381610689565b9450604087013561085381610689565b935060608701359250608087013561086a81610689565b915060a087013561087a81610689565b809150509295509295509295565b5f5f5f6060848603121561089a575f5ffd5b83356108a581610689565b925060208401356108b581610689565b9150604084013580151581146108c9575f5ffd5b809150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b81810381811115610914576109146108d4565b92915050565b80820180821115610914576109146108d4565b5f6020828403121561093d575f5ffd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215610981575f5ffd5b813561060081610689565b5f82515f5b818110156109ab5760208186018101518583015201610991565b505f92019182525091905056fea164736f6c634300081e000a", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/artifacts/Spardose.json b/crates/contracts/artifacts/Spardose.json index 1dcb9cbb77..16ba804c7f 100644 --- a/crates/contracts/artifacts/Spardose.json +++ b/crates/contracts/artifacts/Spardose.json @@ -1 +1,30 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"requestFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x6080604052348015600e575f5ffd5b506102ca8061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063494666b61461002d575b5f5ffd5b61004061003b366004610230565b610042565b005b61006373ffffffffffffffffffffffffffffffffffffffff83163383610067565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052905f906100f990861683610175565b905061010481610189565b61016e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a207472616e73666572206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b6060610182835f846101ae565b9392505050565b5f81515f14806101a85750818060200190518101906101a89190610272565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff1684846040516101d79190610291565b5f6040518083038185875af1925050503d805f8114610211576040519150601f19603f3d011682016040523d82523d5f602084013e610216565b606091505b50925090508061022857815160208301fd5b509392505050565b5f5f60408385031215610241575f5ffd5b823573ffffffffffffffffffffffffffffffffffffffff81168114610264575f5ffd5b946020939093013593505050565b5f60208284031215610282575f5ffd5b81518015158114610182575f5ffd5b5f82515f5b818110156102b05760208186018101518583015201610296565b505f92019182525091905056fea164736f6c634300081e000a","deployedBytecode":"0x608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063494666b61461002d575b5f5ffd5b61004061003b366004610230565b610042565b005b61006373ffffffffffffffffffffffffffffffffffffffff83163383610067565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052905f906100f990861683610175565b905061010481610189565b61016e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a207472616e73666572206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b6060610182835f846101ae565b9392505050565b5f81515f14806101a85750818060200190518101906101a89190610272565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff1684846040516101d79190610291565b5f6040518083038185875af1925050503d805f8114610211576040519150601f19603f3d011682016040523d82523d5f602084013e610216565b606091505b50925090508061022857815160208301fd5b509392505050565b5f5f60408385031215610241575f5ffd5b823573ffffffffffffffffffffffffffffffffffffffff81168114610264575f5ffd5b946020939093013593505050565b5f60208284031215610282575f5ffd5b81518015158114610182575f5ffd5b5f82515f5b818110156102b05760208186018101518583015201610296565b505f92019182525091905056fea164736f6c634300081e000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "requestFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6080604052348015600e575f5ffd5b506102ca8061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063494666b61461002d575b5f5ffd5b61004061003b366004610230565b610042565b005b61006373ffffffffffffffffffffffffffffffffffffffff83163383610067565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052905f906100f990861683610175565b905061010481610189565b61016e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a207472616e73666572206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b6060610182835f846101ae565b9392505050565b5f81515f14806101a85750818060200190518101906101a89190610272565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff1684846040516101d79190610291565b5f6040518083038185875af1925050503d805f8114610211576040519150601f19603f3d011682016040523d82523d5f602084013e610216565b606091505b50925090508061022857815160208301fd5b509392505050565b5f5f60408385031215610241575f5ffd5b823573ffffffffffffffffffffffffffffffffffffffff81168114610264575f5ffd5b946020939093013593505050565b5f60208284031215610282575f5ffd5b81518015158114610182575f5ffd5b5f82515f5b818110156102b05760208186018101518583015201610296565b505f92019182525091905056fea164736f6c634300081e000a", + "deployedBytecode": "0x608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063494666b61461002d575b5f5ffd5b61004061003b366004610230565b610042565b005b61006373ffffffffffffffffffffffffffffffffffffffff83163383610067565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052905f906100f990861683610175565b905061010481610189565b61016e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a207472616e73666572206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b6060610182835f846101ae565b9392505050565b5f81515f14806101a85750818060200190518101906101a89190610272565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff1684846040516101d79190610291565b5f6040518083038185875af1925050503d805f8114610211576040519150601f19603f3d011682016040523d82523d5f602084013e610216565b606091505b50925090508061022857815160208301fd5b509392505050565b5f5f60408385031215610241575f5ffd5b823573ffffffffffffffffffffffffffffffffffffffff81168114610264575f5ffd5b946020939093013593505050565b5f60208284031215610282575f5ffd5b81518015158114610182575f5ffd5b5f82515f5b818110156102b05760208186018101518583015201610296565b505f92019182525091905056fea164736f6c634300081e000a", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/artifacts/Swapper.json b/crates/contracts/artifacts/Swapper.json index b90eda329d..eb7e177447 100644 --- a/crates/contracts/artifacts/Swapper.json +++ b/crates/contracts/artifacts/Swapper.json @@ -1 +1,128 @@ -{"abi":[{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"contract ISettlement","name":"settlement","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Asset","name":"sell","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Asset","name":"buy","type":"tuple"},{"components":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Allowance","name":"allowance","type":"tuple"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Interaction[]","name":"calls","type":"tuple[]"}],"name":"swap","outputs":[{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b506111df806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e8333e0d146100a7575b600080fd5b610071610049366004610a9b565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b6100ba6100b5366004610b54565b6100c8565b60405190815260200161009e565b6000602086018035906100db9088610c11565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016b9190610c2e565b101561017957506000610858565b6102178773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101eb9190610c47565b60006101fa60208a018a610c11565b73ffffffffffffffffffffffffffffffffffffffff169190610862565b61029a8773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610265573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102899190610c47565b602088018035906101fa908a610c11565b6040805160028082526060820183526000926020830190803683370190505090506102c86020880188610c11565b816000815181106102db576102db610c93565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910182015261030b90870187610c11565b8160018151811061031e5761031e610c93565b73ffffffffffffffffffffffffffffffffffffffff92909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905086602001358160008151811061037e5761037e610c93565b6020026020010181815250508760200135816001815181106103a2576103a2610c93565b6020908102919091010152604080516001808252818301909252600091816020015b6104406040518061016001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600063ffffffff16815260200160008019168152602001600081526020016000815260200160008152602001606081525090565b8152602001906001900390816103c45790505090506040518061016001604052806000815260200160018152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020018a6020013581526020018960200135815260200163ffffffff801681526020016000801b815260200160008152602001604081526020016000815260200130604051602001610506919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152508160008151811061052b5761052b610c93565b602002602001018190525061053e610a74565b60208089013590610551908c018c610c11565b73ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8d61057a60208d018d610c11565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190610c2e565b101561078c5760408051600180825281830190925290816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081610629575050815261066660208b018b610c11565b8151805160009061067957610679610c93565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff9092169091526106ac908b018b610c11565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b36106d460208b018b610c11565b60405173ffffffffffffffffffffffffffffffffffffffff909116602482015260208b01356044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b929092179091529050816000602002015160008151811061077c5761077c610c93565b6020026020010151604001819052505b6107968688610d3a565b60208201526040516108519073ffffffffffffffffffffffffffffffffffffffff8d16906313d79a0b906107d49088908890889088906024016110a1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b9290921790915273ffffffffffffffffffffffffffffffffffffffff8e169150610971565b9450505050505b9695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052906000906108f590861683610986565b905061090081610994565b61096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b600061097f836000846109bb565b9392505050565b606061097f836000846109ee565b60008151600014806109b55750818060200190518101906109b5919061115a565b92915050565b60005a905060008083516020850186885af16109db573d6000803e3d6000fd5b5a6109e6908261117c565b949350505050565b606060008473ffffffffffffffffffffffffffffffffffffffff168484604051610a1891906111b6565b60006040518083038185875af1925050503d8060008114610a55576040519150601f19603f3d011682016040523d82523d6000602084013e610a5a565b606091505b509250905080610a6c57815160208301fd5b509392505050565b60405180606001604052806003905b6060815260200190600190039081610a835790505090565b600080600060408486031215610ab057600080fd5b83359250602084013567ffffffffffffffff80821115610acf57600080fd5b818601915086601f830112610ae357600080fd5b813581811115610af257600080fd5b876020828501011115610b0457600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff81168114610b3957600080fd5b50565b600060408284031215610b4e57600080fd5b50919050565b6000806000806000806101008789031215610b6e57600080fd5b8635610b7981610b17565b9550610b888860208901610b3c565b9450610b978860608901610b3c565b9350610ba68860a08901610b3c565b925060e087013567ffffffffffffffff80821115610bc357600080fd5b818901915089601f830112610bd757600080fd5b813581811115610be657600080fd5b8a60208260051b8501011115610bfb57600080fd5b6020830194508093505050509295509295509295565b600060208284031215610c2357600080fd5b813561097f81610b17565b600060208284031215610c4057600080fd5b5051919050565b600060208284031215610c5957600080fd5b815161097f81610b17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040516060810167ffffffffffffffff81118282101715610ce557610ce5610c64565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610d3257610d32610c64565b604052919050565b600067ffffffffffffffff80841115610d5557610d55610c64565b8360051b6020610d66818301610ceb565b868152918501918181019036841115610d7e57600080fd5b865b84811015610e6d57803586811115610d985760008081fd5b88016060368290031215610dac5760008081fd5b610db4610cc2565b8135610dbf81610b17565b8152818601358682015260408083013589811115610ddd5760008081fd5b9290920191601f3681850112610df35760008081fd5b83358a811115610e0557610e05610c64565b610e34897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08484011601610ceb565b91508082523689828701011115610e4b5760008081fd5b808986018a840137600090820189015290820152845250918301918301610d80565b50979650505050505050565b60005b83811015610e94578181015183820152602001610e7c565b50506000910152565b60008151808452610eb5816020860160208601610e79565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610fc75782840389528151610160815186528682015187870152604080830151610f4a8289018273ffffffffffffffffffffffffffffffffffffffff169052565b5050606082810151908701526080808301519087015260a08083015163ffffffff169087015260c0808301519087015260e080830151908701526101008083015190870152610120808301519087015261014091820151918601819052610fb381870183610e9d565b9a87019a9550505090840190600101610f05565b5091979650505050505050565b6000826060808201846000805b6003811015610fc7578584038952825180518086526020918201918087019190600582901b88018101865b8381101561108a578982037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00185528551805173ffffffffffffffffffffffffffffffffffffffff16835283810151848401526040908101519083018c90526110778c840182610e9d565b968401969584019592505060010161100c565b509c81019c97509590950194505050600101610fe1565b6080808252855190820181905260009060209060a0840190828901845b828110156110f057815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016110be565b5050508381038285015286518082528783019183019060005b8181101561112557835183529284019291840191600101611109565b505084810360408601526111398188610ee7565b92505050828103606084015261114f8185610fd4565b979650505050505050565b60006020828403121561116c57600080fd5b8151801515811461097f57600080fd5b818103818111156109b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082516111c8818460208701610e79565b919091019291505056fea164736f6c6343000811000a","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e8333e0d146100a7575b600080fd5b610071610049366004610a9b565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b6100ba6100b5366004610b54565b6100c8565b60405190815260200161009e565b6000602086018035906100db9088610c11565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016b9190610c2e565b101561017957506000610858565b6102178773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101eb9190610c47565b60006101fa60208a018a610c11565b73ffffffffffffffffffffffffffffffffffffffff169190610862565b61029a8773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610265573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102899190610c47565b602088018035906101fa908a610c11565b6040805160028082526060820183526000926020830190803683370190505090506102c86020880188610c11565b816000815181106102db576102db610c93565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910182015261030b90870187610c11565b8160018151811061031e5761031e610c93565b73ffffffffffffffffffffffffffffffffffffffff92909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905086602001358160008151811061037e5761037e610c93565b6020026020010181815250508760200135816001815181106103a2576103a2610c93565b6020908102919091010152604080516001808252818301909252600091816020015b6104406040518061016001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600063ffffffff16815260200160008019168152602001600081526020016000815260200160008152602001606081525090565b8152602001906001900390816103c45790505090506040518061016001604052806000815260200160018152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020018a6020013581526020018960200135815260200163ffffffff801681526020016000801b815260200160008152602001604081526020016000815260200130604051602001610506919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152508160008151811061052b5761052b610c93565b602002602001018190525061053e610a74565b60208089013590610551908c018c610c11565b73ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8d61057a60208d018d610c11565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190610c2e565b101561078c5760408051600180825281830190925290816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081610629575050815261066660208b018b610c11565b8151805160009061067957610679610c93565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff9092169091526106ac908b018b610c11565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b36106d460208b018b610c11565b60405173ffffffffffffffffffffffffffffffffffffffff909116602482015260208b01356044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b929092179091529050816000602002015160008151811061077c5761077c610c93565b6020026020010151604001819052505b6107968688610d3a565b60208201526040516108519073ffffffffffffffffffffffffffffffffffffffff8d16906313d79a0b906107d49088908890889088906024016110a1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b9290921790915273ffffffffffffffffffffffffffffffffffffffff8e169150610971565b9450505050505b9695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052906000906108f590861683610986565b905061090081610994565b61096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b600061097f836000846109bb565b9392505050565b606061097f836000846109ee565b60008151600014806109b55750818060200190518101906109b5919061115a565b92915050565b60005a905060008083516020850186885af16109db573d6000803e3d6000fd5b5a6109e6908261117c565b949350505050565b606060008473ffffffffffffffffffffffffffffffffffffffff168484604051610a1891906111b6565b60006040518083038185875af1925050503d8060008114610a55576040519150601f19603f3d011682016040523d82523d6000602084013e610a5a565b606091505b509250905080610a6c57815160208301fd5b509392505050565b60405180606001604052806003905b6060815260200190600190039081610a835790505090565b600080600060408486031215610ab057600080fd5b83359250602084013567ffffffffffffffff80821115610acf57600080fd5b818601915086601f830112610ae357600080fd5b813581811115610af257600080fd5b876020828501011115610b0457600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff81168114610b3957600080fd5b50565b600060408284031215610b4e57600080fd5b50919050565b6000806000806000806101008789031215610b6e57600080fd5b8635610b7981610b17565b9550610b888860208901610b3c565b9450610b978860608901610b3c565b9350610ba68860a08901610b3c565b925060e087013567ffffffffffffffff80821115610bc357600080fd5b818901915089601f830112610bd757600080fd5b813581811115610be657600080fd5b8a60208260051b8501011115610bfb57600080fd5b6020830194508093505050509295509295509295565b600060208284031215610c2357600080fd5b813561097f81610b17565b600060208284031215610c4057600080fd5b5051919050565b600060208284031215610c5957600080fd5b815161097f81610b17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040516060810167ffffffffffffffff81118282101715610ce557610ce5610c64565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610d3257610d32610c64565b604052919050565b600067ffffffffffffffff80841115610d5557610d55610c64565b8360051b6020610d66818301610ceb565b868152918501918181019036841115610d7e57600080fd5b865b84811015610e6d57803586811115610d985760008081fd5b88016060368290031215610dac5760008081fd5b610db4610cc2565b8135610dbf81610b17565b8152818601358682015260408083013589811115610ddd5760008081fd5b9290920191601f3681850112610df35760008081fd5b83358a811115610e0557610e05610c64565b610e34897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08484011601610ceb565b91508082523689828701011115610e4b5760008081fd5b808986018a840137600090820189015290820152845250918301918301610d80565b50979650505050505050565b60005b83811015610e94578181015183820152602001610e7c565b50506000910152565b60008151808452610eb5816020860160208601610e79565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610fc75782840389528151610160815186528682015187870152604080830151610f4a8289018273ffffffffffffffffffffffffffffffffffffffff169052565b5050606082810151908701526080808301519087015260a08083015163ffffffff169087015260c0808301519087015260e080830151908701526101008083015190870152610120808301519087015261014091820151918601819052610fb381870183610e9d565b9a87019a9550505090840190600101610f05565b5091979650505050505050565b6000826060808201846000805b6003811015610fc7578584038952825180518086526020918201918087019190600582901b88018101865b8381101561108a578982037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00185528551805173ffffffffffffffffffffffffffffffffffffffff16835283810151848401526040908101519083018c90526110778c840182610e9d565b968401969584019592505060010161100c565b509c81019c97509590950194505050600101610fe1565b6080808252855190820181905260009060209060a0840190828901845b828110156110f057815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016110be565b5050508381038285015286518082528783019183019060005b8181101561112557835183529284019291840191600101611109565b505084810360408601526111398188610ee7565b92505050828103606084015261114f8185610fd4565b979650505050505050565b60006020828403121561116c57600080fd5b8151801515811461097f57600080fd5b818103818111156109b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082516111c8818460208701610e79565b919091019291505056fea164736f6c6343000811000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ISettlement", + "name": "settlement", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct Asset", + "name": "sell", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct Asset", + "name": "buy", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct Allowance", + "name": "allowance", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Interaction[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "gasUsed", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506111df806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e8333e0d146100a7575b600080fd5b610071610049366004610a9b565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b6100ba6100b5366004610b54565b6100c8565b60405190815260200161009e565b6000602086018035906100db9088610c11565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016b9190610c2e565b101561017957506000610858565b6102178773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101eb9190610c47565b60006101fa60208a018a610c11565b73ffffffffffffffffffffffffffffffffffffffff169190610862565b61029a8773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610265573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102899190610c47565b602088018035906101fa908a610c11565b6040805160028082526060820183526000926020830190803683370190505090506102c86020880188610c11565b816000815181106102db576102db610c93565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910182015261030b90870187610c11565b8160018151811061031e5761031e610c93565b73ffffffffffffffffffffffffffffffffffffffff92909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905086602001358160008151811061037e5761037e610c93565b6020026020010181815250508760200135816001815181106103a2576103a2610c93565b6020908102919091010152604080516001808252818301909252600091816020015b6104406040518061016001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600063ffffffff16815260200160008019168152602001600081526020016000815260200160008152602001606081525090565b8152602001906001900390816103c45790505090506040518061016001604052806000815260200160018152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020018a6020013581526020018960200135815260200163ffffffff801681526020016000801b815260200160008152602001604081526020016000815260200130604051602001610506919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152508160008151811061052b5761052b610c93565b602002602001018190525061053e610a74565b60208089013590610551908c018c610c11565b73ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8d61057a60208d018d610c11565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190610c2e565b101561078c5760408051600180825281830190925290816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081610629575050815261066660208b018b610c11565b8151805160009061067957610679610c93565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff9092169091526106ac908b018b610c11565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b36106d460208b018b610c11565b60405173ffffffffffffffffffffffffffffffffffffffff909116602482015260208b01356044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b929092179091529050816000602002015160008151811061077c5761077c610c93565b6020026020010151604001819052505b6107968688610d3a565b60208201526040516108519073ffffffffffffffffffffffffffffffffffffffff8d16906313d79a0b906107d49088908890889088906024016110a1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b9290921790915273ffffffffffffffffffffffffffffffffffffffff8e169150610971565b9450505050505b9695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052906000906108f590861683610986565b905061090081610994565b61096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b600061097f836000846109bb565b9392505050565b606061097f836000846109ee565b60008151600014806109b55750818060200190518101906109b5919061115a565b92915050565b60005a905060008083516020850186885af16109db573d6000803e3d6000fd5b5a6109e6908261117c565b949350505050565b606060008473ffffffffffffffffffffffffffffffffffffffff168484604051610a1891906111b6565b60006040518083038185875af1925050503d8060008114610a55576040519150601f19603f3d011682016040523d82523d6000602084013e610a5a565b606091505b509250905080610a6c57815160208301fd5b509392505050565b60405180606001604052806003905b6060815260200190600190039081610a835790505090565b600080600060408486031215610ab057600080fd5b83359250602084013567ffffffffffffffff80821115610acf57600080fd5b818601915086601f830112610ae357600080fd5b813581811115610af257600080fd5b876020828501011115610b0457600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff81168114610b3957600080fd5b50565b600060408284031215610b4e57600080fd5b50919050565b6000806000806000806101008789031215610b6e57600080fd5b8635610b7981610b17565b9550610b888860208901610b3c565b9450610b978860608901610b3c565b9350610ba68860a08901610b3c565b925060e087013567ffffffffffffffff80821115610bc357600080fd5b818901915089601f830112610bd757600080fd5b813581811115610be657600080fd5b8a60208260051b8501011115610bfb57600080fd5b6020830194508093505050509295509295509295565b600060208284031215610c2357600080fd5b813561097f81610b17565b600060208284031215610c4057600080fd5b5051919050565b600060208284031215610c5957600080fd5b815161097f81610b17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040516060810167ffffffffffffffff81118282101715610ce557610ce5610c64565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610d3257610d32610c64565b604052919050565b600067ffffffffffffffff80841115610d5557610d55610c64565b8360051b6020610d66818301610ceb565b868152918501918181019036841115610d7e57600080fd5b865b84811015610e6d57803586811115610d985760008081fd5b88016060368290031215610dac5760008081fd5b610db4610cc2565b8135610dbf81610b17565b8152818601358682015260408083013589811115610ddd5760008081fd5b9290920191601f3681850112610df35760008081fd5b83358a811115610e0557610e05610c64565b610e34897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08484011601610ceb565b91508082523689828701011115610e4b5760008081fd5b808986018a840137600090820189015290820152845250918301918301610d80565b50979650505050505050565b60005b83811015610e94578181015183820152602001610e7c565b50506000910152565b60008151808452610eb5816020860160208601610e79565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610fc75782840389528151610160815186528682015187870152604080830151610f4a8289018273ffffffffffffffffffffffffffffffffffffffff169052565b5050606082810151908701526080808301519087015260a08083015163ffffffff169087015260c0808301519087015260e080830151908701526101008083015190870152610120808301519087015261014091820151918601819052610fb381870183610e9d565b9a87019a9550505090840190600101610f05565b5091979650505050505050565b6000826060808201846000805b6003811015610fc7578584038952825180518086526020918201918087019190600582901b88018101865b8381101561108a578982037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00185528551805173ffffffffffffffffffffffffffffffffffffffff16835283810151848401526040908101519083018c90526110778c840182610e9d565b968401969584019592505060010161100c565b509c81019c97509590950194505050600101610fe1565b6080808252855190820181905260009060209060a0840190828901845b828110156110f057815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016110be565b5050508381038285015286518082528783019183019060005b8181101561112557835183529284019291840191600101611109565b505084810360408601526111398188610ee7565b92505050828103606084015261114f8185610fd4565b979650505050505050565b60006020828403121561116c57600080fd5b8151801515811461097f57600080fd5b818103818111156109b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082516111c8818460208701610e79565b919091019291505056fea164736f6c6343000811000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631626ba7e1461003b578063e8333e0d146100a7575b600080fd5b610071610049366004610a9b565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b6100ba6100b5366004610b54565b6100c8565b60405190815260200161009e565b6000602086018035906100db9088610c11565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff91909116906370a0823190602401602060405180830381865afa158015610147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016b9190610c2e565b101561017957506000610858565b6102178773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101eb9190610c47565b60006101fa60208a018a610c11565b73ffffffffffffffffffffffffffffffffffffffff169190610862565b61029a8773ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610265573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102899190610c47565b602088018035906101fa908a610c11565b6040805160028082526060820183526000926020830190803683370190505090506102c86020880188610c11565b816000815181106102db576102db610c93565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910182015261030b90870187610c11565b8160018151811061031e5761031e610c93565b73ffffffffffffffffffffffffffffffffffffffff92909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905086602001358160008151811061037e5761037e610c93565b6020026020010181815250508760200135816001815181106103a2576103a2610c93565b6020908102919091010152604080516001808252818301909252600091816020015b6104406040518061016001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600063ffffffff16815260200160008019168152602001600081526020016000815260200160008152602001606081525090565b8152602001906001900390816103c45790505090506040518061016001604052806000815260200160018152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020018a6020013581526020018960200135815260200163ffffffff801681526020016000801b815260200160008152602001604081526020016000815260200130604051602001610506919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152508160008151811061052b5761052b610c93565b602002602001018190525061053e610a74565b60208089013590610551908c018c610c11565b73ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8d61057a60208d018d610c11565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604401602060405180830381865afa1580156105ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060e9190610c2e565b101561078c5760408051600180825281830190925290816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081610629575050815261066660208b018b610c11565b8151805160009061067957610679610c93565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff9092169091526106ac908b018b610c11565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b36106d460208b018b610c11565b60405173ffffffffffffffffffffffffffffffffffffffff909116602482015260208b01356044820152606401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b929092179091529050816000602002015160008151811061077c5761077c610c93565b6020026020010151604001819052505b6107968688610d3a565b60208201526040516108519073ffffffffffffffffffffffffffffffffffffffff8d16906313d79a0b906107d49088908890889088906024016110a1565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660e09390931b9290921790915273ffffffffffffffffffffffffffffffffffffffff8e169150610971565b9450505050505b9695505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052906000906108f590861683610986565b905061090081610994565b61096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640160405180910390fd5b5050505050565b600061097f836000846109bb565b9392505050565b606061097f836000846109ee565b60008151600014806109b55750818060200190518101906109b5919061115a565b92915050565b60005a905060008083516020850186885af16109db573d6000803e3d6000fd5b5a6109e6908261117c565b949350505050565b606060008473ffffffffffffffffffffffffffffffffffffffff168484604051610a1891906111b6565b60006040518083038185875af1925050503d8060008114610a55576040519150601f19603f3d011682016040523d82523d6000602084013e610a5a565b606091505b509250905080610a6c57815160208301fd5b509392505050565b60405180606001604052806003905b6060815260200190600190039081610a835790505090565b600080600060408486031215610ab057600080fd5b83359250602084013567ffffffffffffffff80821115610acf57600080fd5b818601915086601f830112610ae357600080fd5b813581811115610af257600080fd5b876020828501011115610b0457600080fd5b6020830194508093505050509250925092565b73ffffffffffffffffffffffffffffffffffffffff81168114610b3957600080fd5b50565b600060408284031215610b4e57600080fd5b50919050565b6000806000806000806101008789031215610b6e57600080fd5b8635610b7981610b17565b9550610b888860208901610b3c565b9450610b978860608901610b3c565b9350610ba68860a08901610b3c565b925060e087013567ffffffffffffffff80821115610bc357600080fd5b818901915089601f830112610bd757600080fd5b813581811115610be657600080fd5b8a60208260051b8501011115610bfb57600080fd5b6020830194508093505050509295509295509295565b600060208284031215610c2357600080fd5b813561097f81610b17565b600060208284031215610c4057600080fd5b5051919050565b600060208284031215610c5957600080fd5b815161097f81610b17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040516060810167ffffffffffffffff81118282101715610ce557610ce5610c64565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610d3257610d32610c64565b604052919050565b600067ffffffffffffffff80841115610d5557610d55610c64565b8360051b6020610d66818301610ceb565b868152918501918181019036841115610d7e57600080fd5b865b84811015610e6d57803586811115610d985760008081fd5b88016060368290031215610dac5760008081fd5b610db4610cc2565b8135610dbf81610b17565b8152818601358682015260408083013589811115610ddd5760008081fd5b9290920191601f3681850112610df35760008081fd5b83358a811115610e0557610e05610c64565b610e34897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08484011601610ceb565b91508082523689828701011115610e4b5760008081fd5b808986018a840137600090820189015290820152845250918301918301610d80565b50979650505050505050565b60005b83811015610e94578181015183820152602001610e7c565b50506000910152565b60008151808452610eb5816020860160208601610e79565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610fc75782840389528151610160815186528682015187870152604080830151610f4a8289018273ffffffffffffffffffffffffffffffffffffffff169052565b5050606082810151908701526080808301519087015260a08083015163ffffffff169087015260c0808301519087015260e080830151908701526101008083015190870152610120808301519087015261014091820151918601819052610fb381870183610e9d565b9a87019a9550505090840190600101610f05565b5091979650505050505050565b6000826060808201846000805b6003811015610fc7578584038952825180518086526020918201918087019190600582901b88018101865b8381101561108a578982037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00185528551805173ffffffffffffffffffffffffffffffffffffffff16835283810151848401526040908101519083018c90526110778c840182610e9d565b968401969584019592505060010161100c565b509c81019c97509590950194505050600101610fe1565b6080808252855190820181905260009060209060a0840190828901845b828110156110f057815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016110be565b5050508381038285015286518082528783019183019060005b8181101561112557835183529284019291840191600101611109565b505084810360408601526111398188610ee7565b92505050828103606084015261114f8185610fd4565b979650505050505050565b60006020828403121561116c57600080fd5b8151801515811461097f57600080fd5b818103818111156109b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082516111c8818460208701610e79565b919091019291505056fea164736f6c6343000811000a", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/artifacts/Trader.json b/crates/contracts/artifacts/Trader.json index e530fb122e..2bb2245e43 100644 --- a/crates/contracts/artifacts/Trader.json +++ b/crates/contracts/artifacts/Trader.json @@ -1 +1,100 @@ -{"abi":[{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"contract ISettlement","name":"settlementContract","type":"address"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"address","name":"nativeToken","type":"address"},{"internalType":"address","name":"spardose","type":"address"}],"name":"ensureTradePreconditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"isValidSignature","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"vaultRelayer","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"safeApprove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"0x6080604052348015600e575f5ffd5b50610d008061001c5f395ff3fe608060405260043610610037575f3560e01c80631626ba7e1461008d578063542eb77d14610104578063eb5625d9146101255761003e565b3661003e57005b5f6100835f368080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525062010000939250506101449050565b9050805160208201f35b348015610098575f5ffd5b506100cf6100a7366004610b01565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b34801561010f575f5ffd5b5061012361011e366004610b9c565b6101c2565b005b348015610130575f5ffd5b5061012361013f366004610c00565b610916565b60605f8373ffffffffffffffffffffffffffffffffffffffff168360405161016c9190610c3e565b5f60405180830381855af49150503d805f81146101a4576040519150601f19603f3d011682016040523d82523d5f602084013e6101a9565b606091505b5092509050806101bb57815160208301fd5b5092915050565b7f02565dba7d68dcbed629110024b7b5e785bfc1a484602045eea513de8a2dcf99805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082161790915560ff16156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f70726570617265537761702063616e206f6e6c792062652063616c6c6564206f60448201527f6e6365000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036103e4576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015610340573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103649190610c6a565b9050838110156103e2575f6103798286610c81565b90508047106103e0578373ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b1580156103c8575f5ffd5b505af11580156103da573d5f5f3e3d5ffd5b50505050505b505b505b5f8573ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa15801561042e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104529190610cb9565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff80831660248301529192505f9187169063dd62ed3e90604401602060405180830381865afa1580156104c7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104eb9190610c6a565b905084811015610748576040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201525f6044820152309063eb5625d9906064015f604051808303815f87803b158015610567575f5ffd5b505af1925050508015610578575060015b506040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6044820152309063eb5625d9906064015f604051808303815f87803b15801561060b575f5ffd5b505af192505050801561061c575060015b506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301525f919088169063dd62ed3e90604401602060405180830381865afa158015610690573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b49190610c6a565b905085811015610746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f74726164657220646964206e6f7420676976652074686520726571756972656460448201527f20617070726f76616c7300000000000000000000000000000000000000000000606482015260840161029a565b505b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8816906370a0823190602401602060405180830381865afa1580156107b2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107d69190610c6a565b90508581101561090c5773ffffffffffffffffffffffffffffffffffffffff841663494666b688610807848a610c81565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044015f604051808303815f87803b15801561086f575f5ffd5b505af1925050508015610880575060015b61090c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f74726164657220646f6573206e6f74206861766520656e6f7567682073656c6c60448201527f20746f6b656e0000000000000000000000000000000000000000000000000000606482015260840161029a565b5050505050505050565b61093773ffffffffffffffffffffffffffffffffffffffff8416838361093c565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052905f906109ce90861683610a46565b90506109d981610a5a565b610a3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640161029a565b5050505050565b6060610a53835f84610a7f565b9392505050565b5f81515f1480610a79575081806020019051810190610a799190610cd4565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610aa89190610c3e565b5f6040518083038185875af1925050503d805f8114610ae2576040519150601f19603f3d011682016040523d82523d5f602084013e610ae7565b606091505b509250905080610af957815160208301fd5b509392505050565b5f5f5f60408486031215610b13575f5ffd5b83359250602084013567ffffffffffffffff811115610b30575f5ffd5b8401601f81018613610b40575f5ffd5b803567ffffffffffffffff811115610b56575f5ffd5b866020828401011115610b67575f5ffd5b939660209190910195509293505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610b99575f5ffd5b50565b5f5f5f5f5f60a08688031215610bb0575f5ffd5b8535610bbb81610b78565b94506020860135610bcb81610b78565b9350604086013592506060860135610be281610b78565b91506080860135610bf281610b78565b809150509295509295909350565b5f5f5f60608486031215610c12575f5ffd5b8335610c1d81610b78565b92506020840135610c2d81610b78565b929592945050506040919091013590565b5f82515f5b81811015610c5d5760208186018101518583015201610c43565b505f920191825250919050565b5f60208284031215610c7a575f5ffd5b5051919050565b81810381811115610a79577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f60208284031215610cc9575f5ffd5b8151610a5381610b78565b5f60208284031215610ce4575f5ffd5b81518015158114610a53575f5ffdfea164736f6c634300081e000a","deployedBytecode":"0x608060405260043610610037575f3560e01c80631626ba7e1461008d578063542eb77d14610104578063eb5625d9146101255761003e565b3661003e57005b5f6100835f368080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525062010000939250506101449050565b9050805160208201f35b348015610098575f5ffd5b506100cf6100a7366004610b01565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b34801561010f575f5ffd5b5061012361011e366004610b9c565b6101c2565b005b348015610130575f5ffd5b5061012361013f366004610c00565b610916565b60605f8373ffffffffffffffffffffffffffffffffffffffff168360405161016c9190610c3e565b5f60405180830381855af49150503d805f81146101a4576040519150601f19603f3d011682016040523d82523d5f602084013e6101a9565b606091505b5092509050806101bb57815160208301fd5b5092915050565b7f02565dba7d68dcbed629110024b7b5e785bfc1a484602045eea513de8a2dcf99805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082161790915560ff16156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f70726570617265537761702063616e206f6e6c792062652063616c6c6564206f60448201527f6e6365000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036103e4576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015610340573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103649190610c6a565b9050838110156103e2575f6103798286610c81565b90508047106103e0578373ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b1580156103c8575f5ffd5b505af11580156103da573d5f5f3e3d5ffd5b50505050505b505b505b5f8573ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa15801561042e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104529190610cb9565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff80831660248301529192505f9187169063dd62ed3e90604401602060405180830381865afa1580156104c7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104eb9190610c6a565b905084811015610748576040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201525f6044820152309063eb5625d9906064015f604051808303815f87803b158015610567575f5ffd5b505af1925050508015610578575060015b506040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6044820152309063eb5625d9906064015f604051808303815f87803b15801561060b575f5ffd5b505af192505050801561061c575060015b506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301525f919088169063dd62ed3e90604401602060405180830381865afa158015610690573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b49190610c6a565b905085811015610746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f74726164657220646964206e6f7420676976652074686520726571756972656460448201527f20617070726f76616c7300000000000000000000000000000000000000000000606482015260840161029a565b505b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8816906370a0823190602401602060405180830381865afa1580156107b2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107d69190610c6a565b90508581101561090c5773ffffffffffffffffffffffffffffffffffffffff841663494666b688610807848a610c81565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044015f604051808303815f87803b15801561086f575f5ffd5b505af1925050508015610880575060015b61090c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f74726164657220646f6573206e6f74206861766520656e6f7567682073656c6c60448201527f20746f6b656e0000000000000000000000000000000000000000000000000000606482015260840161029a565b5050505050505050565b61093773ffffffffffffffffffffffffffffffffffffffff8416838361093c565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052905f906109ce90861683610a46565b90506109d981610a5a565b610a3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640161029a565b5050505050565b6060610a53835f84610a7f565b9392505050565b5f81515f1480610a79575081806020019051810190610a799190610cd4565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610aa89190610c3e565b5f6040518083038185875af1925050503d805f8114610ae2576040519150601f19603f3d011682016040523d82523d5f602084013e610ae7565b606091505b509250905080610af957815160208301fd5b509392505050565b5f5f5f60408486031215610b13575f5ffd5b83359250602084013567ffffffffffffffff811115610b30575f5ffd5b8401601f81018613610b40575f5ffd5b803567ffffffffffffffff811115610b56575f5ffd5b866020828401011115610b67575f5ffd5b939660209190910195509293505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610b99575f5ffd5b50565b5f5f5f5f5f60a08688031215610bb0575f5ffd5b8535610bbb81610b78565b94506020860135610bcb81610b78565b9350604086013592506060860135610be281610b78565b91506080860135610bf281610b78565b809150509295509295909350565b5f5f5f60608486031215610c12575f5ffd5b8335610c1d81610b78565b92506020840135610c2d81610b78565b929592945050506040919091013590565b5f82515f5b81811015610c5d5760208186018101518583015201610c43565b505f920191825250919050565b5f60208284031215610c7a575f5ffd5b5051919050565b81810381811115610a79577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f60208284031215610cc9575f5ffd5b8151610a5381610b78565b5f60208284031215610ce4575f5ffd5b81518015158114610a53575f5ffdfea164736f6c634300081e000a","devdoc":{"methods":{}},"userdoc":{"methods":{}}} +{ + "abi": [ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "contract ISettlement", + "name": "settlementContract", + "type": "address" + }, + { + "internalType": "address", + "name": "sellToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "nativeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "spardose", + "type": "address" + } + ], + "name": "ensureTradePreconditions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultRelayer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "safeApprove", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x6080604052348015600e575f5ffd5b50610d008061001c5f395ff3fe608060405260043610610037575f3560e01c80631626ba7e1461008d578063542eb77d14610104578063eb5625d9146101255761003e565b3661003e57005b5f6100835f368080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525062010000939250506101449050565b9050805160208201f35b348015610098575f5ffd5b506100cf6100a7366004610b01565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b34801561010f575f5ffd5b5061012361011e366004610b9c565b6101c2565b005b348015610130575f5ffd5b5061012361013f366004610c00565b610916565b60605f8373ffffffffffffffffffffffffffffffffffffffff168360405161016c9190610c3e565b5f60405180830381855af49150503d805f81146101a4576040519150601f19603f3d011682016040523d82523d5f602084013e6101a9565b606091505b5092509050806101bb57815160208301fd5b5092915050565b7f02565dba7d68dcbed629110024b7b5e785bfc1a484602045eea513de8a2dcf99805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082161790915560ff16156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f70726570617265537761702063616e206f6e6c792062652063616c6c6564206f60448201527f6e6365000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036103e4576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015610340573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103649190610c6a565b9050838110156103e2575f6103798286610c81565b90508047106103e0578373ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b1580156103c8575f5ffd5b505af11580156103da573d5f5f3e3d5ffd5b50505050505b505b505b5f8573ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa15801561042e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104529190610cb9565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff80831660248301529192505f9187169063dd62ed3e90604401602060405180830381865afa1580156104c7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104eb9190610c6a565b905084811015610748576040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201525f6044820152309063eb5625d9906064015f604051808303815f87803b158015610567575f5ffd5b505af1925050508015610578575060015b506040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6044820152309063eb5625d9906064015f604051808303815f87803b15801561060b575f5ffd5b505af192505050801561061c575060015b506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301525f919088169063dd62ed3e90604401602060405180830381865afa158015610690573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b49190610c6a565b905085811015610746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f74726164657220646964206e6f7420676976652074686520726571756972656460448201527f20617070726f76616c7300000000000000000000000000000000000000000000606482015260840161029a565b505b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8816906370a0823190602401602060405180830381865afa1580156107b2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107d69190610c6a565b90508581101561090c5773ffffffffffffffffffffffffffffffffffffffff841663494666b688610807848a610c81565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044015f604051808303815f87803b15801561086f575f5ffd5b505af1925050508015610880575060015b61090c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f74726164657220646f6573206e6f74206861766520656e6f7567682073656c6c60448201527f20746f6b656e0000000000000000000000000000000000000000000000000000606482015260840161029a565b5050505050505050565b61093773ffffffffffffffffffffffffffffffffffffffff8416838361093c565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052905f906109ce90861683610a46565b90506109d981610a5a565b610a3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640161029a565b5050505050565b6060610a53835f84610a7f565b9392505050565b5f81515f1480610a79575081806020019051810190610a799190610cd4565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610aa89190610c3e565b5f6040518083038185875af1925050503d805f8114610ae2576040519150601f19603f3d011682016040523d82523d5f602084013e610ae7565b606091505b509250905080610af957815160208301fd5b509392505050565b5f5f5f60408486031215610b13575f5ffd5b83359250602084013567ffffffffffffffff811115610b30575f5ffd5b8401601f81018613610b40575f5ffd5b803567ffffffffffffffff811115610b56575f5ffd5b866020828401011115610b67575f5ffd5b939660209190910195509293505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610b99575f5ffd5b50565b5f5f5f5f5f60a08688031215610bb0575f5ffd5b8535610bbb81610b78565b94506020860135610bcb81610b78565b9350604086013592506060860135610be281610b78565b91506080860135610bf281610b78565b809150509295509295909350565b5f5f5f60608486031215610c12575f5ffd5b8335610c1d81610b78565b92506020840135610c2d81610b78565b929592945050506040919091013590565b5f82515f5b81811015610c5d5760208186018101518583015201610c43565b505f920191825250919050565b5f60208284031215610c7a575f5ffd5b5051919050565b81810381811115610a79577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f60208284031215610cc9575f5ffd5b8151610a5381610b78565b5f60208284031215610ce4575f5ffd5b81518015158114610a53575f5ffdfea164736f6c634300081e000a", + "deployedBytecode": "0x608060405260043610610037575f3560e01c80631626ba7e1461008d578063542eb77d14610104578063eb5625d9146101255761003e565b3661003e57005b5f6100835f368080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525062010000939250506101449050565b9050805160208201f35b348015610098575f5ffd5b506100cf6100a7366004610b01565b7f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b34801561010f575f5ffd5b5061012361011e366004610b9c565b6101c2565b005b348015610130575f5ffd5b5061012361013f366004610c00565b610916565b60605f8373ffffffffffffffffffffffffffffffffffffffff168360405161016c9190610c3e565b5f60405180830381855af49150503d805f81146101a4576040519150601f19603f3d011682016040523d82523d5f602084013e6101a9565b606091505b5092509050806101bb57815160208301fd5b5092915050565b7f02565dba7d68dcbed629110024b7b5e785bfc1a484602045eea513de8a2dcf99805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082161790915560ff16156102a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f70726570617265537761702063616e206f6e6c792062652063616c6c6564206f60448201527f6e6365000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036103e4576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015610340573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103649190610c6a565b9050838110156103e2575f6103798286610c81565b90508047106103e0578373ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b1580156103c8575f5ffd5b505af11580156103da573d5f5f3e3d5ffd5b50505050505b505b505b5f8573ffffffffffffffffffffffffffffffffffffffff16639b552cc26040518163ffffffff1660e01b8152600401602060405180830381865afa15801561042e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104529190610cb9565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff80831660248301529192505f9187169063dd62ed3e90604401602060405180830381865afa1580156104c7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104eb9190610c6a565b905084811015610748576040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201525f6044820152309063eb5625d9906064015f604051808303815f87803b158015610567575f5ffd5b505af1925050508015610578575060015b506040517feb5625d900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8088166004830152831660248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6044820152309063eb5625d9906064015f604051808303815f87803b15801561060b575f5ffd5b505af192505050801561061c575060015b506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301525f919088169063dd62ed3e90604401602060405180830381865afa158015610690573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b49190610c6a565b905085811015610746576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f74726164657220646964206e6f7420676976652074686520726571756972656460448201527f20617070726f76616c7300000000000000000000000000000000000000000000606482015260840161029a565b505b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8816906370a0823190602401602060405180830381865afa1580156107b2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107d69190610c6a565b90508581101561090c5773ffffffffffffffffffffffffffffffffffffffff841663494666b688610807848a610c81565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044015f604051808303815f87803b15801561086f575f5ffd5b505af1925050508015610880575060015b61090c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f74726164657220646f6573206e6f74206861766520656e6f7567682073656c6c60448201527f20746f6b656e0000000000000000000000000000000000000000000000000000606482015260840161029a565b5050505050505050565b61093773ffffffffffffffffffffffffffffffffffffffff8416838361093c565b505050565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052905f906109ce90861683610a46565b90506109d981610a5a565b610a3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f5361666545524332303a20617070726f76616c206661696c6564000000000000604482015260640161029a565b5050505050565b6060610a53835f84610a7f565b9392505050565b5f81515f1480610a79575081806020019051810190610a799190610cd4565b92915050565b60605f8473ffffffffffffffffffffffffffffffffffffffff168484604051610aa89190610c3e565b5f6040518083038185875af1925050503d805f8114610ae2576040519150601f19603f3d011682016040523d82523d5f602084013e610ae7565b606091505b509250905080610af957815160208301fd5b509392505050565b5f5f5f60408486031215610b13575f5ffd5b83359250602084013567ffffffffffffffff811115610b30575f5ffd5b8401601f81018613610b40575f5ffd5b803567ffffffffffffffff811115610b56575f5ffd5b866020828401011115610b67575f5ffd5b939660209190910195509293505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610b99575f5ffd5b50565b5f5f5f5f5f60a08688031215610bb0575f5ffd5b8535610bbb81610b78565b94506020860135610bcb81610b78565b9350604086013592506060860135610be281610b78565b91506080860135610bf281610b78565b809150509295509295909350565b5f5f5f60608486031215610c12575f5ffd5b8335610c1d81610b78565b92506020840135610c2d81610b78565b929592945050506040919091013590565b5f82515f5b81811015610c5d5760208186018101518583015201610c43565b505f920191825250919050565b5f60208284031215610c7a575f5ffd5b5051919050565b81810381811115610a79577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f60208284031215610cc9575f5ffd5b8151610a5381610b78565b5f60208284031215610ce4575f5ffd5b81518015158114610a53575f5ffdfea164736f6c634300081e000a", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} diff --git a/crates/contracts/artifacts/UniswapV2Factory.json b/crates/contracts/artifacts/UniswapV2Factory.json index ff8b66c2e3..c7cc7a97b7 100644 --- a/crates/contracts/artifacts/UniswapV2Factory.json +++ b/crates/contracts/artifacts/UniswapV2Factory.json @@ -1 +1,196 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"_feeToSetter","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"feeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feeToSetter","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_feeTo","type":"address"}],"name":"setFeeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_feeToSetter","type":"address"}],"name":"setFeeToSetter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}],"bytecode":"608060405234801561001057600080fd5b506040516136863803806136868339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b03909216919091179055613623806100636000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a2e74af61161005b578063a2e74af6146100fd578063c9c6539614610132578063e6a439051461016d578063f46901ed146101a857610088565b8063017e7e581461008d578063094b7415146100be5780631e3dd18b146100c6578063574f2ba3146100e3575b600080fd5b6100956101db565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100956101f7565b610095600480360360208110156100dc57600080fd5b5035610213565b6100eb610247565b60408051918252519081900360200190f35b6101306004803603602081101561011357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661024d565b005b6100956004803603604081101561014857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661031a565b6100956004803603604081101561018357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661076d565b610130600480360360208110156101be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166107a0565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6003818154811061022057fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60035490565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056323a204944454e544943414c5f4144445245535345530000604482015290519081900360640190fd5b6000808373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106103f45783856103f7565b84845b909250905073ffffffffffffffffffffffffffffffffffffffff821661047e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f556e697377617056323a205a45524f5f41444452455353000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82811660009081526002602090815260408083208585168452909152902054161561051f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f556e697377617056323a20504149525f45584953545300000000000000000000604482015290519081900360640190fd5b6060604051806020016105319061086d565b6020820181038252601f19601f82011660405250905060008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140192505050604051602081830303815290604052805190602001209050808251602084016000f5604080517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152868116602483015291519297509087169163485cc9559160448082019260009290919082900301818387803b15801561065e57600080fd5b505af1158015610672573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff84811660008181526002602081815260408084208987168086529083528185208054978d167fffffffffffffffffffffffff000000000000000000000000000000000000000098891681179091559383528185208686528352818520805488168517905560038054600181018255958190527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90950180549097168417909655925483519283529082015281517f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9929181900390910190a35050505092915050565b600260209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461082657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b612d748061087b8339019056fe60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429a265627a7a723158202760f92d7fa1db6f5aa16307bad65df4ebcc8550c4b1f03755ab8dfd830c178f64736f6c63430005100032"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_feeToSetter", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "pair", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "PairCreated", + "type": "event" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allPairs", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "allPairsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + } + ], + "name": "createPair", + "outputs": [ + { + "internalType": "address", + "name": "pair", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "feeTo", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "feeToSetter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "getPair", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_feeTo", + "type": "address" + } + ], + "name": "setFeeTo", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_feeToSetter", + "type": "address" + } + ], + "name": "setFeeToSetter", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "608060405234801561001057600080fd5b506040516136863803806136868339818101604052602081101561003357600080fd5b5051600180546001600160a01b0319166001600160a01b03909216919091179055613623806100636000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a2e74af61161005b578063a2e74af6146100fd578063c9c6539614610132578063e6a439051461016d578063f46901ed146101a857610088565b8063017e7e581461008d578063094b7415146100be5780631e3dd18b146100c6578063574f2ba3146100e3575b600080fd5b6100956101db565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100956101f7565b610095600480360360208110156100dc57600080fd5b5035610213565b6100eb610247565b60408051918252519081900360200190f35b6101306004803603602081101561011357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661024d565b005b6100956004803603604081101561014857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661031a565b6100956004803603604081101561018357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661076d565b610130600480360360208110156101be57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166107a0565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6003818154811061022057fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60035490565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056323a204944454e544943414c5f4144445245535345530000604482015290519081900360640190fd5b6000808373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106103f45783856103f7565b84845b909250905073ffffffffffffffffffffffffffffffffffffffff821661047e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f556e697377617056323a205a45524f5f41444452455353000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82811660009081526002602090815260408083208585168452909152902054161561051f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f556e697377617056323a20504149525f45584953545300000000000000000000604482015290519081900360640190fd5b6060604051806020016105319061086d565b6020820181038252601f19601f82011660405250905060008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140192505050604051602081830303815290604052805190602001209050808251602084016000f5604080517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152868116602483015291519297509087169163485cc9559160448082019260009290919082900301818387803b15801561065e57600080fd5b505af1158015610672573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff84811660008181526002602081815260408084208987168086529083528185208054978d167fffffffffffffffffffffffff000000000000000000000000000000000000000098891681179091559383528185208686528352818520805488168517905560038054600181018255958190527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90950180549097168417909655925483519283529082015281517f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9929181900390910190a35050505092915050565b600260209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461082657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b612d748061087b8339019056fe60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429a265627a7a723158202760f92d7fa1db6f5aa16307bad65df4ebcc8550c4b1f03755ab8dfd830c178f64736f6c63430005100032" +} diff --git a/crates/contracts/artifacts/UniswapV2Router02.json b/crates/contracts/artifacts/UniswapV2Router02.json index 11f3070d7d..bb735ec84e 100644 --- a/crates/contracts/artifacts/UniswapV2Router02.json +++ b/crates/contracts/artifacts/UniswapV2Router02.json @@ -1 +1,976 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETHSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermit","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityWithPermit","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapETHForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETHSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}],"bytecode":"60c06040523480156200001157600080fd5b506040516200573e3803806200573e833981810160405260408110156200003757600080fd5b5080516020909101516001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c6155b762000187600039806101ac5280610e5d5280610e985280610fd5528061129852806116f252806118d65280611e1e5280611fa252806120725280612179528061232c52806123c15280612673528061271a52806127ef52806128f452806129dc5280612a5d52806130ec5280613422528061347852806134ac528061352d528061374752806138f7528061398c5250806110c752806111c5528061136b52806113a4528061154f52806117e452806118b45280611aa1528061225f528061240052806125a95280612a9c5280612ddf5280613071528061309a52806130ca52806132a75280613456528061382d52806139cb528061444a528061448d52806147ed52806149ce5280614f49528061502a52806150aa52506155b76000f3fe60806040526004361061018f5760003560e01c80638803dbee116100d6578063c45a01551161007f578063e8e3370011610059578063e8e3370014610c71578063f305d71914610cfe578063fb3bdb4114610d51576101d5565b8063c45a015514610b25578063d06ca61f14610b3a578063ded9382a14610bf1576101d5565b8063af2979eb116100b0578063af2979eb146109c8578063b6f9de9514610a28578063baa2abde14610abb576101d5565b80638803dbee146108af578063ad5c464814610954578063ad615dec14610992576101d5565b80634a25d94a11610138578063791ac94711610112578063791ac947146107415780637ff36ab5146107e657806385f8c25914610879576101d5565b80634a25d94a146105775780635b0d59841461061c5780635c11d7951461069c576101d5565b80631f00ca74116101695780631f00ca74146103905780632195995c1461044757806338ed1739146104d2576101d5565b806302751cec146101da578063054d50d41461025357806318cbafe51461029b576101d5565b366101d5573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146101d357fe5b005b600080fd5b3480156101e657600080fd5b5061023a600480360360c08110156101fd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a00135610de4565b6040805192835260208301919091528051918290030190f35b34801561025f57600080fd5b506102896004803603606081101561027657600080fd5b5080359060208101359060400135610f37565b60408051918252519081900360200190f35b3480156102a757600080fd5b50610340600480360360a08110156102be57600080fd5b8135916020810135918101906060810160408201356401000000008111156102e557600080fd5b8201836020820111156102f757600080fd5b8035906020019184602083028401116401000000008311171561031957600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135610f4c565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561037c578181015183820152602001610364565b505050509050019250505060405180910390f35b34801561039c57600080fd5b50610340600480360360408110156103b357600080fd5b813591908101906040810160208201356401000000008111156103d557600080fd5b8201836020820111156103e757600080fd5b8035906020019184602083028401116401000000008311171561040957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611364945050505050565b34801561045357600080fd5b5061023a600480360361016081101561046b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359091169060c08101359060e081013515159060ff610100820135169061012081013590610140013561139a565b3480156104de57600080fd5b50610340600480360360a08110156104f557600080fd5b81359160208101359181019060608101604082013564010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184602083028401116401000000008311171561055057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356114d8565b34801561058357600080fd5b50610340600480360360a081101561059a57600080fd5b8135916020810135918101906060810160408201356401000000008111156105c157600080fd5b8201836020820111156105d357600080fd5b803590602001918460208302840111640100000000831117156105f557600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135611669565b34801561062857600080fd5b50610289600480360361014081101561064057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e082013516906101008101359061012001356118ac565b3480156106a857600080fd5b506101d3600480360360a08110156106bf57600080fd5b8135916020810135918101906060810160408201356401000000008111156106e657600080fd5b8201836020820111156106f857600080fd5b8035906020019184602083028401116401000000008311171561071a57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356119fe565b34801561074d57600080fd5b506101d3600480360360a081101561076457600080fd5b81359160208101359181019060608101604082013564010000000081111561078b57600080fd5b82018360208201111561079d57600080fd5b803590602001918460208302840111640100000000831117156107bf57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135611d97565b610340600480360360808110156107fc57600080fd5b8135919081019060408101602082013564010000000081111561081e57600080fd5b82018360208201111561083057600080fd5b8035906020019184602083028401116401000000008311171561085257600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612105565b34801561088557600080fd5b506102896004803603606081101561089c57600080fd5b5080359060208101359060400135612525565b3480156108bb57600080fd5b50610340600480360360a08110156108d257600080fd5b8135916020810135918101906060810160408201356401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612532565b34801561096057600080fd5b50610969612671565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561099e57600080fd5b50610289600480360360608110156109b557600080fd5b5080359060208101359060400135612695565b3480156109d457600080fd5b50610289600480360360c08110156109eb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a001356126a2565b6101d360048036036080811015610a3e57600080fd5b81359190810190604081016020820135640100000000811115610a6057600080fd5b820183602082011115610a7257600080fd5b80359060200191846020830284011164010000000083111715610a9457600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612882565b348015610ac757600080fd5b5061023a600480360360e0811015610ade57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359091169060c00135612d65565b348015610b3157600080fd5b5061096961306f565b348015610b4657600080fd5b5061034060048036036040811015610b5d57600080fd5b81359190810190604081016020820135640100000000811115610b7f57600080fd5b820183602082011115610b9157600080fd5b80359060200191846020830284011164010000000083111715610bb357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613093945050505050565b348015610bfd57600080fd5b5061023a6004803603610140811015610c1557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e082013516906101008101359061012001356130c0565b348015610c7d57600080fd5b50610ce06004803603610100811015610c9557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359160c0820135169060e00135613218565b60408051938452602084019290925282820152519081900360600190f35b610ce0600480360360c0811015610d1457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a001356133a7565b61034060048036036080811015610d6757600080fd5b81359190810190604081016020820135640100000000811115610d8957600080fd5b820183602082011115610d9b57600080fd5b80359060200191846020830284011164010000000083111715610dbd57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356136d3565b6000808242811015610e5757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b610e86897f00000000000000000000000000000000000000000000000000000000000000008a8a8a308a612d65565b9093509150610e96898685613b22565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610f0957600080fd5b505af1158015610f1d573d6000803e3d6000fd5b50505050610f2b8583613cff565b50965096945050505050565b6000610f44848484613e3c565b949350505050565b60608142811015610fbe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001686867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811061102357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6111207f000000000000000000000000000000000000000000000000000000000000000089888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b9150868260018451038151811061113357fe5b60200260200101511015611192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b611257868660008181106111a257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff163361123d7f00000000000000000000000000000000000000000000000000000000000000008a8a60008181106111f157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b600181811061121b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166140c6565b8560008151811061124a57fe5b60200260200101516141b1565b61129682878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250614381915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836001855103815181106112e257fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b50505050611359848360018551038151811061134c57fe5b6020026020010151613cff565b509695505050505050565b60606113917f00000000000000000000000000000000000000000000000000000000000000008484614608565b90505b92915050565b60008060006113ca7f00000000000000000000000000000000000000000000000000000000000000008f8f6140c6565b90506000876113d9578c6113fb565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c48101889052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b15801561149757600080fd5b505af11580156114ab573d6000803e3d6000fd5b505050506114be8f8f8f8f8f8f8f612d65565b809450819550505050509b509b9950505050505050505050565b6060814281101561154a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6115a87f000000000000000000000000000000000000000000000000000000000000000089888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b915086826001845103815181106115bb57fe5b6020026020010151101561161a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b61162a868660008181106111a257fe5b61135982878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b606081428110156116db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001686867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811061174057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117df57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b61183d7f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150868260008151811061184d57fe5b60200260200101511115611192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b6000806118fa7f00000000000000000000000000000000000000000000000000000000000000008d7f00000000000000000000000000000000000000000000000000000000000000006140c6565b9050600086611909578b61192b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018b905260ff8916608482015260a4810188905260c48101879052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b1580156119c757600080fd5b505af11580156119db573d6000803e3d6000fd5b505050506119ed8d8d8d8d8d8d6126a2565b9d9c50505050505050505050505050565b8042811015611a6e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b611afd85856000818110611a7e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1633611af77f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061121b57fe5b8a6141b1565b600085857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611b2d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611bc657600080fd5b505afa158015611bda573d6000803e3d6000fd5b505050506040513d6020811015611bf057600080fd5b50516040805160208881028281018201909352888252929350611c32929091899189918291850190849080828437600092019190915250889250614796915050565b86611d368288887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611c6557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b505afa158015611d12573d6000803e3d6000fd5b505050506040513d6020811015611d2857600080fd5b50519063ffffffff614b2916565b1015611d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b5050505050505050565b8042811015611e0757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001685857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611e6c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f0b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b611f1b85856000818110611a7e57fe5b611f59858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250614796915050565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b158015611fe957600080fd5b505afa158015611ffd573d6000803e3d6000fd5b505050506040513d602081101561201357600080fd5b5051905086811015612070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156120e357600080fd5b505af11580156120f7573d6000803e3d6000fd5b50505050611d8d8482613cff565b6060814281101561217757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16868660008181106121bb57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461225a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6122b87f000000000000000000000000000000000000000000000000000000000000000034888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b915086826001845103815181106122cb57fe5b6020026020010151101561232a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061237357fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123a657600080fd5b505af11580156123ba573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61242c7f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b8460008151811061243957fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156124aa57600080fd5b505af11580156124be573d6000803e3d6000fd5b505050506040513d60208110156124d457600080fd5b50516124dc57fe5b61251b82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b5095945050505050565b6000610f44848484614b9b565b606081428110156125a457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6126027f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150868260008151811061261257fe5b6020026020010151111561161a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b6000610f44848484614cbf565b6000814281101561271457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b612743887f00000000000000000000000000000000000000000000000000000000000000008989893089612d65565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290519194506127ed92508a91879173ffffffffffffffffffffffffffffffffffffffff8416916370a0823191602480820192602092909190829003018186803b1580156127bc57600080fd5b505afa1580156127d0573d6000803e3d6000fd5b505050506040513d60208110156127e657600080fd5b5051613b22565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561286057600080fd5b505af1158015612874573d6000803e3d6000fd5b505050506113598483613cff565b80428110156128f257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168585600081811061293657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b60003490507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015612a4257600080fd5b505af1158015612a56573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612ac87f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612b3257600080fd5b505af1158015612b46573d6000803e3d6000fd5b505050506040513d6020811015612b5c57600080fd5b5051612b6457fe5b600086867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110612b9457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c2d57600080fd5b505afa158015612c41573d6000803e3d6000fd5b505050506040513d6020811015612c5757600080fd5b50516040805160208981028281018201909352898252929350612c999290918a918a918291850190849080828437600092019190915250899250614796915050565b87611d368289897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110612ccc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b6000808242811015612dd857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6000612e057f00000000000000000000000000000000000000000000000000000000000000008c8c6140c6565b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff831660248201819052604482018d9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015612e8657600080fd5b505af1158015612e9a573d6000803e3d6000fd5b505050506040513d6020811015612eb057600080fd5b5050604080517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015282516000938493928616926389afcb44926024808301939282900301818787803b158015612f2357600080fd5b505af1158015612f37573d6000803e3d6000fd5b505050506040513d6040811015612f4d57600080fd5b50805160209091015190925090506000612f678e8e614d9f565b5090508073ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff1614612fa4578183612fa7565b82825b90975095508a871015613005576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154bf6026913960400191505060405180910390fd5b8986101561305e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154256026913960400191505060405180910390fd5b505050505097509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60606113917f00000000000000000000000000000000000000000000000000000000000000008484613f60565b60008060006131107f00000000000000000000000000000000000000000000000000000000000000008e7f00000000000000000000000000000000000000000000000000000000000000006140c6565b905060008761311f578c613141565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c48101889052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b1580156131dd57600080fd5b505af11580156131f1573d6000803e3d6000fd5b505050506132038e8e8e8e8e8e610de4565b909f909e509c50505050505050505050505050565b6000806000834281101561328d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61329b8c8c8c8c8c8c614ef2565b909450925060006132cd7f00000000000000000000000000000000000000000000000000000000000000008e8e6140c6565b90506132db8d3383886141b1565b6132e78c3383876141b1565b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561336657600080fd5b505af115801561337a573d6000803e3d6000fd5b505050506040513d602081101561339057600080fd5b5051949d939c50939a509198505050505050505050565b6000806000834281101561341c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61344a8a7f00000000000000000000000000000000000000000000000000000000000000008b348c8c614ef2565b9094509250600061349c7f00000000000000000000000000000000000000000000000000000000000000008c7f00000000000000000000000000000000000000000000000000000000000000006140c6565b90506134aa8b3383886141b1565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561351257600080fd5b505af1158015613526573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156135d257600080fd5b505af11580156135e6573d6000803e3d6000fd5b505050506040513d60208110156135fc57600080fd5b505161360457fe5b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561368357600080fd5b505af1158015613697573d6000803e3d6000fd5b505050506040513d60208110156136ad57600080fd5b50519250348410156136c5576136c533853403613cff565b505096509650969350505050565b6060814281101561374557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168686600081811061378957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461382857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6138867f00000000000000000000000000000000000000000000000000000000000000008888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150348260008151811061389657fe5b602002602001015111156138f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061393e57fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561397157600080fd5b505af1158015613985573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6139f77f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b84600081518110613a0457fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015613a7557600080fd5b505af1158015613a89573d6000803e3d6000fd5b505050506040513d6020811015613a9f57600080fd5b5051613aa757fe5b613ae682878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b81600081518110613af357fe5b602002602001015134111561251b5761251b3383600081518110613b1357fe5b60200260200101513403613cff565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b60208310613bf857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613bbb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c5a576040519150601f19603f3d011682016040523d82523d6000602084013e613c5f565b606091505b5091509150818015613c8d575080511580613c8d5750808060200190516020811015613c8a57600080fd5b50515b613cf857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff84169083906040518082805190602001908083835b60208310613d7657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613d39565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613dd8576040519150601f19603f3d011682016040523d82523d6000602084013e613ddd565b606091505b5050905080613e37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806154e56023913960400191505060405180910390fd5b505050565b6000808411613e96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615557602b913960400191505060405180910390fd5b600083118015613ea65750600082115b613efb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b6000613f0f856103e563ffffffff6151f316565b90506000613f23828563ffffffff6151f316565b90506000613f4983613f3d886103e863ffffffff6151f316565b9063ffffffff61527916565b9050808281613f5457fe5b04979650505050505050565b6060600282511015613fd357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff81118015613feb57600080fd5b50604051908082528060200260200182016040528015614015578160200160208202803683370190505b509050828160008151811061402657fe5b60200260200101818152505060005b60018351038110156140be576000806140788786858151811061405457fe5b602002602001015187866001018151811061406b57fe5b60200260200101516152eb565b9150915061409a84848151811061408b57fe5b60200260200101518383613e3c565b8484600101815181106140a957fe5b60209081029190910101525050600101614035565b509392505050565b60008060006140d58585614d9f565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b6020831061428f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614252565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146142f1576040519150601f19603f3d011682016040523d82523d6000602084013e6142f6565b606091505b5091509150818015614324575080511580614324575080806020019051602081101561432157600080fd5b50515b614379576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806155336024913960400191505060405180910390fd5b505050505050565b60005b60018351038110156146025760008084838151811061439f57fe5b60200260200101518584600101815181106143b657fe5b60200260200101519150915060006143ce8383614d9f565b50905060008785600101815181106143e257fe5b602002602001015190506000808373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461442a5782600061442e565b6000835b91509150600060028a510388106144455788614486565b6144867f0000000000000000000000000000000000000000000000000000000000000000878c8b6002018151811061447957fe5b60200260200101516140c6565b90506144b37f000000000000000000000000000000000000000000000000000000000000000088886140c6565b73ffffffffffffffffffffffffffffffffffffffff1663022c0d9f84848460006040519080825280601f01601f1916602001820160405280156144fd576020820181803683370190505b506040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015614588578181015183820152602001614570565b50505050905090810190601f1680156145b55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156145d757600080fd5b505af11580156145eb573d6000803e3d6000fd5b505060019099019850614384975050505050505050565b50505050565b606060028251101561467b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff8111801561469357600080fd5b506040519080825280602002602001820160405280156146bd578160200160208202803683370190505b50905082816001835103815181106146d157fe5b602090810291909101015281517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b80156140be576000806147318786600186038151811061471d57fe5b602002602001015187868151811061406b57fe5b9150915061475384848151811061474457fe5b60200260200101518383614b9b565b84600185038151811061476257fe5b602090810291909101015250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01614701565b60005b6001835103811015613e37576000808483815181106147b457fe5b60200260200101518584600101815181106147cb57fe5b60200260200101519150915060006147e38383614d9f565b50905060006148137f000000000000000000000000000000000000000000000000000000000000000085856140c6565b90506000806000808473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561486157600080fd5b505afa158015614875573d6000803e3d6000fd5b505050506040513d606081101561488b57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905060008073ffffffffffffffffffffffffffffffffffffffff8a8116908916146148d55782846148d8565b83835b9150915061495d828b73ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b955061496a868383613e3c565b9450505050506000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146149ae578260006149b2565b6000835b91509150600060028c51038a106149c9578a6149fd565b6149fd7f0000000000000000000000000000000000000000000000000000000000000000898e8d6002018151811061447957fe5b60408051600080825260208201928390527f022c0d9f000000000000000000000000000000000000000000000000000000008352602482018781526044830187905273ffffffffffffffffffffffffffffffffffffffff8086166064850152608060848501908152845160a48601819052969750908c169563022c0d9f958a958a958a9591949193919260c486019290918190849084905b83811015614aad578181015183820152602001614a95565b50505050905090810190601f168015614ada5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015614afc57600080fd5b505af1158015614b10573d6000803e3d6000fd5b50506001909b019a506147999950505050505050505050565b8082038281111561139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6000808411614bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806153d4602c913960400191505060405180910390fd5b600083118015614c055750600082115b614c5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b6000614c7e6103e8614c72868863ffffffff6151f316565b9063ffffffff6151f316565b90506000614c986103e5614c72868963ffffffff614b2916565b9050614cb56001828481614ca857fe5b049063ffffffff61527916565b9695505050505050565b6000808411614d19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806154736025913960400191505060405180910390fd5b600083118015614d295750600082115b614d7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b82614d8f858463ffffffff6151f316565b81614d9657fe5b04949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415614e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806154006025913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610614e61578284614e64565b83835b909250905073ffffffffffffffffffffffffffffffffffffffff8216614eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b604080517fe6a4390500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287811660248301529151600092839283927f00000000000000000000000000000000000000000000000000000000000000009092169163e6a4390591604480820192602092909190829003018186803b158015614f9257600080fd5b505afa158015614fa6573d6000803e3d6000fd5b505050506040513d6020811015614fbc57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614156150a257604080517fc9c6539600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a81166004830152898116602483015291517f00000000000000000000000000000000000000000000000000000000000000009092169163c9c65396916044808201926020929091908290030181600087803b15801561507557600080fd5b505af1158015615089573d6000803e3d6000fd5b505050506040513d602081101561509f57600080fd5b50505b6000806150d07f00000000000000000000000000000000000000000000000000000000000000008b8b6152eb565b915091508160001480156150e2575080155b156150f2578793508692506151e6565b60006150ff898484614cbf565b905087811161516c5785811015615161576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154256026913960400191505060405180910390fd5b8894509250826151e4565b6000615179898486614cbf565b90508981111561518557fe5b878110156151de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154bf6026913960400191505060405180910390fd5b94508793505b505b5050965096945050505050565b600081158061520e5750508082028282828161520b57fe5b04145b61139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b8082018281101561139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b60008060006152fa8585614d9f565b50905060008061530b8888886140c6565b73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561535057600080fd5b505afa158015615364573d6000803e3d6000fd5b505050506040513d606081101561537a57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905073ffffffffffffffffffffffffffffffffffffffff878116908416146153c15780826153c4565b81815b9099909850965050505050505056fe556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e69737761705632526f757465723a20494e53554646494349454e545f425f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e54556e69737761705632526f757465723a204558434553534956455f494e5055545f414d4f554e54556e69737761705632526f757465723a20494e53554646494349454e545f415f414d4f554e545472616e7366657248656c7065723a204554485f5452414e534645525f4641494c4544556e69737761705632526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a26469706673582212206dd6e03c4b2c0a8e55214926227ae9e2d6f9fec2ce74a6446d615afa355c84f364736f6c63430006060033"} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "address", + "name": "_WETH", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountADesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBDesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "addLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountTokenDesired", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "addLiquidityETH", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveB", + "type": "uint256" + } + ], + "name": "quote", + "outputs": [ + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidityETH", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "removeLiquidityETHSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityETHWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountTokenMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountETHMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "amountETH", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenA", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenB", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountAMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountBMin", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "approveMax", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "removeLiquidityWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapETHForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactETHForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactETHForTokensSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForETH", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForETHSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensSupportingFeeOnTransferTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactETH", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "60c06040523480156200001157600080fd5b506040516200573e3803806200573e833981810160405260408110156200003757600080fd5b5080516020909101516001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c6155b762000187600039806101ac5280610e5d5280610e985280610fd5528061129852806116f252806118d65280611e1e5280611fa252806120725280612179528061232c52806123c15280612673528061271a52806127ef52806128f452806129dc5280612a5d52806130ec5280613422528061347852806134ac528061352d528061374752806138f7528061398c5250806110c752806111c5528061136b52806113a4528061154f52806117e452806118b45280611aa1528061225f528061240052806125a95280612a9c5280612ddf5280613071528061309a52806130ca52806132a75280613456528061382d52806139cb528061444a528061448d52806147ed52806149ce5280614f49528061502a52806150aa52506155b76000f3fe60806040526004361061018f5760003560e01c80638803dbee116100d6578063c45a01551161007f578063e8e3370011610059578063e8e3370014610c71578063f305d71914610cfe578063fb3bdb4114610d51576101d5565b8063c45a015514610b25578063d06ca61f14610b3a578063ded9382a14610bf1576101d5565b8063af2979eb116100b0578063af2979eb146109c8578063b6f9de9514610a28578063baa2abde14610abb576101d5565b80638803dbee146108af578063ad5c464814610954578063ad615dec14610992576101d5565b80634a25d94a11610138578063791ac94711610112578063791ac947146107415780637ff36ab5146107e657806385f8c25914610879576101d5565b80634a25d94a146105775780635b0d59841461061c5780635c11d7951461069c576101d5565b80631f00ca74116101695780631f00ca74146103905780632195995c1461044757806338ed1739146104d2576101d5565b806302751cec146101da578063054d50d41461025357806318cbafe51461029b576101d5565b366101d5573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146101d357fe5b005b600080fd5b3480156101e657600080fd5b5061023a600480360360c08110156101fd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a00135610de4565b6040805192835260208301919091528051918290030190f35b34801561025f57600080fd5b506102896004803603606081101561027657600080fd5b5080359060208101359060400135610f37565b60408051918252519081900360200190f35b3480156102a757600080fd5b50610340600480360360a08110156102be57600080fd5b8135916020810135918101906060810160408201356401000000008111156102e557600080fd5b8201836020820111156102f757600080fd5b8035906020019184602083028401116401000000008311171561031957600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135610f4c565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561037c578181015183820152602001610364565b505050509050019250505060405180910390f35b34801561039c57600080fd5b50610340600480360360408110156103b357600080fd5b813591908101906040810160208201356401000000008111156103d557600080fd5b8201836020820111156103e757600080fd5b8035906020019184602083028401116401000000008311171561040957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611364945050505050565b34801561045357600080fd5b5061023a600480360361016081101561046b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359091169060c08101359060e081013515159060ff610100820135169061012081013590610140013561139a565b3480156104de57600080fd5b50610340600480360360a08110156104f557600080fd5b81359160208101359181019060608101604082013564010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184602083028401116401000000008311171561055057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356114d8565b34801561058357600080fd5b50610340600480360360a081101561059a57600080fd5b8135916020810135918101906060810160408201356401000000008111156105c157600080fd5b8201836020820111156105d357600080fd5b803590602001918460208302840111640100000000831117156105f557600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135611669565b34801561062857600080fd5b50610289600480360361014081101561064057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e082013516906101008101359061012001356118ac565b3480156106a857600080fd5b506101d3600480360360a08110156106bf57600080fd5b8135916020810135918101906060810160408201356401000000008111156106e657600080fd5b8201836020820111156106f857600080fd5b8035906020019184602083028401116401000000008311171561071a57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356119fe565b34801561074d57600080fd5b506101d3600480360360a081101561076457600080fd5b81359160208101359181019060608101604082013564010000000081111561078b57600080fd5b82018360208201111561079d57600080fd5b803590602001918460208302840111640100000000831117156107bf57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135611d97565b610340600480360360808110156107fc57600080fd5b8135919081019060408101602082013564010000000081111561081e57600080fd5b82018360208201111561083057600080fd5b8035906020019184602083028401116401000000008311171561085257600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612105565b34801561088557600080fd5b506102896004803603606081101561089c57600080fd5b5080359060208101359060400135612525565b3480156108bb57600080fd5b50610340600480360360a08110156108d257600080fd5b8135916020810135918101906060810160408201356401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612532565b34801561096057600080fd5b50610969612671565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561099e57600080fd5b50610289600480360360608110156109b557600080fd5b5080359060208101359060400135612695565b3480156109d457600080fd5b50610289600480360360c08110156109eb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a001356126a2565b6101d360048036036080811015610a3e57600080fd5b81359190810190604081016020820135640100000000811115610a6057600080fd5b820183602082011115610a7257600080fd5b80359060200191846020830284011164010000000083111715610a9457600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612882565b348015610ac757600080fd5b5061023a600480360360e0811015610ade57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359091169060c00135612d65565b348015610b3157600080fd5b5061096961306f565b348015610b4657600080fd5b5061034060048036036040811015610b5d57600080fd5b81359190810190604081016020820135640100000000811115610b7f57600080fd5b820183602082011115610b9157600080fd5b80359060200191846020830284011164010000000083111715610bb357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613093945050505050565b348015610bfd57600080fd5b5061023a6004803603610140811015610c1557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e082013516906101008101359061012001356130c0565b348015610c7d57600080fd5b50610ce06004803603610100811015610c9557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359160c0820135169060e00135613218565b60408051938452602084019290925282820152519081900360600190f35b610ce0600480360360c0811015610d1457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a001356133a7565b61034060048036036080811015610d6757600080fd5b81359190810190604081016020820135640100000000811115610d8957600080fd5b820183602082011115610d9b57600080fd5b80359060200191846020830284011164010000000083111715610dbd57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356136d3565b6000808242811015610e5757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b610e86897f00000000000000000000000000000000000000000000000000000000000000008a8a8a308a612d65565b9093509150610e96898685613b22565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610f0957600080fd5b505af1158015610f1d573d6000803e3d6000fd5b50505050610f2b8583613cff565b50965096945050505050565b6000610f44848484613e3c565b949350505050565b60608142811015610fbe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001686867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811061102357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6111207f000000000000000000000000000000000000000000000000000000000000000089888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b9150868260018451038151811061113357fe5b60200260200101511015611192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b611257868660008181106111a257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff163361123d7f00000000000000000000000000000000000000000000000000000000000000008a8a60008181106111f157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b600181811061121b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166140c6565b8560008151811061124a57fe5b60200260200101516141b1565b61129682878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250614381915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836001855103815181106112e257fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b50505050611359848360018551038151811061134c57fe5b6020026020010151613cff565b509695505050505050565b60606113917f00000000000000000000000000000000000000000000000000000000000000008484614608565b90505b92915050565b60008060006113ca7f00000000000000000000000000000000000000000000000000000000000000008f8f6140c6565b90506000876113d9578c6113fb565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c48101889052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b15801561149757600080fd5b505af11580156114ab573d6000803e3d6000fd5b505050506114be8f8f8f8f8f8f8f612d65565b809450819550505050509b509b9950505050505050505050565b6060814281101561154a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6115a87f000000000000000000000000000000000000000000000000000000000000000089888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b915086826001845103815181106115bb57fe5b6020026020010151101561161a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b61162a868660008181106111a257fe5b61135982878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b606081428110156116db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001686867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811061174057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117df57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b61183d7f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150868260008151811061184d57fe5b60200260200101511115611192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b6000806118fa7f00000000000000000000000000000000000000000000000000000000000000008d7f00000000000000000000000000000000000000000000000000000000000000006140c6565b9050600086611909578b61192b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018b905260ff8916608482015260a4810188905260c48101879052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b1580156119c757600080fd5b505af11580156119db573d6000803e3d6000fd5b505050506119ed8d8d8d8d8d8d6126a2565b9d9c50505050505050505050505050565b8042811015611a6e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b611afd85856000818110611a7e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1633611af77f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061121b57fe5b8a6141b1565b600085857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611b2d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611bc657600080fd5b505afa158015611bda573d6000803e3d6000fd5b505050506040513d6020811015611bf057600080fd5b50516040805160208881028281018201909352888252929350611c32929091899189918291850190849080828437600092019190915250889250614796915050565b86611d368288887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611c6557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b505afa158015611d12573d6000803e3d6000fd5b505050506040513d6020811015611d2857600080fd5b50519063ffffffff614b2916565b1015611d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b5050505050505050565b8042811015611e0757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001685857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611e6c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f0b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b611f1b85856000818110611a7e57fe5b611f59858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250614796915050565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b158015611fe957600080fd5b505afa158015611ffd573d6000803e3d6000fd5b505050506040513d602081101561201357600080fd5b5051905086811015612070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156120e357600080fd5b505af11580156120f7573d6000803e3d6000fd5b50505050611d8d8482613cff565b6060814281101561217757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16868660008181106121bb57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461225a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6122b87f000000000000000000000000000000000000000000000000000000000000000034888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b915086826001845103815181106122cb57fe5b6020026020010151101561232a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061237357fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123a657600080fd5b505af11580156123ba573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61242c7f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b8460008151811061243957fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156124aa57600080fd5b505af11580156124be573d6000803e3d6000fd5b505050506040513d60208110156124d457600080fd5b50516124dc57fe5b61251b82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b5095945050505050565b6000610f44848484614b9b565b606081428110156125a457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6126027f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150868260008151811061261257fe5b6020026020010151111561161a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b6000610f44848484614cbf565b6000814281101561271457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b612743887f00000000000000000000000000000000000000000000000000000000000000008989893089612d65565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290519194506127ed92508a91879173ffffffffffffffffffffffffffffffffffffffff8416916370a0823191602480820192602092909190829003018186803b1580156127bc57600080fd5b505afa1580156127d0573d6000803e3d6000fd5b505050506040513d60208110156127e657600080fd5b5051613b22565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561286057600080fd5b505af1158015612874573d6000803e3d6000fd5b505050506113598483613cff565b80428110156128f257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168585600081811061293657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b60003490507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015612a4257600080fd5b505af1158015612a56573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612ac87f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612b3257600080fd5b505af1158015612b46573d6000803e3d6000fd5b505050506040513d6020811015612b5c57600080fd5b5051612b6457fe5b600086867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110612b9457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c2d57600080fd5b505afa158015612c41573d6000803e3d6000fd5b505050506040513d6020811015612c5757600080fd5b50516040805160208981028281018201909352898252929350612c999290918a918a918291850190849080828437600092019190915250899250614796915050565b87611d368289897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110612ccc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b6000808242811015612dd857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6000612e057f00000000000000000000000000000000000000000000000000000000000000008c8c6140c6565b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff831660248201819052604482018d9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015612e8657600080fd5b505af1158015612e9a573d6000803e3d6000fd5b505050506040513d6020811015612eb057600080fd5b5050604080517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015282516000938493928616926389afcb44926024808301939282900301818787803b158015612f2357600080fd5b505af1158015612f37573d6000803e3d6000fd5b505050506040513d6040811015612f4d57600080fd5b50805160209091015190925090506000612f678e8e614d9f565b5090508073ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff1614612fa4578183612fa7565b82825b90975095508a871015613005576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154bf6026913960400191505060405180910390fd5b8986101561305e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154256026913960400191505060405180910390fd5b505050505097509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60606113917f00000000000000000000000000000000000000000000000000000000000000008484613f60565b60008060006131107f00000000000000000000000000000000000000000000000000000000000000008e7f00000000000000000000000000000000000000000000000000000000000000006140c6565b905060008761311f578c613141565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c48101889052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b1580156131dd57600080fd5b505af11580156131f1573d6000803e3d6000fd5b505050506132038e8e8e8e8e8e610de4565b909f909e509c50505050505050505050505050565b6000806000834281101561328d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61329b8c8c8c8c8c8c614ef2565b909450925060006132cd7f00000000000000000000000000000000000000000000000000000000000000008e8e6140c6565b90506132db8d3383886141b1565b6132e78c3383876141b1565b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561336657600080fd5b505af115801561337a573d6000803e3d6000fd5b505050506040513d602081101561339057600080fd5b5051949d939c50939a509198505050505050505050565b6000806000834281101561341c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61344a8a7f00000000000000000000000000000000000000000000000000000000000000008b348c8c614ef2565b9094509250600061349c7f00000000000000000000000000000000000000000000000000000000000000008c7f00000000000000000000000000000000000000000000000000000000000000006140c6565b90506134aa8b3383886141b1565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561351257600080fd5b505af1158015613526573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156135d257600080fd5b505af11580156135e6573d6000803e3d6000fd5b505050506040513d60208110156135fc57600080fd5b505161360457fe5b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561368357600080fd5b505af1158015613697573d6000803e3d6000fd5b505050506040513d60208110156136ad57600080fd5b50519250348410156136c5576136c533853403613cff565b505096509650969350505050565b6060814281101561374557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168686600081811061378957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461382857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6138867f00000000000000000000000000000000000000000000000000000000000000008888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150348260008151811061389657fe5b602002602001015111156138f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061393e57fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561397157600080fd5b505af1158015613985573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6139f77f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b84600081518110613a0457fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015613a7557600080fd5b505af1158015613a89573d6000803e3d6000fd5b505050506040513d6020811015613a9f57600080fd5b5051613aa757fe5b613ae682878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b81600081518110613af357fe5b602002602001015134111561251b5761251b3383600081518110613b1357fe5b60200260200101513403613cff565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b60208310613bf857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613bbb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c5a576040519150601f19603f3d011682016040523d82523d6000602084013e613c5f565b606091505b5091509150818015613c8d575080511580613c8d5750808060200190516020811015613c8a57600080fd5b50515b613cf857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff84169083906040518082805190602001908083835b60208310613d7657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613d39565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613dd8576040519150601f19603f3d011682016040523d82523d6000602084013e613ddd565b606091505b5050905080613e37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806154e56023913960400191505060405180910390fd5b505050565b6000808411613e96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615557602b913960400191505060405180910390fd5b600083118015613ea65750600082115b613efb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b6000613f0f856103e563ffffffff6151f316565b90506000613f23828563ffffffff6151f316565b90506000613f4983613f3d886103e863ffffffff6151f316565b9063ffffffff61527916565b9050808281613f5457fe5b04979650505050505050565b6060600282511015613fd357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff81118015613feb57600080fd5b50604051908082528060200260200182016040528015614015578160200160208202803683370190505b509050828160008151811061402657fe5b60200260200101818152505060005b60018351038110156140be576000806140788786858151811061405457fe5b602002602001015187866001018151811061406b57fe5b60200260200101516152eb565b9150915061409a84848151811061408b57fe5b60200260200101518383613e3c565b8484600101815181106140a957fe5b60209081029190910101525050600101614035565b509392505050565b60008060006140d58585614d9f565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b6020831061428f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614252565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146142f1576040519150601f19603f3d011682016040523d82523d6000602084013e6142f6565b606091505b5091509150818015614324575080511580614324575080806020019051602081101561432157600080fd5b50515b614379576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806155336024913960400191505060405180910390fd5b505050505050565b60005b60018351038110156146025760008084838151811061439f57fe5b60200260200101518584600101815181106143b657fe5b60200260200101519150915060006143ce8383614d9f565b50905060008785600101815181106143e257fe5b602002602001015190506000808373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461442a5782600061442e565b6000835b91509150600060028a510388106144455788614486565b6144867f0000000000000000000000000000000000000000000000000000000000000000878c8b6002018151811061447957fe5b60200260200101516140c6565b90506144b37f000000000000000000000000000000000000000000000000000000000000000088886140c6565b73ffffffffffffffffffffffffffffffffffffffff1663022c0d9f84848460006040519080825280601f01601f1916602001820160405280156144fd576020820181803683370190505b506040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015614588578181015183820152602001614570565b50505050905090810190601f1680156145b55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156145d757600080fd5b505af11580156145eb573d6000803e3d6000fd5b505060019099019850614384975050505050505050565b50505050565b606060028251101561467b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff8111801561469357600080fd5b506040519080825280602002602001820160405280156146bd578160200160208202803683370190505b50905082816001835103815181106146d157fe5b602090810291909101015281517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b80156140be576000806147318786600186038151811061471d57fe5b602002602001015187868151811061406b57fe5b9150915061475384848151811061474457fe5b60200260200101518383614b9b565b84600185038151811061476257fe5b602090810291909101015250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01614701565b60005b6001835103811015613e37576000808483815181106147b457fe5b60200260200101518584600101815181106147cb57fe5b60200260200101519150915060006147e38383614d9f565b50905060006148137f000000000000000000000000000000000000000000000000000000000000000085856140c6565b90506000806000808473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561486157600080fd5b505afa158015614875573d6000803e3d6000fd5b505050506040513d606081101561488b57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905060008073ffffffffffffffffffffffffffffffffffffffff8a8116908916146148d55782846148d8565b83835b9150915061495d828b73ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b955061496a868383613e3c565b9450505050506000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146149ae578260006149b2565b6000835b91509150600060028c51038a106149c9578a6149fd565b6149fd7f0000000000000000000000000000000000000000000000000000000000000000898e8d6002018151811061447957fe5b60408051600080825260208201928390527f022c0d9f000000000000000000000000000000000000000000000000000000008352602482018781526044830187905273ffffffffffffffffffffffffffffffffffffffff8086166064850152608060848501908152845160a48601819052969750908c169563022c0d9f958a958a958a9591949193919260c486019290918190849084905b83811015614aad578181015183820152602001614a95565b50505050905090810190601f168015614ada5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015614afc57600080fd5b505af1158015614b10573d6000803e3d6000fd5b50506001909b019a506147999950505050505050505050565b8082038281111561139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6000808411614bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806153d4602c913960400191505060405180910390fd5b600083118015614c055750600082115b614c5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b6000614c7e6103e8614c72868863ffffffff6151f316565b9063ffffffff6151f316565b90506000614c986103e5614c72868963ffffffff614b2916565b9050614cb56001828481614ca857fe5b049063ffffffff61527916565b9695505050505050565b6000808411614d19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806154736025913960400191505060405180910390fd5b600083118015614d295750600082115b614d7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b82614d8f858463ffffffff6151f316565b81614d9657fe5b04949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415614e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806154006025913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610614e61578284614e64565b83835b909250905073ffffffffffffffffffffffffffffffffffffffff8216614eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b604080517fe6a4390500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287811660248301529151600092839283927f00000000000000000000000000000000000000000000000000000000000000009092169163e6a4390591604480820192602092909190829003018186803b158015614f9257600080fd5b505afa158015614fa6573d6000803e3d6000fd5b505050506040513d6020811015614fbc57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614156150a257604080517fc9c6539600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a81166004830152898116602483015291517f00000000000000000000000000000000000000000000000000000000000000009092169163c9c65396916044808201926020929091908290030181600087803b15801561507557600080fd5b505af1158015615089573d6000803e3d6000fd5b505050506040513d602081101561509f57600080fd5b50505b6000806150d07f00000000000000000000000000000000000000000000000000000000000000008b8b6152eb565b915091508160001480156150e2575080155b156150f2578793508692506151e6565b60006150ff898484614cbf565b905087811161516c5785811015615161576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154256026913960400191505060405180910390fd5b8894509250826151e4565b6000615179898486614cbf565b90508981111561518557fe5b878110156151de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154bf6026913960400191505060405180910390fd5b94508793505b505b5050965096945050505050565b600081158061520e5750508082028282828161520b57fe5b04145b61139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b8082018281101561139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b60008060006152fa8585614d9f565b50905060008061530b8888886140c6565b73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561535057600080fd5b505afa158015615364573d6000803e3d6000fd5b505050506040513d606081101561537a57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905073ffffffffffffffffffffffffffffffffffffffff878116908416146153c15780826153c4565b81815b9099909850965050505050505056fe556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e69737761705632526f757465723a20494e53554646494349454e545f425f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e54556e69737761705632526f757465723a204558434553534956455f494e5055545f414d4f554e54556e69737761705632526f757465723a20494e53554646494349454e545f415f414d4f554e545472616e7366657248656c7065723a204554485f5452414e534645525f4641494c4544556e69737761705632526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a26469706673582212206dd6e03c4b2c0a8e55214926227ae9e2d6f9fec2ce74a6446d615afa355c84f364736f6c63430006060033" +} diff --git a/crates/contracts/artifacts/UniswapV3Pool.json b/crates/contracts/artifacts/UniswapV3Pool.json index 005f010aa0..87969854f7 100644 --- a/crates/contracts/artifacts/UniswapV3Pool.json +++ b/crates/contracts/artifacts/UniswapV3Pool.json @@ -1 +1,990 @@ -{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"Collect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"CollectProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paid0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paid1","type":"uint256"}],"name":"Flash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"observationCardinalityNextOld","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"observationCardinalityNextNew","type":"uint16"}],"name":"IncreaseObservationCardinalityNext","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"feeProtocol0Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol0New","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1New","type":"uint8"}],"name":"SetFeeProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"int256","name":"amount0","type":"int256"},{"indexed":false,"internalType":"int256","name":"amount1","type":"int256"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Swap","type":"event"},{"inputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount","type":"uint128"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount0Requested","type":"uint128"},{"internalType":"uint128","name":"amount1Requested","type":"uint128"}],"name":"collect","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint128","name":"amount0Requested","type":"uint128"},{"internalType":"uint128","name":"amount1Requested","type":"uint128"}],"name":"collectProtocol","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeGrowthGlobal0X128","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeGrowthGlobal1X128","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"}],"name":"increaseObservationCardinalityNext","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidity","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLiquidityPerTick","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"observations","outputs":[{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"int56","name":"tickCumulative","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityCumulativeX128","type":"uint160"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"secondsAgos","type":"uint32[]"}],"name":"observe","outputs":[{"internalType":"int56[]","name":"tickCumulatives","type":"int56[]"},{"internalType":"uint160[]","name":"secondsPerLiquidityCumulativeX128s","type":"uint160[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"positions","outputs":[{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"feeGrowthInside0LastX128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthInside1LastX128","type":"uint256"},{"internalType":"uint128","name":"tokensOwed0","type":"uint128"},{"internalType":"uint128","name":"tokensOwed1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFees","outputs":[{"internalType":"uint128","name":"token0","type":"uint128"},{"internalType":"uint128","name":"token1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"feeProtocol0","type":"uint8"},{"internalType":"uint8","name":"feeProtocol1","type":"uint8"}],"name":"setFeeProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slot0","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint16","name":"observationIndex","type":"uint16"},{"internalType":"uint16","name":"observationCardinality","type":"uint16"},{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"},{"internalType":"uint8","name":"feeProtocol","type":"uint8"},{"internalType":"bool","name":"unlocked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"name":"snapshotCumulativesInside","outputs":[{"internalType":"int56","name":"tickCumulativeInside","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityInsideX128","type":"uint160"},{"internalType":"uint32","name":"secondsInside","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"int256","name":"amountSpecified","type":"int256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[{"internalType":"int256","name":"amount0","type":"int256"},{"internalType":"int256","name":"amount1","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int16","name":"","type":"int16"}],"name":"tickBitmap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"","type":"int24"}],"name":"ticks","outputs":[{"internalType":"uint128","name":"liquidityGross","type":"uint128"},{"internalType":"int128","name":"liquidityNet","type":"int128"},{"internalType":"uint256","name":"feeGrowthOutside0X128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthOutside1X128","type":"uint256"},{"internalType":"int56","name":"tickCumulativeOutside","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityOutsideX128","type":"uint160"},{"internalType":"uint32","name":"secondsOutside","type":"uint32"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount0", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount1", + "type": "uint128" + } + ], + "name": "Collect", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount0", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount1", + "type": "uint128" + } + ], + "name": "CollectProtocol", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paid0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paid1", + "type": "uint256" + } + ], + "name": "Flash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "observationCardinalityNextOld", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "observationCardinalityNextNew", + "type": "uint16" + } + ], + "name": "IncreaseObservationCardinalityNext", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + }, + { + "indexed": false, + "internalType": "int24", + "name": "tick", + "type": "int24" + } + ], + "name": "Initialize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "indexed": true, + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol0Old", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol1Old", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol0New", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "feeProtocol1New", + "type": "uint8" + } + ], + "name": "SetFeeProtocol", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount0", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "amount1", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "liquidity", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "int24", + "name": "tick", + "type": "int24" + } + ], + "name": "Swap", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "internalType": "uint128", + "name": "amount", + "type": "uint128" + } + ], + "name": "burn", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "internalType": "uint128", + "name": "amount0Requested", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount1Requested", + "type": "uint128" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint128", + "name": "amount0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount1", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint128", + "name": "amount0Requested", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount1Requested", + "type": "uint128" + } + ], + "name": "collectProtocol", + "outputs": [ + { + "internalType": "uint128", + "name": "amount0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "amount1", + "type": "uint128" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fee", + "outputs": [ + { + "internalType": "uint24", + "name": "", + "type": "uint24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeGrowthGlobal0X128", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeGrowthGlobal1X128", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "flash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "observationCardinalityNext", + "type": "uint16" + } + ], + "name": "increaseObservationCardinalityNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "liquidity", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLiquidityPerTick", + "outputs": [ + { + "internalType": "uint128", + "name": "", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + }, + { + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "observations", + "outputs": [ + { + "internalType": "uint32", + "name": "blockTimestamp", + "type": "uint32" + }, + { + "internalType": "int56", + "name": "tickCumulative", + "type": "int56" + }, + { + "internalType": "uint160", + "name": "secondsPerLiquidityCumulativeX128", + "type": "uint160" + }, + { + "internalType": "bool", + "name": "initialized", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32[]", + "name": "secondsAgos", + "type": "uint32[]" + } + ], + "name": "observe", + "outputs": [ + { + "internalType": "int56[]", + "name": "tickCumulatives", + "type": "int56[]" + }, + { + "internalType": "uint160[]", + "name": "secondsPerLiquidityCumulativeX128s", + "type": "uint160[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "positions", + "outputs": [ + { + "internalType": "uint128", + "name": "liquidity", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "feeGrowthInside0LastX128", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeGrowthInside1LastX128", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "tokensOwed0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "tokensOwed1", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolFees", + "outputs": [ + { + "internalType": "uint128", + "name": "token0", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "token1", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "feeProtocol0", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "feeProtocol1", + "type": "uint8" + } + ], + "name": "setFeeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "slot0", + "outputs": [ + { + "internalType": "uint160", + "name": "sqrtPriceX96", + "type": "uint160" + }, + { + "internalType": "int24", + "name": "tick", + "type": "int24" + }, + { + "internalType": "uint16", + "name": "observationIndex", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "observationCardinality", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "observationCardinalityNext", + "type": "uint16" + }, + { + "internalType": "uint8", + "name": "feeProtocol", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "unlocked", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int24", + "name": "tickLower", + "type": "int24" + }, + { + "internalType": "int24", + "name": "tickUpper", + "type": "int24" + } + ], + "name": "snapshotCumulativesInside", + "outputs": [ + { + "internalType": "int56", + "name": "tickCumulativeInside", + "type": "int56" + }, + { + "internalType": "uint160", + "name": "secondsPerLiquidityInsideX128", + "type": "uint160" + }, + { + "internalType": "uint32", + "name": "secondsInside", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "zeroForOne", + "type": "bool" + }, + { + "internalType": "int256", + "name": "amountSpecified", + "type": "int256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "int256", + "name": "amount0", + "type": "int256" + }, + { + "internalType": "int256", + "name": "amount1", + "type": "int256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int16", + "name": "", + "type": "int16" + } + ], + "name": "tickBitmap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tickSpacing", + "outputs": [ + { + "internalType": "int24", + "name": "", + "type": "int24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int24", + "name": "", + "type": "int24" + } + ], + "name": "ticks", + "outputs": [ + { + "internalType": "uint128", + "name": "liquidityGross", + "type": "uint128" + }, + { + "internalType": "int128", + "name": "liquidityNet", + "type": "int128" + }, + { + "internalType": "uint256", + "name": "feeGrowthOutside0X128", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeGrowthOutside1X128", + "type": "uint256" + }, + { + "internalType": "int56", + "name": "tickCumulativeOutside", + "type": "int56" + }, + { + "internalType": "uint160", + "name": "secondsPerLiquidityOutsideX128", + "type": "uint160" + }, + { + "internalType": "uint32", + "name": "secondsOutside", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "initialized", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token0", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/UniswapV3QuoterV2.json b/crates/contracts/artifacts/UniswapV3QuoterV2.json index 9251f061d5..7d72b79934 100644 --- a/crates/contracts/artifacts/UniswapV3QuoterV2.json +++ b/crates/contracts/artifacts/UniswapV3QuoterV2.json @@ -1 +1,269 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH9","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"quoteExactInput","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint160[]","name":"sqrtPriceX96AfterList","type":"uint160[]"},{"internalType":"uint32[]","name":"initializedTicksCrossedList","type":"uint32[]"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IQuoterV2.QuoteExactInputSingleParams","name":"params","type":"tuple"}],"name":"quoteExactInputSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"internalType":"uint32","name":"initializedTicksCrossed","type":"uint32"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"quoteExactOutput","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint160[]","name":"sqrtPriceX96AfterList","type":"uint160[]"},{"internalType":"uint32[]","name":"initializedTicksCrossedList","type":"uint32[]"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IQuoterV2.QuoteExactOutputSingleParams","name":"params","type":"tuple"}],"name":"quoteExactOutputSingle","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"internalType":"uint32","name":"initializedTicksCrossed","type":"uint32"},{"internalType":"uint256","name":"gasEstimate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"path","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"view","type":"function"}]} \ No newline at end of file +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "address", + "name": "_WETH9", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "WETH9", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "path", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "name": "quoteExactInput", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint160[]", + "name": "sqrtPriceX96AfterList", + "type": "uint160[]" + }, + { + "internalType": "uint32[]", + "name": "initializedTicksCrossedList", + "type": "uint32[]" + }, + { + "internalType": "uint256", + "name": "gasEstimate", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + } + ], + "internalType": "struct IQuoterV2.QuoteExactInputSingleParams", + "name": "params", + "type": "tuple" + } + ], + "name": "quoteExactInputSingle", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceX96After", + "type": "uint160" + }, + { + "internalType": "uint32", + "name": "initializedTicksCrossed", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "gasEstimate", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "path", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "quoteExactOutput", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint160[]", + "name": "sqrtPriceX96AfterList", + "type": "uint160[]" + }, + { + "internalType": "uint32[]", + "name": "initializedTicksCrossedList", + "type": "uint32[]" + }, + { + "internalType": "uint256", + "name": "gasEstimate", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + } + ], + "internalType": "struct IQuoterV2.QuoteExactOutputSingleParams", + "name": "params", + "type": "tuple" + } + ], + "name": "quoteExactOutputSingle", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceX96After", + "type": "uint160" + }, + { + "internalType": "uint32", + "name": "initializedTicksCrossed", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "gasEstimate", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "amount0Delta", + "type": "int256" + }, + { + "internalType": "int256", + "name": "amount1Delta", + "type": "int256" + }, + { + "internalType": "bytes", + "name": "path", + "type": "bytes" + } + ], + "name": "uniswapV3SwapCallback", + "outputs": [], + "stateMutability": "view", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/UniswapV3SwapRouterV2.json b/crates/contracts/artifacts/UniswapV3SwapRouterV2.json index 7346410f88..5cc70cda4a 100644 --- a/crates/contracts/artifacts/UniswapV3SwapRouterV2.json +++ b/crates/contracts/artifacts/UniswapV3SwapRouterV2.json @@ -1 +1,60 @@ -{"abi":[{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IV3SwapRouter.ExactOutputSingleParams","name":"params","type":"tuple"}],"name":"exactOutputSingle","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"}]} +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint24", + "name": "fee", + "type": "uint24" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaximum", + "type": "uint256" + }, + { + "internalType": "uint160", + "name": "sqrtPriceLimitX96", + "type": "uint160" + } + ], + "internalType": "struct IV3SwapRouter.ExactOutputSingleParams", + "name": "params", + "type": "tuple" + } + ], + "name": "exactOutputSingle", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + } + ] +} diff --git a/crates/contracts/artifacts/WETH9.json b/crates/contracts/artifacts/WETH9.json index 818f057257..6e4607ddbb 100644 --- a/crates/contracts/artifacts/WETH9.json +++ b/crates/contracts/artifacts/WETH9.json @@ -1 +1,288 @@ -{"abi":[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"guy","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"dst","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"src","type":"address"},{"indexed":false,"name":"wad","type":"uint256"}],"name":"Withdrawal","type":"event"},{"constant":false,"inputs":[],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"},{"name":"wad","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"src","type":"address"},{"name":"dst","type":"address"},{"name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x60806040526040805190810160405280600d81526020017f57726170706564204574686572000000000000000000000000000000000000008152506000908051906020019061004f9291906100ca565b506040805190810160405280600481526020017f57455448000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100ca565b506012600260006101000a81548160ff021916908360ff1602179055503480156100c457600080fd5b5061016f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010b57805160ff1916838001178555610139565b82800160010185558215610139579182015b8281111561013857825182559160200191906001019061011d565b5b509050610146919061014a565b5090565b61016c91905b80821115610168576000816000905550600101610150565b5090565b90565b610cd88061017e6000396000f3fe6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b9578063095ea7b31461014957806318160ddd146101bc57806323b872dd146101e75780632e1a7d4d1461027a578063313ce567146102b557806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063d0e30db01461044e578063dd62ed3e14610458575b6100b76104dd565b005b3480156100c557600080fd5b506100ce61057a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010e5780820151818401526020810190506100f3565b50505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015557600080fd5b506101a26004803603604081101561016c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610618565b604051808215151515815260200191505060405180910390f35b3480156101c857600080fd5b506101d161070a565b6040518082815260200191505060405180910390f35b3480156101f357600080fd5b506102606004803603606081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610729565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b506102b36004803603602081101561029d57600080fd5b8101908080359060200190929190505050610a76565b005b3480156102c157600080fd5b506102ca610ba9565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bbc565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610bd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e757600080fd5b50610434600480360360408110156103fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c72565b604051808215151515815260200191505060405180910390f35b6104566104dd565b005b34801561046457600080fd5b506104c76004803603604081101561047b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c87565b6040518082815260200191505060405180910390f35b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106105780601f106105e557610100808354040283529160200191610610565b820191906000526020600020905b8154815290600101906020018083116105f357829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561077957600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561085157507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561096c5781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156108e157600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ac457600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b57573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c6a5780601f10610c3f57610100808354040283529160200191610c6a565b820191906000526020600020905b815481529060010190602001808311610c4d57829003601f168201915b505050505081565b6000610c7f338484610729565b905092915050565b600460205281600052604060002060205280600052604060002060009150915050548156fea165627a7a7230582089f5a509ec49def9e0fd69996f7ea7cb42adb14f134f71ea034b8ce39df0a1e00029","devdoc":{"methods":{}},"userdoc":{"methods":{}}} \ No newline at end of file +{ + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040526040805190810160405280600d81526020017f57726170706564204574686572000000000000000000000000000000000000008152506000908051906020019061004f9291906100ca565b506040805190810160405280600481526020017f57455448000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100ca565b506012600260006101000a81548160ff021916908360ff1602179055503480156100c457600080fd5b5061016f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010b57805160ff1916838001178555610139565b82800160010185558215610139579182015b8281111561013857825182559160200191906001019061011d565b5b509050610146919061014a565b5090565b61016c91905b80821115610168576000816000905550600101610150565b5090565b90565b610cd88061017e6000396000f3fe6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b9578063095ea7b31461014957806318160ddd146101bc57806323b872dd146101e75780632e1a7d4d1461027a578063313ce567146102b557806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063d0e30db01461044e578063dd62ed3e14610458575b6100b76104dd565b005b3480156100c557600080fd5b506100ce61057a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010e5780820151818401526020810190506100f3565b50505050905090810190601f16801561013b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015557600080fd5b506101a26004803603604081101561016c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610618565b604051808215151515815260200191505060405180910390f35b3480156101c857600080fd5b506101d161070a565b6040518082815260200191505060405180910390f35b3480156101f357600080fd5b506102606004803603606081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610729565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b506102b36004803603602081101561029d57600080fd5b8101908080359060200190929190505050610a76565b005b3480156102c157600080fd5b506102ca610ba9565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bbc565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610bd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e757600080fd5b50610434600480360360408110156103fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c72565b604051808215151515815260200191505060405180910390f35b6104566104dd565b005b34801561046457600080fd5b506104c76004803603604081101561047b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c87565b6040518082815260200191505060405180910390f35b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106105780601f106105e557610100808354040283529160200191610610565b820191906000526020600020905b8154815290600101906020018083116105f357829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561077957600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561085157507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561096c5781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156108e157600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ac457600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b57573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c6a5780601f10610c3f57610100808354040283529160200191610c6a565b820191906000526020600020905b815481529060010190602001808311610c4d57829003601f168201915b505050505081565b6000610c7f338484610729565b905092915050565b600460205281600052604060002060205280600052604060002060009150915050548156fea165627a7a7230582089f5a509ec49def9e0fd69996f7ea7cb42adb14f134f71ea034b8ce39df0a1e00029", + "devdoc": { + "methods": {} + }, + "userdoc": { + "methods": {} + } +} From 29f34afdf89d9b403023f40161452968caf864bc Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Mon, 27 Oct 2025 10:16:22 +0100 Subject: [PATCH 046/117] Migrate authenticator contract to alloy (#3817) # Description Migrates the authenticator contract (source of truth for which addresses are allow listed solvers) to use alloy. # Changes - [x] removed old bindings - [x] added new bindings - [x] fixed type errors until the compiler stopped yelling at me I also added `ProviderSignerExt::without_wallet()` to get a fresh provider that can be used to sign impersonated accounts. That is needed because telling `anvil` to impersonate some address does not magically add the signer to the wallet. So when we have a wallet configured and ask to sign for a particular address `alloy` complains that it doesn't know how to sign. If we don't have any wallet configured alloy will just forward the tx to the node for signing. ## How to test - compiler - existing e2e tests --- .../participation_guard/onchain.rs | 7 +- .../src/domain/settlement/transaction/mod.rs | 10 +- .../src/infra/blockchain/contracts.rs | 19 ++-- crates/contracts/build.rs | 92 ------------------- crates/contracts/src/alloy.rs | 26 ++++++ crates/contracts/src/lib.rs | 1 - crates/driver/src/tests/setup/blockchain.rs | 51 +++++----- crates/e2e/src/setup/deploy.rs | 23 +++-- .../e2e/src/setup/onchain_components/mod.rs | 64 +++++++------ .../tests/e2e/solver_participation_guard.rs | 10 +- crates/ethrpc/src/alloy/mod.rs | 18 ++++ 11 files changed, 144 insertions(+), 177 deletions(-) diff --git a/crates/autopilot/src/domain/competition/participation_guard/onchain.rs b/crates/autopilot/src/domain/competition/participation_guard/onchain.rs index a23cd7e483..bcdd7140db 100644 --- a/crates/autopilot/src/domain/competition/participation_guard/onchain.rs +++ b/crates/autopilot/src/domain/competition/participation_guard/onchain.rs @@ -1,4 +1,7 @@ -use crate::{domain::eth, infra}; +use { + crate::{domain::eth, infra}, + ethrpc::alloy::conversions::IntoAlloy, +}; /// Calls Authenticator contract to check if a solver has a sufficient /// permission. @@ -13,7 +16,7 @@ impl super::SolverValidator for Validator { .eth .contracts() .authenticator() - .is_solver(solver.0) + .isSolver(solver.0.into_alloy()) .call() .await?) } diff --git a/crates/autopilot/src/domain/settlement/transaction/mod.rs b/crates/autopilot/src/domain/settlement/transaction/mod.rs index 714d19957a..f5a1768dc7 100644 --- a/crates/autopilot/src/domain/settlement/transaction/mod.rs +++ b/crates/autopilot/src/domain/settlement/transaction/mod.rs @@ -3,7 +3,9 @@ use { boundary, domain::{self, auction::order, eth}, }, + contracts::alloy::GPv2AllowListAuthentication, ethcontract::{BlockId, common::FunctionExt}, + ethrpc::alloy::conversions::IntoAlloy, std::{collections::HashSet, sync::LazyLock}, }; @@ -22,7 +24,7 @@ pub trait Authenticator { } #[async_trait::async_trait] -impl Authenticator for contracts::GPv2AllowListAuthentication { +impl Authenticator for GPv2AllowListAuthentication::Instance { async fn is_valid_solver( &self, prospective_solver: eth::Address, @@ -34,8 +36,8 @@ impl Authenticator for contracts::GPv2AllowListAuthentication { // find an eligible caller in the callstack. To avoid this case the // underlying call needs to happen on the same block the transaction happened. Ok(self - .is_solver(prospective_solver.into()) - .block(block) + .isSolver(prospective_solver.0.into_alloy()) + .block(block.into_alloy()) .call() .await .map_err(Error::Authentication)?) @@ -276,5 +278,5 @@ pub enum Error { #[error("failed to recover signature {0}")] SignatureRecover(#[source] anyhow::Error), #[error("failed to check authentication {0}")] - Authentication(#[source] ethcontract::errors::MethodError), + Authentication(#[source] alloy::contract::Error), } diff --git a/crates/autopilot/src/infra/blockchain/contracts.rs b/crates/autopilot/src/infra/blockchain/contracts.rs index 337c8fcc89..427437de80 100644 --- a/crates/autopilot/src/infra/blockchain/contracts.rs +++ b/crates/autopilot/src/infra/blockchain/contracts.rs @@ -1,7 +1,13 @@ use { crate::domain, chain::Chain, - contracts::alloy::{ChainalysisOracle, HooksTrampoline, InstanceExt, support::Balances}, + contracts::alloy::{ + ChainalysisOracle, + GPv2AllowListAuthentication, + HooksTrampoline, + InstanceExt, + support::Balances, + }, ethrpc::{Web3, alloy::conversions::IntoAlloy}, primitive_types::H160, }; @@ -17,7 +23,7 @@ pub struct Contracts { /// The authenticator contract that decides which solver is allowed to /// submit settlements. - authenticator: contracts::GPv2AllowListAuthentication, + authenticator: GPv2AllowListAuthentication::Instance, /// The domain separator for settlement contract used for signing orders. settlement_domain_separator: domain::eth::DomainSeparator, } @@ -92,13 +98,14 @@ impl Contracts { .0, ); - let authenticator = contracts::GPv2AllowListAuthentication::at( - web3, + let authenticator = GPv2AllowListAuthentication::Instance::new( settlement .authenticator() .call() .await - .expect("authenticator address"), + .expect("authenticator address") + .into_alloy(), + web3.alloy.clone(), ); Self { @@ -147,7 +154,7 @@ impl Contracts { self.weth.address().into() } - pub fn authenticator(&self) -> &contracts::GPv2AllowListAuthentication { + pub fn authenticator(&self) -> &GPv2AllowListAuthentication::Instance { &self.authenticator } } diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 06af3d62fe..eb6192a8e2 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -33,98 +33,6 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); generate_contract("ERC20"); - generate_contract_with_config("GPv2AllowListAuthentication", |builder| { - builder - .contract_mod_override("gpv2_allow_list_authentication") - .add_network( - MAINNET, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(12593263)), - }, - ) - .add_network( - GOERLI, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(7020442)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(16465099)), - }, - ) - .add_network( - SEPOLIA, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(4717469)), - }, - ) - .add_network( - ARBITRUM_ONE, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(204702129)), - }, - ) - .add_network( - BASE, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(21407137)), - }, - ) - .add_network( - AVALANCHE, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(59891351)), - }, - ) - .add_network( - BNB, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(48173639)), - }, - ) - .add_network( - OPTIMISM, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(134254466)), - }, - ) - .add_network( - POLYGON, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(45854728)), - }, - ) - .add_network( - LENS, - Network { - address: addr("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(2612937)), - }, - ) - }); generate_contract_with_config("GPv2Settlement", |builder| { builder .contract_mod_override("gpv2_settlement") diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index d1c5cd1617..de9503cf61 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -628,6 +628,32 @@ crate::bindings!( } ); +crate::bindings!( + GPv2AllowListAuthentication, + crate::deployments! { + // + MAINNET => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 12593263), + // + GNOSIS => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 16465099), + // + SEPOLIA => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 4717469), + // + ARBITRUM_ONE => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 204702129), + // + BASE => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 21407137), + // + AVALANCHE => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 59891351), + // + BNB => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 48173639), + // + OPTIMISM => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 134254466), + // + POLYGON => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 45854728), + // + LENS => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 2612937), + } +); + pub mod cow_amm { crate::bindings!(CowAmmFactoryGetter); } diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 5130e034de..15e4f3059c 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -54,7 +54,6 @@ include_contracts! { CowAmmLegacyHelper; CowAmmUniswapV2PriceOracle; ERC20; - GPv2AllowListAuthentication; GPv2Settlement; WETH9; } diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index b45471b3d0..acfb1eff88 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -13,6 +13,7 @@ use { BalancerV2Vault, ERC20Mintable, FlashLoanRouter, + GPv2AllowListAuthentication::GPv2AllowListAuthentication, support::{Balances, Signatures}, }, ethcontract::PrivateKey, @@ -293,20 +294,16 @@ impl Blockchain { .deploy() .await .unwrap(); - let authenticator = wait_for( + let authenticator = GPv2AllowListAuthentication::deploy(web3.alloy.clone()) + .await + .unwrap(); + let mut settlement = contracts::GPv2Settlement::builder( &web3, - contracts::GPv2AllowListAuthentication::builder(&web3) - .from(main_trader_account.clone()) - .deploy(), - ) - .await - .unwrap(); - let mut settlement = wait_for( - &web3, - contracts::GPv2Settlement::builder(&web3, authenticator.address(), vault.into_legacy()) - .from(main_trader_account.clone()) - .deploy(), + authenticator.address().into_legacy(), + vault.into_legacy(), ) + .from(main_trader_account.clone()) + .deploy() .await .unwrap(); if let Some(settlement_address) = config.settlement_address { @@ -341,15 +338,12 @@ impl Blockchain { }; let balances = Balances::Instance::new(balances_address, web3.alloy.clone()); - wait_for( - &web3, - authenticator - .initialize_manager(main_trader_account.address()) - .from(main_trader_account.clone()) - .send(), - ) - .await - .unwrap(); + authenticator + .initializeManager(main_trader_account.address().into_alloy()) + .from(main_trader_account.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let signatures_address = if let Some(signatures_address) = config.signatures_address { signatures_address.into_alloy() @@ -375,15 +369,12 @@ impl Blockchain { let mut trader_accounts = Vec::new(); for config in config.solvers { - wait_for( - &web3, - authenticator - .add_solver(config.address()) - .from(main_trader_account.clone()) - .send(), - ) - .await - .unwrap(); + authenticator + .addSolver(config.address().into_alloy()) + .from(main_trader_account.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); wait_for( &web3, web3.eth() diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index 8ca1486f16..f66218dcaa 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -1,7 +1,6 @@ use { crate::deploy, contracts::{ - GPv2AllowListAuthentication, GPv2Settlement, WETH9, alloy::{ @@ -9,6 +8,7 @@ use { BalancerV2Vault, CoWSwapEthFlow, FlashLoanRouter, + GPv2AllowListAuthentication, HooksTrampoline, InstanceExt, UniswapV2Factory, @@ -17,7 +17,10 @@ use { }, }, ethcontract::{Address, H256}, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::DomainSeparator, shared::ethrpc::Web3, }; @@ -33,7 +36,7 @@ pub struct Contracts { pub balancer_vault: BalancerV2Vault::Instance, pub gp_settlement: GPv2Settlement, pub signatures: Signatures::Instance, - pub gp_authenticator: GPv2AllowListAuthentication, + pub gp_authenticator: GPv2AllowListAuthentication::Instance, pub balances: Balances::Instance, pub uniswap_v2_factory: UniswapV2Factory::Instance, pub uniswap_v2_router: UniswapV2Router02::Instance, @@ -78,7 +81,9 @@ impl Contracts { balancer_vault: BalancerV2Vault::Instance::deployed(&web3.alloy) .await .unwrap(), - gp_authenticator: GPv2AllowListAuthentication::deployed(web3).await.unwrap(), + gp_authenticator: GPv2AllowListAuthentication::Instance::deployed(&web3.alloy) + .await + .unwrap(), uniswap_v2_factory: UniswapV2Factory::Instance::deployed(&web3.alloy) .await .unwrap(), @@ -154,16 +159,18 @@ impl Contracts { .await .unwrap(); - let gp_authenticator = deploy!(web3, GPv2AllowListAuthentication); + let gp_authenticator = GPv2AllowListAuthentication::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); gp_authenticator - .initialize_manager(admin) - .send() + .initializeManager(admin.into_alloy()) + .send_and_watch() .await .expect("failed to initialize manager"); let gp_settlement = deploy!( web3, GPv2Settlement( - gp_authenticator.address(), + gp_authenticator.address().into_legacy(), balancer_vault.address().into_legacy(), ) ); diff --git a/crates/e2e/src/setup/onchain_components/mod.rs b/crates/e2e/src/setup/onchain_components/mod.rs index b058c3daec..95ef941bed 100644 --- a/crates/e2e/src/setup/onchain_components/mod.rs +++ b/crates/e2e/src/setup/onchain_components/mod.rs @@ -8,7 +8,11 @@ use { signers::local::PrivateKeySigner, }, app_data::Hook, - contracts::alloy::{ERC20Mintable, test::CowProtocolToken}, + contracts::alloy::{ + ERC20Mintable, + GPv2AllowListAuthentication::GPv2AllowListAuthentication, + test::CowProtocolToken, + }, core::panic, ethcontract::{ Account, @@ -19,6 +23,7 @@ use { }, ethrpc::alloy::{ CallBuilderExt, + ProviderSignerExt, conversions::{IntoAlloy, IntoLegacy}, }, hex_literal::hex, @@ -342,8 +347,8 @@ impl OnchainComponents { self.contracts .gp_authenticator - .add_solver(solver.address()) - .send() + .addSolver(solver.address().into_alloy()) + .send_and_watch() .await .expect("failed to add solver"); } @@ -355,15 +360,15 @@ impl OnchainComponents { if allowed { self.contracts .gp_authenticator - .add_solver(solver) - .send() + .addSolver(solver.into_alloy()) + .send_and_watch() .await .expect("failed to add solver"); } else { self.contracts .gp_authenticator - .remove_solver(solver) - .send() + .removeSolver(solver.into_alloy()) + .send_and_watch() .await .expect("failed to remove solver"); } @@ -375,13 +380,9 @@ impl OnchainComponents { &mut self, with_wei: U256, ) -> [TestAccount; N] { - let auth_manager = self - .contracts - .gp_authenticator - .manager() - .call() - .await - .unwrap(); + let authenticator = &self.contracts.gp_authenticator; + + let auth_manager = authenticator.manager().call().await.unwrap().into_legacy(); let forked_node_api = self.web3.api::>(); @@ -390,29 +391,36 @@ impl OnchainComponents { .await .expect("could not set auth_manager balance"); - let auth_manager = forked_node_api - .impersonate(&auth_manager) - .await - .expect("could not impersonate auth_manager"); + let impersonated_authenticator = { + forked_node_api + .impersonate(&auth_manager) + .await + .expect("could not impersonate auth_manager"); + + // we create a new provider without a wallet so that + // alloy does not try to sign the tx with it and instead + // forwards the tx to the node for signing. This will + // work because we told anvil to impersonate that address. + let provider = authenticator.provider().clone().without_wallet(); + GPv2AllowListAuthentication::new(*authenticator.address(), provider) + }; let solvers = self.make_accounts::(with_wei).await; for solver in &solvers { - self.contracts - .gp_authenticator - .add_solver(solver.address()) - .from(auth_manager.clone()) - .send() + impersonated_authenticator + .addSolver(solver.address().into_alloy()) + .from(auth_manager.into_alloy()) + .send_and_watch() .await .expect("failed to add solver"); } if let Some(router) = &self.contracts.flashloan_router { - self.contracts - .gp_authenticator - .add_solver(router.address().into_legacy()) - .from(auth_manager.clone()) - .send() + impersonated_authenticator + .addSolver(*router.address()) + .from(auth_manager.into_alloy()) + .send_and_watch() .await .expect("failed to add flashloan wrapper"); } diff --git a/crates/e2e/tests/e2e/solver_participation_guard.rs b/crates/e2e/tests/e2e/solver_participation_guard.rs index 3cd3bf22a8..dcc1e34ebe 100644 --- a/crates/e2e/tests/e2e/solver_participation_guard.rs +++ b/crates/e2e/tests/e2e/solver_participation_guard.rs @@ -209,9 +209,8 @@ async fn not_allowed_solver(web3: Web3) { onchain .contracts() .gp_authenticator - .methods() - .remove_solver(solver_address) - .send() + .removeSolver(solver_address.into_alloy()) + .send_and_watch() .await .unwrap(); @@ -225,9 +224,8 @@ async fn not_allowed_solver(web3: Web3) { onchain .contracts() .gp_authenticator - .methods() - .add_solver(solver_address) - .send() + .addSolver(solver_address.into_alloy()) + .send_and_watch() .await .unwrap(); diff --git a/crates/ethrpc/src/alloy/mod.rs b/crates/ethrpc/src/alloy/mod.rs index 1dc3dcf5f2..8161d559a9 100644 --- a/crates/ethrpc/src/alloy/mod.rs +++ b/crates/ethrpc/src/alloy/mod.rs @@ -71,6 +71,13 @@ impl RpcClientRandomIdExt for RpcClient { pub trait ProviderSignerExt { /// Creates a new provider with the given signer. fn with_signer(&self, signer: Account) -> Self; + + /// Creates a new provider without any signers. + /// This is only ever useful if you configured + /// anvil to impersonate some account and want + /// to avoid alloy complaining that it doesn't + /// have the private key for the requested signer. + fn without_wallet(&self) -> Self; } impl ProviderSignerExt for AlloyProvider { @@ -91,6 +98,17 @@ impl ProviderSignerExt for AlloyProvider { .connect_client(client) .erased() } + + fn without_wallet(&self) -> Self { + let is_local = self.client().is_local(); + let transport = self.client().transport().clone(); + let client = RpcClient::with_random_id(transport, is_local); + + ProviderBuilder::new() + .with_simple_nonce_management() + .connect_client(client) + .erased() + } } #[cfg(feature = "test-util")] From 80550c9b27e21ecc64e0dcc68f2064be90915365 Mon Sep 17 00:00:00 2001 From: pennylees Date: Mon, 27 Oct 2025 20:26:27 +0900 Subject: [PATCH 047/117] chore: remove repetitive words in comment (#3826) --- crates/driver/src/infra/liquidity/fetcher.rs | 2 +- crates/shared/src/account_balances/mod.rs | 2 +- crates/solvers/src/domain/liquidity/concentrated.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/driver/src/infra/liquidity/fetcher.rs b/crates/driver/src/infra/liquidity/fetcher.rs index d9109280b4..d248bbe732 100644 --- a/crates/driver/src/infra/liquidity/fetcher.rs +++ b/crates/driver/src/infra/liquidity/fetcher.rs @@ -26,7 +26,7 @@ pub enum AtBlock { /// computed anyway. At worse, we might provide a slightly sub-optimal /// route in some cases, but this is an acceptable trade-off. Recent, - /// Fetches liquidity liquidity for the latest state of the blockchain. + /// Fetches liquidity for the latest state of the blockchain. Latest, /// Useful for chains that can't fetch liquidity on non-finalized /// blocks(e.g. Avalanche). diff --git a/crates/shared/src/account_balances/mod.rs b/crates/shared/src/account_balances/mod.rs index c1556e23ab..4f011306bf 100644 --- a/crates/shared/src/account_balances/mod.rs +++ b/crates/shared/src/account_balances/mod.rs @@ -75,7 +75,7 @@ pub trait BalanceFetching: Send + Sync { // Check that the settlement contract can make use of this user's token balance. // This check could fail if the user does not have enough balance, has not // given the allowance to the allowance manager or if the token does not - // allow freely transferring amounts around for for example if it is paused + // allow freely transferring amounts around for example if it is paused // or takes a fee on transfer. If the node supports the trace_callMany we // can perform more extensive tests. async fn can_transfer( diff --git a/crates/solvers/src/domain/liquidity/concentrated.rs b/crates/solvers/src/domain/liquidity/concentrated.rs index 076ec4994d..b31a2b88b9 100644 --- a/crates/solvers/src/domain/liquidity/concentrated.rs +++ b/crates/solvers/src/domain/liquidity/concentrated.rs @@ -7,7 +7,7 @@ pub struct Pool { pub fee: Fee, } -/// Amount of fees accrued when using using this pool. +/// Amount of fees accrued when using this pool. /// Uniswap v3 was launched with 3 fee tiers (5, 30, 100 bps) but more could be /// added by the uniswap DAO. #[derive(Clone, Debug)] From 7a8fd90ddcb4d42f29220638aa2dafde1a8edf1f Mon Sep 17 00:00:00 2001 From: Grinsven <112948755+Grinsven@users.noreply.github.com> Date: Tue, 28 Oct 2025 08:37:01 +0100 Subject: [PATCH 048/117] Fix duplicate order_events creation (#3465) (#3811) Fixes #3465 - `insert_orders_and_ignore_conflicts` was creating an `order_event` even when the insert failed due to ON CONFLICT DO NOTHING, causing duplicate events for the same order_uid. Changed `insert_order_and_ignore_conflicts` to return bool (true if inserted, false if conflict) using `rows_affected() > 0`. Now only creates the event if the order was actually inserted. Added test that inserts same order twice and verifies only 1 event created. Prevents double-counting/billing and replication issues from duplicate (order_uid, timestamp, label='created') rows. --------- Co-authored-by: Grinsven Co-authored-by: Martin Magnus --- crates/database/src/orders.rs | 85 ++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 17 deletions(-) diff --git a/crates/database/src/orders.rs b/crates/database/src/orders.rs index 56a16adb2c..8e9658236a 100644 --- a/crates/database/src/orders.rs +++ b/crates/database/src/orders.rs @@ -107,16 +107,19 @@ pub async fn insert_orders_and_ignore_conflicts( orders: &[Order], ) -> Result<(), sqlx::Error> { for order in orders { - insert_order_and_ignore_conflicts(ex, order).await?; - insert_order_event( - ex, - &OrderEvent { - label: OrderEventLabel::Created, - timestamp: order.creation_timestamp, - order_uid: order.uid, - }, - ) - .await?; + let inserted = insert_order_and_ignore_conflicts(ex, order).await?; + // Only insert order_event if the order was actually inserted + if inserted { + insert_order_event( + ex, + &OrderEvent { + label: OrderEventLabel::Created, + timestamp: order.creation_timestamp, + order_uid: order.uid, + }, + ) + .await?; + } } Ok(()) } @@ -151,7 +154,7 @@ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $ pub async fn insert_order_and_ignore_conflicts( ex: &mut PgConnection, order: &Order, -) -> Result<(), sqlx::Error> { +) -> Result { // To be used only for the ethflow contract order placement, where reorgs force // us to update orders // Since each order has a unique UID even after a reorg onchain placed orders @@ -164,7 +167,7 @@ async fn insert_order_execute_sqlx( query_str: &str, ex: &mut PgConnection, order: &Order, -) -> Result<(), sqlx::Error> { +) -> Result { sqlx::query(query_str) .bind(order.uid) .bind(order.owner) @@ -187,13 +190,14 @@ async fn insert_order_execute_sqlx( .bind(order.cancellation_timestamp) .bind(order.class) .execute(ex) - .await?; - Ok(()) + .await + .map(|result| result.rows_affected() > 0) } #[instrument(skip_all)] pub async fn insert_order(ex: &mut PgConnection, order: &Order) -> Result<(), sqlx::Error> { - insert_order_execute_sqlx(INSERT_ORDER_QUERY, ex, order).await + insert_order_execute_sqlx(INSERT_ORDER_QUERY, ex, order).await?; + Ok(()) } #[instrument(skip_all)] @@ -1044,9 +1048,10 @@ mod tests { crate::clear_DANGER_(&mut db).await.unwrap(); let order = Order::default(); - insert_order_and_ignore_conflicts(&mut db, &order) + let inserted = insert_order_and_ignore_conflicts(&mut db, &order) .await .unwrap(); + assert!(inserted); // First insert should succeed let order_ = read_order(&mut db, &order.uid).await.unwrap().unwrap(); assert_eq!(order, order_); } @@ -1326,9 +1331,10 @@ mod tests { let order = Order::default(); insert_order(&mut db, &order).await.unwrap(); - insert_order_and_ignore_conflicts(&mut db, &order) + let inserted = insert_order_and_ignore_conflicts(&mut db, &order) .await .unwrap(); + assert!(!inserted); // Second insert should be skipped due to conflict let order_ = read_order(&mut db, &order.uid).await.unwrap().unwrap(); assert_eq!(order, order_); } @@ -1349,6 +1355,51 @@ mod tests { .unwrap(); } + #[tokio::test] + #[ignore] + async fn postgres_insert_orders_and_ignore_conflicts_does_not_create_duplicate_events() { + let mut db = PgConnection::connect("postgresql://").await.unwrap(); + let mut db = db.begin().await.unwrap(); + crate::clear_DANGER_(&mut db).await.unwrap(); + + let order = Order::default(); + + // First insert should create both order and event + insert_orders_and_ignore_conflicts(&mut db, vec![order.clone()].as_slice()) + .await + .unwrap(); + + // Count events after first insert + let event_count: i64 = + sqlx::query_scalar("SELECT COUNT(*) FROM order_events WHERE order_uid = $1") + .bind(order.uid) + .fetch_one(&mut *db) + .await + .unwrap(); + assert_eq!( + event_count, 1, + "First insert should create exactly one event" + ); + + // Second insert should be skipped (conflict) and should NOT create another + // event + insert_orders_and_ignore_conflicts(&mut db, vec![order.clone()].as_slice()) + .await + .unwrap(); + + // Count events after second insert - should still be 1 + let event_count_after: i64 = + sqlx::query_scalar("SELECT COUNT(*) FROM order_events WHERE order_uid = $1") + .bind(order.uid) + .fetch_one(&mut *db) + .await + .unwrap(); + assert_eq!( + event_count_after, 1, + "Second insert should NOT create a duplicate event" + ); + } + #[tokio::test] #[ignore] async fn postgres_quote_roundtrip_updating_on_conflict() { From 6ebe1d1b2481341c12681690e8966065c675b5cb Mon Sep 17 00:00:00 2001 From: "Jan [Yann]" <4518474+fafk@users.noreply.github.com> Date: Tue, 28 Oct 2025 08:50:25 +0100 Subject: [PATCH 049/117] Adapt services for Linea and partially Plasma (#3790) # Description Adapt services to support Linea network and add some types to support Plasma in the future. # Changes - [x] Add necessary types and configs - [x] Allow uniswap v3 subgraph queries to omit liqudityNet filter on `Tick`s - there is currently no working univ3 public subgraph on Linea that would support this filter. The only subgraph that is fully synced is not a full uniswapv3 subgraph, it is deployed from a [fork](https://github.com/Uniswap/v3-subgraph/blob/main/src/v3/schema.graphql): https://thegraph.com/explorer/subgraphs/7C5T97oN7ahfSEdKcsH2DP8potkBa64g8HNh7RYDFfQi?view=Query&chain=arbitrum-one#query-subgraph - It works by attempting a simple query with such filter and if the query fails it skips this. I tested this on Linea with protocol set up locally. On Linea uniswap v2 has basically no liquidity (~$300). I haven't looked into liquidity sources for Plasma, so I left them empty. ## How to test [x] Run a protocol locally and make a settlement. --- crates/chain/src/lib.rs | 11 +- crates/contracts/build.rs | 20 ++ crates/contracts/src/alloy.rs | 22 ++ .../src/bad_token/token_owner_finder/mod.rs | 2 + .../src/price_estimation/native/coingecko.rs | 2 + .../shared/src/price_estimation/native/mod.rs | 1 + crates/shared/src/sources/mod.rs | 2 + .../src/sources/uniswap_v3/graph_api.rs | 198 +++++++++++------- .../src/sources/uniswap_v3/pool_fetching.rs | 3 +- crates/shared/src/subgraph.rs | 60 ++++-- 10 files changed, 228 insertions(+), 93 deletions(-) diff --git a/crates/chain/src/lib.rs b/crates/chain/src/lib.rs index fd3beb0f3d..271511d459 100644 --- a/crates/chain/src/lib.rs +++ b/crates/chain/src/lib.rs @@ -24,6 +24,8 @@ pub enum Chain { Optimism = 10, Polygon = 137, Lens = 232, + Linea = 59144, + Plasma = 9745, } impl Chain { @@ -49,6 +51,8 @@ impl Chain { Self::Optimism => "Optimism", Self::Polygon => "Polygon", Self::Lens => "Lens", + Self::Linea => "Linea", + Self::Plasma => "Plasma", } } @@ -61,9 +65,10 @@ impl Chain { | Self::ArbitrumOne | Self::Base | Self::Bnb + | Self::Linea | Self::Optimism => 10u128.pow(17).into(), Self::Gnosis | Self::Avalanche | Self::Lens => 10u128.pow(18).into(), - Self::Polygon => 10u128.pow(20).into(), + Self::Polygon | Self::Plasma => 10u128.pow(20).into(), Self::Hardhat => { panic!("unsupported chain for default amount to estimate native prices with") } @@ -85,6 +90,8 @@ impl Chain { Self::Optimism => Duration::from_millis(2_000), Self::Polygon => Duration::from_millis(2_000), Self::Lens => Duration::from_millis(2_000), + Self::Linea => Duration::from_millis(2_000), + Self::Plasma => Duration::from_millis(1_000), } } @@ -114,6 +121,8 @@ impl TryFrom for Chain { x if x == Self::Optimism as u64 => Self::Optimism, x if x == Self::Polygon as u64 => Self::Polygon, x if x == Self::Lens as u64 => Self::Lens, + x if x == Self::Linea as u64 => Self::Linea, + x if x == Self::Plasma as u64 => Self::Plasma, _ => Err(ChainIdNotSupported)?, }; Ok(network) diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index eb6192a8e2..5727f683b0 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -21,6 +21,8 @@ const AVALANCHE: &str = "43114"; const BNB: &str = "56"; const OPTIMISM: &str = "10"; const LENS: &str = "232"; +const LINEA: &str = "59144"; +const PLASMA: &str = "9745"; fn main() { // NOTE: This is a workaround for `rerun-if-changed` directives for @@ -123,6 +125,22 @@ fn main() { deployment_information: Some(DeploymentInformation::BlockNumber(2621745)), }, ) + .add_network( + LINEA, + Network { + address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), + // + deployment_information: Some(DeploymentInformation::BlockNumber(24333100)), + }, + ) + .add_network( + PLASMA, + Network { + address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), + // + deployment_information: Some(DeploymentInformation::BlockNumber(2621745)), + }, + ) }); generate_contract_with_config("WETH9", |builder| { // Note: the WETH address must be consistent with the one used by the ETH-flow @@ -139,6 +157,8 @@ fn main() { .add_network_str(OPTIMISM, "0x4200000000000000000000000000000000000006") .add_network_str(POLYGON, "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270") .add_network_str(LENS, "0x6bDc36E20D267Ff0dd6097799f82e78907105e2F") + .add_network_str(LINEA, "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f") + .add_network_str(PLASMA, "0x6100E367285b01F48D07953803A2d8dCA5D19873") }); generate_contract("CowAmm"); generate_contract_with_config("CowAmmConstantProductFactory", |builder| { diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index de9503cf61..48d4c1f51d 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -9,6 +9,8 @@ pub mod networks { pub const BNB: u64 = 56; pub const OPTIMISM: u64 = 10; pub const LENS: u64 = 232; + pub const LINEA: u64 = 59144; + pub const PLASMA: u64 = 9745; } crate::bindings!( @@ -476,6 +478,7 @@ crate::bindings!( OPTIMISM => address!("0x61fFE014bA17989E743c5F6cB21bF9697530B21e"), POLYGON => address!("0x61fFE014bA17989E743c5F6cB21bF9697530B21e"), LENS => address!("0x1eEA2B790Dc527c5a4cd3d4f3ae8A2DDB65B2af1"), + LINEA => address!("0x42bE4D6527829FeFA1493e1fb9F3676d2425C3C1"), // Not listed on Gnosis and Sepolia chains } ); @@ -491,6 +494,7 @@ crate::bindings!( AVALANCHE => address!("0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE"), BNB => address!("0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"), LENS => address!("0x6ddD32cd941041D8b61df213B9f515A7D288Dc13"), + LINEA => address!("0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a"), // Not available on Gnosis Chain } ); @@ -508,6 +512,7 @@ crate::bindings!( POLYGON => address!( "0x1F98431c8aD98523631AE4a59f267346ea31F984"), // not official LENS => address!( "0xc3A5b857Ba82a2586A45a8B59ECc3AA50Bc3D0e3"), + LINEA => address!("0x31FAfd4889FA1269F7a13A66eE0fB458f27D72A9"), // Not available on Gnosis Chain } ); @@ -527,6 +532,9 @@ crate::bindings!( OPTIMISM => address!("0x60Bf78233f48eC42eE3F101b9a05eC7878728006"), POLYGON => address!("0x60Bf78233f48eC42eE3F101b9a05eC7878728006"), LENS => address!("0x60Bf78233f48eC42eE3F101b9a05eC7878728006"), + // compiled with an older, linea-compatible evm version + LINEA => address!("0xeFcf0d30DB41Ae0b136c5E3B4340dFeE2D099Ada"), + PLASMA => address!("0x60Bf78233f48eC42eE3F101b9a05eC7878728006"), } ); @@ -554,6 +562,10 @@ crate::bindings!( POLYGON => (address!("0x04501b9b1d52e67f6862d157e00d13419d2d6e95"), 71296258), // LENS => (address!("0xFb337f8a725A142f65fb9ff4902d41cc901de222"), 3007173), + // + LINEA => (address!("0x04501b9b1d52e67f6862d157e00d13419d2d6e95"), 24522097), + // + PLASMA => (address!("0x04501b9b1d52e67f6862d157e00d13419d2d6e95"), 3521855), } ); crate::bindings!(CoWSwapOnchainOrders); @@ -651,6 +663,10 @@ crate::bindings!( POLYGON => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 45854728), // LENS => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 2612937), + // + LINEA => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 24333100), + // + PLASMA => (address!("0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE"), 3439709), } ); @@ -679,6 +695,9 @@ pub mod support { LENS => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), GNOSIS => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), SEPOLIA => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), + // built with evm=London, because deployment reverts on Linea otherwise + LINEA => address!("0xf6E57e72F7dB3D9A51a8B4c149C00475b94A37e4"), + PLASMA => address!("0x8262d639c38470F38d2eff15926F7071c28057Af"), } ); // Support contracts used for various order simulations. @@ -695,6 +714,9 @@ pub mod support { LENS => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), GNOSIS => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), SEPOLIA => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + PLASMA => address!("0x3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), + // built with evm=London, because deployment reverts on Linea otherwise + LINEA => address!("0x361350f708f7c0c63c8a505226592c3e5d1faa29"), } ); } diff --git a/crates/shared/src/bad_token/token_owner_finder/mod.rs b/crates/shared/src/bad_token/token_owner_finder/mod.rs index 21cc299313..6bd2bc868f 100644 --- a/crates/shared/src/bad_token/token_owner_finder/mod.rs +++ b/crates/shared/src/bad_token/token_owner_finder/mod.rs @@ -206,6 +206,8 @@ impl TokenOwnerFindingStrategy { | Chain::Optimism | Chain::Avalanche | Chain::Polygon + | Chain::Linea + | Chain::Plasma | Chain::Lens => &[Self::Liquidity], Chain::Hardhat => panic!("unsupported chain for token owner finding"), } diff --git a/crates/shared/src/price_estimation/native/coingecko.rs b/crates/shared/src/price_estimation/native/coingecko.rs index 078c3c00dd..20fc412120 100644 --- a/crates/shared/src/price_estimation/native/coingecko.rs +++ b/crates/shared/src/price_estimation/native/coingecko.rs @@ -81,6 +81,8 @@ impl CoinGecko { Chain::Optimism => "optimistic-ethereum".to_string(), Chain::Bnb => "binance-smart-chain".to_string(), Chain::Lens => "lens".to_string(), + Chain::Linea => "linea".to_string(), + Chain::Plasma => "plasma".to_string(), Chain::Sepolia | Chain::Goerli | Chain::Hardhat => { anyhow::bail!("unsupported network {}", chain.name()) } diff --git a/crates/shared/src/price_estimation/native/mod.rs b/crates/shared/src/price_estimation/native/mod.rs index 2bcdee2975..93451f12d3 100644 --- a/crates/shared/src/price_estimation/native/mod.rs +++ b/crates/shared/src/price_estimation/native/mod.rs @@ -77,6 +77,7 @@ impl NativePriceEstimator { } } + // TODO explain why we use BUY order type (shallow liquidity) fn query(&self, token: &H160, timeout: Duration) -> Query { Query { sell_token: *token, diff --git a/crates/shared/src/sources/mod.rs b/crates/shared/src/sources/mod.rs index c2963e6571..4290a7c4f6 100644 --- a/crates/shared/src/sources/mod.rs +++ b/crates/shared/src/sources/mod.rs @@ -69,6 +69,8 @@ pub fn defaults_for_network(chain: &Chain) -> Vec { BaselineSource::UniswapV3, ], Chain::Lens => vec![BaselineSource::UniswapV3], + Chain::Linea => vec![BaselineSource::UniswapV3], + Chain::Plasma => vec![], Chain::Sepolia => vec![BaselineSource::TestnetUniswapV2], Chain::Hardhat => panic!("unsupported baseline sources for Hardhat"), } diff --git a/crates/shared/src/sources/uniswap_v3/graph_api.rs b/crates/shared/src/sources/uniswap_v3/graph_api.rs index f936f8cde3..e785fc87c8 100644 --- a/crates/shared/src/sources/uniswap_v3/graph_api.rs +++ b/crates/shared/src/sources/uniswap_v3/graph_api.rs @@ -17,65 +17,17 @@ use { std::collections::HashMap, }; -const ALL_POOLS_QUERY: &str = r#" - query Pools($block: Int, $pageSize: Int, $lastId: ID) { - pools( - block: { number: $block } - first: $pageSize - where: { - id_gt: $lastId - tick_not: null - ticks_: { liquidityNet_not: "0" } - } - ) { - id - token0 { - symbol - id - decimals - } - token1 { - symbol - id - decimals - } - feeTier - liquidity - sqrtPrice - tick - } - } -"#; - -const POOLS_BY_IDS_QUERY: &str = r#" - query Pools($block: Int, $pool_ids: [ID], $pageSize: Int, $lastId: ID) { - pools( - block: { number: $block } - first: $pageSize - where: { - id_in: $pool_ids - id_gt: $lastId - tick_not: null - ticks_: { liquidityNet_not: "0" } - } - ) { - id - token0 { - symbol - id - decimals - } - token1 { - symbol - id - decimals - } - feeTier - liquidity - sqrtPrice - tick - } - } +// Some subgraphs don't have a the ticks_ filter. Use this query to check for +// its presence. +const CHECK_LIQUIDITY_NET_FILTER: &str = r#" +query CheckLiquidityNetField($block: Int) { + pools( + first: 1 + where: { ticks_: { liquidityNet_not: "0" } } + ) { + id + } +} "#; const TICKS_BY_POOL_IDS_QUERY: &str = r#" @@ -101,26 +53,57 @@ const TICKS_BY_POOL_IDS_QUERY: &str = r#" /// /// This client is not implemented to allow general GraphQL queries, but instead /// implements high-level methods that perform GraphQL queries under the hood. -pub struct UniV3SubgraphClient(SubgraphClient); +pub struct UniV3SubgraphClient { + client: SubgraphClient, + /// Some subgraphs do not support the liquidityNet filter on ticks. + /// This flag indicates whether to use it or not in queries. + use_liquidity_net_filter: bool, +} impl UniV3SubgraphClient { /// Creates a new Uniswap V3 subgraph client from the specified URL. - pub fn from_subgraph_url( + pub async fn from_subgraph_url( subgraph_url: &Url, client: Client, max_pools_per_tick_query: usize, ) -> Result { - Ok(Self(SubgraphClient::try_new( - subgraph_url.clone(), - client, - max_pools_per_tick_query, - )?)) + let subgraph_client = + SubgraphClient::try_new(subgraph_url.clone(), client, max_pools_per_tick_query)?; + + Ok(Self { + client: subgraph_client, + use_liquidity_net_filter: true, + } + .set_liquidity_net_filter() + .await) + } + + // Try a simple query to verify that the liquidityNet filter is supported + async fn set_liquidity_net_filter(mut self) -> Self { + let result: Result = self + .client + .query_without_retry::(CHECK_LIQUIDITY_NET_FILTER, &None) + .await; + + if let Err(err) = &result + && err.to_string().contains("liquidityNet_not") + { + // If the query fails, it likely means the subgraph does not support the + // liquidityNet filter. + self.use_liquidity_net_filter = false; + } + + self } - async fn get_pools(&self, query: &str, variables: Map) -> Result> { + async fn get_pools( + &self, + query: String, + variables: Map, + ) -> Result> { Ok(self - .0 - .paginated_query(query, variables) + .client + .paginated_query(&query, variables) .await? .into_iter() .filter(|pool: &PoolData| pool.liquidity > U256::zero()) @@ -133,7 +116,8 @@ impl UniV3SubgraphClient { let variables = json_map! { "block" => block_number, }; - let pools = self.get_pools(ALL_POOLS_QUERY, variables).await?; + let query = Self::all_pools_query(self.use_liquidity_net_filter); + let pools = self.get_pools(query, variables).await?; Ok(RegisteredPools { fetched_block_number: block_number, pools, @@ -149,7 +133,8 @@ impl UniV3SubgraphClient { "block" => block_number, "pool_ids" => json!(pool_ids) }; - let pools = self.get_pools(POOLS_BY_IDS_QUERY, variables).await?; + let query = Self::pools_by_ids_query(self.use_liquidity_net_filter); + let pools = self.get_pools(query, variables).await?; Ok(pools) } @@ -163,13 +148,13 @@ impl UniV3SubgraphClient { // Default chunk size is usize::MAX - all pool ids in one `where`. We want to // run requests sequentially to avoid overwhelming the node. - for chunk in pool_ids.chunks(self.0.max_pools_per_tick_query()) { + for chunk in pool_ids.chunks(self.client.max_pools_per_tick_query()) { let variables = json_map! { "block" => block_number, "pool_ids" => json!(chunk) }; let mut batch = self - .0 + .client .paginated_query(TICKS_BY_POOL_IDS_QUERY, variables) .await?; all.append(&mut batch); @@ -217,7 +202,7 @@ impl UniV3SubgraphClient { // retrieve historic block hashes just from the subgraph (it always // returns `null`). Ok(self - .0 + .client .query::(block_number_query::QUERY, None) .await? .meta @@ -225,6 +210,71 @@ impl UniV3SubgraphClient { .number .saturating_sub(MAX_REORG_BLOCK_COUNT)) } + + fn all_pools_query(include_ticks_filter: bool) -> String { + let tick_filter = if include_ticks_filter { + r#"ticks_: { liquidityNet_not: "0" }"# + } else { + "" + }; + + format!( + r#" + query Pools($block: Int, $pageSize: Int, $lastId: ID) {{ + pools( + block: {{ number: $block }} + first: $pageSize + where: {{ + id_gt: $lastId + tick_not: null + {tick_filter} + }} + ) {{ + id + token0 {{ symbol id decimals }} + token1 {{ symbol id decimals }} + feeTier + liquidity + sqrtPrice + tick + }} + }} + "# + ) + } + + fn pools_by_ids_query(include_ticks_filter: bool) -> String { + let tick_filter = if include_ticks_filter { + r#"ticks_: { liquidityNet_not: "0" }"# + } else { + "liquidity_not: 0" + }; + + format!( + r#" + query Pools($block: Int, $pool_ids: [ID], $pageSize: Int, $lastId: ID) {{ + pools( + block: {{ number: $block }} + first: $pageSize + where: {{ + id_in: $pool_ids + id_gt: $lastId + tick_not: null + {tick_filter} + }} + ) {{ + id + token0 {{ symbol id decimals }} + token1 {{ symbol id decimals }} + feeTier + liquidity + sqrtPrice + tick + }} + }} + "# + ) + } } /// Result of the registered stable pool query. diff --git a/crates/shared/src/sources/uniswap_v3/pool_fetching.rs b/crates/shared/src/sources/uniswap_v3/pool_fetching.rs index baf1a0795a..88873e2fc6 100644 --- a/crates/shared/src/sources/uniswap_v3/pool_fetching.rs +++ b/crates/shared/src/sources/uniswap_v3/pool_fetching.rs @@ -145,7 +145,8 @@ impl PoolsCheckpointHandler { max_pools_per_tick_query: usize, ) -> Result { let graph_api = - UniV3SubgraphClient::from_subgraph_url(subgraph_url, client, max_pools_per_tick_query)?; + UniV3SubgraphClient::from_subgraph_url(subgraph_url, client, max_pools_per_tick_query) + .await?; let mut registered_pools = graph_api.get_registered_pools().await?; tracing::debug!( block = %registered_pools.fetched_block_number, pools = %registered_pools.pools.len(), diff --git a/crates/shared/src/subgraph.rs b/crates/shared/src/subgraph.rs index aa7fd838d7..afa43a5aa4 100644 --- a/crates/shared/src/subgraph.rs +++ b/crates/shared/src/subgraph.rs @@ -9,13 +9,14 @@ use { }; pub const QUERY_PAGE_SIZE: usize = 1000; -const MAX_NUMBER_OF_RETRIES: usize = 10; +const MAX_NUMBER_OF_ATTEMPTS_DEFAULT: usize = 10; /// A general client for querying subgraphs. pub struct SubgraphClient { client: Client, subgraph_url: Url, max_pools_per_tick_query: usize, + max_number_of_attempts: usize, } pub trait ContainsId { @@ -39,6 +40,7 @@ impl SubgraphClient { client, subgraph_url, max_pools_per_tick_query, + max_number_of_attempts: MAX_NUMBER_OF_ATTEMPTS_DEFAULT, }) } @@ -50,25 +52,49 @@ impl SubgraphClient { // for long lasting queries subgraph call might randomly fail // introduced retry mechanism that should efficiently help since failures are // quick and we need 1 or 2 retries to succeed. - for _ in 0..MAX_NUMBER_OF_RETRIES { - match self - .client - .post(self.subgraph_url.clone()) - .json(&Query { - query, - variables: variables.clone(), - }) - .send() - .await? - .json::>() - .await? - .into_result() - { + let mut error: Option = None; + for _ in 0..self.max_number_of_attempts { + match self.query_without_retry(query, &variables).await { Ok(result) => return Ok(result), - Err(err) => tracing::warn!("failed to query subgraph: {}", err), + Err(err) => error = Some(err), + } + } + Err(anyhow::anyhow!(format!( + "failed to execute query on subgraph: {}", + error.unwrap() + ))) + } + + pub async fn query_without_retry( + &self, + query: &str, + variables: &Option>, + ) -> Result + where + T: DeserializeOwned, + { + match self + .client + .post(self.subgraph_url.clone()) + .json(&Query { + query, + variables: variables.clone(), + }) + .send() + .await? + .json::>() + .await? + .into_result() + { + Ok(result) => Ok(result), + Err(err) => { + tracing::warn!("failed to query subgraph: {}", err); + Err(anyhow::anyhow!(format!( + "failed to execute query on subgraph: {}", + err + ))) } } - Err(anyhow::anyhow!("failed to execute query on subgraph")) } /// Performs the specified GraphQL query on the current subgraph. From a8b02428f15219c1d1a8acbc99de69df234f336b Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Tue, 28 Oct 2025 09:29:15 +0100 Subject: [PATCH 050/117] Replace `#[allow]` with `#[expect]` (#3825) # Description Rust [`1.81`](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0/#expect-lint) introduced `#[expect]` as an alternative to `#[allow]`. `#[allow]` always allows the given clippy lint to happen in the annotated code regardless of whether it's actually necessary. A good example is `#[allow(dead_code)]`. It's useful during development when you don't have all the code hooked up yet. But once the code is hooked up you might forget to remove the annotation. Once the code becomes unused AGAIN (e.g. due to a refactor) you ideally would like to get warned again. This can be achieved with `#[expect]`. It also allows the provided clippy lint to happen in the annotated code but it also complains if clippy actually didn't complain about it while compiling. So far my impression is `#[expect]` is strictly more useful than `#[allow]` except for a few cases: * macros - some uses of the code generated by the macro might trigger `clippy` while others might not * member variables that are only there for the side effects of `Drop` - we don't care whether or not the field gets used outside of the `Drop` logic * debug - IIRC dead code analysis does not consider logging; as long as we print the info we desire we don't care if the variable is used for anything else As a follow up it's also possible to enable a `clippy` lint for this but this will only work once we move away from bindings generated with `ethcontract-rs`. # Changes - replaced most occurrences of `#[allow]` with `#[expect]` (except where it didn't make sense) - deleted some outdated annotations that were caught with this change - addressed some `dead_code` annotations ## How to test compiler --- .../src/database/onchain_order_events/mod.rs | 2 +- crates/autopilot/src/domain/settlement/mod.rs | 2 +- crates/autopilot/src/run_loop.rs | 4 +-- crates/autopilot/src/shadow.rs | 2 +- crates/autopilot/src/solvable_orders.rs | 2 +- crates/contracts/src/alloy.rs | 4 +-- crates/database/src/lib.rs | 4 +-- crates/driver/src/domain/competition/mod.rs | 2 +- .../competition/solution/interaction.rs | 2 +- .../src/domain/competition/solution/mod.rs | 2 +- .../src/domain/competition/solution/trade.rs | 2 +- crates/driver/src/domain/eth/mod.rs | 2 +- crates/driver/src/infra/liquidity/config.rs | 8 ++--- .../src/infra/simulator/tenderly/mod.rs | 3 +- crates/driver/src/tests/cases/mod.rs | 4 --- crates/driver/src/tests/setup/blockchain.rs | 13 ++++---- crates/driver/src/tests/setup/mod.rs | 32 ------------------- crates/e2e/tests/e2e/database.rs | 7 +--- crates/e2e/tests/e2e/limit_orders.rs | 1 - crates/ethrpc/src/alloy/buffering.rs | 2 -- crates/ethrpc/src/alloy/instrumentation.rs | 2 -- crates/observe/src/future.rs | 8 +++-- crates/orderbook/src/orderbook.rs | 1 - crates/orderbook/src/run.rs | 2 +- crates/rate-limit/src/lib.rs | 2 +- crates/shared/src/account_balances/mod.rs | 2 +- .../src/bad_token/token_owner_finder/mod.rs | 2 +- crates/shared/src/order_quoting.rs | 2 +- crates/shared/src/order_validation.rs | 2 +- .../shared/src/price_estimation/buffered.rs | 10 ++---- .../price_estimation/native_price_cache.rs | 2 +- .../price_estimation/trade_verifier/mod.rs | 4 +-- .../sources/balancer_v2/pool_fetching/mod.rs | 2 +- .../sources/balancer_v2/swap/fixed_point.rs | 4 +-- crates/shared/src/trade_finding/external.rs | 3 -- crates/solvers-dto/src/auction.rs | 1 - 36 files changed, 46 insertions(+), 103 deletions(-) diff --git a/crates/autopilot/src/database/onchain_order_events/mod.rs b/crates/autopilot/src/database/onchain_order_events/mod.rs index 1af3f4516a..9b3285960a 100644 --- a/crates/autopilot/src/database/onchain_order_events/mod.rs +++ b/crates/autopilot/src/database/onchain_order_events/mod.rs @@ -581,7 +581,7 @@ async fn get_quote( }) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn convert_onchain_order_placement( order_placement: &ContractOrderPlacement, event_timestamp: i64, diff --git a/crates/autopilot/src/domain/settlement/mod.rs b/crates/autopilot/src/domain/settlement/mod.rs index 37a73e29b9..ee7e517ef0 100644 --- a/crates/autopilot/src/domain/settlement/mod.rs +++ b/crates/autopilot/src/domain/settlement/mod.rs @@ -38,7 +38,6 @@ pub use { /// on-chain. /// /// Referenced as a [`Settlement`] in the codebase. -#[allow(dead_code)] #[derive(Debug)] pub struct Settlement { /// The gas used by the settlement transaction. @@ -46,6 +45,7 @@ pub struct Settlement { /// The effective gas price of the settlement transaction. gas_price: eth::EffectiveGasPrice, /// The block number of the block that contains the settlement transaction. + #[allow(dead_code, reason = "we want this data for the Debug printing")] block: eth::BlockNo, /// The solver (is different from `tx.from` for smart contract solvers) solver: eth::Address, diff --git a/crates/autopilot/src/run_loop.rs b/crates/autopilot/src/run_loop.rs index 392e130540..0373fbaffa 100644 --- a/crates/autopilot/src/run_loop.rs +++ b/crates/autopilot/src/run_loop.rs @@ -87,7 +87,7 @@ pub struct RunLoop { } impl RunLoop { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( config: Config, eth: infra::Ethereum, @@ -722,7 +722,7 @@ impl RunLoop { /// Execute the solver's solution. Returns Ok when the corresponding /// transaction has been mined. - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] async fn settle( &self, driver: &infra::Driver, diff --git a/crates/autopilot/src/shadow.rs b/crates/autopilot/src/shadow.rs index 71b31c9b85..b183e3e70a 100644 --- a/crates/autopilot/src/shadow.rs +++ b/crates/autopilot/src/shadow.rs @@ -44,7 +44,7 @@ pub struct RunLoop { } impl RunLoop { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( orderbook: infra::shadow::Orderbook, drivers: Vec>, diff --git a/crates/autopilot/src/solvable_orders.rs b/crates/autopilot/src/solvable_orders.rs index 2011cfe509..3fb84e5c47 100644 --- a/crates/autopilot/src/solvable_orders.rs +++ b/crates/autopilot/src/solvable_orders.rs @@ -112,7 +112,7 @@ struct Inner { } impl SolvableOrdersCache { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( min_order_validity_period: Duration, persistence: infra::Persistence, diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 48d4c1f51d..38c830152f 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -798,7 +798,7 @@ macro_rules! bindings { // Generate the main bindings in a private module. That allows // us to re-export all items in our own module while also adding // some items ourselves. - #[allow(non_snake_case)] + #[expect(non_snake_case)] mod [<$contract Private>] { alloy::sol!( #[allow(missing_docs, clippy::too_many_arguments)] @@ -808,7 +808,7 @@ macro_rules! bindings { ); } - #[allow(non_snake_case)] + #[expect(non_snake_case)] pub mod $contract { use alloy::providers::DynProvider; diff --git a/crates/database/src/lib.rs b/crates/database/src/lib.rs index 8f7f263511..6cdfb9c9a0 100644 --- a/crates/database/src/lib.rs +++ b/crates/database/src/lib.rs @@ -91,7 +91,7 @@ pub fn all_tables() -> impl Iterator { } /// Delete all data in the database. Only used by tests. -#[allow(non_snake_case)] +#[expect(non_snake_case)] pub async fn clear_DANGER_(ex: &mut PgTransaction<'_>) -> sqlx::Result<()> { for table in all_tables() { ex.execute(format!("TRUNCATE {table};").as_str()).await?; @@ -100,7 +100,7 @@ pub async fn clear_DANGER_(ex: &mut PgTransaction<'_>) -> sqlx::Result<()> { } /// Like above but more ergonomic for some tests that use a pool. -#[allow(non_snake_case)] +#[expect(non_snake_case)] pub async fn clear_DANGER(pool: &PgPool) -> sqlx::Result<()> { let mut transaction = pool.begin().await?; clear_DANGER_(&mut transaction).await?; diff --git a/crates/driver/src/domain/competition/mod.rs b/crates/driver/src/domain/competition/mod.rs index 13a395f1fc..b43b119a11 100644 --- a/crates/driver/src/domain/competition/mod.rs +++ b/crates/driver/src/domain/competition/mod.rs @@ -73,7 +73,7 @@ pub struct Competition { } impl Competition { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( solver: Solver, eth: Ethereum, diff --git a/crates/driver/src/domain/competition/solution/interaction.rs b/crates/driver/src/domain/competition/solution/interaction.rs index b51d310f55..089d04c441 100644 --- a/crates/driver/src/domain/competition/solution/interaction.rs +++ b/crates/driver/src/domain/competition/solution/interaction.rs @@ -9,7 +9,7 @@ use { /// Interaction with a smart contract which is needed to execute this solution /// on the blockchain. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub enum Interaction { Custom(Custom), Liquidity(Liquidity), diff --git a/crates/driver/src/domain/competition/solution/mod.rs b/crates/driver/src/domain/competition/solution/mod.rs index 5b81987279..4f948a9fe2 100644 --- a/crates/driver/src/domain/competition/solution/mod.rs +++ b/crates/driver/src/domain/competition/solution/mod.rs @@ -58,7 +58,7 @@ pub struct Solution { } impl Solution { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( id: Id, mut trades: Vec, diff --git a/crates/driver/src/domain/competition/solution/trade.rs b/crates/driver/src/domain/competition/solution/trade.rs index e6c441a97f..3aefc566e4 100644 --- a/crates/driver/src/domain/competition/solution/trade.rs +++ b/crates/driver/src/domain/competition/solution/trade.rs @@ -12,7 +12,7 @@ use crate::{ /// A trade which executes an order as part of this solution. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub enum Trade { Fulfillment(Fulfillment), Jit(Jit), diff --git a/crates/driver/src/domain/eth/mod.rs b/crates/driver/src/domain/eth/mod.rs index d8e3290c1e..d7324b25d8 100644 --- a/crates/driver/src/domain/eth/mod.rs +++ b/crates/driver/src/domain/eth/mod.rs @@ -444,7 +444,7 @@ impl From<&solvers_dto::solution::Flashloan> for Flashloan { } } -#[allow(clippy::from_over_into)] +#[expect(clippy::from_over_into)] impl Into for &Flashloan { fn into(self) -> FlashloanHint { FlashloanHint { diff --git a/crates/driver/src/infra/liquidity/config.rs b/crates/driver/src/infra/liquidity/config.rs index 756ed2df68..b2f64faa63 100644 --- a/crates/driver/src/infra/liquidity/config.rs +++ b/crates/driver/src/infra/liquidity/config.rs @@ -60,7 +60,7 @@ pub struct UniswapV2 { impl UniswapV2 { /// Returns the liquidity configuration for Uniswap V2. - #[allow(clippy::self_named_constructors)] + #[expect(clippy::self_named_constructors)] pub fn uniswap_v2(chain: Chain) -> Option { Some(Self { router: ContractAddress::from( @@ -149,7 +149,7 @@ pub struct Swapr { impl Swapr { /// Returns the liquidity configuration for Swapr. - #[allow(clippy::self_named_constructors)] + #[expect(clippy::self_named_constructors)] pub fn swapr(chain: Chain) -> Option { Some(Self { router: ContractAddress::from( @@ -185,7 +185,7 @@ pub struct UniswapV3 { impl UniswapV3 { /// Returns the liquidity configuration for Uniswap V3. - #[allow(clippy::self_named_constructors)] + #[expect(clippy::self_named_constructors)] pub fn uniswap_v3( graph_url: &Url, chain: Chain, @@ -241,7 +241,7 @@ pub struct BalancerV2 { impl BalancerV2 { /// Returns the liquidity configuration for Balancer V2. - #[allow(clippy::self_named_constructors)] + #[expect(clippy::self_named_constructors)] pub fn balancer_v2(graph_url: &Url, chain: Chain) -> Option { macro_rules! address_for { ( $chain:expr, [ $( $($p:ident)::+ ),* $(,)? ] ) => {{ diff --git a/crates/driver/src/infra/simulator/tenderly/mod.rs b/crates/driver/src/infra/simulator/tenderly/mod.rs index ffd1d8a9a9..793290bb04 100644 --- a/crates/driver/src/infra/simulator/tenderly/mod.rs +++ b/crates/driver/src/infra/simulator/tenderly/mod.rs @@ -109,9 +109,8 @@ pub struct Simulation { // We want the string to be printed together with a simulation so we // don't care that it's not used for anything else. -#[allow(dead_code)] #[derive(Debug)] -pub struct SimulationId(String); +pub struct SimulationId(#[allow(dead_code, reason = "intended for Debug implementation")] String); #[derive(Debug, PartialEq, Eq)] pub(super) enum GenerateAccessList { diff --git a/crates/driver/src/tests/cases/mod.rs b/crates/driver/src/tests/cases/mod.rs index 9440dd6e88..15349cb5e5 100644 --- a/crates/driver/src/tests/cases/mod.rs +++ b/crates/driver/src/tests/cases/mod.rs @@ -24,10 +24,6 @@ pub mod quote; pub mod settle; pub mod solver_balance; -#[allow(dead_code)] -/// Example solver name. -const SOLVER_NAME: &str = "test1"; - /// The default surplus factor. Set to a high value to ensure a positive score /// by default. Use a surplus factor of 1 if you want to test negative scores. pub const DEFAULT_SURPLUS_FACTOR: &str = "1e-8"; diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index acfb1eff88..dc705be803 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -1,10 +1,7 @@ use { super::{Asset, Order, Partial}, crate::{ - domain::{ - competition::order, - eth::{self, ContractAddress}, - }, + domain::{competition::order, eth}, tests::{self, boundary, cases::EtherExt}, }, alloy::{primitives::U256, signers::local::PrivateKeySigner}, @@ -42,7 +39,6 @@ pub struct Pair { pool: Pool, } -#[allow(dead_code)] #[derive(Debug)] pub struct Blockchain { pub trader_secret_key: SecretKey, @@ -54,8 +50,12 @@ pub struct Blockchain { pub balances: Balances::Instance, pub signatures: Signatures::Instance, pub flashloan_router: FlashLoanRouter::Instance, - pub ethflow: Option, pub domain_separator: boundary::DomainSeparator, + #[allow( + dead_code, + reason = "we need to keep the node alive to run the `Drop` implementation at the \ + appropriate time" + )] pub node: Node, pub pairs: Vec, } @@ -655,7 +655,6 @@ impl Blockchain { signatures, domain_separator, weth, - ethflow: None, web3, web3_url: node.url(), node, diff --git a/crates/driver/src/tests/setup/mod.rs b/crates/driver/src/tests/setup/mod.rs index d920a19755..50b31d46cb 100644 --- a/crates/driver/src/tests/setup/mod.rs +++ b/crates/driver/src/tests/setup/mod.rs @@ -434,36 +434,6 @@ pub struct Pool { } impl Pool { - /// Restores reserve_a value from the given reserve_b and the quote. Reverse - /// operation for the `blockchain::Pool::out` function. - /// - #[allow(dead_code)] - pub fn adjusted_reserve_a(self, quote: &LiquidityQuote) -> Self { - let (quote_sell_amount, quote_buy_amount) = if quote.sell_token == self.token_a { - (quote.sell_amount, quote.buy_amount) - } else { - (quote.buy_amount, quote.sell_amount) - }; - let reserve_a_min = ceil_div( - eth::U256::from(997) - * quote_sell_amount - * (self.amount_b - quote_buy_amount - eth::U256::from(1)), - eth::U256::from(1000) * quote_buy_amount, - ); - let reserve_a_max = - (eth::U256::from(997) * quote_sell_amount * (self.amount_b - quote_buy_amount)) - / (eth::U256::from(1000) * quote_buy_amount); - if reserve_a_min > reserve_a_max { - panic!( - "Unexpected calculated reserves. min: {reserve_a_min:?}, max: {reserve_a_max:?}" - ); - } - Self { - amount_a: reserve_a_min, - ..self - } - } - /// Restores reserve_b value from the given reserve_a and the quote. Reverse /// operation for the `blockchain::Pool::out` function /// @@ -596,7 +566,6 @@ impl Solution { } /// Increase the solution gas consumption by at least `units`. - #[allow(dead_code)] pub fn increase_gas(self, units: usize) -> Self { // non-zero bytes costs 16 gas let additional_bytes = (units / 16) + 1; @@ -1216,7 +1185,6 @@ impl Test { balances } - #[allow(dead_code)] pub fn web3(&self) -> &web3::Web3 { &self.blockchain.web3 } diff --git a/crates/e2e/tests/e2e/database.rs b/crates/e2e/tests/e2e/database.rs index 37f7fb9df2..26eb950867 100644 --- a/crates/e2e/tests/e2e/database.rs +++ b/crates/e2e/tests/e2e/database.rs @@ -2,7 +2,7 @@ //! during a test. use { - database::{Address, TransactionHash, byte_array::ByteArray, order_events}, + database::{Address, byte_array::ByteArray, order_events}, e2e::setup::Db, model::order::OrderUid, sqlx::PgConnection, @@ -31,14 +31,9 @@ pub async fn quote_metadata(db: &Db, quote_id: i64) -> Option<(serde_json::Value .unwrap() } -#[allow(dead_code)] #[derive(Clone, Debug, sqlx::FromRow)] pub struct AuctionTransaction { - pub tx_hash: TransactionHash, - pub block_number: i64, pub solver: Address, - // index of the `Settlement` event - pub log_index: i64, pub solution_uid: i64, } diff --git a/crates/e2e/tests/e2e/limit_orders.rs b/crates/e2e/tests/e2e/limit_orders.rs index b30f5fc77c..f0bc3f89d8 100644 --- a/crates/e2e/tests/e2e/limit_orders.rs +++ b/crates/e2e/tests/e2e/limit_orders.rs @@ -371,7 +371,6 @@ async fn two_limit_orders_test(web3: Web3) { .unwrap(); } -#[allow(unused)] async fn two_limit_orders_multiple_winners_test(web3: Web3) { let mut onchain = OnchainComponents::deploy(web3).await; diff --git a/crates/ethrpc/src/alloy/buffering.rs b/crates/ethrpc/src/alloy/buffering.rs index 76c8f1dbe9..36a697c85c 100644 --- a/crates/ethrpc/src/alloy/buffering.rs +++ b/crates/ethrpc/src/alloy/buffering.rs @@ -33,13 +33,11 @@ use { }; /// Layer that buffers multiple calls into batch calls. -#[allow(dead_code)] pub(crate) struct BatchCallLayer { config: Config, } impl BatchCallLayer { - #[allow(dead_code)] pub fn new(config: Config) -> Self { Self { config } } diff --git a/crates/ethrpc/src/alloy/instrumentation.rs b/crates/ethrpc/src/alloy/instrumentation.rs index 9d03911abe..38d0d8b36f 100644 --- a/crates/ethrpc/src/alloy/instrumentation.rs +++ b/crates/ethrpc/src/alloy/instrumentation.rs @@ -27,7 +27,6 @@ use { }; /// Layer that attaches a label to each request that passes through. -#[allow(dead_code)] pub(crate) struct LabelingLayer { pub label: String, } @@ -87,7 +86,6 @@ where /// Layer that logs and collects metrics based on the /// [`ProviderLabel`] metadata attached to each request. -#[allow(dead_code)] pub(crate) struct InstrumentationLayer; impl Layer for InstrumentationLayer { diff --git a/crates/observe/src/future.rs b/crates/observe/src/future.rs index 5b00ea5b9d..99b3be3e61 100644 --- a/crates/observe/src/future.rs +++ b/crates/observe/src/future.rs @@ -34,9 +34,11 @@ pin_project! { #[derive(Debug)] enum State { NeverPolled, - // We rely on the side effects of dropping the timer so it's okay that we never use it for - // anything else. - #[allow(dead_code)] + #[allow( + dead_code, + reason = "we rely on the side effects of dropping the timer so it's okay that we never \ + use it for anything else" + )] Running(prometheus::HistogramTimer), Done, } diff --git a/crates/orderbook/src/orderbook.rs b/crates/orderbook/src/orderbook.rs index 4bcfdee76e..a6d3cf6596 100644 --- a/crates/orderbook/src/orderbook.rs +++ b/crates/orderbook/src/orderbook.rs @@ -239,7 +239,6 @@ pub struct Orderbook { } impl Orderbook { - #[allow(clippy::too_many_arguments)] pub fn new( domain_separator: DomainSeparator, settlement_contract: H160, diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index 4d5818d055..ffcf61b01d 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -523,7 +523,7 @@ async fn check_database_connection(orderbook: &Orderbook) { .expect("failed to connect to database"); } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn serve_api( database: Postgres, database_replica: Postgres, diff --git a/crates/rate-limit/src/lib.rs b/crates/rate-limit/src/lib.rs index 9d95e99e56..8534f9e46e 100644 --- a/crates/rate-limit/src/lib.rs +++ b/crates/rate-limit/src/lib.rs @@ -340,7 +340,7 @@ mod tests { .execute( async { unreachable!("don't evaluate closure when rate limited"); - #[allow(unreachable_code)] // to help the type checker + #[expect(unreachable_code)] // to help the type checker 3 }, |_| unreachable!("don't evaluate closure when rate limited"), diff --git a/crates/shared/src/account_balances/mod.rs b/crates/shared/src/account_balances/mod.rs index 4f011306bf..60e3747d31 100644 --- a/crates/shared/src/account_balances/mod.rs +++ b/crates/shared/src/account_balances/mod.rs @@ -135,7 +135,7 @@ impl BalanceSimulator { self.vault } - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub async fn simulate( &self, owner: H160, diff --git a/crates/shared/src/bad_token/token_owner_finder/mod.rs b/crates/shared/src/bad_token/token_owner_finder/mod.rs index 6bd2bc868f..550ab09b4d 100644 --- a/crates/shared/src/bad_token/token_owner_finder/mod.rs +++ b/crates/shared/src/bad_token/token_owner_finder/mod.rs @@ -281,7 +281,7 @@ impl Display for Arguments { } /// Initializes a set of token owner finders. -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub async fn init( args: &Arguments, web3: Web3, diff --git a/crates/shared/src/order_quoting.rs b/crates/shared/src/order_quoting.rs index 30a70a99a7..bd89634bb7 100644 --- a/crates/shared/src/order_quoting.rs +++ b/crates/shared/src/order_quoting.rs @@ -417,7 +417,7 @@ pub struct OrderQuoter { } impl OrderQuoter { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( price_estimator: Arc, native_price_estimator: Arc, diff --git a/crates/shared/src/order_validation.rs b/crates/shared/src/order_validation.rs index 974582090c..2ea8f3995a 100644 --- a/crates/shared/src/order_validation.rs +++ b/crates/shared/src/order_validation.rs @@ -287,7 +287,7 @@ pub struct OrderAppData { } impl OrderValidator { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( native_token: WETH9, banned_users: Arc, diff --git a/crates/shared/src/price_estimation/buffered.rs b/crates/shared/src/price_estimation/buffered.rs index cb12419451..e84db5b5d1 100644 --- a/crates/shared/src/price_estimation/buffered.rs +++ b/crates/shared/src/price_estimation/buffered.rs @@ -43,7 +43,6 @@ pub struct Configuration { } /// Trait for fetching a batch of native price estimates. -#[allow(dead_code)] #[cfg_attr(test, mockall::automock)] pub trait NativePriceBatchFetching: Sync + Send + NativePriceEstimating { /// Fetches a batch of native price estimates. @@ -65,17 +64,14 @@ pub trait NativePriceBatchFetching: Sync + Send + NativePriceEstimating { /// Buffered implementation that implements automatic batching of /// native prices requests. -#[allow(dead_code)] #[derive(Clone)] pub struct BufferedRequest { - config: Configuration, - inner: Arc, + inner: std::marker::PhantomData, requests: mpsc::UnboundedSender, results: broadcast::Sender, } /// Object to map the token with its native price estimator result -#[allow(dead_code)] #[derive(Clone)] struct NativePriceResult { token: H160, @@ -132,7 +128,6 @@ where } } -#[allow(dead_code)] impl BufferedRequest where Inner: NativePriceBatchFetching + Send + Sync + NativePriceEstimating + 'static, @@ -152,10 +147,9 @@ where ); Self { - inner, + inner: Default::default(), requests: requests_sender, results: results_sender, - config, } } diff --git a/crates/shared/src/price_estimation/native_price_cache.rs b/crates/shared/src/price_estimation/native_price_cache.rs index bddaaa1e75..61c68a3462 100644 --- a/crates/shared/src/price_estimation/native_price_cache.rs +++ b/crates/shared/src/price_estimation/native_price_cache.rs @@ -333,7 +333,7 @@ impl CachingNativePriceEstimator { /// recently used prices have a higher priority. If `update_size` is /// `Some(n)` at most `n` prices get updated per interval. /// If `update_size` is `None` no limit gets applied. - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub fn new( estimator: Box, max_age: Duration, diff --git a/crates/shared/src/price_estimation/trade_verifier/mod.rs b/crates/shared/src/price_estimation/trade_verifier/mod.rs index dc7142bcad..dcc7e79f29 100644 --- a/crates/shared/src/price_estimation/trade_verifier/mod.rs +++ b/crates/shared/src/price_estimation/trade_verifier/mod.rs @@ -82,7 +82,7 @@ impl TradeVerifier { const SPARDOSE: Address = address!("0000000000000000000000000000000000020000"); const TRADER_IMPL: H160 = addr!("0000000000000000000000000000000000010000"); - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub async fn new( web3: Web3, simulator: Option>, @@ -475,7 +475,7 @@ fn encode_interactions(interactions: &[Interaction]) -> Vec interactions.iter().map(|i| i.encode()).collect() } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn encode_settlement( query: &PriceQuery, verification: &Verification, diff --git a/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs b/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs index 0dd41c6791..ebccd402bc 100644 --- a/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs +++ b/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs @@ -367,7 +367,7 @@ impl BalancerContracts { } impl BalancerPoolFetcher { - #[allow(clippy::too_many_arguments)] + #[expect(clippy::too_many_arguments)] pub async fn new( subgraph_url: &Url, block_retriever: Arc, diff --git a/crates/shared/src/sources/balancer_v2/swap/fixed_point.rs b/crates/shared/src/sources/balancer_v2/swap/fixed_point.rs index 6a010bda7d..44209a0be4 100644 --- a/crates/shared/src/sources/balancer_v2/swap/fixed_point.rs +++ b/crates/shared/src/sources/balancer_v2/swap/fixed_point.rs @@ -132,12 +132,12 @@ impl Bfp { self.0.is_zero() } - #[allow(clippy::should_implement_trait)] + #[expect(clippy::should_implement_trait)] pub fn add(self, other: Self) -> Result { Ok(Self(self.0.checked_add(other.0).ok_or(Error::AddOverflow)?)) } - #[allow(clippy::should_implement_trait)] + #[expect(clippy::should_implement_trait)] pub fn sub(self, other: Self) -> Result { Ok(Self(self.0.checked_sub(other.0).ok_or(Error::SubOverflow)?)) } diff --git a/crates/shared/src/trade_finding/external.rs b/crates/shared/src/trade_finding/external.rs index 6ab6ae4422..b1bc5edb27 100644 --- a/crates/shared/src/trade_finding/external.rs +++ b/crates/shared/src/trade_finding/external.rs @@ -264,7 +264,6 @@ pub(crate) mod dto { #[serde(untagged)] pub enum QuoteKind { Legacy(LegacyQuote), - #[allow(unused)] Regular(Quote), } @@ -284,7 +283,6 @@ pub(crate) mod dto { #[serde_as] #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "camelCase")] - #[allow(unused)] pub struct Quote { #[serde_as(as = "HashMap<_, HexOrDecimalU256>")] pub clearing_prices: HashMap, @@ -313,7 +311,6 @@ pub(crate) mod dto { #[serde_as] #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] - #[allow(unused)] pub struct JitOrder { pub buy_token: H160, pub sell_token: H160, diff --git a/crates/solvers-dto/src/auction.rs b/crates/solvers-dto/src/auction.rs index ec4c0663a0..736e212abe 100644 --- a/crates/solvers-dto/src/auction.rs +++ b/crates/solvers-dto/src/auction.rs @@ -158,7 +158,6 @@ pub struct Token { pub trusted: bool, } -#[allow(clippy::enum_variant_names)] #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "kind", rename_all = "camelCase")] pub enum Liquidity { From 7142f2fc7ffe51197dc4d3ba0a17818a1e7857bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 28 Oct 2025 09:29:32 +0000 Subject: [PATCH 051/117] [TRIVIAL] Fix wrong network id (#3829) --- crates/contracts/src/alloy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 38c830152f..302ea26b13 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -106,7 +106,7 @@ crate::bindings!( // OPTIMISM => (address!("0x230a59F4d9ADc147480f03B0D3fFfeCd56c3289a"), 82737545), // - OPTIMISM => (address!("0xFc8a407Bba312ac761D8BFe04CE1201904842B76"), 40611103), + POLYGON => (address!("0xFc8a407Bba312ac761D8BFe04CE1201904842B76"), 40611103), // BNB => (address!("0x230a59F4d9ADc147480f03B0D3fFfeCd56c3289a"), 26665331), // Not available on Base and Lens From f221dd8d129e645482b4e82c8002f596dc2d8f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 28 Oct 2025 09:53:32 +0000 Subject: [PATCH 052/117] Gate mockall deps (#3799) Co-authored-by: Martin Magnus --- Cargo.lock | 1 + crates/app-data/Cargo.toml | 2 +- crates/autopilot/Cargo.toml | 1 + crates/driver/Cargo.toml | 2 +- crates/ethrpc/Cargo.toml | 5 +++-- crates/ethrpc/src/lib.rs | 1 + crates/shared/Cargo.toml | 7 ++++++- crates/shared/src/account_balances/mod.rs | 2 +- crates/shared/src/bad_token/mod.rs | 2 +- crates/shared/src/code_fetching.rs | 2 +- crates/shared/src/order_quoting.rs | 2 +- crates/shared/src/order_validation.rs | 4 ++-- crates/shared/src/price_estimation/mod.rs | 2 +- crates/shared/src/price_estimation/native/mod.rs | 2 +- crates/shared/src/signature_validator/mod.rs | 2 +- .../shared/src/sources/balancer_v2/pool_fetching/mod.rs | 2 +- crates/shared/src/sources/balancer_v2/pools/common.rs | 2 +- crates/shared/src/sources/balancer_v2/pools/mod.rs | 8 ++++---- crates/shared/src/token_info.rs | 2 +- crates/shared/src/zeroex_api.rs | 2 +- crates/solver/Cargo.toml | 3 ++- crates/solvers-dto/Cargo.toml | 4 ++-- crates/solvers/Cargo.toml | 1 + 23 files changed, 36 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e16ebed404..6939fab136 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6298,6 +6298,7 @@ dependencies = [ "tower 0.4.13", "tower-http", "tracing", + "url", "vergen", "web3", ] diff --git a/crates/app-data/Cargo.toml b/crates/app-data/Cargo.toml index 1669d90f5e..b972eddfdd 100644 --- a/crates/app-data/Cargo.toml +++ b/crates/app-data/Cargo.toml @@ -12,7 +12,7 @@ tiny-keccak = { workspace = true, features = ["keccak"] } serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } -primitive-types = { workspace = true } +primitive-types = { workspace = true, features = ["serde"] } const-hex = { workspace = true } hex-literal = { workspace = true } number = { path = "../number" } diff --git a/crates/autopilot/Cargo.toml b/crates/autopilot/Cargo.toml index 8527e2afb2..6471f4d7a0 100644 --- a/crates/autopilot/Cargo.toml +++ b/crates/autopilot/Cargo.toml @@ -66,6 +66,7 @@ web3 = { workspace = true } [dev-dependencies] mockall = { workspace = true } tokio = { workspace = true, features = ["test-util"] } +shared = { workspace = true, features = ["test-util"] } [build-dependencies] anyhow = { workspace = true } diff --git a/crates/driver/Cargo.toml b/crates/driver/Cargo.toml index 445466539d..07ce68b144 100644 --- a/crates/driver/Cargo.toml +++ b/crates/driver/Cargo.toml @@ -79,7 +79,7 @@ app-data = { workspace = true, features = ["test_helpers"] } maplit = { workspace = true } tokio = { workspace = true, features = ["test-util", "process"] } tempfile = { workspace = true } -ethrpc = {workspace = true, features = ["test-util"]} +ethrpc = { workspace = true, features = ["test-util"] } contracts = { workspace = true } [build-dependencies] diff --git a/crates/ethrpc/Cargo.toml b/crates/ethrpc/Cargo.toml index 0bae002003..36d43c02c5 100644 --- a/crates/ethrpc/Cargo.toml +++ b/crates/ethrpc/Cargo.toml @@ -19,7 +19,6 @@ futures = { workspace = true } const-hex = { workspace = true } hex-literal = { workspace = true } itertools = { workspace = true } -mockall = { workspace = true } observe = { workspace = true } primitive-types = { workspace = true } prometheus = { workspace = true } @@ -35,13 +34,15 @@ tower = { workspace = true } tracing = { workspace = true } url = { workspace = true } web3 = { workspace = true } +mockall = { workspace = true, optional = true } [dev-dependencies] +mockall = { workspace = true } maplit = { workspace = true } testlib = { workspace = true } [features] -test-util = [] +test-util = ["dep:mockall"] [lints] workspace = true diff --git a/crates/ethrpc/src/lib.rs b/crates/ethrpc/src/lib.rs index 6c53042187..37f67052f8 100644 --- a/crates/ethrpc/src/lib.rs +++ b/crates/ethrpc/src/lib.rs @@ -4,6 +4,7 @@ pub mod buffered; pub mod extensions; pub mod http; pub mod instrumented; +#[cfg(any(test, feature = "test-util"))] pub mod mock; use { diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index f90feb29d2..a01d9254cf 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -35,7 +35,6 @@ humantime = { workspace = true } indexmap = { workspace = true } itertools = { workspace = true } maplit = { workspace = true } -mockall = { workspace = true } model = { workspace = true } num = { workspace = true } number = { workspace = true } @@ -59,6 +58,8 @@ tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "time" url = { workspace = true } web3 = { workspace = true } +mockall = { workspace = true, optional = true } + [dev-dependencies] async-stream = { workspace = true } ethcontract-mock = { workspace = true } @@ -66,6 +67,10 @@ regex = { workspace = true } testlib = { workspace = true } app-data = { workspace = true, features = ["test_helpers"] } tokio = { workspace = true, features = ["rt-multi-thread"] } +mockall = { workspace = true } + +[features] +test-util = ["dep:mockall"] [lints] workspace = true diff --git a/crates/shared/src/account_balances/mod.rs b/crates/shared/src/account_balances/mod.rs index 60e3747d31..69d73bdff8 100644 --- a/crates/shared/src/account_balances/mod.rs +++ b/crates/shared/src/account_balances/mod.rs @@ -65,7 +65,7 @@ impl From for TransferSimulationError { } } -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait BalanceFetching: Send + Sync { // Returns the balance available to the allowance manager for the given owner diff --git a/crates/shared/src/bad_token/mod.rs b/crates/shared/src/bad_token/mod.rs index 319d753ba7..86efd3027b 100644 --- a/crates/shared/src/bad_token/mod.rs +++ b/crates/shared/src/bad_token/mod.rs @@ -26,7 +26,7 @@ impl TokenQuality { } /// Detect how well behaved a token is. -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait BadTokenDetecting: Send + Sync { async fn detect(&self, token: H160) -> Result; diff --git a/crates/shared/src/code_fetching.rs b/crates/shared/src/code_fetching.rs index f2f0537d8f..54f1f108d6 100644 --- a/crates/shared/src/code_fetching.rs +++ b/crates/shared/src/code_fetching.rs @@ -10,7 +10,7 @@ use { web3::types::{Bytes, H160}, }; -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait CodeFetching: Send + Sync + 'static { /// Fetches the code for the specified address. diff --git a/crates/shared/src/order_quoting.rs b/crates/shared/src/order_quoting.rs index bd89634bb7..7f2af10221 100644 --- a/crates/shared/src/order_quoting.rs +++ b/crates/shared/src/order_quoting.rs @@ -232,7 +232,7 @@ impl TryFrom for QuoteData { } } -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait OrderQuoting: Send + Sync { /// Computes a quote for the specified order parameters. Doesn't store the diff --git a/crates/shared/src/order_validation.rs b/crates/shared/src/order_validation.rs index 2ea8f3995a..fa0c8fae10 100644 --- a/crates/shared/src/order_validation.rs +++ b/crates/shared/src/order_validation.rs @@ -50,7 +50,7 @@ use { tracing::instrument, }; -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait OrderValidating: Send + Sync { /// Partial (aka Pre-) Validation is aimed at catching malformed order data @@ -207,7 +207,7 @@ impl From for ValidationError { } } -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait] pub trait LimitOrderCounting: Send + Sync { async fn count(&self, owner: H160) -> Result; diff --git a/crates/shared/src/price_estimation/mod.rs b/crates/shared/src/price_estimation/mod.rs index 53cd207505..e0e795d31e 100644 --- a/crates/shared/src/price_estimation/mod.rs +++ b/crates/shared/src/price_estimation/mod.rs @@ -558,7 +558,7 @@ impl Estimate { pub type PriceEstimateResult = Result; -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] pub trait PriceEstimating: Send + Sync + 'static { fn estimate(&self, query: Arc) -> BoxFuture<'_, PriceEstimateResult>; } diff --git a/crates/shared/src/price_estimation/native/mod.rs b/crates/shared/src/price_estimation/native/mod.rs index 93451f12d3..af52cefaa4 100644 --- a/crates/shared/src/price_estimation/native/mod.rs +++ b/crates/shared/src/price_estimation/native/mod.rs @@ -43,7 +43,7 @@ pub fn to_normalized_price(price: f64) -> Option { .then_some(U256::from_f64_lossy(price_in_eth)) } -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] pub trait NativePriceEstimating: Send + Sync { /// Like `PriceEstimating::estimate`. /// diff --git a/crates/shared/src/signature_validator/mod.rs b/crates/shared/src/signature_validator/mod.rs index d7552f91c1..ce21a266bc 100644 --- a/crates/shared/src/signature_validator/mod.rs +++ b/crates/shared/src/signature_validator/mod.rs @@ -64,7 +64,7 @@ pub enum SignatureValidationError { Other(#[from] anyhow::Error), } -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] /// pub trait SignatureValidating: Send + Sync { diff --git a/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs b/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs index ebccd402bc..f245fa28c4 100644 --- a/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs +++ b/crates/shared/src/sources/balancer_v2/pool_fetching/mod.rs @@ -150,7 +150,7 @@ impl FetchedBalancerPools { } } -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait BalancerPoolFetching: Send + Sync { async fn fetch( diff --git a/crates/shared/src/sources/balancer_v2/pools/common.rs b/crates/shared/src/sources/balancer_v2/pools/common.rs index 23a3d90c7c..cc657846d6 100644 --- a/crates/shared/src/sources/balancer_v2/pools/common.rs +++ b/crates/shared/src/sources/balancer_v2/pools/common.rs @@ -19,7 +19,7 @@ use { }; /// Trait for fetching pool data that is generic on a factory type. -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait::async_trait] pub trait PoolInfoFetching: Send + Sync where diff --git a/crates/shared/src/sources/balancer_v2/pools/mod.rs b/crates/shared/src/sources/balancer_v2/pools/mod.rs index 4d7eb26f15..d35749c778 100644 --- a/crates/shared/src/sources/balancer_v2/pools/mod.rs +++ b/crates/shared/src/sources/balancer_v2/pools/mod.rs @@ -68,10 +68,10 @@ impl PoolStatus { } /// A Balancer factory indexing implementation. -#[mockall::automock( - type PoolInfo = weighted::PoolInfo; - type PoolState = weighted::PoolState; -)] +#[cfg_attr(any(test, feature="test-util"), mockall::automock( + type PoolInfo = weighted::PoolInfo; + type PoolState = weighted::PoolState; +))] #[async_trait::async_trait] pub trait FactoryIndexing: Send + Sync + 'static { /// The permanent pool info for this factory. diff --git a/crates/shared/src/token_info.rs b/crates/shared/src/token_info.rs index 40783b02dc..a49dcf5fc2 100644 --- a/crates/shared/src/token_info.rs +++ b/crates/shared/src/token_info.rs @@ -27,7 +27,7 @@ pub struct TokenInfo { #[error("error fetching token info: {0}")] pub struct Error(String); -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] #[async_trait] pub trait TokenInfoFetching: Send + Sync { /// Retrieves information for a token. diff --git a/crates/shared/src/zeroex_api.rs b/crates/shared/src/zeroex_api.rs index e67ab657a2..139c05103f 100644 --- a/crates/shared/src/zeroex_api.rs +++ b/crates/shared/src/zeroex_api.rs @@ -215,7 +215,7 @@ pub struct OrdersResponse { /// Abstract 0x API. Provides a mockable implementation. #[async_trait::async_trait] -#[mockall::automock] +#[cfg_attr(any(test, feature = "test-util"), mockall::automock)] pub trait ZeroExApi: Send + Sync { /// Retrieves all current limit orders. async fn get_orders( diff --git a/crates/solver/Cargo.toml b/crates/solver/Cargo.toml index 982c2059ac..fc2b29d4dd 100644 --- a/crates/solver/Cargo.toml +++ b/crates/solver/Cargo.toml @@ -24,7 +24,6 @@ const-hex = { workspace = true } hex-literal = { workspace = true } itertools = { workspace = true } maplit = { workspace = true } -mockall = { workspace = true } model = { workspace = true } num = { workspace = true } number = { workspace = true } @@ -42,6 +41,8 @@ web3 = { workspace = true } derivative = { workspace = true } tokio = { workspace = true, features = ["test-util"] } testlib = { workspace = true } +mockall = { workspace = true } +shared = { workspace = true, features = ["test-util"] } [lints] workspace = true diff --git a/crates/solvers-dto/Cargo.toml b/crates/solvers-dto/Cargo.toml index 56377b6635..8860a4e0bb 100644 --- a/crates/solvers-dto/Cargo.toml +++ b/crates/solvers-dto/Cargo.toml @@ -6,10 +6,10 @@ edition = "2024" license = "MIT OR Apache-2.0" [dependencies] -bytes-hex = { workspace = true } # may get marked as unused but it's used with serde app-data = { workspace = true } bigdecimal = { workspace = true, features = ["serde"] } -chrono = { workspace = true } +bytes-hex = { workspace = true } # may get marked as unused but it's used with serde +chrono = { workspace = true, features = ["serde"] } const-hex = { workspace = true } number = { workspace = true } serde = { workspace = true } diff --git a/crates/solvers/Cargo.toml b/crates/solvers/Cargo.toml index c50da7e3a4..184331fce1 100644 --- a/crates/solvers/Cargo.toml +++ b/crates/solvers/Cargo.toml @@ -33,6 +33,7 @@ num = { workspace = true } prometheus = { workspace = true } prometheus-metric-storage = { workspace = true } reqwest = { workspace = true } +url = { workspace = true, features = ["serde"] } serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } From d894594682523e9db5f4ea7638dc1f6e6a5a693a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 28 Oct 2025 12:01:27 +0000 Subject: [PATCH 053/117] Migrate WETH9 to alloy (#3816) --- .../src/infra/blockchain/contracts.rs | 22 +- crates/autopilot/src/run.rs | 17 +- crates/contracts/build.rs | 18 - crates/contracts/src/alloy.rs | 18 + crates/contracts/src/lib.rs | 2 - crates/driver/Cargo.toml | 1 + crates/driver/src/boundary/liquidity/mod.rs | 4 +- .../domain/competition/solution/encoding.rs | 9 +- .../driver/src/infra/blockchain/contracts.rs | 18 +- crates/driver/src/tests/setup/blockchain.rs | 147 +++--- crates/driver/src/tests/setup/driver.rs | 2 +- crates/driver/src/tests/setup/mod.rs | 5 +- crates/driver/src/tests/setup/solver.rs | 2 +- crates/e2e/src/setup/colocation.rs | 3 +- crates/e2e/src/setup/deploy.rs | 16 +- .../e2e/src/setup/onchain_components/mod.rs | 80 ++-- crates/e2e/src/setup/services.rs | 4 +- crates/e2e/tests/e2e/autopilot_leader.rs | 6 +- crates/e2e/tests/e2e/buffers.rs | 2 +- crates/e2e/tests/e2e/cow_amm.rs | 202 ++++---- crates/e2e/tests/e2e/eth_integration.rs | 5 +- crates/e2e/tests/e2e/eth_safe.rs | 4 +- crates/e2e/tests/e2e/ethflow.rs | 35 +- crates/e2e/tests/e2e/hooks.rs | 144 +++--- crates/e2e/tests/e2e/jit_orders.rs | 51 +- crates/e2e/tests/e2e/limit_orders.rs | 32 +- crates/e2e/tests/e2e/liquidity.rs | 4 +- .../e2e/liquidity_source_notification.rs | 2 +- crates/e2e/tests/e2e/order_cancellation.rs | 4 +- crates/e2e/tests/e2e/partial_fill.rs | 40 +- .../e2e/tests/e2e/place_order_with_quote.rs | 40 +- crates/e2e/tests/e2e/protocol_fee.rs | 106 ++--- crates/e2e/tests/e2e/quote_verification.rs | 83 ++-- crates/e2e/tests/e2e/quoting.rs | 70 +-- crates/e2e/tests/e2e/refunder.rs | 4 +- crates/e2e/tests/e2e/smart_contract_orders.rs | 8 +- crates/e2e/tests/e2e/solver_competition.rs | 16 +- crates/e2e/tests/e2e/submission.rs | 38 +- .../tests/e2e/tracking_insufficient_funds.rs | 121 +++-- crates/e2e/tests/e2e/uncovered_order.rs | 38 +- crates/e2e/tests/e2e/univ2.rs | 37 +- crates/e2e/tests/e2e/vault_balances.rs | 8 +- crates/orderbook/src/run.rs | 10 +- crates/shared/src/arguments.rs | 2 +- crates/shared/src/order_validation.rs | 59 ++- crates/shared/src/price_estimation/factory.rs | 9 +- .../price_estimation/trade_verifier/mod.rs | 26 +- crates/solver/Cargo.toml | 1 + crates/solver/src/interactions/weth.rs | 53 ++- crates/solver/src/liquidity/mod.rs | 10 - .../solver/src/liquidity/order_converter.rs | 440 ------------------ .../src/settlement/settlement_encoder.rs | 40 +- crates/solvers/src/infra/contracts.rs | 22 +- 53 files changed, 931 insertions(+), 1209 deletions(-) delete mode 100644 crates/solver/src/liquidity/order_converter.rs diff --git a/crates/autopilot/src/infra/blockchain/contracts.rs b/crates/autopilot/src/infra/blockchain/contracts.rs index 427437de80..12387800ac 100644 --- a/crates/autopilot/src/infra/blockchain/contracts.rs +++ b/crates/autopilot/src/infra/blockchain/contracts.rs @@ -6,9 +6,13 @@ use { GPv2AllowListAuthentication, HooksTrampoline, InstanceExt, + WETH9, support::Balances, }, - ethrpc::{Web3, alloy::conversions::IntoAlloy}, + ethrpc::{ + Web3, + alloy::conversions::{IntoAlloy, IntoLegacy}, + }, primitive_types::H160, }; @@ -16,7 +20,7 @@ use { pub struct Contracts { settlement: contracts::GPv2Settlement, signatures: contracts::alloy::support::Signatures::Instance, - weth: contracts::WETH9, + weth: WETH9::Instance, balances: Balances::Instance, chainalysis_oracle: Option, trampoline: HooksTrampoline::Instance, @@ -62,9 +66,13 @@ impl Contracts { web3.alloy.clone(), ); - let weth = contracts::WETH9::at( - web3, - address_for(contracts::WETH9::raw_contract(), addresses.weth), + let weth = WETH9::Instance::new( + addresses + .weth + .map(IntoAlloy::into_alloy) + .or_else(|| WETH9::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let balances = Balances::Instance::new( @@ -144,14 +152,14 @@ impl Contracts { &self.chainalysis_oracle } - pub fn weth(&self) -> &contracts::WETH9 { + pub fn weth(&self) -> &WETH9::Instance { &self.weth } /// Wrapped version of the native token (e.g. WETH for Ethereum, WXDAI for /// Gnosis Chain) pub fn wrapped_native_token(&self) -> domain::eth::WrappedNativeToken { - self.weth.address().into() + self.weth.address().into_legacy().into() } pub fn authenticator(&self) -> &GPv2AllowListAuthentication::Instance { diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index b591fc4bf8..36a44d31f1 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -26,7 +26,7 @@ use { }, chain::Chain, clap::Parser, - contracts::alloy::{BalancerV2Vault, IUniswapV3Factory, InstanceExt}, + contracts::alloy::{BalancerV2Vault, IUniswapV3Factory, InstanceExt, WETH9}, ethcontract::{BlockNumber, H160, common::DeploymentInformation}, ethrpc::{ Web3, @@ -207,7 +207,10 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { let contracts = infra::blockchain::contracts::Addresses { settlement: args.shared.settlement_contract_address, signatures: args.shared.signatures_contract_address, - weth: args.shared.native_token_address, + weth: args + .shared + .native_token_address + .map(IntoLegacy::into_legacy), balances: args .shared .balances_contract_address @@ -310,7 +313,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { .await; let base_tokens = Arc::new(BaseTokens::new( - eth.contracts().weth().address(), + eth.contracts().weth().address().into_legacy(), &args.shared.base_tokens, )); let mut allowed_tokens = args.allowed_tokens.clone(); @@ -374,7 +377,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { web3: web3.clone(), simulation_web3, chain, - native_token: eth.contracts().weth().address(), + native_token: eth.contracts().weth().address().into_legacy(), settlement: eth.contracts().settlement().address(), authenticator: eth .contracts() @@ -525,7 +528,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { bad_token_detector.clone(), native_price_estimator.clone(), signature_validator.clone(), - eth.contracts().weth().address(), + eth.contracts().weth().address().into_legacy(), args.limit_order_price_factor .try_into() .expect("limit order price factor can't be converted to BigDecimal"), @@ -739,7 +742,7 @@ async fn shadow_mode(args: Arguments) -> ! { &args.shared.node_url, "base", ); - let weth = contracts::WETH9::deployed(&web3) + let weth = WETH9::Instance::deployed(&web3.alloy) .await .expect("couldn't find deployed WETH contract"); @@ -785,7 +788,7 @@ async fn shadow_mode(args: Arguments) -> ! { liveness.clone(), current_block, args.max_winners_per_auction, - weth.address().into(), + weth.address().into_legacy().into(), ); shadow.run_forever().await; } diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 5727f683b0..4a5c5e72ec 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -142,24 +142,6 @@ fn main() { }, ) }); - generate_contract_with_config("WETH9", |builder| { - // Note: the WETH address must be consistent with the one used by the ETH-flow - // contract - builder - .add_network_str(MAINNET, "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2") - .add_network_str(GOERLI, "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6") - .add_network_str(GNOSIS, "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d") - .add_network_str(SEPOLIA, "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14") - .add_network_str(ARBITRUM_ONE, "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1") - .add_network_str(BASE, "0x4200000000000000000000000000000000000006") - .add_network_str(AVALANCHE, "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7") - .add_network_str(BNB, "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c") - .add_network_str(OPTIMISM, "0x4200000000000000000000000000000000000006") - .add_network_str(POLYGON, "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270") - .add_network_str(LENS, "0x6bDc36E20D267Ff0dd6097799f82e78907105e2F") - .add_network_str(LINEA, "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f") - .add_network_str(PLASMA, "0x6100E367285b01F48D07953803A2d8dCA5D19873") - }); generate_contract("CowAmm"); generate_contract_with_config("CowAmmConstantProductFactory", |builder| { builder diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 302ea26b13..86c1647246 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -670,6 +670,24 @@ crate::bindings!( } ); +crate::bindings!( + WETH9, + crate::deployments! { + // Note: the WETH address must be consistent with the one used by the ETH-flow + // contract + MAINNET => address!("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"), + GNOSIS => address!("0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d"), + SEPOLIA => address!("0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14"), + ARBITRUM_ONE => address!("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"), + BASE => address!("0x4200000000000000000000000000000000000006"), + AVALANCHE => address!("0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"), + BNB => address!("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"), + OPTIMISM => address!("0x4200000000000000000000000000000000000006"), + POLYGON => address!("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"), + LENS => address!("0x6bDc36E20D267Ff0dd6097799f82e78907105e2F"), + } +); + pub mod cow_amm { crate::bindings!(CowAmmFactoryGetter); } diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 15e4f3059c..32645783d9 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -55,7 +55,6 @@ include_contracts! { CowAmmUniswapV2PriceOracle; ERC20; GPv2Settlement; - WETH9; } #[cfg(test)] @@ -124,7 +123,6 @@ mod tests { for network in &[MAINNET, GNOSIS, SEPOLIA, ARBITRUM_ONE] { assert_has_deployment_address!(GPv2Settlement for *network); - assert_has_deployment_address!(WETH9 for *network); assert!( alloy::BalancerV2NoProtocolFeeLiquidityBootstrappingPoolFactory::deployment_address(network).is_some() ) diff --git a/crates/driver/Cargo.toml b/crates/driver/Cargo.toml index 07ce68b144..0f4b880741 100644 --- a/crates/driver/Cargo.toml +++ b/crates/driver/Cargo.toml @@ -81,6 +81,7 @@ tokio = { workspace = true, features = ["test-util", "process"] } tempfile = { workspace = true } ethrpc = { workspace = true, features = ["test-util"] } contracts = { workspace = true } +alloy = { workspace = true, features = ["signer-mnemonic"] } [build-dependencies] anyhow = { workspace = true } diff --git a/crates/driver/src/boundary/liquidity/mod.rs b/crates/driver/src/boundary/liquidity/mod.rs index 5cff9649bb..1811156129 100644 --- a/crates/driver/src/boundary/liquidity/mod.rs +++ b/crates/driver/src/boundary/liquidity/mod.rs @@ -4,7 +4,7 @@ use { infra::{self, blockchain::Ethereum}, }, anyhow::Result, - ethrpc::block_stream::CurrentBlockWatcher, + ethrpc::{alloy::conversions::IntoLegacy, block_stream::CurrentBlockWatcher}, futures::future, model::TokenPair, shared::{ @@ -108,7 +108,7 @@ impl Fetcher { .await?; let base_tokens = BaseTokens::new( - eth.contracts().weth().address(), + eth.contracts().weth().address().into_legacy(), &config .base_tokens .iter() diff --git a/crates/driver/src/domain/competition/solution/encoding.rs b/crates/driver/src/domain/competition/solution/encoding.rs index aad3f57cd2..6c0ca88545 100644 --- a/crates/driver/src/domain/competition/solution/encoding.rs +++ b/crates/driver/src/domain/competition/solution/encoding.rs @@ -13,7 +13,7 @@ use { util::Bytes, }, allowance::Allowance, - contracts::alloy::FlashLoanRouter::LoanRequest, + contracts::alloy::{FlashLoanRouter::LoanRequest, WETH9}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, itertools::Itertools, }; @@ -308,12 +308,11 @@ pub fn approve(allowance: &Allowance) -> eth::Interaction { } } -fn unwrap(amount: eth::TokenAmount, weth: &contracts::WETH9) -> eth::Interaction { - let tx = weth.withdraw(amount.into()).into_inner(); +fn unwrap(amount: eth::TokenAmount, weth: &WETH9::Instance) -> eth::Interaction { eth::Interaction { - target: tx.to.unwrap().into(), + target: weth.address().into_legacy().into(), value: Ether(0.into()), - call_data: tx.data.unwrap().0.into(), + call_data: Bytes(weth.withdraw(amount.0.into_alloy()).calldata().to_vec()), } } diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index 45ab8ffcf5..aab85ae8f7 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -1,7 +1,7 @@ use { crate::{domain::eth, infra::blockchain::Ethereum}, chain::Chain, - contracts::alloy::{BalancerV2Vault, FlashLoanRouter, support::Balances}, + contracts::alloy::{BalancerV2Vault, FlashLoanRouter, WETH9, support::Balances}, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -16,7 +16,7 @@ pub struct Contracts { vault_relayer: eth::ContractAddress, vault: BalancerV2Vault::Instance, signatures: contracts::alloy::support::Signatures::Instance, - weth: contracts::WETH9, + weth: WETH9::Instance, /// The domain separator for settlement contract used for signing orders. settlement_domain_separator: eth::DomainSeparator, @@ -85,9 +85,13 @@ impl Contracts { web3.alloy.clone(), ); - let weth = contracts::WETH9::at( - web3, - address_for(contracts::WETH9::raw_contract(), addresses.weth), + let weth = WETH9::Instance::new( + addresses + .weth + .map(|addr| addr.0.into_alloy()) + .or_else(|| WETH9::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let settlement_domain_separator = eth::DomainSeparator( @@ -140,12 +144,12 @@ impl Contracts { &self.vault } - pub fn weth(&self) -> &contracts::WETH9 { + pub fn weth(&self) -> &WETH9::Instance { &self.weth } pub fn weth_address(&self) -> eth::WethAddress { - self.weth.address().into() + self.weth.address().into_legacy().into() } pub fn settlement_domain_separator(&self) -> ð::DomainSeparator { diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index dc705be803..7c00785b74 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -4,13 +4,17 @@ use { domain::{competition::order, eth}, tests::{self, boundary, cases::EtherExt}, }, - alloy::{primitives::U256, signers::local::PrivateKeySigner}, + alloy::{ + primitives::U256, + signers::local::{MnemonicBuilder, PrivateKeySigner}, + }, contracts::alloy::{ BalancerV2Authorizer, BalancerV2Vault, ERC20Mintable, FlashLoanRouter, GPv2AllowListAuthentication::GPv2AllowListAuthentication, + WETH9, support::{Balances, Signatures}, }, ethcontract::PrivateKey, @@ -45,7 +49,7 @@ pub struct Blockchain { pub web3: Web3, pub web3_url: String, pub tokens: HashMap<&'static str, ERC20Mintable::Instance>, - pub weth: contracts::WETH9, + pub weth: WETH9::Instance, pub settlement: contracts::GPv2Settlement, pub balances: Balances::Instance, pub signatures: Signatures::Instance, @@ -235,18 +239,29 @@ impl Blockchain { ); let signer = PrivateKeySigner::from_slice(private_key).unwrap(); web3.wallet.register_signer(signer); + // This account is equivalent to `primary_account`, but due to the wallet + // initialization process and the fact that we launch anvil manually, we need to + // add it ourselves. + // It also must be added after the main_trader because otherwise this will be + // used as the default signing account + let anvil_test_account = MnemonicBuilder::english() + .phrase("test test test test test test test test test test test junk") + .index(0) + .unwrap() + .build() + .unwrap(); + web3.wallet.register_signer(anvil_test_account); + + let primary_account = primary_account(&web3).await; + let primary_address = primary_account.address(); // Use the primary account to fund the trader, cow amm and the solver with ETH. - let balance = web3 - .eth() - .balance(primary_address(&web3).await, None) - .await - .unwrap(); + let balance = web3.eth().balance(primary_address, None).await.unwrap(); wait_for( &web3, web3.eth() .send_transaction(web3::types::TransactionRequest { - from: primary_address(&web3).await, + from: primary_address, to: Some(main_trader_account.address()), value: Some(balance / 5), ..Default::default() @@ -255,19 +270,17 @@ impl Blockchain { .await .unwrap(); - let weth = wait_for( - &web3, - contracts::WETH9::builder(&web3) - .from(main_trader_account.clone()) - .deploy(), - ) - .await - .unwrap(); + let weth = contracts::alloy::WETH9::Instance::deploy_builder(web3.alloy.clone()) + .from(main_trader_account.address().into_alloy()) + .deploy() + .await + .unwrap(); + let weth = WETH9::WETH9::new(weth, web3.alloy.clone()); wait_for( &web3, ethcontract::transaction::TransactionBuilder::new(web3.legacy.clone()) - .from(primary_account(&web3).await) - .to(weth.address()) + .from(primary_account) + .to(weth.address().into_legacy()) .value(balance / 5) .send(), ) @@ -286,7 +299,7 @@ impl Blockchain { let vault = BalancerV2Vault::Instance::deploy_builder( web3.alloy.clone(), vault_authorizer, - weth.address().into_alloy(), + *weth.address(), alloy::primitives::U256::ZERO, alloy::primitives::U256::ZERO, ) @@ -379,7 +392,7 @@ impl Blockchain { &web3, web3.eth() .send_transaction(web3::types::TransactionRequest { - from: primary_address(&web3).await, + from: primary_address, to: Some(config.address()), value: Some(config.balance), ..Default::default() @@ -437,26 +450,18 @@ impl Blockchain { for pool in config.pools { // Get token addresses. let token_a = if pool.reserve_a.token == "WETH" { - weth.address() + *weth.address() } else { - tokens - .get(pool.reserve_a.token) - .unwrap() - .address() - .into_legacy() + *tokens.get(pool.reserve_a.token).unwrap().address() }; let token_b = if pool.reserve_b.token == "WETH" { - weth.address() + *weth.address() } else { - tokens - .get(pool.reserve_b.token) - .unwrap() - .address() - .into_legacy() + *tokens.get(pool.reserve_b.token).unwrap().address() }; // Create the pair. uniswap_factory - .createPair(token_a.into_alloy(), token_b.into_alloy()) + .createPair(token_a, token_b) .from(main_trader_account.address().into_alloy()) .send_and_watch() .await @@ -464,7 +469,7 @@ impl Blockchain { // Fund the pair and the settlement contract. let pair = contracts::alloy::IUniswapLikePair::Instance::new( uniswap_factory - .getPair(token_a.into_alloy(), token_b.into_alloy()) + .getPair(token_a, token_b) .call() .await .unwrap(), @@ -477,29 +482,26 @@ impl Blockchain { pool: pool.to_owned(), }); if pool.reserve_a.token == "WETH" { - wait_for( - &web3, - weth.transfer(pair.address().into_legacy(), pool.reserve_a.amount) - .from(primary_account(&web3).await) - .send(), - ) - .await - .unwrap(); - wait_for( - &web3, - weth.transfer(settlement.address(), pool.reserve_a.amount) - .from(primary_account(&web3).await) - .send(), + weth.transfer(*pair.address(), pool.reserve_a.amount.into_alloy()) + .from(primary_address.into_alloy()) + .send_and_watch() + .await + .unwrap(); + weth.transfer( + settlement.address().into_alloy(), + pool.reserve_a.amount.into_alloy(), ) + .from(primary_address.into_alloy()) + .send_and_watch() .await .unwrap(); for trader_account in trader_accounts.iter() { - wait_for( - &web3, - weth.transfer(trader_account.address(), pool.reserve_a.amount) - .from(primary_account(&web3).await) - .send(), + weth.transfer( + trader_account.address().into_alloy(), + pool.reserve_a.amount.into_alloy(), ) + .from(primary_address.into_alloy()) + .send_and_watch() .await .unwrap(); } @@ -553,29 +555,26 @@ impl Blockchain { } } if pool.reserve_b.token == "WETH" { - wait_for( - &web3, - weth.transfer(pair.address().into_legacy(), pool.reserve_b.amount) - .from(primary_account(&web3).await) - .send(), - ) - .await - .unwrap(); - wait_for( - &web3, - weth.transfer(settlement.address(), pool.reserve_b.amount) - .from(primary_account(&web3).await) - .send(), + weth.transfer(*pair.address(), pool.reserve_b.amount.into_alloy()) + .from(primary_address.into_alloy()) + .send_and_watch() + .await + .unwrap(); + weth.transfer( + settlement.address().into_alloy(), + pool.reserve_b.amount.into_alloy(), ) + .from(primary_address.into_alloy()) + .send_and_watch() .await .unwrap(); for trader_account in trader_accounts.iter() { - wait_for( - &web3, - weth.transfer(trader_account.address(), pool.reserve_b.amount) - .from(primary_account(&web3).await) - .send(), + weth.transfer( + trader_account.address().into_alloy(), + pool.reserve_b.amount.into_alloy(), ) + .from(primary_address.into_alloy()) + .send_and_watch() .await .unwrap(); } @@ -867,7 +866,7 @@ impl Blockchain { /// Returns the address of the token with the given symbol. pub fn get_token(&self, token: &str) -> eth::H160 { match token { - "WETH" => self.weth.address(), + "WETH" => self.weth.address().into_legacy(), "ETH" => eth::ETH_TOKEN.into(), _ => self.tokens.get(token).unwrap().address().into_legacy(), } @@ -877,7 +876,7 @@ impl Blockchain { /// WETH. pub fn get_token_wrapped(&self, token: &str) -> eth::H160 { match token { - "WETH" | "ETH" => self.weth.address(), + "WETH" | "ETH" => self.weth.address().into_legacy(), _ => self.tokens.get(token).unwrap().address().into_legacy(), } } @@ -891,10 +890,6 @@ impl Blockchain { } } -async fn primary_address(web3: &Web3) -> ethcontract::H160 { - web3.eth().accounts().await.unwrap()[0] -} - async fn primary_account(web3: &Web3) -> ethcontract::Account { ethcontract::Account::Local(web3.eth().accounts().await.unwrap()[0], None) } diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index 161530bf98..09b320bbef 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -235,7 +235,7 @@ async fn create_config_file( gas-price-cap = "1000000000000" "#, hex_address(blockchain.settlement.address()), - hex_address(blockchain.weth.address()), + blockchain.weth.address(), blockchain.balances.address(), blockchain.signatures.address(), hex_address(blockchain.flashloan_router.address().into_legacy()), diff --git a/crates/driver/src/tests/setup/mod.rs b/crates/driver/src/tests/setup/mod.rs index 50b31d46cb..b55a3ca162 100644 --- a/crates/driver/src/tests/setup/mod.rs +++ b/crates/driver/src/tests/setup/mod.rs @@ -1168,10 +1168,11 @@ impl Test { "WETH", self.blockchain .weth - .balance_of(self.trader_address) + .balanceOf(self.trader_address.into_alloy()) .call() .await - .unwrap(), + .unwrap() + .into_legacy(), ); balances.insert( "ETH", diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index 475c796534..0a08544ee3 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -469,7 +469,7 @@ impl Solver { rpc, Addresses { settlement: Some(config.blockchain.settlement.address().into()), - weth: Some(config.blockchain.weth.address().into()), + weth: Some(config.blockchain.weth.address().into_legacy().into()), balances: Some(config.blockchain.balances.address().into_legacy().into()), signatures: Some(config.blockchain.signatures.address().into_legacy().into()), cow_amm_helper_by_factory: Default::default(), diff --git a/crates/e2e/src/setup/colocation.rs b/crates/e2e/src/setup/colocation.rs index 9869dc715e..bdb79cfe4b 100644 --- a/crates/e2e/src/setup/colocation.rs +++ b/crates/e2e/src/setup/colocation.rs @@ -1,5 +1,6 @@ use { crate::setup::*, + ::alloy::primitives::Address, ethcontract::H160, reqwest::Url, std::collections::HashSet, @@ -19,7 +20,7 @@ pub struct SolverEngine { pub async fn start_baseline_solver( name: String, account: TestAccount, - weth: H160, + weth: Address, base_tokens: Vec, max_hops: usize, merge_solutions: bool, diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index f66218dcaa..e58e2ffe65 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -2,7 +2,6 @@ use { crate::deploy, contracts::{ GPv2Settlement, - WETH9, alloy::{ BalancerV2Authorizer, BalancerV2Vault, @@ -13,6 +12,7 @@ use { InstanceExt, UniswapV2Factory, UniswapV2Router02, + WETH9, support::{Balances, Signatures}, }, }, @@ -40,7 +40,7 @@ pub struct Contracts { pub balances: Balances::Instance, pub uniswap_v2_factory: UniswapV2Factory::Instance, pub uniswap_v2_router: UniswapV2Router02::Instance, - pub weth: WETH9, + pub weth: WETH9::Instance, pub allowance: Address, pub domain_separator: DomainSeparator, pub ethflows: Vec, @@ -90,7 +90,7 @@ impl Contracts { uniswap_v2_router: UniswapV2Router02::Instance::deployed(&web3.alloy) .await .unwrap(), - weth: WETH9::deployed(web3).await.unwrap(), + weth: WETH9::Instance::deployed(&web3.alloy).await.unwrap(), allowance: gp_settlement .vault_relayer() .call() @@ -131,7 +131,7 @@ impl Contracts { let accounts: Vec
= web3.eth().accounts().await.expect("get accounts failed"); let admin = accounts[0]; - let weth = deploy!(web3, WETH9()); + let weth = WETH9::Instance::deploy(web3.alloy.clone()).await.unwrap(); let balancer_authorizer = BalancerV2Authorizer::Instance::deploy(web3.alloy.clone(), admin.into_alloy()) @@ -140,7 +140,7 @@ impl Contracts { let balancer_vault = BalancerV2Vault::Instance::deploy( web3.alloy.clone(), *balancer_authorizer.address(), - weth.address().into_alloy(), + *weth.address(), alloy::primitives::U256::ZERO, alloy::primitives::U256::ZERO, ) @@ -154,7 +154,7 @@ impl Contracts { let uniswap_v2_router = UniswapV2Router02::Instance::deploy( web3.alloy.clone(), *uniswap_v2_factory.address(), - weth.address().into_alloy(), + *weth.address(), ) .await .unwrap(); @@ -211,14 +211,14 @@ impl Contracts { let ethflow = CoWSwapEthFlow::Instance::deploy( web3.alloy.clone(), gp_settlement.address().into_alloy(), - weth.address().into_alloy(), + *weth.address(), ) .await .unwrap(); let ethflow_secondary = CoWSwapEthFlow::Instance::deploy( web3.alloy.clone(), gp_settlement.address().into_alloy(), - weth.address().into_alloy(), + *weth.address(), ) .await .unwrap(); diff --git a/crates/e2e/src/setup/onchain_components/mod.rs b/crates/e2e/src/setup/onchain_components/mod.rs index 95ef941bed..c096973624 100644 --- a/crates/e2e/src/setup/onchain_components/mod.rs +++ b/crates/e2e/src/setup/onchain_components/mod.rs @@ -29,7 +29,6 @@ use { hex_literal::hex, model::{ DomainSeparator, - TokenPair, signature::{EcdsaSignature, EcdsaSigningScheme}, }, secp256k1::SecretKey, @@ -483,14 +482,19 @@ impl OnchainComponents { .send_and_watch() .await .unwrap(); - tx_value!(minter, weth_amount, self.contracts.weth.deposit()); + + self.contracts + .weth + .deposit() + .value(weth_amount.into_alloy()) + .from(minter.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); self.contracts .uniswap_v2_factory - .createPair( - *contract.address(), - self.contracts.weth.address().into_alloy(), - ) + .createPair(*contract.address(), *self.contracts.weth.address()) .from(minter.address().into_alloy()) .send_and_watch() .await @@ -506,18 +510,22 @@ impl OnchainComponents { .await .unwrap(); - tx!( - minter, - self.contracts.weth.approve( - self.contracts.uniswap_v2_router.address().into_legacy(), - weth_amount + self.contracts + .weth + .approve( + *self.contracts.uniswap_v2_router.address(), + weth_amount.into_alloy(), ) - ); + .from(minter.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + self.contracts .uniswap_v2_router .addLiquidity( *contract.address(), - self.contracts.weth.address().into_alloy(), + *self.contracts.weth.address(), token_amount.into_alloy(), weth_amount.into_alloy(), ::alloy::primitives::U256::ZERO, @@ -595,7 +603,7 @@ impl OnchainComponents { let pair = contracts::alloy::IUniswapLikePair::Instance::new( self.contracts .uniswap_v2_factory - .getPair(self.contracts.weth.address().into_alloy(), *token.address()) + .getPair(*self.contracts.weth.address(), *token.address()) .call() .await .expect("failed to get Uniswap V2 pair"), @@ -606,17 +614,11 @@ impl OnchainComponents { // Mint amount + 1 to the pool, and then swap out 1 of the minted token // in order to force it to update its K-value. token.mint(pair.address().into_legacy(), amount + 1).await; - let (out0, out1) = - if TokenPair::new(self.contracts.weth.address(), token.address().into_legacy()) - .unwrap() - .get() - .0 - == token.address().into_legacy() - { - (1, 0) - } else { - (0, 1) - }; + let (out0, out1) = if self.contracts.weth.address() < token.address() { + (1, 0) + } else { + (0, 1) + }; pair.swap( ::alloy::primitives::U256::from(out0), ::alloy::primitives::U256::from(out1), @@ -651,11 +653,18 @@ impl OnchainComponents { ) -> CowToken { let cow = self.deploy_cow_token(cow_supply).await; - tx_value!(cow.holder, weth_amount, self.contracts.weth.deposit()); + self.contracts + .weth + .deposit() + .value(weth_amount.into_alloy()) + .from(cow.holder.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); self.contracts .uniswap_v2_factory - .createPair(*cow.address(), self.contracts.weth.address().into_alloy()) + .createPair(*cow.address(), *self.contracts.weth.address()) .from(cow.holder.address().into_alloy()) .send_and_watch() .await @@ -668,18 +677,21 @@ impl OnchainComponents { .send_and_watch() .await .unwrap(); - tx!( - cow.holder, - self.contracts.weth.approve( - self.contracts.uniswap_v2_router.address().into_legacy(), - weth_amount + self.contracts + .weth + .approve( + *self.contracts.uniswap_v2_router.address(), + weth_amount.into_alloy(), ) - ); + .from(cow.holder.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); self.contracts .uniswap_v2_router .addLiquidity( *cow.address(), - self.contracts.weth.address().into_alloy(), + *self.contracts.weth.address(), cow_amount.into_alloy(), weth_amount.into_alloy(), ::alloy::primitives::U256::ZERO, diff --git a/crates/e2e/src/setup/services.rs b/crates/e2e/src/setup/services.rs index f0e3bb6a07..3930a37d47 100644 --- a/crates/e2e/src/setup/services.rs +++ b/crates/e2e/src/setup/services.rs @@ -263,7 +263,7 @@ impl<'a> Services<'a> { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - self.contracts.weth.address(), + *self.contracts.weth.address(), vec![], 1, true, @@ -328,7 +328,7 @@ impl<'a> Services<'a> { colocation::start_baseline_solver( "baseline_solver".into(), solver.clone(), - self.contracts.weth.address(), + *self.contracts.weth.address(), vec![], 1, true, diff --git a/crates/e2e/tests/e2e/autopilot_leader.rs b/crates/e2e/tests/e2e/autopilot_leader.rs index 1119b1be47..fea8b13721 100644 --- a/crates/e2e/tests/e2e/autopilot_leader.rs +++ b/crates/e2e/tests/e2e/autopilot_leader.rs @@ -62,7 +62,7 @@ async fn dual_autopilot_only_leader_produces_auctions(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver1.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -71,7 +71,7 @@ async fn dual_autopilot_only_leader_produces_auctions(web3: Web3) { colocation::start_baseline_solver( "test_solver2".into(), solver2.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -114,7 +114,7 @@ async fn dual_autopilot_only_leader_produces_auctions(web3: Web3) { OrderCreation { sell_token: token_a.address().into_legacy(), sell_amount: to_wei(10), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(5), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, diff --git a/crates/e2e/tests/e2e/buffers.rs b/crates/e2e/tests/e2e/buffers.rs index ac7c16cbe8..da22bd732d 100644 --- a/crates/e2e/tests/e2e/buffers.rs +++ b/crates/e2e/tests/e2e/buffers.rs @@ -53,7 +53,7 @@ async fn onchain_settlement_without_liquidity(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index dad6adc16c..094a8fbe19 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -1,6 +1,5 @@ use { app_data::AppDataHash, - autopilot::util::conv::U256Ext, contracts::{ ERC20, alloy::support::{Balances, Signatures}, @@ -23,7 +22,6 @@ use { wait_for_condition, }, tx, - tx_value, }, ethcontract::{BlockId, BlockNumber, H160, U256, web3::ethabi::Token}, ethrpc::alloy::{ @@ -96,26 +94,28 @@ async fn cow_amm_jit(web3: Web3) { .await .unwrap(); // Fund cow amm owner with 1 WETH and allow factory take them - tx_value!( - cow_amm_owner.account(), - to_wei(1), - onchain.contracts().weth.deposit() - ); - tx!( - cow_amm_owner.account(), - onchain - .contracts() - .weth - .approve(cow_amm_factory.address(), to_wei(1)) - ); + onchain + .contracts() + .weth + .deposit() + .value(eth(1)) + .from(cow_amm_owner.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .approve(cow_amm_factory.address().into_alloy(), eth(1)) + .from(cow_amm_owner.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let pair = onchain .contracts() .uniswap_v2_factory - .getPair( - onchain.contracts().weth.address().into_alloy(), - *dai.address(), - ) + .getPair(*onchain.contracts().weth.address(), *dai.address()) .call() .await .expect("failed to get Uniswap V2 pair"); @@ -124,7 +124,7 @@ async fn cow_amm_jit(web3: Web3) { .amm_deterministic_address( cow_amm_owner.address(), dai.address().into_legacy(), - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), ) .call() .await @@ -138,7 +138,7 @@ async fn cow_amm_jit(web3: Web3) { .create( dai.address().into_legacy(), to_wei(2_000), - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), to_wei(1), 0.into(), // min traded token oracle.address(), @@ -162,7 +162,7 @@ async fn cow_amm_jit(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -217,7 +217,7 @@ async fn cow_amm_jit(web3: Web3) { // If this order gets settled around the oracle price it will receive plenty of // surplus. let cow_amm_order = OrderData { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: dai.address().into_legacy(), receiver: None, sell_amount: U256::exp10(17), @@ -301,22 +301,30 @@ async fn cow_amm_jit(web3: Web3) { }; // fund trader "bob" and approve vault relayer - tx_value!( - bob.account(), - U256::exp10(17), - onchain.contracts().weth.deposit() - ); - tx!( - bob.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, U256::MAX) - ); + onchain + .contracts() + .weth + .deposit() + .from(bob.address().into_alloy()) + .value(alloy::primitives::U256::from(10u64.pow(17))) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .approve( + onchain.contracts().allowance.into_alloy(), + alloy::primitives::U256::MAX, + ) + .from(bob.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); // place user order with the same limit price as the CoW AMM order let user_order = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: U256::exp10(17), // 0.1 WETH buy_token: dai.address().into_legacy(), buy_amount: to_wei(230), // 230 DAI @@ -349,7 +357,10 @@ async fn cow_amm_jit(web3: Web3) { // assume price of the univ2 pool prices: HashMap::from([ (dai.address().into_legacy(), to_wei(100)), - (onchain.contracts().weth.address(), to_wei(300_000)), + ( + onchain.contracts().weth.address().into_legacy(), + to_wei(300_000), + ), ]), trades: vec![ solvers_dto::solution::Trade::Jit(solvers_dto::solution::JitTrade { @@ -480,26 +491,33 @@ async fn cow_amm_driver_support(web3: Web3) { let weth_balance = onchain .contracts() .weth - .balance_of(USDC_WETH_COW_AMM) + .balanceOf(USDC_WETH_COW_AMM.into_alloy()) .call() .await .unwrap(); - // Assuming that the pool is balanced, imbalance it by 30%, so the driver can + // Assuming that the pool is balanced, imbalance it by ~30%, so the driver can // crate a CoW AMM JIT order. This imbalance shouldn't exceed 50%, since // such an order will be rejected by the SC: - let weth_to_send = weth_balance.checked_mul_f64(0.3).unwrap(); - tx_value!( - solver.account(), - weth_to_send, - onchain.contracts().weth.deposit() - ); - tx!( - solver.account(), - onchain - .contracts() - .weth - .transfer(USDC_WETH_COW_AMM, weth_to_send) - ); + let weth_to_send = weth_balance + .checked_div(alloy::primitives::U256::from(3)) + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(solver.address().into_alloy()) + .value(weth_to_send) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .transfer(USDC_WETH_COW_AMM.into_alloy(), weth_to_send) + .from(solver.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let amm_usdc_balance_before = usdc.balance_of(USDC_WETH_COW_AMM).call().await.unwrap(); @@ -552,7 +570,7 @@ async fn cow_amm_driver_support(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -683,7 +701,7 @@ factory = "0xf76c421bAb7df8548604E60deCCcE50477C10462" let found_amm_jit_orders = auctions.iter().any(|auction| { auction.orders.iter().any(|order| { order.owner == USDC_WETH_COW_AMM - && order.sell_token == H160(onchain.contracts().weth.address().0) + && order.sell_token == onchain.contracts().weth.address().into_legacy() && order.buy_token == usdc.address() }) }); @@ -741,32 +759,38 @@ async fn cow_amm_opposite_direction(web3: Web3) { .await .unwrap(); - tx_value!( - cow_amm_owner.account(), - to_wei(1), - onchain.contracts().weth.deposit() - ); - tx!( - cow_amm_owner.account(), - onchain - .contracts() - .weth - .approve(cow_amm_factory.address(), to_wei(1)) - ); + onchain + .contracts() + .weth + .deposit() + .from(cow_amm_owner.address().into_alloy()) + .value(eth(1)) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .approve(cow_amm_factory.address().into_alloy(), eth(1)) + .from(cow_amm_owner.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); - tx_value!( - solver.account(), - to_wei(1), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .deposit() + .from(solver.address().into_alloy()) + .value(eth(1)) + .send_and_watch() + .await + .unwrap(); let pair = onchain .contracts() .uniswap_v2_factory - .getPair( - onchain.contracts().weth.address().into_alloy(), - *dai.address(), - ) + .getPair(*onchain.contracts().weth.address(), *dai.address()) .call() .await .expect("failed to get Uniswap V2 pair"); @@ -775,7 +799,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { .amm_deterministic_address( cow_amm_owner.address(), dai.address().into_legacy(), - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), ) .call() .await @@ -790,7 +814,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { .create( dai.address().into_legacy(), to_wei(2_000), - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), to_wei(1), 0.into(), // min traded token oracle.address(), @@ -812,7 +836,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -861,7 +885,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { // CoW AMM order remains the same (selling WETH for DAI) let cow_amm_order = OrderData { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: dai.address().into_legacy(), receiver: None, sell_amount: U256::exp10(17), // 0.1 WETH @@ -956,14 +980,14 @@ async fn cow_amm_opposite_direction(web3: Web3) { let amm_weth_balance_before = onchain .contracts() .weth - .balance_of(cow_amm.address()) + .balanceOf(cow_amm.address().into_alloy()) .call() .await .unwrap(); let bob_weth_balance_before = onchain .contracts() .weth - .balance_of(bob.address()) + .balanceOf(bob.address().into_alloy()) .call() .await .unwrap(); @@ -981,7 +1005,10 @@ async fn cow_amm_opposite_direction(web3: Web3) { id: 1, prices: HashMap::from([ (dai.address().into_legacy(), to_wei(1)), // 1 DAI = $1 - (onchain.contracts().weth.address(), to_wei(2300)), // 1 WETH = $2300 + ( + onchain.contracts().weth.address().into_legacy(), + to_wei(2300), + ), // 1 WETH = $2300 ]), trades: vec![ solvers_dto::solution::Trade::Jit(solvers_dto::solution::JitTrade { @@ -1024,7 +1051,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { let quote_request = OrderQuoteRequest { from: bob.address(), sell_token: dai.address().into_legacy(), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::AfterFee { value: NonZeroU256::try_from(executed_amount).unwrap(), @@ -1039,7 +1066,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { assert_eq!(quote_response.quote.sell_token, dai.address().into_legacy()); assert_eq!( quote_response.quote.buy_token, - onchain.contracts().weth.address() + onchain.contracts().weth.address().into_legacy() ); // Ensure the amounts are the same as the solution proposes. assert_eq!(quote_response.quote.sell_amount, executed_amount); @@ -1049,7 +1076,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { let user_order = OrderCreation { sell_token: dai.address().into_legacy(), sell_amount: executed_amount, // 230 DAI - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: U256::from(90000000000000000u64), // 0.09 WETH to generate some surplus valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -1073,14 +1100,14 @@ async fn cow_amm_opposite_direction(web3: Web3) { let amm_weth_balance_after = onchain .contracts() .weth - .balance_of(cow_amm.address()) + .balanceOf(cow_amm.address().into_alloy()) .call() .await .unwrap(); let bob_weth_balance_after = onchain .contracts() .weth - .balance_of(bob.address()) + .balanceOf(bob.address().into_alloy()) .call() .await .unwrap(); @@ -1089,7 +1116,8 @@ async fn cow_amm_opposite_direction(web3: Web3) { let bob_weth_received = bob_weth_balance_after - bob_weth_balance_before; // Bob should receive WETH, CoW AMM's WETH balance decreases - bob_weth_received >= user_order.buy_amount && amm_weth_sent == cow_amm_order.sell_amount + bob_weth_received >= user_order.buy_amount.into_alloy() + && amm_weth_sent == cow_amm_order.sell_amount.into_alloy() }) .await .unwrap(); diff --git a/crates/e2e/tests/e2e/eth_integration.rs b/crates/e2e/tests/e2e/eth_integration.rs index 74c5de80de..d84854417b 100644 --- a/crates/e2e/tests/e2e/eth_integration.rs +++ b/crates/e2e/tests/e2e/eth_integration.rs @@ -83,7 +83,10 @@ async fn eth_integration(web3: Web3) { assert_eq!(status, 400, "{body}"); // Place Orders - assert_ne!(onchain.contracts().weth.address(), BUY_ETH_ADDRESS); + assert_ne!( + onchain.contracts().weth.address().into_legacy(), + BUY_ETH_ADDRESS + ); let order_buy_eth_a = OrderCreation { kind: OrderKind::Buy, sell_token: token.address().into_legacy(), diff --git a/crates/e2e/tests/e2e/eth_safe.rs b/crates/e2e/tests/e2e/eth_safe.rs index 00d7a0ec67..c23ae7eacd 100644 --- a/crates/e2e/tests/e2e/eth_safe.rs +++ b/crates/e2e/tests/e2e/eth_safe.rs @@ -62,11 +62,11 @@ async fn test(web3: Web3) { let balance = onchain .contracts() .weth - .balance_of(safe.address().into_legacy()) + .balanceOf(safe.address()) .call() .await .unwrap(); - assert_eq!(balance, 0.into()); + assert_eq!(balance, ::alloy::primitives::U256::ZERO); let mut order = OrderCreation { from: Some(safe.address().into_legacy()), sell_token: token.address().into_legacy(), diff --git a/crates/e2e/tests/e2e/ethflow.rs b/crates/e2e/tests/e2e/ethflow.rs index 664d6e54fe..0f0cd6e934 100644 --- a/crates/e2e/tests/e2e/ethflow.rs +++ b/crates/e2e/tests/e2e/ethflow.rs @@ -5,10 +5,7 @@ use { }, anyhow::bail, autopilot::database::onchain_order_events::ethflow_events::WRAP_ALL_SELECTOR, - contracts::{ - WETH9, - alloy::{CoWSwapEthFlow, ERC20Mintable}, - }, + contracts::alloy::{CoWSwapEthFlow, ERC20Mintable, WETH9}, database::order_events::OrderEventLabel, e2e::{ nodes::local_node::TestNodeApi, @@ -226,9 +223,9 @@ async fn eth_flow_tx(web3: Web3) { // Pre and post interactions provided in the appdata got executed. // Note that the allowance was set for the trampoline contract // which proofs that the interactions were correctly sandboxed. - let trampoline = onchain.contracts().hooks.address(); + let trampoline = *onchain.contracts().hooks.address(); let allowance = dai - .allowance(*trampoline, trader.address().into_alloy()) + .allowance(trampoline, trader.address().into_alloy()) .call() .await .unwrap(); @@ -237,11 +234,11 @@ async fn eth_flow_tx(web3: Web3) { let allowance = onchain .contracts() .weth - .allowance(trampoline.into_legacy(), trader.address()) + .allowance(trampoline, trader.address().into_alloy()) .call() .await .unwrap(); - assert_eq!(allowance, to_wei(10)); + assert_eq!(allowance, eth(10)); // Just to be super sure we assert that we indeed were not // able to set an allowance on behalf of the settlement contract. @@ -256,11 +253,11 @@ async fn eth_flow_tx(web3: Web3) { let allowance = onchain .contracts() .weth - .allowance(settlement, trader.address()) + .allowance(settlement.into_alloy(), trader.address().into_alloy()) .call() .await .unwrap(); - assert_eq!(allowance, 0.into()); + assert_eq!(allowance, alloy::primitives::U256::ZERO); } async fn eth_flow_without_quote(web3: Web3) { @@ -588,7 +585,10 @@ async fn test_trade_query( // Expected values from actual EIP1271 order instead of eth-flow order assert_eq!(response[0].owner, ethflow_contract.address().into_legacy()); - assert_eq!(response[0].sell_token, contracts.weth.address()); + assert_eq!( + response[0].sell_token, + contracts.weth.address().into_legacy() + ); } async fn test_order_parameters( @@ -604,7 +604,10 @@ async fn test_order_parameters( response.metadata.owner, ethflow_contract.address().into_legacy() ); - assert_eq!(response.data.sell_token, contracts.weth.address()); + assert_eq!( + response.data.sell_token, + contracts.weth.address().into_legacy() + ); // Specific parameters return the missing values assert_eq!( @@ -659,13 +662,13 @@ impl ExtendedEthFlowOrder { fn to_cow_swap_order( &self, ethflow_contract: &CoWSwapEthFlow::Instance, - weth: &WETH9, + weth: &WETH9::Instance, ) -> Order { // Each ethflow user order has an order that is representing // it as EIP1271 order with a different owner and valid_to OrderBuilder::default() .with_kind(OrderKind::Sell) - .with_sell_token(weth.address()) + .with_sell_token(weth.address().into_legacy()) .with_sell_amount(self.0.sell_amount) .with_fee_amount(self.0.fee_amount) .with_receiver(Some(self.0.receiver)) @@ -831,11 +834,11 @@ pub struct EthFlowTradeIntent { impl EthFlowTradeIntent { // How a user trade intent is converted into a quote request by the frontend - pub fn to_quote_request(&self, from: H160, weth: &WETH9) -> OrderQuoteRequest { + pub fn to_quote_request(&self, from: H160, weth: &WETH9::Instance) -> OrderQuoteRequest { OrderQuoteRequest { from, // Even if the user sells ETH, we request a quote for WETH - sell_token: weth.address(), + sell_token: weth.address().into_legacy(), buy_token: self.buy_token, receiver: Some(self.receiver), validity: Validity::For(3600), diff --git a/crates/e2e/tests/e2e/hooks.rs b/crates/e2e/tests/e2e/hooks.rs index d778597f7b..4e8ccb4b6d 100644 --- a/crates/e2e/tests/e2e/hooks.rs +++ b/crates/e2e/tests/e2e/hooks.rs @@ -1,23 +1,17 @@ use { alloy::providers::Provider, app_data::Hook, - e2e::{ - setup::{ - OnchainComponents, - Services, - TIMEOUT, - eth, - hook_for_transaction, - onchain_components, - run_test, - safe::Safe, - to_wei, - wait_for_condition, - }, - tx, - tx_value, + e2e::setup::{ + OnchainComponents, + Services, + TIMEOUT, + eth, + onchain_components, + run_test, + safe::Safe, + to_wei, + wait_for_condition, }, - ethcontract::U256, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -88,7 +82,7 @@ async fn gas_limit(web3: Web3) { let order = OrderCreation { sell_token: cow.address().into_legacy(), sell_amount: to_wei(4), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(3), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -147,15 +141,17 @@ async fn allowance(web3: Web3) { gas_limit: tx.estimate_gas().await.unwrap(), } }; - let steal_weth = hook_for_transaction( - onchain - .contracts() - .weth - .approve(trader.address(), U256::max_value()) - .from(solver.account().clone()) - .tx, - ) - .await; + let steal_weth = { + let approve = onchain.contracts().weth.approve( + trader.address().into_alloy(), + ::alloy::primitives::U256::MAX, + ); + Hook { + target: onchain.contracts().weth.address().into_legacy(), + call_data: approve.calldata().to_vec(), + gas_limit: approve.estimate_gas().await.unwrap(), + } + }; let services = Services::new(&onchain).await; services.start_protocol(solver).await; @@ -163,7 +159,7 @@ async fn allowance(web3: Web3) { let order = OrderCreation { sell_token: cow.address().into_legacy(), sell_amount: to_wei(5), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(3), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -209,11 +205,11 @@ async fn allowance(web3: Web3) { let balance = onchain .contracts() .weth - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); - assert!(balance >= order.buy_amount); + assert!(balance >= order.buy_amount.into_alloy()); tracing::info!("Waiting for auction to be cleared."); let auction_is_empty = || async { services.get_auction().await.auction.orders.is_empty() }; @@ -233,13 +229,13 @@ async fn allowance(web3: Web3) { .contracts() .weth .allowance( - onchain.contracts().gp_settlement.address(), - trader.address(), + onchain.contracts().gp_settlement.address().into_alloy(), + trader.address().into_alloy(), ) .call() .await .unwrap(); - assert_eq!(allowance, U256::zero()); + assert_eq!(allowance, ::alloy::primitives::U256::ZERO); // Note that the allowances were set with the `HooksTrampoline` contract! // This is OK since the `HooksTrampoline` contract is not used for holding @@ -257,13 +253,13 @@ async fn allowance(web3: Web3) { .contracts() .weth .allowance( - (*onchain.contracts().hooks.address()).into_legacy(), - trader.address(), + *onchain.contracts().hooks.address(), + trader.address().into_alloy(), ) .call() .await .unwrap(); - assert_eq!(allowance, U256::max_value()); + assert_eq!(allowance, ::alloy::primitives::U256::MAX); } async fn signature(web3: Web3) { @@ -356,7 +352,7 @@ async fn signature(web3: Web3) { sell_amount: to_wei(6), partially_fillable: true, sell_token: token.address().into_legacy(), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(3), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -412,11 +408,11 @@ async fn signature(web3: Web3) { let balance = onchain .contracts() .weth - .balance_of(safe.address().into_legacy()) + .balanceOf(safe.address()) .call() .await .unwrap(); - assert!(balance >= order.buy_amount); + assert!(balance >= order.buy_amount.into_alloy()); // Check Safe was deployed let code = web3 @@ -446,14 +442,22 @@ async fn partial_fills(web3: Web3) { .await; let sell_token = onchain.contracts().weth.clone(); - tx!( - trader.account(), - sell_token.approve(onchain.contracts().allowance, to_wei(2)) - ); - tx_value!(trader.account(), to_wei(1), sell_token.deposit()); + sell_token + .approve(onchain.contracts().allowance.into_alloy(), eth(2)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + sell_token + .deposit() + .from(trader.address().into_alloy()) + .value(eth(1)) + .send_and_watch() + .await + .unwrap(); let balance_before_first_trade = sell_token - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); @@ -464,7 +468,7 @@ async fn partial_fills(web3: Web3) { let pre_inc = counter.setCounterToBalance( "pre".to_string(), - sell_token.address().into_alloy(), + *sell_token.address(), trader.address().into_alloy(), ); let pre_hook = Hook { @@ -475,7 +479,7 @@ async fn partial_fills(web3: Web3) { let post_inc = counter.setCounterToBalance( "post".to_string(), - sell_token.address().into_alloy(), + *sell_token.address(), trader.address().into_alloy(), ); let post_hook = Hook { @@ -486,7 +490,7 @@ async fn partial_fills(web3: Web3) { tracing::info!("Placing order"); let order = OrderCreation { - sell_token: sell_token.address(), + sell_token: sell_token.address().into_legacy(), sell_amount: to_wei(2), buy_token: token.address().into_legacy(), buy_amount: to_wei(1), @@ -517,60 +521,46 @@ async fn partial_fills(web3: Web3) { tracing::info!("Waiting for first trade."); let trade_happened = || async { sell_token - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap() - == 0.into() + .is_zero() }; wait_for_condition(TIMEOUT, trade_happened).await.unwrap(); assert_eq!( - counter - .counters("pre".to_string()) - .call() - .await - .unwrap() - .into_legacy(), + counter.counters("pre".to_string()).call().await.unwrap(), balance_before_first_trade ); let post_balance_after_first_trade = sell_token - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); assert_eq!( - counter - .counters("post".to_string()) - .call() - .await - .unwrap() - .into_legacy(), + counter.counters("post".to_string()).call().await.unwrap(), post_balance_after_first_trade ); tracing::info!("Fund remaining sell balance."); - tx_value!(trader.account(), to_wei(1), sell_token.deposit()); + sell_token + .deposit() + .from(trader.address().into_alloy()) + .value(eth(1)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Waiting for second trade."); wait_for_condition(TIMEOUT, trade_happened).await.unwrap(); assert_eq!( - counter - .counters("pre".to_string()) - .call() - .await - .unwrap() - .into_legacy(), + counter.counters("pre".to_string()).call().await.unwrap(), balance_before_first_trade ); assert_eq!( - counter - .counters("post".to_string()) - .call() - .await - .unwrap() - .into_legacy(), + counter.counters("post".to_string()).call().await.unwrap(), sell_token - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap() @@ -661,7 +651,7 @@ async fn quote_verification(web3: Web3) { .submit_quote(&OrderQuoteRequest { from: trader.address(), sell_token: token.address().into_legacy(), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: NonZeroU256::try_from(to_wei(5)).unwrap(), diff --git a/crates/e2e/tests/e2e/jit_orders.rs b/crates/e2e/tests/e2e/jit_orders.rs index 91e1b28c44..f6e01f473e 100644 --- a/crates/e2e/tests/e2e/jit_orders.rs +++ b/crates/e2e/tests/e2e/jit_orders.rs @@ -1,10 +1,6 @@ use { - e2e::{ - setup::{colocation::SolverEngine, eth, mock::Mock, solution::JitOrder, *}, - tx, - tx_value, - }, - ethcontract::prelude::U256, + ::alloy::primitives::U256, + e2e::setup::{colocation::SolverEngine, eth, mock::Mock, solution::JitOrder, *}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -37,24 +33,27 @@ async fn single_limit_order_test(web3: Web3) { token.mint(solver.address(), to_wei(100)).await; - tx_value!( - trader.account(), - to_wei(20), - onchain.contracts().weth.deposit() - ); - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, U256::MAX) - ); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(20)) + .send_and_watch() + .await + .unwrap(); + + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), U256::MAX) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); token - .approve( - onchain.contracts().allowance.into_alloy(), - ::alloy::primitives::U256::MAX, - ) + .approve(onchain.contracts().allowance.into_alloy(), U256::MAX) .from(solver.address().into_alloy()) .send_and_watch() .await @@ -71,7 +70,7 @@ async fn single_limit_order_test(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -112,7 +111,7 @@ async fn single_limit_order_test(web3: Web3) { // Place order let order = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: to_wei(10), buy_token: token.address().into_legacy(), buy_amount: to_wei(5), @@ -149,7 +148,7 @@ async fn single_limit_order_test(web3: Web3) { }, buy: Asset { amount: to_wei(1), - token: onchain.contracts().weth.address(), + token: onchain.contracts().weth.address().into_legacy(), }, kind: OrderKind::Sell, partially_fillable: false, @@ -167,7 +166,7 @@ async fn single_limit_order_test(web3: Web3) { id: 0, prices: HashMap::from([ (token.address().into_legacy(), to_wei(1)), - (onchain.contracts().weth.address(), to_wei(1)), + (onchain.contracts().weth.address().into_legacy(), to_wei(1)), ]), trades: vec![ solvers_dto::solution::Trade::Jit(solvers_dto::solution::JitTrade { diff --git a/crates/e2e/tests/e2e/limit_orders.rs b/crates/e2e/tests/e2e/limit_orders.rs index f0bc3f89d8..c6ff3a627c 100644 --- a/crates/e2e/tests/e2e/limit_orders.rs +++ b/crates/e2e/tests/e2e/limit_orders.rs @@ -421,7 +421,7 @@ async fn two_limit_orders_multiple_winners_test(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver_a.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![base_a.address().into_legacy()], 2, false, @@ -430,7 +430,7 @@ async fn two_limit_orders_multiple_winners_test(web3: Web3) { colocation::start_baseline_solver( "solver2".into(), solver_b.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![base_b.address().into_legacy()], 2, false, @@ -640,7 +640,7 @@ async fn too_many_limit_orders_test(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver, - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -660,7 +660,7 @@ async fn too_many_limit_orders_test(web3: Web3) { let order = OrderCreation { sell_token: token_a.address().into_legacy(), sell_amount: to_wei(1), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(1), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -678,7 +678,7 @@ async fn too_many_limit_orders_test(web3: Web3) { let order = OrderCreation { sell_token: token_a.address().into_legacy(), sell_amount: to_wei(1), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(2), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -722,7 +722,7 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver, - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -742,7 +742,7 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { let quote_request = OrderQuoteRequest { from: trader.address(), sell_token: token.address().into_legacy(), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: NonZeroU256::try_from(to_wei(5)).unwrap(), @@ -756,7 +756,7 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { let order = OrderCreation { sell_token: token.address().into_legacy(), sell_amount: quote.quote.sell_amount, - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: quote.quote.buy_amount.saturating_sub(to_wei(4)), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -773,7 +773,7 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { let order = OrderCreation { sell_token: token.address().into_legacy(), sell_amount: to_wei(1), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(3), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -792,7 +792,7 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { let order = OrderCreation { sell_token: token.address().into_legacy(), sell_amount: quote.quote.sell_amount, - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: quote.quote.buy_amount.saturating_sub(to_wei(2)), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -809,7 +809,7 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { let order = OrderCreation { sell_token: token.address().into_legacy(), sell_amount: to_wei(1), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(2), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -1085,7 +1085,7 @@ async fn no_liquidity_limit_order(web3: Web3) { let mut order = OrderCreation { sell_token: token_a.address().into_legacy(), sell_amount: to_wei(10), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(1), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -1115,7 +1115,7 @@ async fn no_liquidity_limit_order(web3: Web3) { let balance_before = onchain .contracts() .weth - .balance_of(trader_a.address()) + .balanceOf(trader_a.address().into_alloy()) .call() .await .unwrap(); @@ -1153,15 +1153,15 @@ async fn no_liquidity_limit_order(web3: Web3) { max_volume_factor: 0.01 } ); - assert_eq!(fee.token, onchain.contracts().weth.address()); + assert_eq!(fee.token, onchain.contracts().weth.address().into_legacy()); assert!(fee.amount > 0.into()); let balance_after = onchain .contracts() .weth - .balance_of(trader_a.address()) + .balanceOf(trader_a.address().into_alloy()) .call() .await .unwrap(); - assert!(balance_after.checked_sub(balance_before).unwrap() >= to_wei(5)); + assert!(balance_after.checked_sub(balance_before).unwrap() >= eth(5)); } diff --git a/crates/e2e/tests/e2e/liquidity.rs b/crates/e2e/tests/e2e/liquidity.rs index d7fcbcd584..0a5e547850 100644 --- a/crates/e2e/tests/e2e/liquidity.rs +++ b/crates/e2e/tests/e2e/liquidity.rs @@ -134,7 +134,7 @@ async fn zero_ex_liquidity(web3: Web3) { zeroex_maker.clone(), zeroex.address().into_legacy(), chain_id, - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), ); let zeroex_api_port = ZeroExApi::new(zeroex_liquidity_orders.to_vec()).run().await; @@ -146,7 +146,7 @@ async fn zero_ex_liquidity(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index a66e63a760..2e4407be04 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -151,7 +151,7 @@ async fn liquidity_source_notification(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, diff --git a/crates/e2e/tests/e2e/order_cancellation.rs b/crates/e2e/tests/e2e/order_cancellation.rs index ac4eec3c10..c73e76a815 100644 --- a/crates/e2e/tests/e2e/order_cancellation.rs +++ b/crates/e2e/tests/e2e/order_cancellation.rs @@ -59,7 +59,7 @@ async fn order_cancellation(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver, - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -94,7 +94,7 @@ async fn order_cancellation(web3: Web3) { let request = OrderQuoteRequest { from: trader.address(), sell_token: token.address().into_legacy(), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::AfterFee { value: NonZeroU256::try_from(to_wei(1)).unwrap(), diff --git a/crates/e2e/tests/e2e/partial_fill.rs b/crates/e2e/tests/e2e/partial_fill.rs index 4442bc8a7e..23f3c79522 100644 --- a/crates/e2e/tests/e2e/partial_fill.rs +++ b/crates/e2e/tests/e2e/partial_fill.rs @@ -1,7 +1,10 @@ use { ::alloy::primitives::U256, - e2e::{setup::*, tx, tx_value}, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + e2e::setup::*, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::{ order::{OrderCreation, OrderKind}, signature::{EcdsaSigningScheme, Signature, SigningScheme}, @@ -29,18 +32,23 @@ async fn test(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(10), to_wei(10)) .await; - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(4)) - ); - tx_value!( - trader.account(), - to_wei(4), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(4)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(4)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -54,7 +62,7 @@ async fn test(web3: Web3) { .unwrap(); assert_eq!(balance, U256::ZERO); let order = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: to_wei(4), buy_token: token.address().into_legacy(), buy_amount: to_wei(3), @@ -88,7 +96,7 @@ async fn test(web3: Web3) { let sell_balance = onchain .contracts() .weth - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); diff --git a/crates/e2e/tests/e2e/place_order_with_quote.rs b/crates/e2e/tests/e2e/place_order_with_quote.rs index 2290629bbb..ab8ad8ade6 100644 --- a/crates/e2e/tests/e2e/place_order_with_quote.rs +++ b/crates/e2e/tests/e2e/place_order_with_quote.rs @@ -1,8 +1,11 @@ use { ::alloy::primitives::U256, driver::domain::eth::NonZeroU256, - e2e::{nodes::local_node::TestNodeApi, setup::*, tx, tx_value}, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + e2e::{nodes::local_node::TestNodeApi, setup::*}, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::{ order::{OrderCreation, OrderKind}, quote::{OrderQuoteRequest, OrderQuoteSide, SellAmount}, @@ -29,18 +32,23 @@ async fn place_order_with_quote(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(3)) - ); - tx_value!( - trader.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -56,7 +64,7 @@ async fn place_order_with_quote(web3: Web3) { let quote_sell_amount = to_wei(1); let quote_request = OrderQuoteRequest { from: trader.address(), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { @@ -84,7 +92,7 @@ async fn place_order_with_quote(web3: Web3) { assert_eq!(balance, U256::ZERO); let order = OrderCreation { quote_id: quote_response.id, - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: quote_sell_amount, buy_token: token.address().into_legacy(), buy_amount: quote_response.quote.buy_amount, diff --git a/crates/e2e/tests/e2e/protocol_fee.rs b/crates/e2e/tests/e2e/protocol_fee.rs index 033ebd8db2..ea4142c344 100644 --- a/crates/e2e/tests/e2e/protocol_fee.rs +++ b/crates/e2e/tests/e2e/protocol_fee.rs @@ -3,8 +3,6 @@ use { e2e::{ assert_approximately_eq, setup::{eth, fee::*, *}, - tx, - tx_value, }, ethcontract::{Address, prelude::U256}, ethrpc::alloy::{ @@ -110,29 +108,31 @@ async fn combined_protocol_fees(web3: Web3) { .unwrap(); } - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(100)) - ); - tx_value!( - trader.account(), - to_wei(100), - onchain.contracts().weth.deposit() - ); - tx!( - solver.account(), - onchain.contracts().weth.approve( - onchain - .contracts() - .uniswap_v2_router - .address() - .into_legacy(), - to_wei(200) - ) - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(100)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(100)) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .approve(*onchain.contracts().uniswap_v2_router.address(), eth(200)) + .from(solver.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let autopilot_config = vec![ ProtocolFeesConfig(vec![limit_surplus_policy, market_price_improvement_policy]).to_string(), @@ -162,7 +162,7 @@ async fn combined_protocol_fees(web3: Web3) { .map(|token| { get_quote( &services, - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), token.address().into_legacy(), OrderKind::Sell, sell_amount, @@ -227,7 +227,7 @@ async fn combined_protocol_fees(web3: Web3) { onchain.mint_block().await; let new_market_order_quote = get_quote( &services, - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), market_order_token.address().into_legacy(), OrderKind::Sell, sell_amount, @@ -256,7 +256,7 @@ async fn combined_protocol_fees(web3: Web3) { .map(|token| { get_quote( &services, - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), token.address().into_legacy(), OrderKind::Sell, sell_amount, @@ -442,29 +442,31 @@ async fn surplus_partner_fee(web3: Web3) { .send_and_watch() .await .unwrap(); - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(100)) - ); - tx_value!( - trader.account(), - to_wei(100), - onchain.contracts().weth.deposit() - ); - tx!( - solver.account(), - onchain.contracts().weth.approve( - onchain - .contracts() - .uniswap_v2_router - .address() - .into_legacy(), - to_wei(200) - ) - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(100)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(100)) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .approve(*onchain.contracts().uniswap_v2_router.address(), eth(200)) + .from(solver.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let services = Services::new(&onchain).await; services @@ -481,7 +483,7 @@ async fn surplus_partner_fee(web3: Web3) { let order = OrderCreation { sell_amount: to_wei(10), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), // just set any low amount since it doesn't matter for this test buy_amount: to_wei(1), buy_token: token.address().into_legacy(), diff --git a/crates/e2e/tests/e2e/quote_verification.rs b/crates/e2e/tests/e2e/quote_verification.rs index f1fae1b7a5..19c394429a 100644 --- a/crates/e2e/tests/e2e/quote_verification.rs +++ b/crates/e2e/tests/e2e/quote_verification.rs @@ -1,7 +1,7 @@ use { bigdecimal::{BigDecimal, Zero}, e2e::setup::{eth, *}, - ethcontract::{H160, U256}, + ethcontract::H160, ethrpc::{ Web3, alloy::{ @@ -110,7 +110,7 @@ async fn standard_verified_quote(web3: Web3) { .submit_quote(&OrderQuoteRequest { from: trader.address(), sell_token: token.address().into_legacy(), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: to_wei(1).try_into().unwrap(), @@ -148,7 +148,7 @@ async fn test_bypass_verification_for_rfq_quotes(web3: Web3) { Arc::new(BalanceOverrides::default()), block_stream, onchain.contracts().gp_settlement.address(), - onchain.contracts().weth.address(), + onchain.contracts().weth.address().into_legacy(), BigDecimal::zero(), Default::default(), ) @@ -246,20 +246,27 @@ async fn verified_quote_eth_balance(web3: Web3) { // quote where the trader has no WETH balances or approval set, but // sufficient ETH for the trade - assert_eq!( - ( - weth.balance_of(trader.address()).call().await.unwrap(), - weth.allowance(trader.address(), onchain.contracts().allowance) - .call() - .await - .unwrap(), - ), - (U256::zero(), U256::zero()), + assert!( + weth.balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap() + .is_zero() + ); + assert!( + weth.allowance( + trader.address().into_alloy(), + onchain.contracts().allowance.into_alloy() + ) + .call() + .await + .unwrap() + .is_zero() ); let response = services .submit_quote(&OrderQuoteRequest { from: trader.address(), - sell_token: weth.address(), + sell_token: weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { @@ -296,7 +303,7 @@ async fn verified_quote_for_settlement_contract(web3: Web3) { services.start_protocol(solver.clone()).await; let request = OrderQuoteRequest { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { @@ -409,7 +416,7 @@ async fn verified_quote_with_simulated_balance(web3: Web3) { .submit_quote(&OrderQuoteRequest { from: trader.address(), sell_token: token.address().into_legacy(), - buy_token: weth.address(), + buy_token: weth.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: to_wei(1).try_into().unwrap(), @@ -422,26 +429,36 @@ async fn verified_quote_with_simulated_balance(web3: Web3) { assert!(response.verified); // quote where the trader has no balances or approval set from WETH->TOKEN - assert_eq!( - ( - onchain - .web3() - .eth() - .balance(trader.address(), None) - .await - .unwrap(), - weth.balance_of(trader.address()).call().await.unwrap(), - weth.allowance(trader.address(), onchain.contracts().allowance) - .call() - .await - .unwrap(), - ), - (U256::zero(), U256::zero(), U256::zero()), + assert!( + onchain + .web3() + .eth() + .balance(trader.address(), None) + .await + .unwrap() + .is_zero() + ); + assert!( + weth.balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap() + .is_zero() + ); + assert!( + weth.allowance( + trader.address().into_alloy(), + onchain.contracts().allowance.into_alloy() + ) + .call() + .await + .unwrap() + .is_zero() ); let response = services .submit_quote(&OrderQuoteRequest { from: trader.address(), - sell_token: weth.address(), + sell_token: weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { @@ -459,7 +476,7 @@ async fn verified_quote_with_simulated_balance(web3: Web3) { let response = services .submit_quote(&OrderQuoteRequest { from: H160::zero(), - sell_token: weth.address(), + sell_token: weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { @@ -477,7 +494,7 @@ async fn verified_quote_with_simulated_balance(web3: Web3) { let response = services .submit_quote(&OrderQuoteRequest { from: H160::zero(), - sell_token: weth.address(), + sell_token: weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { diff --git a/crates/e2e/tests/e2e/quoting.rs b/crates/e2e/tests/e2e/quoting.rs index 23c6804fee..6165ad24fa 100644 --- a/crates/e2e/tests/e2e/quoting.rs +++ b/crates/e2e/tests/e2e/quoting.rs @@ -1,9 +1,5 @@ use { - e2e::{ - setup::{colocation::SolverEngine, eth, mock::Mock, *}, - tx, - tx_value, - }, + e2e::setup::{colocation::SolverEngine, eth, mock::Mock, *}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -56,18 +52,23 @@ async fn test(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(3)) - ); - tx_value!( - trader.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -76,7 +77,7 @@ async fn test(web3: Web3) { tracing::info!("Quoting order"); let request = OrderQuoteRequest { from: trader.address(), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { @@ -190,18 +191,23 @@ async fn uses_stale_liquidity(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(1)) - ); - tx_value!( - trader.account(), - to_wei(1), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(1)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(1)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -209,7 +215,7 @@ async fn uses_stale_liquidity(web3: Web3) { let quote = OrderQuoteRequest { from: trader.address(), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::AfterFee { @@ -310,7 +316,7 @@ async fn quote_timeout(web3: Web3) { let quote_request = |timeout| OrderQuoteRequest { from: trader.address(), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token: sell_token.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { diff --git a/crates/e2e/tests/e2e/refunder.rs b/crates/e2e/tests/e2e/refunder.rs index f79a5a6790..8b75cd1811 100644 --- a/crates/e2e/tests/e2e/refunder.rs +++ b/crates/e2e/tests/e2e/refunder.rs @@ -40,7 +40,7 @@ async fn refunder_tx(web3: Web3) { let ethflow_contract = onchain.contracts().ethflows.first().unwrap(); let quote = OrderQuoteRequest { from: ethflow_contract.address().into_legacy(), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token, receiver, validity: Validity::For(3600), @@ -69,7 +69,7 @@ async fn refunder_tx(web3: Web3) { let quote = OrderQuoteRequest { from: ethflow_contract_2.address().into_legacy(), - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), buy_token, receiver, validity: Validity::For(3600), diff --git a/crates/e2e/tests/e2e/smart_contract_orders.rs b/crates/e2e/tests/e2e/smart_contract_orders.rs index 5d44a5bad3..e3f515fd0c 100644 --- a/crates/e2e/tests/e2e/smart_contract_orders.rs +++ b/crates/e2e/tests/e2e/smart_contract_orders.rs @@ -53,7 +53,7 @@ async fn smart_contract_orders(web3: Web3) { kind: OrderKind::Sell, sell_token: token.address().into_legacy(), sell_amount: to_wei(5), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(3), valid_to: model::time::now_in_epoch_seconds() + 300, ..Default::default() @@ -141,12 +141,12 @@ async fn smart_contract_orders(web3: Web3) { let weth_balance = onchain .contracts() .weth - .balance_of(safe.address().into_legacy()) + .balanceOf(safe.address()) .call() .await .expect("Couldn't fetch native token balance"); - token_balance.is_zero() && weth_balance > to_wei(6) + token_balance.is_zero() && weth_balance > eth(6) }) .await .unwrap(); @@ -195,7 +195,7 @@ async fn erc1271_gas_limit(web3: Web3) { let order = OrderCreation { sell_token: cow.address().into_legacy(), sell_amount: to_wei(4), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(3), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, diff --git a/crates/e2e/tests/e2e/solver_competition.rs b/crates/e2e/tests/e2e/solver_competition.rs index 1f20ec3b80..3973d3ef97 100644 --- a/crates/e2e/tests/e2e/solver_competition.rs +++ b/crates/e2e/tests/e2e/solver_competition.rs @@ -63,7 +63,7 @@ async fn solver_competition(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -72,7 +72,7 @@ async fn solver_competition(web3: Web3) { colocation::start_baseline_solver( "solver2".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![], 1, true, @@ -100,7 +100,7 @@ async fn solver_competition(web3: Web3) { let order = OrderCreation { sell_token: token_a.address().into_legacy(), sell_amount: to_wei(10), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(5), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -203,7 +203,7 @@ async fn wrong_solution_submission_address(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![base_a.address().into_legacy()], 1, true, @@ -212,7 +212,7 @@ async fn wrong_solution_submission_address(web3: Web3) { colocation::start_baseline_solver( "solver2".into(), solver.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), vec![base_b.address().into_legacy()], 1, true, @@ -242,7 +242,7 @@ async fn wrong_solution_submission_address(web3: Web3) { let order_a = OrderCreation { sell_token: token_a.address().into_legacy(), sell_amount: to_wei(10), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(5), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -260,7 +260,7 @@ async fn wrong_solution_submission_address(web3: Web3) { let order_b = OrderCreation { sell_token: token_b.address().into_legacy(), sell_amount: to_wei(10), - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(5), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -345,7 +345,7 @@ async fn store_filtered_solutions(web3: Web3) { colocation::start_baseline_solver( "test_solver".into(), good_solver_account.clone(), - onchain.contracts().weth.address(), + *onchain.contracts().weth.address(), base_tokens.clone(), 1, true, diff --git a/crates/e2e/tests/e2e/submission.rs b/crates/e2e/tests/e2e/submission.rs index 17f825c8a0..89416eba00 100644 --- a/crates/e2e/tests/e2e/submission.rs +++ b/crates/e2e/tests/e2e/submission.rs @@ -1,8 +1,11 @@ use { ::alloy::primitives::U256, - e2e::{nodes::local_node::TestNodeApi, setup::*, tx, tx_value}, + e2e::{nodes::local_node::TestNodeApi, setup::*}, ethcontract::{BlockId, H160, H256}, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, futures::{Stream, StreamExt}, model::{ order::{OrderCreation, OrderKind}, @@ -30,18 +33,23 @@ async fn test_cancel_on_expiry(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(3)) - ); - tx_value!( - trader.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -61,7 +69,7 @@ async fn test_cancel_on_expiry(web3: Web3) { .unwrap(); assert_eq!(balance, U256::ZERO); let order = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: to_wei(2), buy_token: token.address().into_legacy(), buy_amount: to_wei(1), diff --git a/crates/e2e/tests/e2e/tracking_insufficient_funds.rs b/crates/e2e/tests/e2e/tracking_insufficient_funds.rs index 0441b914db..e0094a3f90 100644 --- a/crates/e2e/tests/e2e/tracking_insufficient_funds.rs +++ b/crates/e2e/tests/e2e/tracking_insufficient_funds.rs @@ -1,7 +1,10 @@ use { database::order_events::{OrderEvent, OrderEventLabel}, - e2e::{setup::*, tx, tx_value}, - ethrpc::alloy::conversions::IntoLegacy, + e2e::setup::*, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::{ order::{OrderCreation, OrderKind}, signature::EcdsaSigningScheme, @@ -27,30 +30,40 @@ async fn test(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; - tx!( - trader_a.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(3)) - ); - tx_value!( - trader_a.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); - tx!( - trader_b.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(3)) - ); - tx_value!( - trader_b.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader_a.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader_a.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader_b.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader_b.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -58,7 +71,7 @@ async fn test(web3: Web3) { tracing::info!("Placing order"); let order_a = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: to_wei(2), buy_token: token.address().into_legacy(), buy_amount: to_wei(1), @@ -72,7 +85,7 @@ async fn test(web3: Web3) { SecretKeyRef::from(&SecretKey::from_slice(trader_a.private_key()).unwrap()), ); let order_b = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: to_wei(2), buy_token: token.address().into_legacy(), buy_amount: to_wei(1), @@ -89,14 +102,22 @@ async fn test(web3: Web3) { let uid_b = services.create_order(&order_b).await.unwrap(); tracing::info!("Withdrawing WETH to render the order invalid due to insufficient funds"); - tx!( - trader_a.account(), - onchain.contracts().weth.withdraw(to_wei(3)) - ); - tx!( - trader_b.account(), - onchain.contracts().weth.withdraw(to_wei(3)) - ); + onchain + .contracts() + .weth + .withdraw(eth(3)) + .from(trader_a.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .withdraw(eth(3)) + .from(trader_b.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let orders_are_invalid = || async { let events_a = crate::database::events_of_order(services.db(), &uid_a).await; @@ -114,11 +135,15 @@ async fn test(web3: Web3) { // Make sure that the next update is happened and no new Invalid event is // received for the `order_b`. `order_a` is required to track if the next update // is happened. - tx_value!( - trader_a.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .deposit() + .from(trader_a.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); onchain.mint_block().await; let orders_updated = || async { let events_a = crate::database::events_of_order(services.db(), &uid_a).await; @@ -132,11 +157,15 @@ async fn test(web3: Web3) { wait_for_condition(TIMEOUT, orders_updated).await.unwrap(); // Another update should proceed with the order_b. - tx_value!( - trader_b.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .deposit() + .from(trader_b.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); onchain.mint_block().await; let orders_updated = || async { let events_a = crate::database::events_of_order(services.db(), &uid_b).await; diff --git a/crates/e2e/tests/e2e/uncovered_order.rs b/crates/e2e/tests/e2e/uncovered_order.rs index 05c6113a17..97fb964011 100644 --- a/crates/e2e/tests/e2e/uncovered_order.rs +++ b/crates/e2e/tests/e2e/uncovered_order.rs @@ -1,6 +1,9 @@ use { - e2e::{setup::*, tx, tx_value}, - ethrpc::alloy::conversions::IntoLegacy, + e2e::setup::*, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::{ order::{OrderCreation, OrderKind}, signature::EcdsaSigningScheme, @@ -30,10 +33,11 @@ async fn test(web3: Web3) { .await; let weth = &onchain.contracts().weth; - tx!( - trader.account(), - weth.approve(onchain.contracts().allowance, to_wei(3)) - ); + weth.approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -41,7 +45,7 @@ async fn test(web3: Web3) { tracing::info!("Placing order with 0 sell tokens"); let order = OrderCreation { - sell_token: weth.address(), + sell_token: weth.address().into_legacy(), sell_amount: to_wei(2), fee_amount: 0.into(), buy_token: token.address().into_legacy(), @@ -61,17 +65,31 @@ async fn test(web3: Web3) { services.create_order(&order).await.unwrap_err(); tracing::info!("Placing order with 1 wei of sell_tokens"); - tx_value!(trader.account(), 1.into(), weth.deposit()); + weth.deposit() + .from(trader.address().into_alloy()) + .value(::alloy::primitives::U256::ONE) + .send_and_watch() + .await + .unwrap(); // Now that the trader has some funds they are able to create // an order (even if it exceeds their current balance). services.create_order(&order).await.unwrap(); tracing::info!("Deposit ETH to make order executable"); - tx_value!(trader.account(), to_wei(2), weth.deposit()); + weth.deposit() + .from(trader.address().into_alloy()) + .value(eth(2)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Waiting for trade."); wait_for_condition(TIMEOUT, || async { - let balance_after = weth.balance_of(trader.address()).call().await.unwrap(); + let balance_after = weth + .balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap(); !balance_after.is_zero() }) .await diff --git a/crates/e2e/tests/e2e/univ2.rs b/crates/e2e/tests/e2e/univ2.rs index f90e34eeb2..d9f7daa5b6 100644 --- a/crates/e2e/tests/e2e/univ2.rs +++ b/crates/e2e/tests/e2e/univ2.rs @@ -4,9 +4,11 @@ use { e2e::{ setup::{eth, *}, tx, - tx_value, }, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, model::{ order::{OrderCreation, OrderKind}, signature::EcdsaSigningScheme, @@ -32,18 +34,23 @@ async fn test(web3: Web3) { .deploy_tokens_with_weth_uni_v2_pools(to_wei(1_000), to_wei(1_000)) .await; - tx!( - trader.account(), - onchain - .contracts() - .weth - .approve(onchain.contracts().allowance, to_wei(3)) - ); - tx_value!( - trader.account(), - to_wei(3), - onchain.contracts().weth.deposit() - ); + onchain + .contracts() + .weth + .approve(onchain.contracts().allowance.into_alloy(), eth(3)) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + onchain + .contracts() + .weth + .deposit() + .from(trader.address().into_alloy()) + .value(eth(3)) + .send_and_watch() + .await + .unwrap(); tracing::info!("Starting services."); let services = Services::new(&onchain).await; @@ -57,7 +64,7 @@ async fn test(web3: Web3) { .unwrap(); assert_eq!(balance, U256::ZERO); let order = OrderCreation { - sell_token: onchain.contracts().weth.address(), + sell_token: onchain.contracts().weth.address().into_legacy(), sell_amount: to_wei(2), buy_token: token.address().into_legacy(), buy_amount: to_wei(1), diff --git a/crates/e2e/tests/e2e/vault_balances.rs b/crates/e2e/tests/e2e/vault_balances.rs index 780efc2c8b..5491410586 100644 --- a/crates/e2e/tests/e2e/vault_balances.rs +++ b/crates/e2e/tests/e2e/vault_balances.rs @@ -60,7 +60,7 @@ async fn vault_balances(web3: Web3) { sell_token: token.address().into_legacy(), sell_amount: to_wei(10), sell_token_balance: SellTokenSource::External, - buy_token: onchain.contracts().weth.address(), + buy_token: onchain.contracts().weth.address().into_legacy(), buy_amount: to_wei(8), valid_to: model::time::now_in_epoch_seconds() + 300, ..Default::default() @@ -75,7 +75,7 @@ async fn vault_balances(web3: Web3) { let balance_before = onchain .contracts() .weth - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); @@ -92,12 +92,12 @@ async fn vault_balances(web3: Web3) { let weth_balance_after = onchain .contracts() .weth - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); - token_balance.is_zero() && weth_balance_after.saturating_sub(balance_before) >= to_wei(8) + token_balance.is_zero() && weth_balance_after.saturating_sub(balance_before) >= eth(8) }) .await .unwrap(); diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index ffcf61b01d..dd5ccf3718 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -14,13 +14,13 @@ use { clap::Parser, contracts::{ GPv2Settlement, - WETH9, alloy::{ BalancerV2Vault, ChainalysisOracle, HooksTrampoline, IUniswapV3Factory, InstanceExt, + WETH9, support::Balances, }, }, @@ -129,8 +129,8 @@ pub async fn run(args: Arguments) { .expect("load signatures contract"), }; let native_token = match args.shared.native_token_address { - Some(address) => contracts::WETH9::with_deployment_info(&web3, address, None), - None => WETH9::deployed(&web3) + Some(address) => WETH9::Instance::new(address, web3.alloy.clone()), + None => WETH9::Instance::deployed(&web3.alloy) .await .expect("load native token contract"), }; @@ -228,7 +228,7 @@ pub async fn run(args: Arguments) { .await; let base_tokens = Arc::new(BaseTokens::new( - native_token.address(), + native_token.address().into_legacy(), &args.shared.base_tokens, )); let mut allowed_tokens = args.allowed_tokens.clone(); @@ -302,7 +302,7 @@ pub async fn run(args: Arguments) { web3: web3.clone(), simulation_web3, chain, - native_token: native_token.address(), + native_token: native_token.address().into_legacy(), settlement: settlement_contract.address(), authenticator: settlement_contract .authenticator() diff --git a/crates/shared/src/arguments.rs b/crates/shared/src/arguments.rs index b951635376..ac8fa00b8b 100644 --- a/crates/shared/src/arguments.rs +++ b/crates/shared/src/arguments.rs @@ -261,7 +261,7 @@ pub struct Arguments { /// Override address of the settlement contract. #[clap(long, env)] - pub native_token_address: Option, + pub native_token_address: Option
, /// Override the address of the `HooksTrampoline` contract used for /// trampolining custom order interactions. If not specified, the default diff --git a/crates/shared/src/order_validation.rs b/crates/shared/src/order_validation.rs index fa0c8fae10..ff567c338b 100644 --- a/crates/shared/src/order_validation.rs +++ b/crates/shared/src/order_validation.rs @@ -18,10 +18,11 @@ use { signature_validator::{SignatureCheck, SignatureValidating, SignatureValidationError}, trade_finding, }, + alloy::primitives::Address, anyhow::{Result, anyhow}, app_data::{AppDataHash, Hook, Hooks, ValidatedAppData, Validator}, async_trait::async_trait, - contracts::{WETH9, alloy::HooksTrampoline}, + contracts::alloy::{HooksTrampoline, WETH9}, ethcontract::{H160, H256, U256}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::{ @@ -217,7 +218,7 @@ pub trait LimitOrderCounting: Send + Sync { pub struct OrderValidator { /// For Pre/Partial-Validation: performed during fee & quote phase /// when only part of the order data is available - native_token: WETH9, + native_token: WETH9::Instance, banned_users: Arc, validity_configuration: OrderValidPeriodConfiguration, eip1271_skip_creation_validation: bool, @@ -289,7 +290,7 @@ pub struct OrderAppData { impl OrderValidator { #[expect(clippy::too_many_arguments)] pub fn new( - native_token: WETH9, + native_token: WETH9::Instance, banned_users: Arc, validity_configuration: OrderValidPeriodConfiguration, eip1271_skip_creation_validation: bool, @@ -484,7 +485,7 @@ impl OrderValidating for OrderValidator { self.validity_configuration.validate_period(&order)?; - if has_same_buy_and_sell_token(&order, &self.native_token) { + if has_same_buy_and_sell_token(&order, self.native_token.address()) { return Err(PartialValidationError::SameBuyAndSellToken); } if order.sell_token == BUY_ETH_ADDRESS { @@ -854,9 +855,9 @@ pub enum OrderValidToError { /// Returns true if the orders have same buy and sell tokens. /// /// This also checks for orders selling wrapped native token for native token. -fn has_same_buy_and_sell_token(order: &PreOrderData, native_token: &WETH9) -> bool { +fn has_same_buy_and_sell_token(order: &PreOrderData, native_token: &Address) -> bool { order.sell_token == order.buy_token - || (order.sell_token == native_token.address() && order.buy_token == BUY_ETH_ADDRESS) + || (order.sell_token == native_token.into_legacy() && order.buy_token == BUY_ETH_ADDRESS) } /// Retrieves the quote for an order that is being created and verify that its @@ -1022,7 +1023,6 @@ mod tests { primitives::{Address, U160, address}, providers::{Provider, ProviderBuilder, mock::Asserter}, }, - contracts::dummy_contract, ethcontract::web3::signing::SecretKeyRef, futures::FutureExt, maplit::hashset, @@ -1038,7 +1038,7 @@ mod tests { #[test] fn detects_orders_with_same_buy_and_sell_token() { - let native_token = dummy_contract!(WETH9, [0xef; 20]); + let native_token = [0xef; 20].into(); assert!(has_same_buy_and_sell_token( &PreOrderData { sell_token: H160([0x01; 20]), @@ -1049,7 +1049,7 @@ mod tests { )); assert!(has_same_buy_and_sell_token( &PreOrderData { - sell_token: native_token.address(), + sell_token: native_token.into_legacy(), buy_token: BUY_ETH_ADDRESS, ..Default::default() }, @@ -1069,7 +1069,7 @@ mod tests { assert!(!has_same_buy_and_sell_token( &PreOrderData { sell_token: BUY_ETH_ADDRESS, - buy_token: native_token.address(), + buy_token: native_token.into_legacy(), ..Default::default() }, &native_token, @@ -1078,7 +1078,7 @@ mod tests { #[tokio::test] async fn pre_validate_err() { - let native_token = dummy_contract!(WETH9, [0xef; 20]); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validity_configuration = OrderValidPeriodConfiguration { min: Duration::from_secs(1), max_market: Duration::from_secs(100), @@ -1241,8 +1241,9 @@ mod tests { let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), validity_configuration, false, @@ -1341,8 +1342,9 @@ mod tests { let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration { min: Duration::from_secs(1), @@ -1551,8 +1553,9 @@ mod tests { .expect_count() .returning(|_| Ok(MAX_LIMIT_ORDERS_PER_USER)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration { min: Duration::from_secs(1), @@ -1631,8 +1634,9 @@ mod tests { .expect_count() .returning(|_| Ok(MAX_LIMIT_ORDERS_PER_USER)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -1694,8 +1698,9 @@ mod tests { .returning(|_, _| Ok(())); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -1750,8 +1755,9 @@ mod tests { .returning(|_, _| Ok(())); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -1809,8 +1815,9 @@ mod tests { .returning(|_, _| Ok(())); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -1871,8 +1878,9 @@ mod tests { .returning(|_, _| Err(TransferSimulationError::InsufficientBalance)); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -1932,8 +1940,9 @@ mod tests { .returning(|_| Err(SignatureValidationError::Invalid)); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -2000,8 +2009,9 @@ mod tests { .returning(move |_, _| Err(create_error())); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -2090,8 +2100,9 @@ mod tests { .returning(|_, _| Err(TransferSimulationError::InsufficientBalance)); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration::any(), false, @@ -2500,9 +2511,9 @@ mod tests { .returning(|_| Ok(default_verification_gas_limit())); let mut limit_order_counter = MockLimitOrderCounting::new(); limit_order_counter.expect_count().returning(|_| Ok(0u64)); - + let native_token = WETH9::Instance::new([0xef; 20].into(), ethrpc::mock::web3().alloy); let validator = OrderValidator::new( - dummy_contract!(WETH9, [0xef; 20]), + native_token, Arc::new(order_validation::banned::Users::none()), OrderValidPeriodConfiguration { min: Duration::from_secs(1), diff --git a/crates/shared/src/price_estimation/factory.rs b/crates/shared/src/price_estimation/factory.rs index 04382217fc..40c8ee8400 100644 --- a/crates/shared/src/price_estimation/factory.rs +++ b/crates/shared/src/price_estimation/factory.rs @@ -28,8 +28,9 @@ use { token_info::TokenInfoFetching, }, anyhow::{Context as _, Result}, + contracts::alloy::WETH9, ethcontract::H160, - ethrpc::block_stream::CurrentBlockWatcher, + ethrpc::{alloy::conversions::IntoLegacy, block_stream::CurrentBlockWatcher}, gas_estimation::GasPriceEstimating, number::nonzero::U256 as NonZeroU256, rate_limit::RateLimiter, @@ -184,7 +185,7 @@ impl<'a> PriceEstimatorFactory<'a> { async fn create_native_estimator( &mut self, source: &NativePriceEstimatorSource, - weth: &contracts::WETH9, + weth: &WETH9::Instance, ) -> Result<(String, Arc)> { match source { NativePriceEstimatorSource::Driver(driver) => { @@ -227,7 +228,7 @@ impl<'a> PriceEstimatorFactory<'a> { self.args.coin_gecko.coin_gecko_url.clone(), self.args.coin_gecko.coin_gecko_api_key.clone(), &self.network.chain, - weth.address(), + weth.address().into_legacy(), self.components.tokens.clone(), ) .await?; @@ -340,7 +341,7 @@ impl<'a> PriceEstimatorFactory<'a> { &mut self, native: &[Vec], results_required: NonZeroUsize, - weth: contracts::WETH9, + weth: WETH9::Instance, ) -> Result> { anyhow::ensure!( self.args.native_price_cache_max_age > self.args.native_price_prefetch_time, diff --git a/crates/shared/src/price_estimation/trade_verifier/mod.rs b/crates/shared/src/price_estimation/trade_verifier/mod.rs index dcc7e79f29..70c44da2a0 100644 --- a/crates/shared/src/price_estimation/trade_verifier/mod.rs +++ b/crates/shared/src/price_estimation/trade_verifier/mod.rs @@ -22,9 +22,10 @@ use { bigdecimal::BigDecimal, contracts::{ GPv2Settlement, - WETH9, - alloy::support::{AnyoneAuthenticator, Solver, Spardose, Trader}, - dummy_contract, + alloy::{ + WETH9, + support::{AnyoneAuthenticator, Solver, Spardose, Trader}, + }, }, ethcontract::{Bytes, H160, U256, state_overrides::StateOverride}, ethrpc::{ @@ -497,15 +498,16 @@ fn encode_settlement( OrderKind::Sell => *out_amount, OrderKind::Buy => query.in_amount.get(), }; - let weth = dummy_contract!(WETH9, native_token); - let calldata = weth - .methods() - .withdraw(buy_amount) - .tx - .data - .expect("data gets populated by function call above") - .0; - trade_interactions.push((native_token, 0.into(), Bytes(calldata))); + trade_interactions.push(( + native_token, + 0.into(), + Bytes( + WETH9::WETH9::withdrawCall { + wad: buy_amount.into_alloy(), + } + .abi_encode(), + ), + )); tracing::trace!("adding unwrap interaction for paying out ETH"); } diff --git a/crates/solver/Cargo.toml b/crates/solver/Cargo.toml index fc2b29d4dd..0f6e8d6f23 100644 --- a/crates/solver/Cargo.toml +++ b/crates/solver/Cargo.toml @@ -43,6 +43,7 @@ tokio = { workspace = true, features = ["test-util"] } testlib = { workspace = true } mockall = { workspace = true } shared = { workspace = true, features = ["test-util"] } +ethrpc = {workspace = true, features = ["test-util"]} [lints] workspace = true diff --git a/crates/solver/src/interactions/weth.rs b/crates/solver/src/interactions/weth.rs index 2fdd539254..57f04d99b4 100644 --- a/crates/solver/src/interactions/weth.rs +++ b/crates/solver/src/interactions/weth.rs @@ -1,14 +1,15 @@ use { + alloy::primitives::U256, anyhow::{Result, ensure}, - contracts::WETH9, + contracts::alloy::WETH9, ethcontract::Bytes, - primitive_types::U256, + ethrpc::alloy::conversions::IntoLegacy, shared::interaction::{EncodedInteraction, Interaction}, }; #[derive(Clone, Debug)] pub struct UnwrapWethInteraction { - pub weth: WETH9, + pub weth: WETH9::Instance, pub amount: U256, } @@ -33,19 +34,21 @@ impl UnwrapWethInteraction { impl Interaction for UnwrapWethInteraction { fn encode(&self) -> EncodedInteraction { - let method = self.weth.withdraw(self.amount); - let calldata = method.tx.data.expect("no calldata").0; - (self.weth.address(), 0.into(), Bytes(calldata)) + ( + self.weth.address().into_legacy(), + 0.into(), + Bytes(self.weth.withdraw(self.amount).calldata().to_vec()), + ) } } #[cfg(test)] mod tests { - use {super::*, contracts::dummy_contract, hex_literal::hex}; + use {super::*, hex_literal::hex}; #[test] fn encode_unwrap_weth() { - let weth = dummy_contract!(WETH9, [0x42; 20]); + let weth = WETH9::Instance::new([0x42; 20].into(), ethrpc::mock::web3().alloy); let amount = U256::from(13_370_000_000_000_000_000u128); let interaction = UnwrapWethInteraction { weth: weth.clone(), @@ -53,55 +56,55 @@ mod tests { }; let withdraw_call = interaction.encode(); - assert_eq!(withdraw_call.0, weth.address()); - assert_eq!(withdraw_call.1, U256::from(0)); + assert_eq!(withdraw_call.0, weth.address().into_legacy()); + assert_eq!(withdraw_call.1, U256::ZERO.into_legacy()); let call = &withdraw_call.2.0; assert_eq!(call.len(), 36); let withdraw_signature = hex!("2e1a7d4d"); assert_eq!(call[0..4], withdraw_signature); - assert_eq!(U256::from_big_endian(&call[4..36]), amount); + assert_eq!(U256::from_be_slice(&call[4..36]), amount); } #[test] fn merge_same_native_token() { let mut unwrap0 = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: 1.into(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: U256::ONE, }; let unwrap1 = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: 2.into(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: U256::from(2), }; assert!(unwrap0.merge(&unwrap1).is_ok()); - assert_eq!(unwrap0.amount, 3.into()); + assert_eq!(unwrap0.amount, U256::from(3)); } #[test] fn merge_different_native_token() { let mut unwrap0 = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: 1.into(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: U256::ONE, }; let unwrap1 = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x02; 20]), - amount: 2.into(), + weth: WETH9::Instance::new([0x02; 20].into(), ethrpc::mock::web3().alloy), + amount: U256::from(2), }; assert!(unwrap0.merge(&unwrap1).is_err()); - assert_eq!(unwrap0.amount, 1.into()); + assert_eq!(unwrap0.amount, U256::ONE); } #[test] #[should_panic] fn merge_u256_overflow() { let mut unwrap0 = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: 1.into(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: U256::ONE, }; let unwrap1 = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: U256::max_value(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: U256::MAX, }; let _ = unwrap0.merge(&unwrap1); diff --git a/crates/solver/src/liquidity/mod.rs b/crates/solver/src/liquidity/mod.rs index b2ec32fb38..d158a6d477 100644 --- a/crates/solver/src/liquidity/mod.rs +++ b/crates/solver/src/liquidity/mod.rs @@ -1,5 +1,4 @@ pub mod balancer_v2; -pub mod order_converter; pub mod slippage; pub mod uniswap_v2; pub mod uniswap_v3; @@ -192,15 +191,6 @@ impl Settleable for LimitOrder { } } -#[cfg(test)] -impl From for LimitOrder { - fn from(order: Order) -> Self { - order_converter::OrderConverter::test(H160([0x42; 20])) - .normalize_limit_order(BalancedOrder::full(order), true) - .unwrap() - } -} - /// An order processed by `balance_orders`. /// /// To ensure that all orders passed to solvers are settleable we need to diff --git a/crates/solver/src/liquidity/order_converter.rs b/crates/solver/src/liquidity/order_converter.rs deleted file mode 100644 index e25d41e724..0000000000 --- a/crates/solver/src/liquidity/order_converter.rs +++ /dev/null @@ -1,440 +0,0 @@ -use { - super::{ - BalancedOrder, - Exchange, - LimitOrder, - LimitOrderExecution, - LimitOrderId, - LiquidityOrderId, - SettlementHandling, - }, - crate::{interactions::UnwrapWethInteraction, settlement::SettlementEncoder}, - anyhow::{Result, ensure}, - contracts::WETH9, - model::order::{BUY_ETH_ADDRESS, Order, OrderClass}, - std::sync::Arc, -}; - -#[derive(Clone)] -pub struct OrderConverter { - pub native_token: WETH9, -} - -impl OrderConverter { - /// Creates a order converter with the specified WETH9 address for unit - /// testing purposes. - #[cfg(test)] - pub fn test(native_token: ethcontract::H160) -> Self { - Self { - native_token: contracts::dummy_contract!(WETH9, native_token), - } - } - - /// Converts a GPv2 order into a `LimitOrder` type liquidity for solvers. - /// - /// The second argument is unused for FOK orders. - pub fn normalize_limit_order( - &self, - BalancedOrder { - order, - available_sell_token_balance, - }: BalancedOrder, - manage_native_token_unwraps: bool, - ) -> Result { - let buy_token = if order.data.buy_token == BUY_ETH_ADDRESS { - self.native_token.address() - } else { - order.data.buy_token - }; - - let remaining = shared::remaining_amounts::Remaining::from_order_with_balance( - &(&order).into(), - available_sell_token_balance, - )?; - - let sell_amount = order.data.sell_amount; - - let id = match order.metadata.class { - OrderClass::Market => LimitOrderId::Market(order.metadata.uid), - OrderClass::Liquidity => { - LimitOrderId::Liquidity(LiquidityOrderId::Protocol(order.metadata.uid)) - } - OrderClass::Limit => LimitOrderId::Limit(order.metadata.uid), - }; - let sell_amount = remaining.remaining(sell_amount)?; - let buy_amount = remaining.remaining(order.data.buy_amount)?; - ensure!( - !sell_amount.is_zero() && !buy_amount.is_zero(), - "order with 0 amounts", - ); - - Ok(LimitOrder { - id, - sell_token: order.data.sell_token, - buy_token, - sell_amount, - buy_amount, - kind: order.data.kind, - partially_fillable: order.data.partially_fillable, - user_fee: remaining.remaining(order.data.fee_amount)?, - settlement_handling: Arc::new(OrderSettlementHandler { - order, - native_token: self.native_token.clone(), - manage_native_token_unwraps, - }), - exchange: Exchange::GnosisProtocol, - }) - } -} - -struct OrderSettlementHandler { - order: Order, - native_token: WETH9, - manage_native_token_unwraps: bool, -} - -impl SettlementHandling for OrderSettlementHandler { - fn as_any(&self) -> &dyn std::any::Any { - self - } - - fn encode( - &self, - execution: LimitOrderExecution, - encoder: &mut SettlementEncoder, - ) -> Result<()> { - let manage_native_token_unwraps = - self.order.data.buy_token == BUY_ETH_ADDRESS && self.manage_native_token_unwraps; - if manage_native_token_unwraps { - encoder.add_token_equivalency(self.native_token.address(), BUY_ETH_ADDRESS)?; - } - - let trade = encoder.add_trade(self.order.clone(), execution.filled, execution.fee)?; - - if manage_native_token_unwraps { - encoder.add_unwrap(UnwrapWethInteraction { - weth: self.native_token.clone(), - amount: trade.buy_amount, - }); - } - - Ok(()) - } -} - -#[cfg(test)] -pub mod tests { - use { - super::*, - crate::settlement::tests::assert_settlement_encoded_with, - contracts::dummy_contract, - ethcontract::H160, - maplit::hashmap, - model::order::{OrderData, OrderKind, OrderMetadata}, - primitive_types::U256, - }; - - #[test] - fn eth_buy_liquidity_is_assigned_to_weth() { - let native_token = H160([0x42; 20]); - let converter = OrderConverter::test(native_token); - let order = Order { - data: OrderData { - buy_token: BUY_ETH_ADDRESS, - sell_amount: 1.into(), - buy_amount: 1.into(), - ..Default::default() - }, - ..Default::default() - }; - - assert_eq!( - converter - .normalize_limit_order(BalancedOrder::full(order), true) - .unwrap() - .buy_token, - native_token, - ); - } - - #[test] - fn non_eth_buy_liquidity_stays_put() { - let buy_token = H160([0x21; 20]); - let converter = OrderConverter::test(H160([0x42; 20])); - let order = Order { - data: OrderData { - buy_token, - sell_amount: 1.into(), - buy_amount: 1.into(), - ..Default::default() - }, - ..Default::default() - }; - - assert_eq!( - converter - .normalize_limit_order(BalancedOrder::full(order), true) - .unwrap() - .buy_token, - buy_token - ); - } - - #[test] - fn adds_unwrap_interaction_for_sell_order_with_eth_flag() { - let native_token_address = H160([0x42; 20]); - let sell_token = H160([0x21; 20]); - let native_token = dummy_contract!(WETH9, native_token_address); - - let execution = LimitOrderExecution::new(1337.into(), 0.into()); - let executed_buy_amount = U256::from(2 * 1337); - let fee = U256::from(1234); - - let prices = hashmap! { - native_token.address() => U256::from(100), - sell_token => U256::from(200), - }; - let order = Order { - data: OrderData { - buy_token: BUY_ETH_ADDRESS, - sell_token, - sell_amount: 1337.into(), - kind: OrderKind::Sell, - ..Default::default() - }, - ..Default::default() - }; - println!("{}", order.data.buy_token); - - let order_settlement_handler = OrderSettlementHandler { - order: order.clone(), - native_token: native_token.clone(), - manage_native_token_unwraps: true, - }; - - assert_settlement_encoded_with( - prices, - order_settlement_handler, - execution.clone(), - |encoder| { - encoder - .add_token_equivalency(native_token.address(), BUY_ETH_ADDRESS) - .unwrap(); - encoder.add_unwrap(UnwrapWethInteraction { - weth: native_token, - amount: executed_buy_amount, - }); - assert!(encoder.add_trade(order, execution.filled, fee).is_ok()); - }, - ); - } - - #[test] - fn adds_unwrap_interaction_for_buy_order_with_eth_flag() { - for class in [OrderClass::Market, OrderClass::Limit, OrderClass::Liquidity] { - let native_token_address = H160([0x42; 20]); - let sell_token = H160([0x21; 20]); - let native_token = dummy_contract!(WETH9, native_token_address); - let execution = LimitOrderExecution::new(1337.into(), 0.into()); - let prices = hashmap! { - native_token.address() => U256::from(1), - sell_token => U256::from(2), - }; - let order = Order { - data: OrderData { - buy_token: BUY_ETH_ADDRESS, - buy_amount: 1337.into(), - sell_token, - kind: OrderKind::Buy, - ..Default::default() - }, - metadata: OrderMetadata { - class, - ..Default::default() - }, - ..Default::default() - }; - println!("{}", order.data.buy_token); - - let order_settlement_handler = OrderSettlementHandler { - order: order.clone(), - native_token: native_token.clone(), - manage_native_token_unwraps: true, - }; - - assert_settlement_encoded_with( - prices, - order_settlement_handler, - execution.clone(), - |encoder| { - encoder - .add_token_equivalency(native_token.address(), BUY_ETH_ADDRESS) - .unwrap(); - assert!(encoder.add_trade(order, execution.filled, 0.into()).is_ok()); - encoder.add_unwrap(UnwrapWethInteraction { - weth: native_token, - amount: execution.filled, - }); - }, - ); - } - } - - #[test] - fn does_not_add_unwrap_interaction_for_order_without_eth_flag() { - let native_token_address = H160([0x42; 20]); - let sell_token = H160([0x21; 20]); - let native_token = dummy_contract!(WETH9, native_token_address); - let not_buy_eth_address = H160([0xff; 20]); - assert_ne!(not_buy_eth_address, BUY_ETH_ADDRESS); - - let execution = LimitOrderExecution::new(1337.into(), 0.into()); - let prices = hashmap! { - not_buy_eth_address => U256::from(100), - sell_token => U256::from(200), - }; - let order = Order { - data: OrderData { - buy_token: not_buy_eth_address, - buy_amount: 1337.into(), - sell_token, - sell_amount: 1337.into(), - ..Default::default() - }, - ..Default::default() - }; - - let order_settlement_handler = OrderSettlementHandler { - order: order.clone(), - native_token, - manage_native_token_unwraps: true, - }; - - assert_settlement_encoded_with( - prices, - order_settlement_handler, - execution.clone(), - |encoder| { - assert!(encoder.add_trade(order, execution.filled, 0.into()).is_ok()); - }, - ); - } - - #[test] - fn scales_limit_order_amounts_for_partially_filled_orders() { - let converter = OrderConverter::test(H160::default()); - let mut order = Order { - data: OrderData { - sell_amount: 20.into(), - buy_amount: 40.into(), - fee_amount: 60.into(), - kind: OrderKind::Sell, - partially_fillable: true, - ..Default::default() - }, - metadata: OrderMetadata { - executed_sell_amount_before_fees: 10.into(), - ..Default::default() - }, - ..Default::default() - }; - - let order_ = converter - .normalize_limit_order( - BalancedOrder { - order: order.clone(), - available_sell_token_balance: 1000.into(), - }, - true, - ) - .unwrap(); - // Amounts are halved because the order is half executed. - assert_eq!(order_.sell_amount, 10.into()); - assert_eq!(order_.buy_amount, 20.into()); - assert_eq!(order_.user_fee, 30.into()); - - let order_ = converter - .normalize_limit_order( - BalancedOrder { - order: order.clone(), - available_sell_token_balance: 20.into(), - }, - true, - ) - .unwrap(); - // Amounts are quartered because of balance. - assert_eq!(order_.sell_amount, 5.into()); - assert_eq!(order_.buy_amount, 10.into()); - assert_eq!(order_.user_fee, 15.into()); - - order.metadata.executed_sell_amount_before_fees = 0.into(); - let order_ = converter - .normalize_limit_order( - BalancedOrder { - order, - available_sell_token_balance: 20.into(), - }, - true, - ) - .unwrap(); - // Amounts are still quartered because of balance. - assert_eq!(order_.sell_amount, 5.into()); - assert_eq!(order_.buy_amount, 10.into()); - assert_eq!(order_.user_fee, 15.into()); - } - - #[test] - fn limit_orders_scaled_to_zero_amounts_rejected() { - let converter = OrderConverter::test(Default::default()); - - let sell = Order { - data: OrderData { - sell_amount: 100.into(), - buy_amount: 10.into(), - kind: OrderKind::Sell, - partially_fillable: true, - ..Default::default() - }, - ..Default::default() - }; - let mut sell = BalancedOrder { - order: sell, - available_sell_token_balance: 100.into(), - }; - - assert!(converter.normalize_limit_order(sell.clone(), true).is_ok()); - - // Execute the order so that scaling the buy_amount would result in a - // 0 amount. - sell.order.metadata.executed_sell_amount = 99_u32.into(); - sell.order.metadata.executed_sell_amount_before_fees = 99_u32.into(); - sell.order.metadata.executed_buy_amount = 10_u32.into(); - - assert!(converter.normalize_limit_order(sell, true).is_err()); - - let buy = Order { - data: OrderData { - sell_amount: 10.into(), - buy_amount: 100.into(), - kind: OrderKind::Buy, - partially_fillable: true, - ..Default::default() - }, - ..Default::default() - }; - let mut buy = BalancedOrder { - order: buy, - available_sell_token_balance: 10.into(), - }; - - assert!(converter.normalize_limit_order(buy.clone(), true).is_ok()); - - // Execute the order so that scaling the sell_amount would result in a - // 0 amount. - buy.order.metadata.executed_sell_amount = 10_u32.into(); - buy.order.metadata.executed_sell_amount_before_fees = 10_u32.into(); - buy.order.metadata.executed_buy_amount = 99_u32.into(); - - assert!(converter.normalize_limit_order(buy, true).is_err()); - } -} diff --git a/crates/solver/src/settlement/settlement_encoder.rs b/crates/solver/src/settlement/settlement_encoder.rs index b08687bfe6..a77863a1c7 100644 --- a/crates/solver/src/settlement/settlement_encoder.rs +++ b/crates/solver/src/settlement/settlement_encoder.rs @@ -1,7 +1,7 @@ use { super::{Trade, TradeExecution}, crate::interactions::UnwrapWethInteraction, - anyhow::{Context as _, Result, bail, ensure}, + anyhow::{Context as _, Result, ensure}, itertools::Either, model::{ interaction::InteractionData, @@ -362,6 +362,7 @@ impl SettlementEncoder { self.execution_plan.push((interaction, internalizable)); } + #[cfg(test)] pub(crate) fn add_unwrap(&mut self, unwrap: UnwrapWethInteraction) { for existing_unwrap in self.unwraps.iter_mut() { if existing_unwrap.merge(&unwrap).is_ok() { @@ -374,6 +375,7 @@ impl SettlementEncoder { self.unwraps.push(unwrap); } + #[cfg(test)] pub(crate) fn add_token_equivalency(&mut self, token_a: H160, token_b: H160) -> Result<()> { let (new_token, existing_price) = match ( self.clearing_prices.get(&token_a), @@ -388,7 +390,7 @@ impl SettlementEncoder { // have the same price (i.e. are equivalent). return Ok(()); } - (None, None) => bail!("tokens not part of solution for equivalency"), + (None, None) => anyhow::bail!("tokens not part of solution for equivalency"), (Some(price_a), None) => (token_b, *price_a), (None, Some(price_b)) => (token_a, *price_b), }; @@ -581,8 +583,9 @@ pub(crate) fn verify_executed_amount(order: &Order, executed: U256) -> Result<() pub mod tests { use { super::*, - contracts::{WETH9, dummy_contract}, + contracts::alloy::WETH9, ethcontract::Bytes, + ethrpc::alloy::conversions::IntoAlloy, maplit::hashmap, model::order::{Interactions, OrderBuilder, OrderData}, shared::interaction::{EncodedInteraction, Interaction}, @@ -624,16 +627,16 @@ pub mod tests { #[test] fn settlement_merges_unwraps_for_same_token() { - let weth = dummy_contract!(WETH9, [0x42; 20]); + let weth = WETH9::Instance::new([0x42; 20].into(), ethrpc::mock::web3().alloy); let mut encoder = SettlementEncoder::new(HashMap::new()); encoder.add_unwrap(UnwrapWethInteraction { weth: weth.clone(), - amount: 1.into(), + amount: alloy::primitives::U256::ONE, }); encoder.add_unwrap(UnwrapWethInteraction { weth: weth.clone(), - amount: 2.into(), + amount: alloy::primitives::U256::from(2), }); assert_eq!( @@ -642,7 +645,7 @@ pub mod tests { .interactions[1], [UnwrapWethInteraction { weth, - amount: 3.into(), + amount: alloy::primitives::U256::from(3), } .encode()], ); @@ -737,21 +740,24 @@ pub mod tests { fn settlement_encoder_appends_unwraps_for_different_tokens() { let mut encoder = SettlementEncoder::new(HashMap::new()); encoder.add_unwrap(UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: 1.into(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: alloy::primitives::U256::ONE, }); encoder.add_unwrap(UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x02; 20]), - amount: 2.into(), + weth: WETH9::Instance::new([0x02; 20].into(), ethrpc::mock::web3().alloy), + amount: alloy::primitives::U256::from(2), }); assert_eq!( encoder .unwraps .iter() - .map(|unwrap| (unwrap.weth.address().0, unwrap.amount.as_u64())) + .map(|unwrap| (*unwrap.weth.address(), unwrap.amount)) .collect::>(), - vec![([0x01; 20], 1), ([0x02; 20], 2)], + vec![ + ([0x01; 20].into(), alloy::primitives::U256::ONE), + ([0x02; 20].into(), alloy::primitives::U256::from(2)) + ], ); } @@ -759,8 +765,8 @@ pub mod tests { fn settlement_unwraps_after_execution_plan() { let interaction: EncodedInteraction = (H160([0x01; 20]), 0.into(), Bytes(Vec::new())); let unwrap = UnwrapWethInteraction { - weth: dummy_contract!(WETH9, [0x01; 20]), - amount: 1.into(), + weth: WETH9::Instance::new([0x01; 20].into(), ethrpc::mock::web3().alloy), + amount: alloy::primitives::U256::ONE, }; let mut encoder = SettlementEncoder::new(HashMap::new()); @@ -937,10 +943,10 @@ pub mod tests { .build(); encoder.add_trade(order_1_3, 11.into(), 0.into()).unwrap(); - let weth = dummy_contract!(WETH9, token(2)); + let weth = WETH9::Instance::new(token(2).into_alloy(), ethrpc::mock::web3().alloy); encoder.add_unwrap(UnwrapWethInteraction { weth, - amount: 12.into(), + amount: alloy::primitives::U256::from(12), }); let encoded = encoder.finish(InternalizationStrategy::SkipInternalizableInteraction); diff --git a/crates/solvers/src/infra/contracts.rs b/crates/solvers/src/infra/contracts.rs index 4813e5b2e4..0b159ca085 100644 --- a/crates/solvers/src/infra/contracts.rs +++ b/crates/solvers/src/infra/contracts.rs @@ -1,4 +1,9 @@ -use {crate::domain::eth, chain::Chain}; +use { + crate::domain::eth, + chain::Chain, + contracts::alloy::WETH9, + ethrpc::alloy::conversions::IntoLegacy, +}; #[derive(Clone, Debug)] pub struct Contracts { @@ -7,17 +12,12 @@ pub struct Contracts { impl Contracts { pub fn for_chain(chain: Chain) -> Self { - let a = |contract: &contracts::ethcontract::Contract| { - eth::ContractAddress( - contract - .networks - .get(&chain.id().to_string()) - .expect("contract address for all supported chains") - .address, - ) - }; Self { - weth: eth::WethAddress(a(contracts::WETH9::raw_contract()).0), + weth: eth::WethAddress( + WETH9::deployment_address(&chain.id()) + .expect("there should be a contract address for all supported chains") + .into_legacy(), + ), } } } From 43bbc406593e5ab0808ba257d757ac1ecf1dff23 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 28 Oct 2025 16:42:40 +0300 Subject: [PATCH 054/117] Migrate CoW AMM-related SCs to alloy (#3813) # Description Migrates all the CoW AMM-related SCs to alloy with some caveats. The `GPv2Order.Data` has different representation for its type hash and data hash: https://github.com/cowprotocol/contracts/blob/19972cd8fb3f8663846f772190926f36af068a33/src/contracts/libraries/GPv2Order.sol#L9-L48 Basically, for `kind`, `sellTokenBalance`, and `buyTokenBalance` fields, the `byte32` type is used for the `data hash`, while for the `type hash`, these fields are represented as strings, which was done for human readability. Unfortunately, there is no easy way to manipulate ABI JSON in a way that it starts using one struct for type hash and another for data hash, since the full hash struct is just a combination of type and data hashes, so a helper `GPv2OrderEip712` extension was introduced with new functions to calculate the `GPv2Order.Data` hash. ## How to test Existing tests. ## Further implementation Once `GPv2Settlement` SC is migrated to alloy, it makes sense to drop the `GPv2Order` definition from the cow-amm ABI JSON and switch to `GPv2Settlement::GPv2Order` --- Cargo.lock | 2 + crates/autopilot/src/run.rs | 6 +- crates/autopilot/src/solvable_orders.rs | 11 +- crates/contracts/build.rs | 48 -- crates/contracts/src/alloy.rs | 22 + crates/contracts/src/lib.rs | 4 - crates/cow-amm/Cargo.toml | 1 + crates/cow-amm/src/amm.rs | 97 ++-- crates/cow-amm/src/cache.rs | 43 +- crates/cow-amm/src/factory.rs | 34 +- crates/cow-amm/src/lib.rs | 92 +++- crates/cow-amm/src/maintainers.rs | 6 +- crates/cow-amm/src/registry.rs | 15 +- .../src/domain/competition/pre_processing.rs | 18 +- crates/driver/src/domain/cow_amm.rs | 46 +- crates/e2e/Cargo.toml | 1 + crates/e2e/tests/e2e/cow_amm.rs | 429 ++++++++---------- 17 files changed, 439 insertions(+), 436 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6939fab136..14affd5fea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2169,6 +2169,7 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" name = "cow-amm" version = "0.1.0" dependencies = [ + "alloy", "anyhow", "app-data", "async-trait", @@ -2658,6 +2659,7 @@ dependencies = [ "clap", "const-hex", "contracts", + "cow-amm", "database", "driver", "ethcontract", diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index 36a44d31f1..df0d234c9d 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -30,7 +30,7 @@ use { ethcontract::{BlockNumber, H160, common::DeploymentInformation}, ethrpc::{ Web3, - alloy::conversions::IntoLegacy, + alloy::conversions::{IntoAlloy, IntoLegacy}, block_stream::block_number_to_block_number_hash, }, futures::StreamExt, @@ -485,8 +485,8 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { cow_amm_registry .add_listener( config.index_start, - config.factory, - config.helper, + config.factory.into_alloy(), + config.helper.into_alloy(), db_write.pool.clone(), ) .await; diff --git a/crates/autopilot/src/solvable_orders.rs b/crates/autopilot/src/solvable_orders.rs index 3fb84e5c47..868d393f23 100644 --- a/crates/autopilot/src/solvable_orders.rs +++ b/crates/autopilot/src/solvable_orders.rs @@ -7,7 +7,7 @@ use { anyhow::{Context, Result}, bigdecimal::BigDecimal, database::order_events::OrderEventLabel, - ethrpc::alloy::conversions::IntoAlloy, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, futures::{FutureExt, StreamExt, future::join_all, stream::FuturesUnordered}, indexmap::IndexSet, itertools::Itertools, @@ -207,8 +207,7 @@ impl SolvableOrdersCache { let cow_amm_tokens = cow_amms .iter() - .flat_map(|cow_amm| cow_amm.traded_tokens()) - .cloned() + .flat_map(|cow_amm| cow_amm.traded_tokens().iter().map(|t| t.into_legacy())) .collect::>(); // create auction @@ -270,7 +269,7 @@ impl SolvableOrdersCache { .iter() .filter(|cow_amm| { cow_amm.traded_tokens().iter().all(|token| { - let price_exist = prices.contains_key(token); + let price_exist = prices.contains_key(&token.into_legacy()); if !price_exist { tracing::debug!( cow_amm = ?cow_amm.address(), @@ -281,9 +280,7 @@ impl SolvableOrdersCache { price_exist }) }) - .map(|cow_amm| cow_amm.address()) - .cloned() - .map(eth::Address::from) + .map(|cow_amm| eth::Address::from(cow_amm.address().into_legacy())) .collect::>(); let auction = domain::RawAuctionData { block, diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index 4a5c5e72ec..df00e008ad 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -142,54 +142,6 @@ fn main() { }, ) }); - generate_contract("CowAmm"); - generate_contract_with_config("CowAmmConstantProductFactory", |builder| { - builder - .add_network( - MAINNET, - Network { - address: addr("0x40664207e3375FB4b733d4743CE9b159331fd034"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(19861952)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0xdb1cba3a87f2db53b6e1e6af48e28ed877592ec0"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(33874317)), - }, - ) - .add_network( - SEPOLIA, - Network { - address: addr("0xb808e8183e3a72d196457d127c7fd4befa0d7fd3"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(5874562)), - }, - ) - }); - generate_contract_with_config("CowAmmLegacyHelper", |builder| { - builder - .add_network( - MAINNET, - Network { - address: addr("0x3705ceee5eaa561e3157cf92641ce28c45a3999c"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(20332745)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0xd9ec06b001957498ab1bc716145515d1d0e30ffb"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(35026999)), - }, - ) - }); - generate_contract("CowAmmUniswapV2PriceOracle"); } fn generate_contract(name: &str) { diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 86c1647246..ea0d9aa8ac 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -689,6 +689,28 @@ crate::bindings!( ); pub mod cow_amm { + crate::bindings!(CowAmm); + crate::bindings!( + CowAmmConstantProductFactory, + crate::deployments! { + // + MAINNET => (address!("0x40664207e3375FB4b733d4743CE9b159331fd034"), 19861952), + // + GNOSIS => (address!("0xdb1cba3a87f2db53b6e1e6af48e28ed877592ec0"), 33874317), + // + SEPOLIA => (address!("0xb808e8183e3a72d196457d127c7fd4befa0d7fd3"), 5874562), + } + ); + crate::bindings!( + CowAmmLegacyHelper, + crate::deployments! { + // + MAINNET => (address!("0x3705ceee5eaa561e3157cf92641ce28c45a3999c"), 20332745), + // + GNOSIS => (address!("0xd9ec06b001957498ab1bc716145515d1d0e30ffb"), 35026999), + } + ); + crate::bindings!(CowAmmUniswapV2PriceOracle); crate::bindings!(CowAmmFactoryGetter); } diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 32645783d9..ada1a2bfb4 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -49,10 +49,6 @@ macro_rules! include_contracts { } include_contracts! { - CowAmm; - CowAmmConstantProductFactory; - CowAmmLegacyHelper; - CowAmmUniswapV2PriceOracle; ERC20; GPv2Settlement; } diff --git a/crates/cow-amm/Cargo.toml b/crates/cow-amm/Cargo.toml index 0e6779e42a..1ed898ed06 100644 --- a/crates/cow-amm/Cargo.toml +++ b/crates/cow-amm/Cargo.toml @@ -5,6 +5,7 @@ edition = "2024" [dependencies] anyhow = { workspace = true } +alloy = { workspace = true } app-data = { workspace = true } async-trait = { workspace = true } contracts = { workspace = true } diff --git a/crates/cow-amm/src/amm.rs b/crates/cow-amm/src/amm.rs index fb88519754..3b5470f1a0 100644 --- a/crates/cow-amm/src/amm.rs +++ b/crates/cow-amm/src/amm.rs @@ -1,9 +1,13 @@ use { + alloy::primitives::{Address, TxHash, U256}, anyhow::{Context, Result}, app_data::AppDataHash, - contracts::CowAmmLegacyHelper, + contracts::alloy::cow_amm::{ + CowAmmLegacyHelper, + CowAmmLegacyHelper::CowAmmLegacyHelper::orderReturn, + }, database::byte_array::ByteArray, - ethcontract::{Address, Bytes, U256, errors::MethodError}, + ethrpc::alloy::conversions::IntoLegacy, model::{ DomainSeparator, interaction::InteractionData, @@ -15,13 +19,16 @@ use { #[derive(Clone, Debug)] pub struct Amm { - helper: contracts::CowAmmLegacyHelper, + helper: CowAmmLegacyHelper::Instance, address: Address, tradeable_tokens: Vec
, } impl Amm { - pub async fn new(address: Address, helper: &CowAmmLegacyHelper) -> Result { + pub async fn new( + address: Address, + helper: &CowAmmLegacyHelper::Instance, + ) -> alloy::contract::Result { let tradeable_tokens = helper.tokens(address).call().await?; Ok(Self { @@ -45,9 +52,8 @@ impl Amm { /// need to be supplied in the same order as `traded_tokens` returns /// token addresses. pub async fn template_order(&self, prices: Vec) -> Result { - let (order, pre_interactions, post_interactions, signature) = - self.helper.order(self.address, prices).call().await?; - self.convert_orders_reponse(order, signature, pre_interactions, post_interactions) + let order_return = self.helper.order(self.address, prices).call().await?; + self.convert_orders_reponse(order_return) } /// Generates a template order to rebalance the AMM but also verifies that @@ -66,7 +72,7 @@ impl Amm { let hash = hashed_eip712_message(domain_separator, &template.order.hash_struct()); validator .validate_signature_and_get_additional_gas(SignatureCheck { - signer: self.address, + signer: self.address.into_legacy(), hash, signature: template.signature.to_bytes(), interactions: template.pre_interactions.clone(), @@ -82,16 +88,16 @@ impl Amm { &self, block_number: u64, helper: Address, - tx_hash: ethcontract::H256, + tx_hash: TxHash, ) -> Result { Ok(database::cow_amms::CowAmm { - address: ByteArray(self.address.0), - factory_address: ByteArray(helper.0), + address: ByteArray(self.address.0.0), + factory_address: ByteArray(helper.0.0), tradeable_tokens: self .tradeable_tokens .iter() .cloned() - .map(|addr| ByteArray(addr.0)) + .map(|addr| ByteArray(addr.0.0)) .collect(), block_number: i64::try_from(block_number) .with_context(|| format!("block number {block_number} is not i64"))?, @@ -102,37 +108,33 @@ impl Amm { /// Converts a successful response of the CowAmmHelper into domain types. /// Can be used for any contract that correctly implements the CoW AMM /// helper interface. - fn convert_orders_reponse( - &self, - order: RawOrder, - signature: Bytes>, - pre_interactions: Vec, - post_interactions: Vec, - ) -> Result { + fn convert_orders_reponse(&self, order_return: orderReturn) -> Result { let order = OrderData { - sell_token: order.0, - buy_token: order.1, - receiver: Some(order.2), - sell_amount: order.3, - buy_amount: order.4, - valid_to: order.5, - app_data: AppDataHash(order.6.0), - fee_amount: order.7, - kind: convert_kind(&order.8.0)?, - partially_fillable: order.9, - sell_token_balance: convert_sell_token_source(&order.10.0)?, - buy_token_balance: convert_buy_token_destination(&order.11.0)?, + sell_token: order_return._order.sellToken.into_legacy(), + buy_token: order_return._order.buyToken.into_legacy(), + receiver: Some(order_return._order.receiver.into_legacy()), + sell_amount: order_return._order.sellAmount.into_legacy(), + buy_amount: order_return._order.buyAmount.into_legacy(), + valid_to: order_return._order.validTo, + app_data: AppDataHash(order_return._order.appData.0), + fee_amount: order_return._order.feeAmount.into_legacy(), + kind: convert_kind(&order_return._order.kind.0)?, + partially_fillable: order_return._order.partiallyFillable, + sell_token_balance: convert_sell_token_source(&order_return._order.sellTokenBalance.0)?, + buy_token_balance: convert_buy_token_destination( + &order_return._order.buyTokenBalance.0, + )?, }; - let pre_interactions = convert_interactions(pre_interactions); - let post_interactions = convert_interactions(post_interactions); + let pre_interactions = convert_interactions(order_return.preInteractions); + let post_interactions = convert_interactions(order_return.postInteractions); // The settlement contract expects a signature composed of 2 parts: the // signer address and the actual signature bytes. // The helper contract returns exactly that format but in our code base we // expect the signature to not already include the signer address (the parts // will be concatenated in the encoding logic) so we discard the first 20 bytes. - let raw_signature = signature.0.into_iter().skip(20).collect(); + let raw_signature = order_return.sig.0.into_iter().skip(20).collect(); let signature = Signature::Eip1271(raw_signature); Ok(TemplateOrder { @@ -159,13 +161,15 @@ pub struct TemplateOrder { pub post_interactions: Vec, } -fn convert_interactions(interactions: Vec) -> Vec { +fn convert_interactions( + interactions: Vec, +) -> Vec { interactions .into_iter() .map(|interaction| InteractionData { - target: interaction.0, - value: interaction.1, - call_data: interaction.2.0, + target: interaction.target.into_legacy(), + value: interaction.value.into_legacy(), + call_data: interaction.callData.into_legacy().0, }) .collect() } @@ -201,20 +205,3 @@ fn convert_buy_token_destination(bytes: &[u8]) -> Result { bytes => anyhow::bail!("unknown buy token destination: {bytes}"), } } - -type RawOrder = ( - Address, - Address, - Address, - U256, - U256, - u32, - Bytes<[u8; 32]>, - U256, - Bytes<[u8; 32]>, - bool, - Bytes<[u8; 32]>, - Bytes<[u8; 32]>, -); - -type RawInteraction = (Address, U256, Bytes>); diff --git a/crates/cow-amm/src/cache.rs b/crates/cow-amm/src/cache.rs index 4942590a2e..5a7966362f 100644 --- a/crates/cow-amm/src/cache.rs +++ b/crates/cow-amm/src/cache.rs @@ -1,9 +1,12 @@ use { crate::{Amm, Metrics}, + alloy::{primitives::Address, rpc::types::Log}, anyhow::Context, - contracts::{CowAmmLegacyHelper, cow_amm_legacy_helper::Event as CowAmmEvent}, + contracts::alloy::cow_amm::{ + CowAmmLegacyHelper, + CowAmmLegacyHelper::CowAmmLegacyHelper::CowAmmLegacyHelperEvents as CowAmmEvent, + }, database::byte_array::ByteArray, - ethcontract::{Address, errors::ExecutionError}, ethrpc::block_stream::RangeInclusive, shared::event_handling::EventStoring, sqlx::PgPool, @@ -17,7 +20,7 @@ pub(crate) struct Storage(Arc); impl Storage { pub(crate) async fn new( deployment_block: u64, - helper: CowAmmLegacyHelper, + helper: CowAmmLegacyHelper::Instance, factory_address: Address, db: PgPool, ) -> Self { @@ -43,7 +46,7 @@ impl Storage { async fn initialize_from_database(&self) -> anyhow::Result<()> { let mut ex = self.0.db.acquire().await?; - let factory_address = ByteArray(self.0.factory_address.0); + let factory_address = ByteArray(self.0.factory_address.0.0); let db_amms = { let _timer = Metrics::get() .database_queries @@ -58,7 +61,7 @@ impl Storage { } let amm_process_tasks = db_amms.into_iter().map(|db_amm| async move { - let amm_address = ethcontract::Address::from_slice(&db_amm.address.0); + let amm_address = alloy::primitives::Address::from_slice(&db_amm.address.0); let amm = Amm::new(amm_address, &self.0.helper).await?; let block_number = u64::try_from(db_amm.block_number).context(format!( "db stored cow amm {:?} block number is not u64", @@ -95,7 +98,7 @@ impl Storage { .collect() } - pub(crate) async fn remove_amms(&self, amm_addresses: &[Address]) { + pub(crate) async fn remove_amms(&self, amm_addresses: &[alloy::primitives::Address]) { let mut lock = self.0.cache.write().await; for (_, amms) in lock.iter_mut() { amms.retain(|amm| !amm_addresses.contains(amm.address())) @@ -115,23 +118,23 @@ struct Inner { /// Address of the factory contract that deployed the AMMs. factory_address: Address, /// Helper contract to query required data from the cow amm. - helper: CowAmmLegacyHelper, + helper: CowAmmLegacyHelper::Instance, /// Database connection to persist CoW AMMs and the last indexed block. db: PgPool, } #[async_trait::async_trait] -impl EventStoring> for Storage { +impl EventStoring<(CowAmmEvent, Log)> for Storage { async fn replace_events( &mut self, - events: Vec>, + events: Vec<(CowAmmEvent, Log)>, range: RangeInclusive, ) -> anyhow::Result<()> { { let mut ex = self.0.db.acquire().await?; let start_block = i64::try_from(*range.start()).context("start block is not i64")?; let end_block = i64::try_from(*range.end()).context("end block is not i64")?; - let factory_address = ByteArray(self.0.factory_address.0); + let factory_address = ByteArray(self.0.factory_address.0.0); database::cow_amms::delete_by_block_range( &mut ex, &factory_address, @@ -153,24 +156,20 @@ impl EventStoring> for Storage { /// Apply all the events to the given CoW AMM registry and update the /// internal registry - async fn append_events( - &mut self, - events: Vec>, - ) -> anyhow::Result<()> { + async fn append_events(&mut self, events: Vec<(CowAmmEvent, Log)>) -> anyhow::Result<()> { let mut processed_events = Vec::with_capacity(events.len()); - for event in events { - let Some(meta) = event.meta else { + for (event, log) in events { + let (Some(block_number), Some(tx_hash)) = (log.block_number, log.transaction_hash) + else { tracing::warn!(?event, "event does not contain required meta data"); continue; }; - let CowAmmEvent::CowammpoolCreated(cow_amm) = event.data; + let CowAmmEvent::COWAMMPoolCreated(cow_amm) = event; let cow_amm = cow_amm.amm; match Amm::new(cow_amm, &self.0.helper).await { - Ok(amm) => { - processed_events.push((meta.block_number, meta.transaction_hash, Arc::new(amm))) - } - Err(err) if matches!(&err.inner, ExecutionError::Web3(_)) => { + Ok(amm) => processed_events.push((block_number, tx_hash, Arc::new(amm))), + Err(err) if matches!(&err, alloy::contract::Error::TransportError(_)) => { // Abort completely to later try the entire block range again. // That keeps the cache in a consistent state and avoids indexing // the same event multiple times which would result in duplicate amms. @@ -189,7 +188,7 @@ impl EventStoring> for Storage { .iter() .filter_map(|(block_number, tx_hash, amm)| { amm.as_ref() - .try_to_db_type(*block_number, self.0.helper.address(), *tx_hash) + .try_to_db_type(*block_number, *self.0.helper.address(), *tx_hash) .inspect_err(|err| { tracing::warn!( ?err, diff --git a/crates/cow-amm/src/factory.rs b/crates/cow-amm/src/factory.rs index 81f5e83a81..54f6d7984b 100644 --- a/crates/cow-amm/src/factory.rs +++ b/crates/cow-amm/src/factory.rs @@ -1,25 +1,35 @@ use { - contracts::cow_amm_legacy_helper::Event as CowAmmEvent, - ethcontract::{Address, H256, contract::AllEventsBuilder, dyns::DynAllEventsBuilder}, + alloy::{ + primitives::Address, + providers::DynProvider, + rpc::types::{Filter, FilterSet}, + sol_types::SolEvent, + }, + contracts::alloy::cow_amm::CowAmmLegacyHelper::{ + CowAmmLegacyHelper, + CowAmmLegacyHelper::CowAmmLegacyHelperEvents as CowAmmEvent, + }, ethrpc::Web3, - shared::event_handling::EthcontractEventRetrieving, + shared::event_handling::AlloyEventRetrieving, }; -const AMM_DEPLOYED_TOPIC: H256 = H256(hex_literal::hex!( - "0d03834d0d86c7f57e877af40e26f176dc31bd637535d4ba153d1ac9de88a7ea" -)); - pub(crate) struct Factory { pub(crate) web3: Web3, pub(crate) address: Address, } -impl EthcontractEventRetrieving for Factory { +impl AlloyEventRetrieving for Factory { type Event = CowAmmEvent; - fn get_events(&self) -> DynAllEventsBuilder { - let mut events = AllEventsBuilder::new(self.web3.legacy.clone(), self.address, None); - events.filter = events.filter.topic0(Some(AMM_DEPLOYED_TOPIC).into()); - events + fn filter(&self) -> Filter { + Filter::new() + .address(self.address) + .event_signature(FilterSet::from_iter([ + CowAmmLegacyHelper::COWAMMPoolCreated::SIGNATURE_HASH, + ])) + } + + fn provider(&self) -> &DynProvider { + &self.web3.alloy } } diff --git a/crates/cow-amm/src/lib.rs b/crates/cow-amm/src/lib.rs index 048bc0016e..cc487f4b13 100644 --- a/crates/cow-amm/src/lib.rs +++ b/crates/cow-amm/src/lib.rs @@ -4,7 +4,11 @@ mod factory; mod maintainers; mod registry; -pub use {amm::Amm, contracts::CowAmmLegacyHelper as Helper, registry::Registry}; +pub use { + amm::Amm, + contracts::alloy::cow_amm::CowAmmLegacyHelper::Instance as Helper, + registry::Registry, +}; #[derive(prometheus_metric_storage::MetricStorage)] pub(crate) struct Metrics { @@ -18,3 +22,89 @@ impl Metrics { Metrics::instance(observe::metrics::get_storage_registry()).unwrap() } } + +/// GPv2Order-specific signing utilities. +/// +/// CoW Protocol uses GPv2Order structs for order representation. For EIP-712 +/// signing, certain fields use `string` types in the type hash function (for +/// better UX) but the same fields are stored on-chain as `bytes32`. +/// +/// See: +pub mod gpv2_order { + use { + alloy::{ + primitives::{B256, FixedBytes, Keccak256}, + sol_types::{SolStruct, SolValue}, + }, + contracts::alloy::cow_amm::CowAmm, + ethrpc::alloy::conversions::IntoLegacy, + model::{DomainSeparator, interaction::InteractionData, signature::hashed_eip712_message}, + }; + + /// The correct EIP-712 type hash for GPv2Order as defined in CoW Protocol + /// contracts. + /// + /// This corresponds to: + /// ```text + /// keccak256("Order(address sellToken,address buyToken,address receiver,uint256 sellAmount,uint256 buyAmount,uint32 validTo,bytes32 appData,uint256 feeAmount,string kind,bool partiallyFillable,string sellTokenBalance,string buyTokenBalance)") + /// ``` + /// + /// Note the use of `string` for kind, sellTokenBalance, and buyTokenBalance + /// instead of `bytes32`. + const TYPE_HASH: [u8; 32] = + alloy::hex!("d5a25ba2e97094ad7d83dc28a6572da797d6b3e7fc6663bd93efb789fc17e489"); + + /// Computes the correct EIP-712 hash for a GPv2Order. + fn eip712_hash_struct(order: &CowAmm::GPv2Order::Data) -> B256 { + let mut hasher = Keccak256::new(); + hasher.update(TYPE_HASH); + hasher.update(order.eip712_encode_data()); + hasher.finalize() + } + + /// Generates an EIP-1271 signature for a CoW AMM GPv2Order. + /// + /// The signature format is: + /// 1. AMM address (20 bytes) + /// 2. ABI-encoded order data and trading parameters + /// + /// # Returns + /// The complete signature bytes that can be verified by the CoW Protocol + /// settlement contract. + pub fn generate_eip1271_signature( + order: &CowAmm::GPv2Order::Data, + trading_params: &CowAmm::ConstantProduct::TradingParams, + amm_address: alloy::primitives::Address, + ) -> Vec { + // Encode the order and trading params + let signature_data = (order.clone(), trading_params.clone()).abi_encode_sequence(); + + // Prepend AMM address to the signature + amm_address + .as_slice() + .iter() + .copied() + .chain(signature_data) + .collect() + } + + /// Generates a commit interaction for a CoW AMM GPv2Order. + /// + /// The commit interaction ensures that only the specified order can be + /// settled in the current CoW Protocol batch. + pub fn generate_commit_interaction( + order: &CowAmm::GPv2Order::Data, + amm: &CowAmm::Instance, + domain_separator: &DomainSeparator, + ) -> InteractionData { + let order_hash = eip712_hash_struct(order); + let order_hash = hashed_eip712_message(domain_separator, &order_hash); + let calldata = amm.commit(FixedBytes(order_hash)).calldata().clone(); + + InteractionData { + target: amm.address().into_legacy(), + value: Default::default(), + call_data: calldata.to_vec(), + } + } +} diff --git a/crates/cow-amm/src/maintainers.rs b/crates/cow-amm/src/maintainers.rs index b2271cfe22..3522c71eb9 100644 --- a/crates/cow-amm/src/maintainers.rs +++ b/crates/cow-amm/src/maintainers.rs @@ -2,7 +2,7 @@ use { crate::{Amm, cache::Storage}, contracts::ERC20, ethcontract::futures::future::{join_all, select_ok}, - ethrpc::Web3, + ethrpc::{Web3, alloy::conversions::IntoLegacy}, shared::maintenance::Maintaining, std::sync::Arc, tokio::sync::RwLock, @@ -25,8 +25,8 @@ impl EmptyPoolRemoval { .traded_tokens() .iter() .map(move |token| async move { - ERC20::at(&self.web3, *token) - .balance_of(*amm_address) + ERC20::at(&self.web3, token.into_legacy()) + .balance_of(amm_address.into_legacy()) .call() .await .map_err(|err| { diff --git a/crates/cow-amm/src/registry.rs b/crates/cow-amm/src/registry.rs index 712dbb6744..a2162ca97b 100644 --- a/crates/cow-amm/src/registry.rs +++ b/crates/cow-amm/src/registry.rs @@ -1,10 +1,10 @@ use { crate::{Amm, cache::Storage, factory::Factory, maintainers::EmptyPoolRemoval}, - contracts::CowAmmLegacyHelper, - ethcontract::Address, + alloy::primitives::Address, + contracts::alloy::cow_amm::CowAmmLegacyHelper, ethrpc::{Web3, block_stream::CurrentBlockWatcher}, shared::{ - event_handling::EventHandler, + event_handling::{AlloyEventRetriever, EventHandler}, maintenance::{Maintaining, ServiceMaintenance}, }, sqlx::PgPool, @@ -44,7 +44,7 @@ impl Registry { ) { let storage = Storage::new( deployment_block, - CowAmmLegacyHelper::at(&self.web3, helper_contract), + CowAmmLegacyHelper::Instance::new(helper_contract, self.web3.alloy.clone()), factory, db, ) @@ -56,7 +56,12 @@ impl Registry { web3: self.web3.clone(), address: factory, }; - let event_handler = EventHandler::new(Arc::new(self.web3.clone()), indexer, storage, None); + let event_handler = EventHandler::new( + Arc::new(self.web3.clone()), + AlloyEventRetriever(indexer), + storage, + None, + ); let token_balance_maintainer = EmptyPoolRemoval::new(self.storage.clone(), self.web3.clone()); diff --git a/crates/driver/src/domain/competition/pre_processing.rs b/crates/driver/src/domain/competition/pre_processing.rs index f56aada688..3f3b8dc4d6 100644 --- a/crates/driver/src/domain/competition/pre_processing.rs +++ b/crates/driver/src/domain/competition/pre_processing.rs @@ -12,6 +12,7 @@ use { }, anyhow::{Context, Result}, chrono::Utc, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, futures::{FutureExt, StreamExt, future::BoxFuture, stream::FuturesUnordered}, itertools::Itertools, model::{ @@ -136,9 +137,10 @@ impl DataAggregator { .contracts() .cow_amm_helper_by_factory() .iter() - .map(|(factory, helper)| (factory.0.into(), helper.0.into())) + .map(|(factory, helper)| (factory.0.into_alloy(), helper.0.into_alloy())) .collect(); - let cow_amm_cache = cow_amm::Cache::new(eth.web3().clone(), cow_amm_helper_by_factory); + let cow_amm_cache = + cow_amm::Cache::new(eth.web3().alloy.clone(), cow_amm_helper_by_factory); Self { utilities: Arc::new(Utilities { @@ -414,9 +416,9 @@ impl Utilities { .iter() .map(|t| { auction.tokens - .get(ð::TokenAddress(eth::ContractAddress(*t))) + .get(ð::TokenAddress(eth::ContractAddress(t.into_legacy()))) .and_then(|token| token.price) - .map(|price| price.0.0) + .map(|price| price.0.0.into_alloy()) }) .collect::>>()?; Some((amm, prices)) @@ -438,7 +440,11 @@ impl Utilities { .into_iter() .filter_map(|(amm, result)| match result { Ok(template) => Some(Order { - uid: template.order.uid(&domain_separator, &amm).0.into(), + uid: template + .order + .uid(&domain_separator, &amm.into_legacy()) + .0 + .into(), receiver: template.order.receiver.map(|addr| addr.into()), created: u32::try_from(Utc::now().timestamp()) .unwrap_or(u32::MIN) @@ -480,7 +486,7 @@ impl Utilities { Signature::Eip1271(bytes) => order::Signature { scheme: order::signature::Scheme::Eip1271, data: Bytes(bytes), - signer: amm.into(), + signer: amm.into_legacy().into(), }, _ => { tracing::warn!( diff --git a/crates/driver/src/domain/cow_amm.rs b/crates/driver/src/domain/cow_amm.rs index 34d47821bb..c60dcaaa72 100644 --- a/crates/driver/src/domain/cow_amm.rs +++ b/crates/driver/src/domain/cow_amm.rs @@ -1,8 +1,9 @@ use { crate::domain::eth, - contracts::CowAmmLegacyHelper, + alloy::{primitives::Address, providers::DynProvider}, + contracts::alloy::cow_amm::CowAmmLegacyHelper, cow_amm::Amm, - ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + ethrpc::alloy::conversions::IntoAlloy, itertools::{ Either::{Left, Right}, Itertools, @@ -17,20 +18,25 @@ use { /// Cache for CoW AMM data to avoid using the registry dependency. /// Maps AMM address to the corresponding Amm instance. pub struct Cache { - inner: RwLock>>, - web3: ethrpc::Web3, - helper_by_factory: HashMap, + inner: RwLock>>, + web3: DynProvider, + helper_by_factory: HashMap, } impl Cache { - pub fn new(web3: ethrpc::Web3, factory_mapping: HashMap) -> Self { + pub fn new(web3: DynProvider, factory_mapping: HashMap) -> Self { let helper_by_factory = factory_mapping .into_iter() - .map(|(factory, helper)| (factory, CowAmmLegacyHelper::at(&web3, helper.0))) + .map(|(factory, helper)| { + ( + factory, + CowAmmLegacyHelper::Instance::new(helper, web3.clone()), + ) + }) .collect(); Self { inner: RwLock::new(HashMap::new()), - web3, + web3: web3.clone(), helper_by_factory, } } @@ -41,13 +47,16 @@ impl Cache { &self, surplus_capturing_jit_order_owners: &HashSet, ) -> Vec> { - let (mut cached_amms, missing_amms): (Vec>, Vec) = { + let (mut cached_amms, missing_amms): (Vec>, Vec
) = { let cache = self.inner.read().await; surplus_capturing_jit_order_owners .iter() - .partition_map(|&address| match cache.get(&address) { - Some(amm) => Left(amm.clone()), - None => Right(address), + .partition_map(|&address| { + let address = address.0.into_alloy(); + match cache.get(&address) { + Some(amm) => Left(amm.clone()), + None => Right(address), + } }) }; @@ -77,7 +86,7 @@ impl Cache { return None; }; - match Amm::new(amm_address.0, helper).await { + match Amm::new(amm_address, helper).await { Ok(amm) => Some((amm_address, Arc::new(amm))), Err(err) => { let helper_address = helper.address().0; @@ -114,15 +123,12 @@ impl Cache { /// Fetches the factory address for the given AMM by calling the /// `FACTORY` function. - async fn fetch_amm_factory_address( - &self, - amm_address: eth::Address, - ) -> anyhow::Result { + async fn fetch_amm_factory_address(&self, amm_address: Address) -> anyhow::Result
{ let factory_getter = contracts::alloy::cow_amm::CowAmmFactoryGetter::CowAmmFactoryGetter::new( - amm_address.0.into_alloy(), - &self.web3.alloy, + amm_address, + self.web3.clone(), ); - Ok(factory_getter.FACTORY().call().await?.into_legacy().into()) + Ok(factory_getter.FACTORY().call().await?) } } diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 831f45d740..80fb89344e 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -18,6 +18,7 @@ bigdecimal = { workspace = true } chrono = { workspace = true } clap = { workspace = true } contracts = { workspace = true } +cow-amm = { workspace = true } database = { workspace = true } driver = { workspace = true } ethcontract = { workspace = true } diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index 094a8fbe19..6a52bdd87c 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -1,5 +1,5 @@ use { - app_data::AppDataHash, + alloy::primitives::{Bytes, FixedBytes, U256}, contracts::{ ERC20, alloy::support::{Balances, Signatures}, @@ -23,15 +23,15 @@ use { }, tx, }, - ethcontract::{BlockId, BlockNumber, H160, U256, web3::ethabi::Token}, + ethcontract::{BlockId, BlockNumber, H160}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, }, model::{ - order::{OrderClass, OrderCreation, OrderData, OrderKind, OrderUid}, + order::{OrderClass, OrderCreation, OrderKind, OrderUid}, quote::{OrderQuoteRequest, OrderQuoteSide, SellAmount}, - signature::{EcdsaSigningScheme, hashed_eip712_message}, + signature::EcdsaSigningScheme, }, secp256k1::SecretKey, shared::{addr, ethrpc::Web3}, @@ -72,23 +72,23 @@ async fn cow_amm_jit(web3: Web3) { .await; // set up cow_amm - let oracle = contracts::CowAmmUniswapV2PriceOracle::builder(&web3) - .deploy() + let oracle = + contracts::alloy::cow_amm::CowAmmUniswapV2PriceOracle::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); + + let cow_amm_factory = + contracts::alloy::cow_amm::CowAmmConstantProductFactory::Instance::deploy( + web3.alloy.clone(), + onchain.contracts().gp_settlement.address().into_alloy(), + ) .await .unwrap(); - let cow_amm_factory = contracts::CowAmmConstantProductFactory::builder( - &web3, - onchain.contracts().gp_settlement.address(), - ) - .deploy() - .await - .unwrap(); - // Fund cow amm owner with 2_000 dai and allow factory take them dai.mint(cow_amm_owner.address(), to_wei(2_000)).await; - dai.approve(cow_amm_factory.address().into_alloy(), eth(2_000)) + dai.approve(*cow_amm_factory.address(), eth(2_000)) .from(cow_amm_owner.address().into_alloy()) .send_and_watch() .await @@ -106,7 +106,7 @@ async fn cow_amm_jit(web3: Web3) { onchain .contracts() .weth - .approve(cow_amm_factory.address().into_alloy(), eth(1)) + .approve(*cow_amm_factory.address(), eth(1)) .from(cow_amm_owner.address().into_alloy()) .send_and_watch() .await @@ -121,10 +121,10 @@ async fn cow_amm_jit(web3: Web3) { .expect("failed to get Uniswap V2 pair"); let cow_amm = cow_amm_factory - .amm_deterministic_address( - cow_amm_owner.address(), - dai.address().into_legacy(), - onchain.contracts().weth.address().into_legacy(), + .ammDeterministicAddress( + cow_amm_owner.address().into_alloy(), + *dai.address(), + *onchain.contracts().weth.address(), ) .call() .await @@ -136,20 +136,20 @@ async fn cow_amm_jit(web3: Web3) { cow_amm_factory .create( - dai.address().into_legacy(), - to_wei(2_000), - onchain.contracts().weth.address().into_legacy(), - to_wei(1), - 0.into(), // min traded token - oracle.address(), - ethcontract::Bytes(oracle_data.clone()), - ethcontract::Bytes(APP_DATA), + *dai.address(), + to_wei(2_000).into_alloy(), + *onchain.contracts().weth.address(), + to_wei(1).into_alloy(), + U256::ZERO, // min traded token + *oracle.address(), + Bytes::copy_from_slice(&oracle_data), + FixedBytes(APP_DATA), ) - .from(cow_amm_owner.account().clone()) - .send() + .from(cow_amm_owner.account().address().into_alloy()) + .send_and_watch() .await .unwrap(); - let cow_amm = contracts::CowAmm::at(&web3, cow_amm); + let cow_amm = contracts::alloy::cow_amm::CowAmm::Instance::new(cow_amm, web3.alloy.clone()); // Start system with the regular baseline solver as a quoter but a mock solver // for the actual solver competition. That way we can handcraft a solution @@ -216,88 +216,53 @@ async fn cow_amm_jit(web3: Web3) { // oracle price => 100 WETH == 300000 DAI => 1 WETH == 3000 DAI // If this order gets settled around the oracle price it will receive plenty of // surplus. - let cow_amm_order = OrderData { - sell_token: onchain.contracts().weth.address().into_legacy(), - buy_token: dai.address().into_legacy(), - receiver: None, - sell_amount: U256::exp10(17), - buy_amount: to_wei(230), - valid_to, - app_data: AppDataHash(APP_DATA), - fee_amount: 0.into(), - kind: OrderKind::Sell, - partially_fillable: false, - sell_token_balance: Default::default(), - buy_token_balance: Default::default(), - }; - - // structure of signature copied from - // - let signature_data = ethcontract::web3::ethabi::encode(&[ - Token::Tuple(vec![ - Token::Address(cow_amm_order.sell_token), - Token::Address(cow_amm_order.buy_token), - Token::Address(cow_amm_order.receiver.unwrap_or_default()), - Token::Uint(cow_amm_order.sell_amount), - Token::Uint(cow_amm_order.buy_amount), - Token::Uint(cow_amm_order.valid_to.into()), - Token::FixedBytes(cow_amm_order.app_data.0.to_vec()), - Token::Uint(cow_amm_order.fee_amount), - // enum hashes taken from - // - Token::FixedBytes( - const_hex::decode( - "f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775", - ) + let cow_amm_order = contracts::alloy::cow_amm::CowAmm::GPv2Order::Data { + sellToken: *onchain.contracts().weth.address(), + buyToken: *dai.address(), + receiver: Default::default(), + sellAmount: U256::from(10).pow(U256::from(17)), + buyAmount: to_wei(230).into_alloy(), + validTo: valid_to, + appData: FixedBytes(APP_DATA), + feeAmount: U256::ZERO, + kind: FixedBytes::from_slice( + &const_hex::decode("f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775") .unwrap(), - ), // sell order - Token::Bool(cow_amm_order.partially_fillable), - Token::FixedBytes( - const_hex::decode( - "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", - ) + ), // sell order + partiallyFillable: false, + sellTokenBalance: FixedBytes::from_slice( + &const_hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") .unwrap(), - ), // sell_token_source == erc20 - Token::FixedBytes( - const_hex::decode( - "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", - ) + ), // erc20 + buyTokenBalance: FixedBytes::from_slice( + &const_hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") .unwrap(), - ), // buy_token_destination == erc20 - ]), - Token::Tuple(vec![ - Token::Uint(0.into()), // min_traded_token - Token::Address(oracle.address()), - Token::Bytes(oracle_data), - Token::FixedBytes(APP_DATA.to_vec()), - ]), - ]); - - // Prepend CoW AMM address to the signature so settlement contract know which - // contract this signature refers to. - let signature = cow_amm - .address() - .as_bytes() - .iter() - .cloned() - .chain(signature_data) - .collect(); - - // Creation of commitment copied from - // - let cow_amm_commitment = { - let order_hash = cow_amm_order.hash_struct(); - let order_hash = hashed_eip712_message(&onchain.contracts().domain_separator, &order_hash); - let commitment = cow_amm - .commit(ethcontract::Bytes(order_hash)) - .tx - .data - .unwrap(); - Call { - target: cow_amm.address(), - value: 0.into(), - calldata: commitment.0.to_vec(), - } + ), // erc20 + }; + let trading_params = contracts::alloy::cow_amm::CowAmm::ConstantProduct::TradingParams { + minTradedToken0: U256::ZERO, + priceOracle: *oracle.address(), + priceOracleData: Bytes::copy_from_slice(&oracle_data), + appData: FixedBytes(APP_DATA), + }; + + // Generate EIP-1271 signature for the CoW AMM order + let signature = cow_amm::gpv2_order::generate_eip1271_signature( + &cow_amm_order, + &trading_params, + *cow_amm.address(), + ); + + // Generate commit interaction for the pre-interaction + let cow_amm_commitment_data = cow_amm::gpv2_order::generate_commit_interaction( + &cow_amm_order, + &cow_amm, + &onchain.contracts().domain_separator, + ); + let cow_amm_commitment = Call { + target: cow_amm_commitment_data.target, + value: cow_amm_commitment_data.value, + calldata: cow_amm_commitment_data.call_data, }; // fund trader "bob" and approve vault relayer @@ -325,7 +290,7 @@ async fn cow_amm_jit(web3: Web3) { // place user order with the same limit price as the CoW AMM order let user_order = OrderCreation { sell_token: onchain.contracts().weth.address().into_legacy(), - sell_amount: U256::exp10(17), // 0.1 WETH + sell_amount: ethcontract::U256::exp10(17), // 0.1 WETH buy_token: dai.address().into_legacy(), buy_amount: to_wei(230), // 230 DAI valid_to: model::time::now_in_epoch_seconds() + 300, @@ -339,18 +304,14 @@ async fn cow_amm_jit(web3: Web3) { ); let user_order_id = services.create_order(&user_order).await.unwrap(); - let amm_balance_before = dai - .balanceOf(cow_amm.address().into_alloy()) - .call() - .await - .unwrap(); + let amm_balance_before = dai.balanceOf(*cow_amm.address()).call().await.unwrap(); let bob_balance_before = dai .balanceOf(bob.address().into_alloy()) .call() .await .unwrap(); - let fee = U256::exp10(16); // 0.01 WETH + let fee = ethcontract::U256::exp10(16); // 0.01 WETH mock_solver.configure_solution(Some(Solution { id: 1, @@ -365,21 +326,21 @@ async fn cow_amm_jit(web3: Web3) { trades: vec![ solvers_dto::solution::Trade::Jit(solvers_dto::solution::JitTrade { order: solvers_dto::solution::JitOrder { - sell_token: cow_amm_order.sell_token, - buy_token: cow_amm_order.buy_token, - receiver: cow_amm_order.receiver.unwrap_or_default(), - sell_amount: cow_amm_order.sell_amount, - buy_amount: cow_amm_order.buy_amount, - partially_fillable: cow_amm_order.partially_fillable, - valid_to: cow_amm_order.valid_to, - app_data: cow_amm_order.app_data.0, + sell_token: cow_amm_order.sellToken.into_legacy(), + buy_token: cow_amm_order.buyToken.into_legacy(), + receiver: cow_amm_order.receiver.into_legacy(), + sell_amount: cow_amm_order.sellAmount.into_legacy(), + buy_amount: cow_amm_order.buyAmount.into_legacy(), + partially_fillable: cow_amm_order.partiallyFillable, + valid_to: cow_amm_order.validTo, + app_data: cow_amm_order.appData.0, kind: Kind::Sell, sell_token_balance: SellTokenBalance::Erc20, buy_token_balance: BuyTokenBalance::Erc20, signing_scheme: SigningScheme::Eip1271, signature, }, - executed_amount: cow_amm_order.sell_amount - fee, + executed_amount: cow_amm_order.sellAmount.into_legacy() - fee, fee: Some(fee), }), solvers_dto::solution::Trade::Fulfillment(solvers_dto::solution::Fulfillment { @@ -399,11 +360,7 @@ async fn cow_amm_jit(web3: Web3) { tracing::info!("Waiting for trade."); onchain.mint_block().await; wait_for_condition(TIMEOUT, || async { - let amm_balance = dai - .balanceOf(cow_amm.address().into_alloy()) - .call() - .await - .unwrap(); + let amm_balance = dai.balanceOf(*cow_amm.address()).call().await.unwrap(); let bob_balance = dai .balanceOf(bob.address().into_alloy()) .call() @@ -414,8 +371,7 @@ async fn cow_amm_jit(web3: Web3) { let bob_received = bob_balance - bob_balance_before; // bob and CoW AMM both got surplus and an equal amount - amm_received >= cow_amm_order.buy_amount.into_alloy() - && bob_received > user_order.buy_amount.into_alloy() + amm_received >= cow_amm_order.buyAmount && bob_received > user_order.buy_amount.into_alloy() }) .await .unwrap(); @@ -736,24 +692,24 @@ async fn cow_amm_opposite_direction(web3: Web3) { // the user order. // Set up the CoW AMM as before - let oracle = contracts::CowAmmUniswapV2PriceOracle::builder(&web3) - .deploy() + let oracle = + contracts::alloy::cow_amm::CowAmmUniswapV2PriceOracle::Instance::deploy(web3.alloy.clone()) + .await + .unwrap(); + + let cow_amm_factory = + contracts::alloy::cow_amm::CowAmmConstantProductFactory::Instance::deploy( + web3.alloy.clone(), + onchain.contracts().gp_settlement.address().into_alloy(), + ) .await .unwrap(); - let cow_amm_factory = contracts::CowAmmConstantProductFactory::builder( - &web3, - onchain.contracts().gp_settlement.address(), - ) - .deploy() - .await - .unwrap(); - // Fund the CoW AMM owner with DAI and WETH and approve the factory to transfer // them dai.mint(cow_amm_owner.address(), to_wei(2_000)).await; - dai.approve(cow_amm_factory.address().into_alloy(), eth(2_000)) + dai.approve(*cow_amm_factory.address(), eth(2_000)) .from(cow_amm_owner.address().into_alloy()) .send_and_watch() .await @@ -771,7 +727,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { onchain .contracts() .weth - .approve(cow_amm_factory.address().into_alloy(), eth(1)) + .approve(*cow_amm_factory.address(), eth(1)) .from(cow_amm_owner.address().into_alloy()) .send_and_watch() .await @@ -796,10 +752,10 @@ async fn cow_amm_opposite_direction(web3: Web3) { .expect("failed to get Uniswap V2 pair"); let cow_amm_address = cow_amm_factory - .amm_deterministic_address( - cow_amm_owner.address(), - dai.address().into_legacy(), - onchain.contracts().weth.address().into_legacy(), + .ammDeterministicAddress( + cow_amm_owner.address().into_alloy(), + *dai.address(), + *onchain.contracts().weth.address(), ) .call() .await @@ -812,20 +768,21 @@ async fn cow_amm_opposite_direction(web3: Web3) { // Create the CoW AMM cow_amm_factory .create( - dai.address().into_legacy(), - to_wei(2_000), - onchain.contracts().weth.address().into_legacy(), - to_wei(1), - 0.into(), // min traded token - oracle.address(), - ethcontract::Bytes(oracle_data.clone()), - ethcontract::Bytes(APP_DATA), + *dai.address(), + to_wei(2_000).into_alloy(), + *onchain.contracts().weth.address(), + to_wei(1).into_alloy(), + U256::ZERO, // min traded token + *oracle.address(), + Bytes::copy_from_slice(&oracle_data), + FixedBytes(APP_DATA), ) - .from(cow_amm_owner.account().clone()) - .send() + .from(cow_amm_owner.account().address().into_alloy()) + .send_and_watch() .await .unwrap(); - let cow_amm = contracts::CowAmm::at(&web3, cow_amm_address); + let cow_amm = + contracts::alloy::cow_amm::CowAmm::Instance::new(cow_amm_address, web3.alloy.clone()); // Start system with the mocked solver. Baseline is still required for the // native price estimation. @@ -884,84 +841,52 @@ async fn cow_amm_opposite_direction(web3: Web3) { let executed_amount = to_wei(230); // CoW AMM order remains the same (selling WETH for DAI) - let cow_amm_order = OrderData { - sell_token: onchain.contracts().weth.address().into_legacy(), - buy_token: dai.address().into_legacy(), - receiver: None, - sell_amount: U256::exp10(17), // 0.1 WETH - buy_amount: executed_amount, // 230 DAI - valid_to, - app_data: AppDataHash(APP_DATA), - fee_amount: 0.into(), - kind: OrderKind::Sell, - partially_fillable: false, - sell_token_balance: Default::default(), - buy_token_balance: Default::default(), - }; - - // Create the signature for the CoW AMM order - let signature_data = ethcontract::web3::ethabi::encode(&[ - Token::Tuple(vec![ - Token::Address(cow_amm_order.sell_token), - Token::Address(cow_amm_order.buy_token), - Token::Address(cow_amm_order.receiver.unwrap_or_default()), - Token::Uint(cow_amm_order.sell_amount), - Token::Uint(cow_amm_order.buy_amount), - Token::Uint(cow_amm_order.valid_to.into()), - Token::FixedBytes(cow_amm_order.app_data.0.to_vec()), - Token::Uint(cow_amm_order.fee_amount), - Token::FixedBytes( - const_hex::decode( - "f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775", - ) + let cow_amm_order = contracts::alloy::cow_amm::CowAmm::GPv2Order::Data { + sellToken: *onchain.contracts().weth.address(), + buyToken: *dai.address(), + receiver: Default::default(), + sellAmount: U256::from(10).pow(U256::from(17)), + buyAmount: executed_amount.into_alloy(), + validTo: valid_to, + appData: FixedBytes(APP_DATA), + feeAmount: U256::ZERO, + kind: FixedBytes::from_slice( + &const_hex::decode("f3b277728b3fee749481eb3e0b3b48980dbbab78658fc419025cb16eee346775") .unwrap(), - ), // sell order - Token::Bool(cow_amm_order.partially_fillable), - Token::FixedBytes( - const_hex::decode( - "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", - ) + ), // sell order + partiallyFillable: false, + sellTokenBalance: FixedBytes::from_slice( + &const_hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") .unwrap(), - ), // sell_token_source == erc20 - Token::FixedBytes( - const_hex::decode( - "5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9", - ) + ), // erc20 + buyTokenBalance: FixedBytes::from_slice( + &const_hex::decode("5a28e9363bb942b639270062aa6bb295f434bcdfc42c97267bf003f272060dc9") .unwrap(), - ), // buy_token_destination == erc20 - ]), - Token::Tuple(vec![ - Token::Uint(0.into()), // min_traded_token - Token::Address(oracle.address()), - Token::Bytes(oracle_data), - Token::FixedBytes(APP_DATA.to_vec()), - ]), - ]); - - // Prepend CoW AMM address to the signature so the settlement contract knows - // which contract this signature refers to. - let signature = cow_amm - .address() - .as_bytes() - .iter() - .cloned() - .chain(signature_data) - .collect::>(); - - // Create the commitment call for the pre-interaction - let cow_amm_commitment = { - let order_hash = cow_amm_order.hash_struct(); - let order_hash = hashed_eip712_message(&onchain.contracts().domain_separator, &order_hash); - let commitment = cow_amm - .commit(ethcontract::Bytes(order_hash)) - .tx - .data - .unwrap(); - Call { - target: cow_amm.address(), - value: 0.into(), - calldata: commitment.0.to_vec(), - } + ), // erc20 + }; + let trading_params = contracts::alloy::cow_amm::CowAmm::ConstantProduct::TradingParams { + minTradedToken0: U256::ZERO, + priceOracle: *oracle.address(), + priceOracleData: Bytes::copy_from_slice(&oracle_data), + appData: FixedBytes(APP_DATA), + }; + // Generate EIP-1271 signature for the CoW AMM order + let signature = cow_amm::gpv2_order::generate_eip1271_signature( + &cow_amm_order, + &trading_params, + *cow_amm.address(), + ); + + // Generate commit interaction for the pre-interaction + let cow_amm_commitment_data = cow_amm::gpv2_order::generate_commit_interaction( + &cow_amm_order, + &cow_amm, + &onchain.contracts().domain_separator, + ); + let cow_amm_commitment = Call { + target: cow_amm_commitment_data.target, + value: cow_amm_commitment_data.value, + calldata: cow_amm_commitment_data.call_data, }; // Fund trader "bob" with DAI and approve allowance @@ -980,7 +905,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { let amm_weth_balance_before = onchain .contracts() .weth - .balanceOf(cow_amm.address().into_alloy()) + .balanceOf(*cow_amm.address()) .call() .await .unwrap(); @@ -997,7 +922,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; // Set the fees appropriately - let fee_cow_amm = U256::exp10(16); // 0.01 WETH + let fee_cow_amm = ethcontract::U256::exp10(16); // 0.01 WETH let fee_user = to_wei(1); // 1 DAI let mocked_solutions = |order_uid: OrderUid| { @@ -1013,21 +938,21 @@ async fn cow_amm_opposite_direction(web3: Web3) { trades: vec![ solvers_dto::solution::Trade::Jit(solvers_dto::solution::JitTrade { order: solvers_dto::solution::JitOrder { - sell_token: cow_amm_order.sell_token, - buy_token: cow_amm_order.buy_token, - receiver: cow_amm_order.receiver.unwrap_or_default(), - sell_amount: cow_amm_order.sell_amount, - buy_amount: cow_amm_order.buy_amount, - partially_fillable: cow_amm_order.partially_fillable, - valid_to: cow_amm_order.valid_to, - app_data: cow_amm_order.app_data.0, + sell_token: cow_amm_order.sellToken.into_legacy(), + buy_token: cow_amm_order.buyToken.into_legacy(), + receiver: cow_amm_order.receiver.into_legacy(), + sell_amount: cow_amm_order.sellAmount.into_legacy(), + buy_amount: cow_amm_order.buyAmount.into_legacy(), + partially_fillable: cow_amm_order.partiallyFillable, + valid_to: cow_amm_order.validTo, + app_data: cow_amm_order.appData.0, kind: Kind::Sell, sell_token_balance: SellTokenBalance::Erc20, buy_token_balance: BuyTokenBalance::Erc20, signing_scheme: SigningScheme::Eip1271, signature: signature.clone(), }, - executed_amount: cow_amm_order.sell_amount - fee_cow_amm, + executed_amount: cow_amm_order.sellAmount.into_legacy() - fee_cow_amm, fee: Some(fee_cow_amm), }), solvers_dto::solution::Trade::Fulfillment(solvers_dto::solution::Fulfillment { @@ -1070,14 +995,18 @@ async fn cow_amm_opposite_direction(web3: Web3) { ); // Ensure the amounts are the same as the solution proposes. assert_eq!(quote_response.quote.sell_amount, executed_amount); - assert_eq!(quote_response.quote.buy_amount, U256::exp10(17)); + assert_eq!( + quote_response.quote.buy_amount, + ethcontract::U256::exp10(17) + ); // Place user order where bob sells DAI to buy WETH (opposite direction) let user_order = OrderCreation { sell_token: dai.address().into_legacy(), sell_amount: executed_amount, // 230 DAI buy_token: onchain.contracts().weth.address().into_legacy(), - buy_amount: U256::from(90000000000000000u64), // 0.09 WETH to generate some surplus + buy_amount: ethcontract::U256::from(90000000000000000u64), /* 0.09 WETH to generate some + * surplus */ valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, ..Default::default() @@ -1100,7 +1029,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { let amm_weth_balance_after = onchain .contracts() .weth - .balanceOf(cow_amm.address().into_alloy()) + .balanceOf(*cow_amm.address()) .call() .await .unwrap(); @@ -1117,7 +1046,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { // Bob should receive WETH, CoW AMM's WETH balance decreases bob_weth_received >= user_order.buy_amount.into_alloy() - && amm_weth_sent == cow_amm_order.sell_amount.into_alloy() + && amm_weth_sent == cow_amm_order.sellAmount }) .await .unwrap(); From 724936ef05c9c84c92c42b32a10e19b7a3d47d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Tue, 28 Oct 2025 14:02:15 +0000 Subject: [PATCH 055/117] Partially migrate ERC20 to alloy (#3818) --- crates/contracts/src/alloy.rs | 2 ++ crates/solver/src/interactions/allowances.rs | 24 ++++++------- crates/solver/src/interactions/erc20.rs | 36 +++++++++++++------- 3 files changed, 38 insertions(+), 24 deletions(-) diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index ea0d9aa8ac..c822679577 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -688,6 +688,8 @@ crate::bindings!( } ); +crate::bindings!(ERC20); + pub mod cow_amm { crate::bindings!(CowAmm); crate::bindings!( diff --git a/crates/solver/src/interactions/allowances.rs b/crates/solver/src/interactions/allowances.rs index d1463cf5c2..59a41f5c97 100644 --- a/crates/solver/src/interactions/allowances.rs +++ b/crates/solver/src/interactions/allowances.rs @@ -5,9 +5,9 @@ use { crate::interactions::Erc20ApproveInteraction, anyhow::{Context as _, Result, anyhow, ensure}, - contracts::{ERC20, dummy_contract}, + contracts::ERC20, ethcontract::{H160, U256}, - ethrpc::Web3, + ethrpc::{Web3, alloy::conversions::IntoAlloy}, maplit::hashmap, shared::{ http_solver::model::TokenAmount, @@ -116,15 +116,10 @@ pub struct Approval { impl Interaction for Approval { fn encode(&self) -> EncodedInteraction { - // Use a "dummy" contract - unfortunately `ethcontract` doesn't - // allow you use the generated contract intances to encode - // transaction data without a `Web3` instance. Hopefully, this - // limitation will be lifted soon to clean up stuff like this. - let token = dummy_contract!(ERC20, self.token); let approve = Erc20ApproveInteraction { - token, - spender: self.spender, - amount: U256::max_value(), + token: self.token.into_alloy(), + spender: self.spender.into_alloy(), + amount: alloy::primitives::U256::MAX, }; approve.encode() @@ -243,6 +238,7 @@ where mod tests { use { super::*, + alloy::sol_types::SolCall, ethcontract::{ Bytes, common::abi::{self, Token}, @@ -386,8 +382,12 @@ mod tests { } fn allowance_call_data(owner: H160, spender: H160) -> web3::types::Bytes { - let token = dummy_contract!(ERC20, H160::zero()); - token.allowance(owner, spender).m.tx.data.unwrap() + contracts::alloy::ERC20::ERC20::allowanceCall { + owner: owner.into_alloy(), + spender: spender.into_alloy(), + } + .abi_encode() + .into() } fn allowance_return_data(value: U256) -> Value { diff --git a/crates/solver/src/interactions/erc20.rs b/crates/solver/src/interactions/erc20.rs index 96dbd249e5..0e41d5f12b 100644 --- a/crates/solver/src/interactions/erc20.rs +++ b/crates/solver/src/interactions/erc20.rs @@ -1,24 +1,36 @@ //! Module continaing ERC20 token interaction implementations. use { - contracts::ERC20, + alloy::{ + primitives::{Address, U256}, + sol_types::SolCall, + }, + contracts::alloy::ERC20, ethcontract::Bytes, - primitive_types::{H160, U256}, + ethrpc::alloy::conversions::IntoLegacy, shared::interaction::{EncodedInteraction, Interaction}, }; #[derive(Debug)] pub struct Erc20ApproveInteraction { - pub token: ERC20, - pub spender: H160, + pub token: Address, + pub spender: Address, pub amount: U256, } impl Erc20ApproveInteraction { pub fn as_encoded(&self) -> EncodedInteraction { - let method = self.token.approve(self.spender, self.amount); - let calldata = method.tx.data.expect("no calldata").0; - (self.token.address(), 0.into(), Bytes(calldata)) + ( + self.token.into_legacy(), + 0.into(), + Bytes( + ERC20::ERC20::approveCall { + spender: self.spender, + amount: self.amount, + } + .abi_encode(), + ), + ) } } @@ -30,18 +42,18 @@ impl Interaction for Erc20ApproveInteraction { #[cfg(test)] mod tests { - use {super::*, contracts::dummy_contract, hex_literal::hex}; + use {super::*, ethrpc::alloy::conversions::IntoLegacy, hex_literal::hex}; #[test] fn encode_erc20_approve() { let approve = Erc20ApproveInteraction { - token: dummy_contract!(ERC20, [0x01; 20]), - spender: H160([0x02; 20]), - amount: U256::from_big_endian(&[0x03; 32]), + token: [0x01; 20].into(), + spender: [0x02; 20].into(), + amount: U256::from_be_bytes([0x03; 32]), }; let (target, value, calldata) = approve.as_encoded(); - assert_eq!(target, approve.token.address()); + assert_eq!(target, approve.token.into_legacy()); assert_eq!(value, 0.into()); assert_eq!( calldata.0, From 7b6aa1a982717c64965d11f7d12d7ac8fb667ffb Mon Sep 17 00:00:00 2001 From: "Jan [Yann]" <4518474+fafk@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:15:18 +0100 Subject: [PATCH 056/117] Add linea & plasma native tokens to alloy (#3836) # Description Got lost in one of my rebases. --- crates/contracts/src/alloy.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index c822679577..d635aa12a4 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -685,6 +685,8 @@ crate::bindings!( OPTIMISM => address!("0x4200000000000000000000000000000000000006"), POLYGON => address!("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"), LENS => address!("0x6bDc36E20D267Ff0dd6097799f82e78907105e2F"), + LINEA => address!("0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f"), + PLASMA => address!("0x6100E367285b01F48D07953803A2d8dCA5D19873"), } ); From 66b4aa0317c20dfba86e9bb75c08d8f11f120456 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Tue, 28 Oct 2025 19:35:56 +0100 Subject: [PATCH 057/117] Migrate settlement contract (#3830) # Description First part of migrating the settlement contract to alloy. To do the migration only partially I just added the new alloy metrics and migrated some call sites. ## How to test compiler, e2e tests --- .../src/domain/settlement/observer.rs | 9 +- .../src/infra/blockchain/contracts.rs | 29 ++-- crates/autopilot/src/run.rs | 44 +++--- crates/contracts/src/alloy.rs | 50 ++++--- crates/contracts/src/lib.rs | 72 +--------- .../src/boundary/liquidity/balancer/v2/mod.rs | 22 ++- .../src/boundary/liquidity/uniswap/v2.rs | 6 +- .../src/boundary/liquidity/uniswap/v3.rs | 7 +- .../driver/src/boundary/liquidity/zeroex.rs | 2 +- .../competition/bad_tokens/simulation.rs | 7 +- crates/driver/src/domain/competition/mod.rs | 6 +- .../domain/competition/solution/encoding.rs | 136 ++++++++---------- .../src/domain/competition/solution/mod.rs | 6 +- crates/driver/src/domain/quote.rs | 8 +- .../driver/src/infra/blockchain/contracts.rs | 45 +++--- crates/driver/src/infra/blockchain/mod.rs | 6 +- crates/driver/src/infra/tokens.rs | 21 ++- crates/driver/src/tests/setup/blockchain.rs | 104 +++++++------- crates/driver/src/tests/setup/driver.rs | 2 +- crates/driver/src/tests/setup/solver.rs | 4 +- crates/orderbook/src/run.rs | 53 +++---- crates/shared/src/account_balances/mod.rs | 49 +++---- .../shared/src/account_balances/simulation.rs | 9 +- crates/shared/src/bad_token/trace_call.rs | 28 ++-- crates/shared/src/event_handling.rs | 76 ++++++---- .../price_estimation/trade_verifier/mod.rs | 102 ++++++++----- crates/shared/src/signature_validator/mod.rs | 3 +- .../src/signature_validator/simulation.rs | 61 ++++---- crates/solver/src/interactions/balancer_v2.rs | 15 +- crates/solver/src/interactions/uniswap_v2.rs | 11 +- crates/solver/src/liquidity/balancer_v2.rs | 30 ++-- crates/solver/src/liquidity/uniswap_v2.rs | 27 ++-- crates/solver/src/liquidity/uniswap_v3.rs | 25 ++-- crates/solver/src/liquidity/zeroex.rs | 18 +-- 34 files changed, 524 insertions(+), 569 deletions(-) diff --git a/crates/autopilot/src/domain/settlement/observer.rs b/crates/autopilot/src/domain/settlement/observer.rs index 0cba79ffc1..fc9af2e653 100644 --- a/crates/autopilot/src/domain/settlement/observer.rs +++ b/crates/autopilot/src/domain/settlement/observer.rs @@ -19,6 +19,7 @@ use { infra, }, anyhow::{Context, Result, anyhow}, + ethrpc::alloy::conversions::IntoLegacy, std::time::Duration, }; @@ -114,7 +115,13 @@ impl Observer { let transaction = match self.eth.transaction(tx).await { Ok(transaction) => { let separator = self.eth.contracts().settlement_domain_separator(); - let settlement_contract = self.eth.contracts().settlement().address().into(); + let settlement_contract = self + .eth + .contracts() + .settlement() + .address() + .into_legacy() + .into(); settlement::Transaction::try_new( &transaction, separator, diff --git a/crates/autopilot/src/infra/blockchain/contracts.rs b/crates/autopilot/src/infra/blockchain/contracts.rs index 12387800ac..bae638ad3f 100644 --- a/crates/autopilot/src/infra/blockchain/contracts.rs +++ b/crates/autopilot/src/infra/blockchain/contracts.rs @@ -4,6 +4,7 @@ use { contracts::alloy::{ ChainalysisOracle, GPv2AllowListAuthentication, + GPv2Settlement, HooksTrampoline, InstanceExt, WETH9, @@ -18,7 +19,7 @@ use { #[derive(Debug, Clone)] pub struct Contracts { - settlement: contracts::GPv2Settlement, + settlement: GPv2Settlement::Instance, signatures: contracts::alloy::support::Signatures::Instance, weth: WETH9::Instance, balances: Balances::Instance, @@ -43,18 +44,13 @@ pub struct Addresses { impl Contracts { pub async fn new(web3: &Web3, chain: &Chain, addresses: Addresses) -> Self { - let address_for = |contract: ðcontract::Contract, address: Option| { - address - .or_else(|| deployment_address(contract, chain)) - .unwrap() - }; - - let settlement = contracts::GPv2Settlement::at( - web3, - address_for( - contracts::GPv2Settlement::raw_contract(), - addresses.settlement, - ), + let settlement = GPv2Settlement::Instance::new( + addresses + .settlement + .map(IntoAlloy::into_alloy) + .or_else(|| GPv2Settlement::deployment_address(&chain.id())) + .unwrap(), + web3.alloy.clone(), ); let signatures = contracts::alloy::support::Signatures::Instance::new( @@ -99,7 +95,7 @@ impl Contracts { let settlement_domain_separator = domain::eth::DomainSeparator( settlement - .domain_separator() + .domainSeparator() .call() .await .expect("domain separator") @@ -111,8 +107,7 @@ impl Contracts { .authenticator() .call() .await - .expect("authenticator address") - .into_alloy(), + .expect("authenticator address"), web3.alloy.clone(), ); @@ -128,7 +123,7 @@ impl Contracts { } } - pub fn settlement(&self) -> &contracts::GPv2Settlement { + pub fn settlement(&self) -> &GPv2Settlement::Instance { &self.settlement } diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index df0d234c9d..ce2634abfb 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -26,8 +26,8 @@ use { }, chain::Chain, clap::Parser, - contracts::alloy::{BalancerV2Vault, IUniswapV3Factory, InstanceExt, WETH9}, - ethcontract::{BlockNumber, H160, common::DeploymentInformation}, + contracts::alloy::{BalancerV2Vault, GPv2Settlement, IUniswapV3Factory, InstanceExt, WETH9}, + ethcontract::{BlockNumber, H160}, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -230,11 +230,11 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { let vault_relayer = eth .contracts() .settlement() - .vault_relayer() + .vaultRelayer() .call() - .instrument(info_span!("vault_relayer_call")) .await - .expect("Couldn't get vault relayer address"); + .expect("Couldn't get vault relayer address") + .into_legacy(); let vault_address = args.shared.balancer_v2_vault_address.or_else(|| { let chain_id = chain.id(); @@ -330,7 +330,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { vault.as_ref(), uniswapv3_factory.as_ref(), &base_tokens, - eth.contracts().settlement().address(), + eth.contracts().settlement().address().into_legacy(), ) .instrument(info_span!("token_owner_finder_init")) .await @@ -345,7 +345,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { tracing_node_url, "trace", ), - eth.contracts().settlement().address(), + eth.contracts().settlement().address().into_legacy(), finder, )), args.shared.token_quality_cache_expiry, @@ -377,16 +377,16 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { web3: web3.clone(), simulation_web3, chain, + settlement: eth.contracts().settlement().address().into_legacy(), native_token: eth.contracts().weth().address().into_legacy(), - settlement: eth.contracts().settlement().address(), authenticator: eth .contracts() .settlement() .authenticator() .call() - .instrument(info_span!("authenticator_call")) .await - .expect("failed to query solver authenticator address"), + .expect("failed to query solver authenticator address") + .into_legacy(), base_tokens: base_tokens.clone(), block_stream: eth.current_block().clone(), }, @@ -445,12 +445,8 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { .await; let settlement_observer = crate::domain::settlement::Observer::new(eth.clone(), persistence.clone()); - let settlement_contract_start_index = match contracts::GPv2Settlement::raw_contract() - .networks - .get(&chain_id.to_string()) - .and_then(|v| v.deployment_information) - { - Some(DeploymentInformation::BlockNumber(block)) => { + let settlement_contract_start_index = match GPv2Settlement::deployment_block(&chain_id) { + Some(block) => { tracing::debug!(block, "found settlement contract deployment"); block } @@ -464,9 +460,10 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { } }; let settlement_event_indexer = EventUpdater::new( - boundary::events::settlement::GPv2SettlementContract::new( - eth.contracts().settlement().clone(), - ), + boundary::events::settlement::GPv2SettlementContract::new(contracts::GPv2Settlement::at( + &web3.legacy, + eth.contracts().settlement().address().into_legacy(), + )), boundary::events::settlement::Indexer::new( db_write.clone(), settlement_observer, @@ -535,7 +532,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { domain::ProtocolFees::new(&args.fee_policies, args.fee_policy_max_partner_fee), cow_amm_registry.clone(), args.run_loop_native_price_timeout, - eth.contracts().settlement().address(), + eth.contracts().settlement().address().into_legacy(), args.disable_order_filtering, ); @@ -603,8 +600,11 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { web3.clone(), quoter.clone(), Box::new(custom_ethflow_order_parser), - DomainSeparator::new(chain_id, eth.contracts().settlement().address()), - eth.contracts().settlement().address(), + DomainSeparator::new( + chain_id, + eth.contracts().settlement().address().into_legacy(), + ), + eth.contracts().settlement().address().into_legacy(), eth.contracts().trampoline().clone(), ); diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index d635aa12a4..66bc1ce661 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -670,6 +670,32 @@ crate::bindings!( } ); +crate::bindings!( + GPv2Settlement, + crate::deployments! { + // + MAINNET => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 12593265), + // + GNOSIS => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 16465100), + // + SEPOLIA => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 4717488), + // + ARBITRUM_ONE => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 204704802), + // + BASE => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 21407238), + // + AVALANCHE => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 59891356), + // + BNB => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 48173641), + // + OPTIMISM => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 134254624), + // + POLYGON => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 45859743), + // + LENS => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 2621745), + } +); + crate::bindings!( WETH9, crate::deployments! { @@ -792,11 +818,6 @@ pub trait InstanceExt: Sized { fn deployed( provider: &Provider, ) -> impl std::future::Future> + Send; - - /// Returns the block number at which the contract was deployed, if known. - fn deployed_block( - &self, - ) -> impl std::future::Future>> + Send; } /// Build a `HashMap)>` from entries like: @@ -876,6 +897,11 @@ macro_rules! bindings { $deployment_info }); + /// Returns the contract's deployment block (if one exists) for the given chain. + pub fn deployment_block(chain_id: &u64) -> Option { + DEPLOYMENT_INFO.get(chain_id).map(|(_, block)| *block).flatten() + } + /// Returns the contract's deployment address (if one exists) for the given chain. pub fn deployment_address(chain_id: &u64) -> Option { DEPLOYMENT_INFO.get(chain_id).map(|(addr, _)| *addr) @@ -899,20 +925,6 @@ macro_rules! bindings { )) } } - - fn deployed_block(&self) -> impl Future>> + Send { - async move { - let chain_id = self - .provider() - .get_chain_id() - .await - .context("could not fetch current chain id")?; - if let Some((_address, deployed_block)) = DEPLOYMENT_INFO.get(&chain_id) { - return Ok(*deployed_block); - } - Ok(None) - } - } } )* } diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index ada1a2bfb4..6b84625f5b 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -55,70 +55,14 @@ include_contracts! { #[cfg(test)] mod tests { - use crate::alloy::networks::{ARBITRUM_ONE, GNOSIS, MAINNET, SEPOLIA}; use { super::*, - ethcontract::{ - common::DeploymentInformation, - futures::future::{self, FutureExt as _, Ready}, - json::json, - jsonrpc::{Call, Id, MethodCall, Params, Value}, - web3::{BatchTransport, RequestId, Transport, Web3, error::Result as Web3Result}, - }, + crate::alloy::networks::{ARBITRUM_ONE, GNOSIS, MAINNET, SEPOLIA}, }; - #[derive(Debug, Clone)] - struct ChainIdTransport(u64); - - impl Transport for ChainIdTransport { - type Out = Ready>; - - fn prepare(&self, method: &str, params: Vec) -> (RequestId, Call) { - assert_eq!(method, "eth_chainId"); - assert_eq!(params.len(), 0); - ( - 0, - MethodCall { - jsonrpc: None, - method: method.to_string(), - params: Params::Array(params), - id: Id::Num(0), - } - .into(), - ) - } - - fn send(&self, _id: RequestId, _request: Call) -> Self::Out { - future::ready(Ok(json!(format!("{:x}", self.0)))) - } - } - - impl BatchTransport for ChainIdTransport { - type Batch = Ready>>>; - - fn send_batch(&self, requests: T) -> Self::Batch - where - T: IntoIterator, - { - future::ready(Ok(requests - .into_iter() - .map(|_| Ok(json!(format!("{:x}", self.0)))) - .collect())) - } - } - #[test] fn deployment_addresses() { - macro_rules! assert_has_deployment_address { - ($contract:ident for $network:expr_2021) => {{ - let web3 = Web3::new(ChainIdTransport($network)); - let deployed = $contract::deployed(&web3).now_or_never().unwrap(); - assert!(deployed.is_ok()); - }}; - } - for network in &[MAINNET, GNOSIS, SEPOLIA, ARBITRUM_ONE] { - assert_has_deployment_address!(GPv2Settlement for *network); assert!( alloy::BalancerV2NoProtocolFeeLiquidityBootstrappingPoolFactory::deployment_address(network).is_some() ) @@ -142,20 +86,6 @@ mod tests { #[test] fn deployment_information() { - macro_rules! assert_has_deployment_information { - ($contract:ident for $network:expr_2021) => {{ - let web3 = Web3::new(ChainIdTransport($network)); - let instance = $contract::deployed(&web3).now_or_never().unwrap().unwrap(); - assert!(matches!( - instance.deployment_information(), - Some(DeploymentInformation::BlockNumber(_)), - )); - }}; - } - - for network in &[MAINNET, GNOSIS, SEPOLIA, ARBITRUM_ONE] { - assert_has_deployment_information!(GPv2Settlement for *network); - } assert!(alloy::BalancerV2WeightedPoolFactory::deployment_address(&MAINNET).is_some()); for network in &[MAINNET, ARBITRUM_ONE] { assert!( diff --git a/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs b/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs index b71017a154..9109983c11 100644 --- a/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs +++ b/crates/driver/src/boundary/liquidity/balancer/v2/mod.rs @@ -8,16 +8,13 @@ use { infra::{self, blockchain::Ethereum}, }, anyhow::{Context, Result}, - contracts::{ - GPv2Settlement, - alloy::{ - BalancerV2ComposableStablePoolFactory, - BalancerV2LiquidityBootstrappingPoolFactory, - BalancerV2StablePoolFactoryV2, - BalancerV2Vault, - BalancerV2WeightedPoolFactory, - BalancerV2WeightedPoolFactoryV3, - }, + contracts::alloy::{ + BalancerV2ComposableStablePoolFactory, + BalancerV2LiquidityBootstrappingPoolFactory, + BalancerV2StablePoolFactoryV2, + BalancerV2Vault, + BalancerV2WeightedPoolFactory, + BalancerV2WeightedPoolFactoryV3, }, ethrpc::{ alloy::conversions::IntoAlloy, @@ -53,13 +50,12 @@ fn to_interaction( output: &liquidity::ExactOutput, receiver: ð::Address, ) -> eth::Interaction { - let web3 = contracts::web3::dummy(); let handler = balancer_v2::SettlementHandler::new( pool.id.into(), // Note that this code assumes `receiver == sender`. This assumption is // also baked into the Balancer V2 logic in the `shared` crate, so to // change this assumption, we would need to change it there as well. - GPv2Settlement::at(&web3, receiver.0), + receiver.0.into_alloy(), pool.vault.0.into_alloy(), Allowances::empty(receiver.0), ); @@ -194,7 +190,7 @@ async fn init_liquidity( Ok(BalancerV2Liquidity::new( web3, balancer_pool_fetcher, - eth.contracts().settlement().clone(), + *eth.contracts().settlement().address(), *contracts.vault.address(), )) } diff --git a/crates/driver/src/boundary/liquidity/uniswap/v2.rs b/crates/driver/src/boundary/liquidity/uniswap/v2.rs index 8e06bb54ad..a5fc63e9a8 100644 --- a/crates/driver/src/boundary/liquidity/uniswap/v2.rs +++ b/crates/driver/src/boundary/liquidity/uniswap/v2.rs @@ -8,7 +8,7 @@ use { infra::{self, blockchain::Ethereum}, }, async_trait::async_trait, - contracts::{GPv2Settlement, alloy::IUniswapLikeRouter}, + contracts::alloy::IUniswapLikeRouter, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -99,7 +99,7 @@ pub fn to_interaction( ) -> eth::Interaction { let handler = uniswap_v2::Inner::new( pool.router.0.into_alloy(), - GPv2Settlement::at(&contracts::web3::dummy(), receiver.0), + receiver.0.into_alloy(), Mutex::new(Allowances::empty(receiver.0)), ); @@ -161,7 +161,7 @@ where Ok(Box::new(UniswapLikeLiquidity::with_allowances( *router.address(), - settlement, + *settlement.address(), Box::new(NoAllowanceManaging), pool_fetcher, ))) diff --git a/crates/driver/src/boundary/liquidity/uniswap/v3.rs b/crates/driver/src/boundary/liquidity/uniswap/v3.rs index d8064c14ca..3c38c13c24 100644 --- a/crates/driver/src/boundary/liquidity/uniswap/v3.rs +++ b/crates/driver/src/boundary/liquidity/uniswap/v3.rs @@ -11,7 +11,6 @@ use { infra::{self, blockchain::Ethereum}, }, anyhow::Context, - contracts::GPv2Settlement, ethrpc::{ alloy::conversions::{IntoAlloy, IntoLegacy}, block_stream::BlockRetrieving, @@ -81,11 +80,9 @@ pub fn to_interaction( output: &liquidity::ExactOutput, receiver: ð::Address, ) -> eth::Interaction { - let web3 = contracts::web3::dummy(); - let handler = UniswapV3SettlementHandler::new( pool.router.0.into_alloy(), - GPv2Settlement::at(&web3, receiver.0), + receiver.0.into_alloy(), Mutex::new(Allowances::empty(receiver.0)), pool.fee.0, ); @@ -152,7 +149,7 @@ async fn init_liquidity( Ok(UniswapV3Liquidity::new( config.router.0.into_alloy(), - eth.contracts().settlement().clone(), + *eth.contracts().settlement().address(), web3, pool_fetcher, )) diff --git a/crates/driver/src/boundary/liquidity/zeroex.rs b/crates/driver/src/boundary/liquidity/zeroex.rs index 34367f3643..fdd128885d 100644 --- a/crates/driver/src/boundary/liquidity/zeroex.rs +++ b/crates/driver/src/boundary/liquidity/zeroex.rs @@ -84,7 +84,7 @@ pub async fn collector( config: &infra::liquidity::config::ZeroEx, ) -> anyhow::Result> { let eth = eth.with_metric_label("zeroex".into()); - let settlement = eth.contracts().settlement().clone(); + let settlement = *eth.contracts().settlement().address(); let web3 = eth.web3().clone(); let contract = contracts::alloy::IZeroex::Instance::deployed(&web3.alloy).await?; let http_client_factory = &HttpClientFactory::new(&shared::http_client::Arguments { diff --git a/crates/driver/src/domain/competition/bad_tokens/simulation.rs b/crates/driver/src/domain/competition/bad_tokens/simulation.rs index 87c481c54c..c0dd83994e 100644 --- a/crates/driver/src/domain/competition/bad_tokens/simulation.rs +++ b/crates/driver/src/domain/competition/bad_tokens/simulation.rs @@ -10,6 +10,7 @@ use { }, infra::{self, observe::metrics}, }, + ethrpc::alloy::conversions::IntoLegacy, futures::FutureExt, model::interaction::InteractionData, shared::{ @@ -37,8 +38,10 @@ struct Inner { impl Detector { pub fn new(max_age: Duration, eth: &infra::Ethereum) -> Self { - let detector = - TraceCallDetectorRaw::new(eth.web3().clone(), eth.contracts().settlement().address()); + let detector = TraceCallDetectorRaw::new( + eth.web3().clone(), + eth.contracts().settlement().address().into_legacy(), + ); Self(Arc::new(Inner { cache: Cache::new(max_age), detector, diff --git a/crates/driver/src/domain/competition/mod.rs b/crates/driver/src/domain/competition/mod.rs index b43b119a11..d158dea382 100644 --- a/crates/driver/src/domain/competition/mod.rs +++ b/crates/driver/src/domain/competition/mod.rs @@ -21,6 +21,7 @@ use { }, util::{Bytes, math}, }, + ethrpc::alloy::conversions::IntoLegacy, futures::{StreamExt, future::Either, stream::FuturesUnordered}, itertools::Itertools, num::Zero, @@ -135,6 +136,7 @@ impl Competition { let cow_amm_orders = tasks.cow_amm_orders.await; auction.orders.extend(cow_amm_orders.iter().cloned()); + let settlement = settlement_contract.into_legacy(); let sort_orders_future = Self::run_blocking_with_timer("sort_orders", move || { // Use spawn_blocking() because a lot of CPU bound computations are happening // and we don't want to block the runtime for too long. @@ -142,7 +144,7 @@ impl Competition { auction, solver_address, order_sorting_strategies, - settlement_contract, + settlement, ) }); @@ -159,7 +161,7 @@ impl Competition { balances, app_data, cow_amm_orders, - ð::Address(settlement_contract), + ð::Address(settlement), ) }) .await; diff --git a/crates/driver/src/domain/competition/solution/encoding.rs b/crates/driver/src/domain/competition/solution/encoding.rs index 6c0ca88545..6ef98656c9 100644 --- a/crates/driver/src/domain/competition/solution/encoding.rs +++ b/crates/driver/src/domain/competition/solution/encoding.rs @@ -14,6 +14,7 @@ use { }, allowance::Allowance, contracts::alloy::{FlashLoanRouter::LoanRequest, WETH9}, + ethcontract::H160, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, itertools::Itertools, }; @@ -57,8 +58,8 @@ pub fn tx( .into_iter() .sorted_by_cached_key(|(token, _amount)| *token) { - tokens.push(token.into()); - clearing_prices.push(amount); + tokens.push(token.0.0.into_alloy()); + clearing_prices.push(amount.into_alloy()); } // Encode trades with custom clearing prices @@ -154,10 +155,10 @@ pub fn tx( ) } }; - tokens.push(price.sell_token); - tokens.push(price.buy_token); - clearing_prices.push(price.sell_price); - clearing_prices.push(price.buy_price); + tokens.push(price.sell_token.into_alloy()); + tokens.push(price.buy_token.into_alloy()); + clearing_prices.push(price.sell_price.into_alloy()); + clearing_prices.push(price.buy_price.into_alloy()); trade.sell_token_index = (tokens.len() - 2).into(); trade.buy_token_index = (tokens.len() - 1).into(); @@ -192,9 +193,11 @@ pub fn tx( target: interaction.target.into(), call_data: interaction.call_data.clone(), }, - competition::solution::Interaction::Liquidity(liquidity) => { - liquidity_interaction(liquidity, &slippage, contracts.settlement())? - } + competition::solution::Interaction::Liquidity(liquidity) => liquidity_interaction( + liquidity, + &slippage, + contracts.settlement().address().into_legacy(), + )?, }) } @@ -203,7 +206,7 @@ pub fn tx( interactions.push(unwrap(native_unwrap, contracts.weth())); } - let tx = contracts + let mut settle_calldata = contracts .settlement() .settle( tokens, @@ -215,15 +218,18 @@ pub fn tx( post_interactions.iter().map(codec::interaction).collect(), ], ) - .into_inner(); + .calldata() + .to_vec(); // Encode the auction id into the calldata - let mut settle_calldata = tx.data.unwrap().0; settle_calldata.extend(auction.id().ok_or(Error::MissingAuctionId)?.to_be_bytes()); // Target and calldata depend on whether a flashloan is used let (to, calldata) = if solution.flashloans.is_empty() { - (contracts.settlement().address().into(), settle_calldata) + ( + contracts.settlement().address().into_legacy().into(), + settle_calldata, + ) } else { let router = contracts .flashloan_router() @@ -259,7 +265,7 @@ pub fn tx( pub fn liquidity_interaction( liquidity: &Liquidity, slippage: &slippage::Parameters, - settlement: &contracts::GPv2Settlement, + settlement_contract: H160, ) -> Result { let (input, output) = slippage.apply_to(&slippage::Interaction { input: liquidity.input, @@ -267,21 +273,21 @@ pub fn liquidity_interaction( })?; match liquidity.liquidity.kind.clone() { - liquidity::Kind::UniswapV2(pool) => pool - .swap(&input, &output, &settlement.address().into()) - .ok(), - liquidity::Kind::UniswapV3(pool) => pool - .swap(&input, &output, &settlement.address().into()) - .ok(), - liquidity::Kind::BalancerV2Stable(pool) => pool - .swap(&input, &output, &settlement.address().into()) - .ok(), - liquidity::Kind::BalancerV2Weighted(pool) => pool - .swap(&input, &output, &settlement.address().into()) - .ok(), - liquidity::Kind::Swapr(pool) => pool - .swap(&input, &output, &settlement.address().into()) - .ok(), + liquidity::Kind::UniswapV2(pool) => { + pool.swap(&input, &output, &settlement_contract.into()).ok() + } + liquidity::Kind::UniswapV3(pool) => { + pool.swap(&input, &output, &settlement_contract.into()).ok() + } + liquidity::Kind::BalancerV2Stable(pool) => { + pool.swap(&input, &output, &settlement_contract.into()).ok() + } + liquidity::Kind::BalancerV2Weighted(pool) => { + pool.swap(&input, &output, &settlement_contract.into()).ok() + } + liquidity::Kind::Swapr(pool) => { + pool.swap(&input, &output, &settlement_contract.into()).ok() + } liquidity::Kind::ZeroEx(limit_order) => limit_order.to_interaction(&input).ok(), } .ok_or(Error::InvalidInteractionExecution(Box::new( @@ -346,37 +352,26 @@ struct Flags { } pub mod codec { - use crate::domain::{competition::order, eth}; - - // cf. https://github.com/cowprotocol/contracts/blob/v1.5.0/src/contracts/libraries/GPv2Trade.sol#L16 - type Trade = ( - eth::U256, // sellTokenIndex - eth::U256, // buyTokenIndex - eth::H160, // receiver - eth::U256, // sellAmount - eth::U256, // buyAmount - u32, // validTo - ethcontract::Bytes<[u8; 32]>, // appData - eth::U256, // feeAmount - eth::U256, // flags - eth::U256, // executedAmount - ethcontract::Bytes>, // signature - ); - - pub(super) fn trade(trade: &super::Trade) -> Trade { - ( - trade.sell_token_index, - trade.buy_token_index, - trade.receiver, - trade.sell_amount, - trade.buy_amount, - trade.valid_to, - ethcontract::Bytes(trade.app_data.into()), - trade.fee_amount, - flags(&trade.flags), - trade.executed_amount, - ethcontract::Bytes(trade.signature.0.clone()), - ) + use { + crate::domain::{competition::order, eth}, + contracts::alloy::GPv2Settlement, + ethrpc::alloy::conversions::IntoAlloy, + }; + + pub(super) fn trade(trade: &super::Trade) -> GPv2Settlement::GPv2Trade::Data { + GPv2Settlement::GPv2Trade::Data { + sellTokenIndex: trade.sell_token_index.into_alloy(), + buyTokenIndex: trade.buy_token_index.into_alloy(), + receiver: trade.receiver.into_alloy(), + sellAmount: trade.sell_amount.into_alloy(), + buyAmount: trade.buy_amount.into_alloy(), + validTo: trade.valid_to, + appData: trade.app_data.0.into(), + feeAmount: trade.fee_amount.into_alloy(), + flags: flags(&trade.flags).into_alloy(), + executedAmount: trade.executed_amount.into_alloy(), + signature: trade.signature.0.clone().into(), + } } // cf. https://github.com/cowprotocol/contracts/blob/v1.5.0/src/contracts/libraries/GPv2Trade.sol#L58 @@ -410,19 +405,14 @@ pub mod codec { result.into() } - // cf. https://github.com/cowprotocol/contracts/blob/v1.5.0/src/contracts/libraries/GPv2Interaction.sol#L9 - type Interaction = ( - eth::H160, // target - eth::U256, // value - ethcontract::Bytes>, // signature - ); - - pub(super) fn interaction(interaction: ð::Interaction) -> Interaction { - ( - interaction.target.0, - interaction.value.0, - ethcontract::Bytes(interaction.call_data.0.clone()), - ) + pub(super) fn interaction( + interaction: ð::Interaction, + ) -> GPv2Settlement::GPv2Interaction::Data { + GPv2Settlement::GPv2Interaction::Data { + target: interaction.target.0.into_alloy(), + value: interaction.value.0.into_alloy(), + callData: interaction.call_data.0.clone().into(), + } } pub fn signature(signature: &order::Signature) -> super::Bytes> { diff --git a/crates/driver/src/domain/competition/solution/mod.rs b/crates/driver/src/domain/competition/solution/mod.rs index 4f948a9fe2..4c9b6f161b 100644 --- a/crates/driver/src/domain/competition/solution/mod.rs +++ b/crates/driver/src/domain/competition/solution/mod.rs @@ -16,6 +16,7 @@ use { }, }, chrono::Utc, + ethrpc::alloy::conversions::IntoLegacy, futures::future::try_join_all, itertools::Itertools, num::{BigRational, One}, @@ -273,7 +274,10 @@ impl Solution { let allowances = try_join_all(self.allowances(internalization).map(|required| async move { eth.erc20(required.0.token) - .allowance(settlement_contract.address().into(), required.0.spender) + .allowance( + settlement_contract.address().into_legacy().into(), + required.0.spender, + ) .await .map(|existing| (required, existing)) })) diff --git a/crates/driver/src/domain/quote.rs b/crates/driver/src/domain/quote.rs index 3e6eb7acc5..0fd50b101a 100644 --- a/crates/driver/src/domain/quote.rs +++ b/crates/driver/src/domain/quote.rs @@ -16,6 +16,7 @@ use { util, }, chrono::Utc, + ethrpc::alloy::conversions::IntoLegacy, std::{ collections::{HashMap, HashSet}, iter, @@ -47,7 +48,9 @@ impl Quote { interactions: solution .interactions() .iter() - .map(|i| encode::interaction(i, eth.contracts().settlement())) + .map(|i| { + encode::interaction(i, eth.contracts().settlement().address().into_legacy()) + }) .collect::, _>>()? .into_iter() .flatten() @@ -266,6 +269,7 @@ mod encode { allowance::{Approval, Required}, }, }, + ethcontract::H160, num::rational::Ratio, }; @@ -273,7 +277,7 @@ mod encode { pub(super) fn interaction( interaction: &solution::Interaction, - settlement: &contracts::GPv2Settlement, + settlement: H160, ) -> Result, solution::encoding::Error> { let slippage = solution::slippage::Parameters { relative: Ratio::new_raw(DEFAULT_QUOTE_SLIPPAGE_BPS.into(), 10_000.into()), diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index aab85ae8f7..ec03aa7627 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -1,7 +1,13 @@ use { crate::{domain::eth, infra::blockchain::Ethereum}, chain::Chain, - contracts::alloy::{BalancerV2Vault, FlashLoanRouter, WETH9, support::Balances}, + contracts::alloy::{ + BalancerV2Vault, + FlashLoanRouter, + GPv2Settlement, + WETH9, + support::Balances, + }, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -12,7 +18,7 @@ use { #[derive(Debug, Clone)] pub struct Contracts { - settlement: contracts::GPv2Settlement, + settlement: GPv2Settlement::Instance, vault_relayer: eth::ContractAddress, vault: BalancerV2Vault::Instance, signatures: contracts::alloy::support::Signatures::Instance, @@ -48,26 +54,17 @@ impl Contracts { chain: Chain, addresses: Addresses, ) -> Result { - let address_for = |contract: ðcontract::Contract, - address: Option| { - address - .or_else(|| deployment_address(contract, chain)) - .unwrap() - .0 - }; - - let settlement = contracts::GPv2Settlement::at( - web3, - address_for( - contracts::GPv2Settlement::raw_contract(), - addresses.settlement, - ), - ); - let vault_relayer = settlement.methods().vault_relayer().call().await?.into(); - let vault = BalancerV2Vault::Instance::new( - settlement.methods().vault().call().await?.into_alloy(), + let settlement = GPv2Settlement::Instance::new( + addresses + .settlement + .map(|addr| addr.0.into_alloy()) + .or_else(|| GPv2Settlement::deployment_address(&chain.id())) + .unwrap(), web3.alloy.clone(), ); + let vault_relayer = settlement.vaultRelayer().call().await?; + let vault = + BalancerV2Vault::Instance::new(settlement.vault().call().await?, web3.alloy.clone()); let balance_helper = Balances::Instance::new( addresses .balances @@ -96,7 +93,7 @@ impl Contracts { let settlement_domain_separator = eth::DomainSeparator( settlement - .domain_separator() + .domainSeparator() .call() .await .expect("domain separator") @@ -117,7 +114,7 @@ impl Contracts { Ok(Self { settlement, - vault_relayer, + vault_relayer: vault_relayer.into_legacy().into(), vault, signatures, weth, @@ -128,7 +125,7 @@ impl Contracts { }) } - pub fn settlement(&self) -> &contracts::GPv2Settlement { + pub fn settlement(&self) -> &GPv2Settlement::Instance { &self.settlement } @@ -201,4 +198,6 @@ impl ContractAt for contracts::ERC20 { pub enum Error { #[error("method error: {0:?}")] Method(#[from] ethcontract::errors::MethodError), + #[error("method error: {0:?}")] + Rpc(#[from] alloy::contract::Error), } diff --git a/crates/driver/src/infra/blockchain/mod.rs b/crates/driver/src/infra/blockchain/mod.rs index de6fb6a021..de79a07084 100644 --- a/crates/driver/src/infra/blockchain/mod.rs +++ b/crates/driver/src/infra/blockchain/mod.rs @@ -309,6 +309,8 @@ impl fmt::Debug for Ethereum { #[derive(Debug, Error)] pub enum Error { + #[error("method error: {0:?}")] + Rpc(#[from] alloy::contract::Error), #[error("method error: {0:?}")] Method(#[from] ethcontract::errors::MethodError), #[error("web3 error: {0:?}")] @@ -332,6 +334,7 @@ impl Error { } Error::GasPrice(_) => false, Error::AccessList(_) => true, + Error::Rpc(_) => true, } } } @@ -340,6 +343,7 @@ impl From for Error { fn from(err: contracts::Error) -> Self { match err { contracts::Error::Method(err) => Self::Method(err), + contracts::Error::Rpc(err) => Self::Rpc(err), } } } @@ -347,7 +351,7 @@ impl From for Error { impl From for Error { fn from(err: SimulationError) -> Self { match err { - SimulationError::Method(err) => Self::Method(err), + SimulationError::Method(err) => Self::Rpc(err), SimulationError::Web3(err) => Self::Web3(err), } } diff --git a/crates/driver/src/infra/tokens.rs b/crates/driver/src/infra/tokens.rs index 25f85d5d76..cd8eca650b 100644 --- a/crates/driver/src/infra/tokens.rs +++ b/crates/driver/src/infra/tokens.rs @@ -4,7 +4,10 @@ use { infra::{Ethereum, blockchain}, }, anyhow::Result, - ethrpc::block_stream::{self, CurrentBlockWatcher}, + ethrpc::{ + alloy::conversions::IntoLegacy, + block_stream::{self, CurrentBlockWatcher}, + }, futures::{FutureExt, StreamExt}, itertools::Itertools, model::order::BUY_ETH_ADDRESS, @@ -72,7 +75,13 @@ async fn update_task(blocks: CurrentBlockWatcher, inner: std::sync::Weak) /// Updates the settlement contract's balance for every cached token. async fn update_balances(inner: Arc) -> Result<(), blockchain::Error> { - let settlement = inner.eth.contracts().settlement().address().into(); + let settlement = inner + .eth + .contracts() + .settlement() + .address() + .into_legacy() + .into(); let futures = { let cache = inner.cache.read().unwrap(); let tokens = cache.keys().cloned().collect::>(); @@ -132,7 +141,13 @@ impl Inner { &self, tokens: &[eth::TokenAddress], ) -> Vec> { - let settlement = self.eth.contracts().settlement().address().into(); + let settlement = self + .eth + .contracts() + .settlement() + .address() + .into_legacy() + .into(); let futures = tokens.iter().map(|token| { let build_request = |token: ð::TokenAddress| { let token = self.eth.erc20(*token); diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 7c00785b74..0d3d4c5541 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -14,6 +14,7 @@ use { ERC20Mintable, FlashLoanRouter, GPv2AllowListAuthentication::GPv2AllowListAuthentication, + GPv2Settlement, WETH9, support::{Balances, Signatures}, }, @@ -50,7 +51,7 @@ pub struct Blockchain { pub web3_url: String, pub tokens: HashMap<&'static str, ERC20Mintable::Instance>, pub weth: WETH9::Instance, - pub settlement: contracts::GPv2Settlement, + pub settlement: GPv2Settlement::Instance, pub balances: Balances::Instance, pub signatures: Signatures::Instance, pub flashloan_router: FlashLoanRouter::Instance, @@ -310,35 +311,46 @@ impl Blockchain { let authenticator = GPv2AllowListAuthentication::deploy(web3.alloy.clone()) .await .unwrap(); - let mut settlement = contracts::GPv2Settlement::builder( - &web3, - authenticator.address().into_legacy(), - vault.into_legacy(), + let mut settlement = GPv2Settlement::GPv2Settlement::deploy( + web3.alloy.clone(), + *authenticator.address(), + vault, ) - .from(main_trader_account.clone()) - .deploy() .await .unwrap(); if let Some(settlement_address) = config.settlement_address { - let vault_relayer = settlement.vault_relayer().call().await.unwrap(); + let vault_relayer = settlement.vaultRelayer().call().await.unwrap(); let vault_relayer_code = { // replace the vault relayer code to allow the settlement // contract at a specific address. - let mut code = web3.eth().code(vault_relayer, None).await.unwrap().0; + let mut code = web3 + .eth() + .code(vault_relayer.into_legacy(), None) + .await + .unwrap() + .0; for i in 0..code.len() - 20 { let window = &mut code[i..][..20]; - if window == settlement.address().0 { + if window == settlement.address().as_slice() { window.copy_from_slice(&settlement_address.0); } } code }; - let settlement_code = web3.eth().code(settlement.address(), None).await.unwrap().0; + let settlement_code = web3 + .eth() + .code(settlement.address().into_legacy(), None) + .await + .unwrap() + .0; - set_code(&web3, vault_relayer, &vault_relayer_code).await; + set_code(&web3, vault_relayer.into_legacy(), &vault_relayer_code).await; set_code(&web3, settlement_address, &settlement_code).await; - settlement = contracts::GPv2Settlement::at(&web3, settlement_address); + settlement = GPv2Settlement::GPv2Settlement::new( + settlement_address.into_alloy(), + web3.alloy.clone(), + ); } let balances_address = match config.balances_address { @@ -369,14 +381,12 @@ impl Blockchain { }; let signatures = Signatures::Instance::new(signatures_address, web3.alloy.clone()); - let flashloan_router_address = FlashLoanRouter::Instance::deploy_builder( - web3.alloy.clone(), - settlement.address().into_alloy(), - ) - .from(main_trader_account.address().into_alloy()) - .deploy() - .await - .unwrap(); + let flashloan_router_address = + FlashLoanRouter::Instance::deploy_builder(web3.alloy.clone(), *settlement.address()) + .from(main_trader_account.address().into_alloy()) + .deploy() + .await + .unwrap(); let flashloan_router = FlashLoanRouter::Instance::new(flashloan_router_address, web3.alloy.clone()); @@ -415,7 +425,7 @@ impl Blockchain { } let domain_separator = - boundary::DomainSeparator(settlement.domain_separator().call().await.unwrap().0); + boundary::DomainSeparator(settlement.domainSeparator().call().await.unwrap().0); // Create (deploy) the tokens needed by the pools. let mut tokens = HashMap::new(); @@ -487,14 +497,11 @@ impl Blockchain { .send_and_watch() .await .unwrap(); - weth.transfer( - settlement.address().into_alloy(), - pool.reserve_a.amount.into_alloy(), - ) - .from(primary_address.into_alloy()) - .send_and_watch() - .await - .unwrap(); + weth.transfer(*settlement.address(), pool.reserve_a.amount.into_alloy()) + .from(primary_address.into_alloy()) + .send_and_watch() + .await + .unwrap(); for trader_account in trader_accounts.iter() { weth.transfer( trader_account.address().into_alloy(), @@ -507,12 +514,12 @@ impl Blockchain { } } else { for trader_account in trader_accounts.iter() { - let vault_relayer = settlement.vault_relayer().call().await.unwrap(); + let vault_relayer = settlement.vaultRelayer().call().await.unwrap(); tokens .get(pool.reserve_a.token) .unwrap() - .approve(vault_relayer.into_alloy(), U256::MAX) + .approve(vault_relayer, U256::MAX) .from(trader_account.address().into_alloy()) .send_and_watch() .await @@ -531,10 +538,7 @@ impl Blockchain { tokens .get(pool.reserve_a.token) .unwrap() - .mint( - settlement.address().into_alloy(), - pool.reserve_a.amount.into_alloy(), - ) + .mint(*settlement.address(), pool.reserve_a.amount.into_alloy()) .from(main_trader_account.address().into_alloy()) .send_and_watch() .await @@ -560,14 +564,11 @@ impl Blockchain { .send_and_watch() .await .unwrap(); - weth.transfer( - settlement.address().into_alloy(), - pool.reserve_b.amount.into_alloy(), - ) - .from(primary_address.into_alloy()) - .send_and_watch() - .await - .unwrap(); + weth.transfer(*settlement.address(), pool.reserve_b.amount.into_alloy()) + .from(primary_address.into_alloy()) + .send_and_watch() + .await + .unwrap(); for trader_account in trader_accounts.iter() { weth.transfer( trader_account.address().into_alloy(), @@ -580,12 +581,12 @@ impl Blockchain { } } else { for trader_account in trader_accounts.iter() { - let vault_relayer = settlement.vault_relayer().call().await.unwrap(); + let vault_relayer = settlement.vaultRelayer().call().await.unwrap(); tokens .get(pool.reserve_b.token) .unwrap() - .approve(vault_relayer.into_alloy(), U256::MAX) + .approve(vault_relayer, U256::MAX) .from(trader_account.address().into_alloy()) .send_and_watch() .await @@ -604,10 +605,7 @@ impl Blockchain { tokens .get(pool.reserve_b.token) .unwrap() - .mint( - settlement.address().into_alloy(), - pool.reserve_b.amount.into_alloy(), - ) + .mint(*settlement.address(), pool.reserve_b.amount.into_alloy()) .from(main_trader_account.address().into_alloy()) .send_and_watch() .await @@ -781,12 +779,12 @@ impl Blockchain { } // Approve the tokens needed for the solution. - let vault_relayer = self.settlement.vault_relayer().call().await.unwrap(); + let vault_relayer = self.settlement.vaultRelayer().call().await.unwrap(); self.tokens .get(order.sell_token) .unwrap() - .approve(vault_relayer.into_alloy(), U256::MAX) + .approve(vault_relayer, U256::MAX) .from(trader_account.address().into_alloy()) .send_and_watch() .await @@ -816,7 +814,7 @@ impl Blockchain { .swap( amount_0_out.into_alloy(), amount_1_out.into_alloy(), - self.settlement.address().into_alloy(), + *self.settlement.address(), Default::default(), ) .calldata() diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index 09b320bbef..f6afc2432d 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -234,7 +234,7 @@ async fn create_config_file( [submission] gas-price-cap = "1000000000000" "#, - hex_address(blockchain.settlement.address()), + blockchain.settlement.address(), blockchain.weth.address(), blockchain.balances.address(), blockchain.signatures.address(), diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index 0a08544ee3..f3f7026ead 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -410,7 +410,7 @@ impl Solver { let build_token = |token_name: String| async move { let token = config.blockchain.get_token_wrapped(token_name.as_str()); let contract = contracts::ERC20::at(&config.blockchain.web3, token); - let settlement = config.blockchain.settlement.address(); + let settlement = config.blockchain.settlement.address().into_legacy(); ( hex_address(token), json!({ @@ -468,7 +468,7 @@ impl Solver { let eth = Ethereum::new( rpc, Addresses { - settlement: Some(config.blockchain.settlement.address().into()), + settlement: Some(config.blockchain.settlement.address().into_legacy().into()), weth: Some(config.blockchain.weth.address().into_legacy().into()), balances: Some(config.blockchain.balances.address().into_legacy().into()), signatures: Some(config.blockchain.signatures.address().into_legacy().into()), diff --git a/crates/orderbook/src/run.rs b/crates/orderbook/src/run.rs index dd5ccf3718..77678e6b98 100644 --- a/crates/orderbook/src/run.rs +++ b/crates/orderbook/src/run.rs @@ -8,21 +8,20 @@ use { orderbook::Orderbook, quoter::QuoteHandler, }, + alloy::providers::Provider, anyhow::{Context, Result, anyhow}, app_data::Validator, chain::Chain, clap::Parser, - contracts::{ + contracts::alloy::{ + BalancerV2Vault, + ChainalysisOracle, GPv2Settlement, - alloy::{ - BalancerV2Vault, - ChainalysisOracle, - HooksTrampoline, - IUniswapV3Factory, - InstanceExt, - WETH9, - support::Balances, - }, + HooksTrampoline, + IUniswapV3Factory, + InstanceExt, + WETH9, + support::Balances, }, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, futures::{FutureExt, StreamExt}, @@ -103,8 +102,8 @@ pub async fn run(args: Arguments) { } let settlement_contract = match args.shared.settlement_contract_address { - Some(address) => contracts::GPv2Settlement::with_deployment_info(&web3, address, None), - None => contracts::GPv2Settlement::deployed(&web3) + Some(address) => GPv2Settlement::Instance::new(address.into_alloy(), web3.alloy.clone()), + None => GPv2Settlement::Instance::deployed(&web3.alloy) .await .expect("load settlement contract"), }; @@ -115,7 +114,7 @@ pub async fn run(args: Arguments) { .expect("load balances contract"), }; let vault_relayer = settlement_contract - .vault_relayer() + .vaultRelayer() .call() .await .expect("Couldn't get vault relayer address"); @@ -143,7 +142,7 @@ pub async fn run(args: Arguments) { signature_validator::Contracts { settlement: settlement_contract.clone(), signatures: signatures_contract, - vault_relayer, + vault_relayer: vault_relayer.into_legacy(), }, balance_overrider.clone(), ); @@ -174,7 +173,8 @@ pub async fn run(args: Arguments) { verify_deployed_contract_constants(&settlement_contract, chain_id) .await .expect("Deployed contract constants don't match the ones in this binary"); - let domain_separator = DomainSeparator::new(chain_id, settlement_contract.address()); + let domain_separator = + DomainSeparator::new(chain_id, settlement_contract.address().into_legacy()); let postgres_write = Postgres::try_new(args.db_write_url.as_str()).expect("failed to create database"); @@ -191,7 +191,7 @@ pub async fn run(args: Arguments) { BalanceSimulator::new( settlement_contract.clone(), balances_contract.clone(), - vault_relayer, + vault_relayer.into_legacy(), vault_address.map(IntoLegacy::into_legacy), balance_overrider, ), @@ -250,7 +250,7 @@ pub async fn run(args: Arguments) { vault.as_ref(), uniswapv3_factory.as_ref(), &base_tokens, - settlement_contract.address(), + settlement_contract.address().into_legacy(), ) .await .expect("failed to initialize token owner finders"); @@ -264,7 +264,7 @@ pub async fn run(args: Arguments) { tracing_node_url, "trace", ), - settlement_contract.address(), + settlement_contract.address().into_legacy(), finder, )), args.shared.token_quality_cache_expiry, @@ -302,13 +302,14 @@ pub async fn run(args: Arguments) { web3: web3.clone(), simulation_web3, chain, + settlement: settlement_contract.address().into_legacy(), native_token: native_token.address().into_legacy(), - settlement: settlement_contract.address(), authenticator: settlement_contract .authenticator() .call() .await - .expect("failed to query solver authenticator address"), + .expect("failed to query solver authenticator address") + .into_legacy(), base_tokens: base_tokens.clone(), block_stream: current_block_stream.clone(), }, @@ -440,7 +441,7 @@ pub async fn run(args: Arguments) { )); let orderbook = Arc::new(Orderbook::new( domain_separator, - settlement_contract.address(), + settlement_contract.address().into_legacy(), postgres_write.clone(), postgres_read.clone(), order_validator.clone(), @@ -563,19 +564,19 @@ fn serve_api( /// contract instance. Signature inconsistencies due to a mismatch of these /// constants are hard to debug. async fn verify_deployed_contract_constants( - contract: &GPv2Settlement, + contract: &GPv2Settlement::Instance, chain_id: u64, ) -> Result<()> { - let web3 = contract.raw_instance().web3(); + let provider = contract.provider(); let bytecode = const_hex::encode( - web3.eth() - .code(contract.address(), None) + provider + .get_code_at(*contract.address()) .await .context("Could not load deployed bytecode")? .0, ); - let domain_separator = DomainSeparator::new(chain_id, contract.address()); + let domain_separator = DomainSeparator::new(chain_id, contract.address().into_legacy()); if !bytecode.contains(&const_hex::encode(domain_separator.0)) { return Err(anyhow!("Bytecode did not contain domain separator")); } diff --git a/crates/shared/src/account_balances/mod.rs b/crates/shared/src/account_balances/mod.rs index 69d73bdff8..bb751cb8f4 100644 --- a/crates/shared/src/account_balances/mod.rs +++ b/crates/shared/src/account_balances/mod.rs @@ -4,18 +4,9 @@ use { BalanceOverriding, }, alloy::sol_types::{SolCall, SolType, sol_data}, - contracts::alloy::support::Balances, - ethcontract::{ - Bytes, - contract::MethodBuilder, - dyns::DynTransport, - state_overrides::StateOverrides, - }, - ethrpc::{ - Web3, - alloy::conversions::{IntoAlloy, IntoLegacy}, - block_stream::CurrentBlockWatcher, - }, + contracts::alloy::{GPv2Settlement, support::Balances}, + ethcontract::state_overrides::StateOverrides, + ethrpc::{Web3, alloy::conversions::IntoAlloy, block_stream::CurrentBlockWatcher}, model::{ interaction::InteractionData, order::{Order, SellTokenSource}, @@ -103,7 +94,7 @@ pub fn cached( #[derive(Clone)] pub struct BalanceSimulator { - settlement: contracts::GPv2Settlement, + settlement: GPv2Settlement::Instance, balances: Balances::Instance, vault_relayer: H160, vault: H160, @@ -112,7 +103,7 @@ pub struct BalanceSimulator { impl BalanceSimulator { pub fn new( - settlement: contracts::GPv2Settlement, + settlement: GPv2Settlement::Instance, balances: Balances::Instance, vault_relayer: H160, vault: Option, @@ -135,21 +126,15 @@ impl BalanceSimulator { self.vault } - #[expect(clippy::too_many_arguments)] - pub async fn simulate( + pub async fn simulate( &self, owner: H160, token: H160, source: SellTokenSource, interactions: &[InteractionData], amount: Option, - add_access_lists: F, balance_override: Option, - ) -> Result - where - F: FnOnce(MethodBuilder>>) -> Fut, - Fut: Future>>>, - { + ) -> Result { let overrides: StateOverrides = match balance_override { Some(overrides) => self .balance_overrider @@ -168,7 +153,7 @@ impl BalanceSimulator { // This allows us to end up with very accurate balance simulations. let balance_call = Balances::Balances::balanceCall { contracts: Balances::Balances::Contracts { - settlement: self.settlement.address().into_alloy(), + settlement: *self.settlement.address(), vaultRelayer: self.vault_relayer.into_alloy(), vault: self.vault.into_alloy(), }, @@ -186,17 +171,15 @@ impl BalanceSimulator { .collect(), }; - let delegate_call = self + let response = self .settlement - .simulate_delegatecall( - self.balances.address().into_legacy(), - Bytes(balance_call.abi_encode()), - ) - .from(crate::SIMULATION_ACCOUNT.clone()); - - let delegate_call = add_access_lists(delegate_call).await; + .simulateDelegatecall(*self.balances.address(), balance_call.abi_encode().into()) + .with_cloned_provider() + .state(overrides.into_alloy()) + .from(crate::SIMULATION_ACCOUNT.clone().address().into_alloy()) + .call() + .await?; - let response = delegate_call.call_with_state_overrides(&overrides).await?; let (token_balance, allowance, effective_balance, can_transfer) = <( sol_data::Uint<256>, @@ -240,7 +223,7 @@ pub struct Simulation { #[derive(Debug, Error)] pub enum SimulationError { #[error("method error: {0:?}")] - Method(#[from] ethcontract::errors::MethodError), + Method(#[from] alloy::contract::Error), #[error("web3 error: {0:?}")] Web3(#[from] web3::error::Error), } diff --git a/crates/shared/src/account_balances/simulation.rs b/crates/shared/src/account_balances/simulation.rs index a2acaff004..cdeb96230b 100644 --- a/crates/shared/src/account_balances/simulation.rs +++ b/crates/shared/src/account_balances/simulation.rs @@ -56,7 +56,6 @@ impl Balances { query.source, &query.interactions, None, - |delegate_call| async move { delegate_call }, query.balance_override.clone(), ) .await?; @@ -158,7 +157,6 @@ impl BalanceFetching for Balances { query.source, &query.interactions, Some(amount), - |delegate_call| async move { delegate_call }, query.balance_override.clone(), ) .await @@ -184,6 +182,7 @@ mod tests { super::*, crate::price_estimation::trade_verifier::balance_overrides::DummyOverrider, alloy::primitives::address, + contracts::alloy::GPv2Settlement, ethrpc::Web3, model::order::SellTokenSource, std::sync::Arc, @@ -193,8 +192,10 @@ mod tests { #[tokio::test] async fn test_for_user() { let web3 = Web3::new_from_env(); - let settlement = - contracts::GPv2Settlement::at(&web3, addr!("9008d19f58aabd9ed0d60971565aa8510560ab41")); + let settlement = GPv2Settlement::GPv2Settlement::new( + alloy::primitives::address!("0x9008d19f58aabd9ed0d60971565aa8510560ab41"), + web3.alloy.clone(), + ); let balances = contracts::alloy::support::Balances::Instance::new( address!("3e8C6De9510e7ECad902D005DE3Ab52f35cF4f1b"), web3.alloy.clone(), diff --git a/crates/shared/src/bad_token/trace_call.rs b/crates/shared/src/bad_token/trace_call.rs index a83308ce5a..50b18bbfd6 100644 --- a/crates/shared/src/bad_token/trace_call.rs +++ b/crates/shared/src/bad_token/trace_call.rs @@ -378,8 +378,8 @@ mod tests { sources::{BaselineSource, uniswap_v2}, }, chain::Chain, - contracts::alloy::{BalancerV2Vault, IUniswapV3Factory, InstanceExt}, - ethrpc::Web3, + contracts::alloy::{BalancerV2Vault, GPv2Settlement, IUniswapV3Factory, InstanceExt}, + ethrpc::{Web3, alloy::conversions::IntoLegacy}, hex_literal::hex, std::{env, time::Duration}, web3::types::{ @@ -702,10 +702,12 @@ mod tests { // the callback that I didn't follow in the SC code. // - 0x4f9254c83eb525f9fcf346490bbb3ed28a81c667 Not sure why deny listed. - let settlement = contracts::GPv2Settlement::deployed(&web3).await.unwrap(); + let settlement = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let finder = Arc::new(TokenOwnerFinder { web3: web3.clone(), - settlement_contract: settlement.address(), + settlement_contract: settlement.address().into_legacy(), proposers: vec![ Arc::new(UniswapLikePairProviderFinder { inner: uniswap_v2::UniV2BaselineSourceParameters::from_baseline_source( @@ -756,7 +758,7 @@ mod tests { ), ], }); - let token_cache = TraceCallDetector::new(web3, settlement.address(), finder); + let token_cache = TraceCallDetector::new(web3, settlement.address().into_legacy(), finder); println!("testing good tokens"); for &token in base_tokens { @@ -777,7 +779,9 @@ mod tests { observe::tracing::initialize(&observe::Config::default().with_env_filter("shared=debug")); let web3 = Web3::new_from_env(); let base_tokens = vec![testlib::tokens::WETH]; - let settlement = contracts::GPv2Settlement::deployed(&web3).await.unwrap(); + let settlement = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let factory = IUniswapV3Factory::Instance::deployed(&web3.alloy) .await .unwrap(); @@ -788,10 +792,10 @@ mod tests { ); let finder = Arc::new(TokenOwnerFinder { web3: web3.clone(), - settlement_contract: settlement.address(), + settlement_contract: settlement.address().into_legacy(), proposers: vec![univ3], }); - let token_cache = TraceCallDetector::new(web3, settlement.address(), finder); + let token_cache = TraceCallDetector::new(web3, settlement.address().into_legacy(), finder); let result = token_cache.detect(testlib::tokens::USDC).await; dbg!(&result); @@ -906,13 +910,15 @@ mod tests { let web3 = Web3::new_from_env(); - let settlement = contracts::GPv2Settlement::deployed(&web3).await.unwrap(); + let settlement = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let finder = Arc::new(TokenOwnerFinder { web3: web3.clone(), proposers: vec![solver_token_finder], - settlement_contract: settlement.address(), + settlement_contract: settlement.address().into_legacy(), }); - let token_cache = TraceCallDetector::new(web3, settlement.address(), finder); + let token_cache = TraceCallDetector::new(web3, settlement.address().into_legacy(), finder); for token in tokens { let result = token_cache.detect(token).await; diff --git a/crates/shared/src/event_handling.rs b/crates/shared/src/event_handling.rs index 216bf9c5de..1cce5232fe 100644 --- a/crates/shared/src/event_handling.rs +++ b/crates/shared/src/event_handling.rs @@ -772,38 +772,46 @@ fn track_block_range(range: &str) { mod tests { use { super::*, - contracts::{GPv2Settlement, gpv2_settlement}, - ethcontract::{BlockNumber, Event as EthcontractEvent, H256}, + contracts::alloy::{GPv2Settlement, InstanceExt}, + ethcontract::{BlockNumber, H256}, ethrpc::{Web3, block_stream::block_number_to_block_number_hash}, std::str::FromStr, }; - impl_event_retrieving! { - pub GPv2SettlementContract for gpv2_settlement + impl AlloyEventRetrieving for GPv2Settlement::Instance { + type Event = GPv2Settlement::GPv2Settlement::GPv2SettlementEvents; + + fn filter(&self) -> alloy::rpc::types::Filter { + Filter::new().address(*self.address()) + } + + fn provider(&self) -> &contracts::alloy::Provider { + self.provider() + } } /// Simple event storage for testing purposes of EventHandler struct EventStorage { - pub events: Vec>, + pub events: Vec<(T, alloy::rpc::types::Log)>, } #[async_trait::async_trait] - impl EventStoring> for EventStorage + impl EventStoring<(T, alloy::rpc::types::Log)> for EventStorage where T: Send + Sync, { async fn replace_events( &mut self, - events: Vec>, + events: Vec<(T, alloy::rpc::types::Log)>, range: RangeInclusive, ) -> Result<()> { self.events - .retain(|event| event.meta.clone().unwrap().block_number < *range.start()); + .retain(|(_, log)| log.block_number.unwrap() < *range.start()); self.append_events(events).await?; Ok(()) } - async fn append_events(&mut self, events: Vec>) -> Result<()> { + async fn append_events(&mut self, events: Vec<(T, alloy::rpc::types::Log)>) -> Result<()> { self.events.extend(events); Ok(()) } @@ -812,7 +820,7 @@ mod tests { Ok(self .events .last() - .map(|event| event.meta.clone().unwrap().block_number) + .map(|(_, log)| log.block_number.unwrap()) .unwrap_or_default()) } @@ -930,7 +938,9 @@ mod tests { #[ignore] async fn past_events_by_block_hashes_test() { let web3 = Web3::new_from_env(); - let contract = GPv2Settlement::deployed(&web3).await.unwrap(); + let contract = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let storage = EventStorage { events: vec![] }; let blocks = vec![ ( @@ -962,12 +972,8 @@ mod tests { .unwrap(), ), ]; - let event_handler = EventHandler::new( - Arc::new(web3), - GPv2SettlementContract(contract), - storage, - None, - ); + let event_handler = + EventHandler::new(Arc::new(web3), AlloyEventRetriever(contract), storage, None); let (replacement_blocks, _) = event_handler.past_events_by_block_hashes(&blocks).await; assert_eq!(replacement_blocks, blocks[..2]); } @@ -976,7 +982,9 @@ mod tests { #[ignore] async fn update_events_test() { let web3 = Web3::new_from_env(); - let contract = GPv2Settlement::deployed(&web3).await.unwrap(); + let contract = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let storage = EventStorage { events: vec![] }; let current_block = web3.eth().block_number().await.unwrap(); @@ -994,7 +1002,7 @@ mod tests { let block = (block.number.unwrap().as_u64(), block.hash.unwrap()); let mut event_handler = EventHandler::new( Arc::new(web3), - GPv2SettlementContract(contract), + AlloyEventRetriever(contract), storage, Some(block), ); @@ -1007,7 +1015,9 @@ mod tests { async fn multiple_new_blocks_but_no_reorg_test() { tracing_subscriber::fmt::init(); let web3 = Web3::new_from_env(); - let contract = GPv2Settlement::deployed(&web3).await.unwrap(); + let contract = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let storage = EventStorage { events: vec![] }; let current_block = web3.eth().block_number().await.unwrap(); @@ -1025,7 +1035,7 @@ mod tests { let block = (block.number.unwrap().as_u64(), block.hash.unwrap()); let mut event_handler = EventHandler::new( Arc::new(web3), - GPv2SettlementContract(contract), + AlloyEventRetriever(contract), storage, Some(block), ); @@ -1039,18 +1049,22 @@ mod tests { #[ignore] async fn optional_block_skipping() { let web3 = Web3::new_from_env(); - let contract = GPv2Settlement::deployed(&web3).await.unwrap(); + let contract = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let current_block = web3.eth().block_number().await.unwrap(); // In this test we query for events multiple times. Newer events might be // included each time we query again for the same events, but we want to // disregard them. - let remove_events_after_test_start = |v: Vec>| { + let remove_events_after_test_start = |v: Vec<( + GPv2Settlement::GPv2Settlement::GPv2SettlementEvents, + alloy::rpc::types::Log, + )>| { v.into_iter() - .filter(|e| { + .filter(|(_, log)| { // We make the test robust against reorgs by removing events that are too new - e.meta.as_ref().unwrap().block_number - <= (current_block - MAX_REORG_BLOCK_COUNT).as_u64() + log.block_number.unwrap() <= (current_block - MAX_REORG_BLOCK_COUNT).as_u64() }) .collect::>() }; @@ -1066,7 +1080,7 @@ mod tests { .unwrap(); let mut base_event_handler = EventHandler::new( Arc::new(web3.clone()), - GPv2SettlementContract(contract.clone()), + AlloyEventRetriever(contract.clone()), storage_empty, Some(event_start), ); @@ -1086,7 +1100,7 @@ mod tests { .unwrap(); let mut base_block_skip_event_handler = EventHandler::new_skip_blocks_before( Arc::new(web3.clone()), - GPv2SettlementContract(contract.clone()), + AlloyEventRetriever(contract.clone()), storage_empty, event_start, ) @@ -1113,8 +1127,8 @@ mod tests { .expect("Should have some events") .clone(); assert!( - first_event.meta.as_ref().unwrap().block_number + MAX_REORG_BLOCK_COUNT + 1 - < last_event.meta.as_ref().unwrap().block_number, + first_event.1.block_number.unwrap() + MAX_REORG_BLOCK_COUNT + 1 + < last_event.1.block_number.unwrap(), "Test assumption broken" ); @@ -1124,7 +1138,7 @@ mod tests { }; let mut nonempty_event_handler = EventHandler::new_skip_blocks_before( Arc::new(web3.clone()), - GPv2SettlementContract(contract), + AlloyEventRetriever(contract), storage_nonempty, // Same event start as for the two previous event handlers. The test checks that this // is disregarded. diff --git a/crates/shared/src/price_estimation/trade_verifier/mod.rs b/crates/shared/src/price_estimation/trade_verifier/mod.rs index 70c44da2a0..3b05ae5417 100644 --- a/crates/shared/src/price_estimation/trade_verifier/mod.rs +++ b/crates/shared/src/price_estimation/trade_verifier/mod.rs @@ -20,12 +20,10 @@ use { alloy::primitives::{Address, address}, anyhow::{Context, Result, anyhow}, bigdecimal::BigDecimal, - contracts::{ + contracts::alloy::{ GPv2Settlement, - alloy::{ - WETH9, - support::{AnyoneAuthenticator, Solver, Spardose, Trader}, - }, + WETH9, + support::{AnyoneAuthenticator, Solver, Spardose, Trader}, }, ethcontract::{Bytes, H160, U256, state_overrides::StateOverride}, ethrpc::{ @@ -71,7 +69,7 @@ pub struct TradeVerifier { code_fetcher: Arc, balance_overrides: Arc, block_stream: CurrentBlockWatcher, - settlement: GPv2Settlement, + settlement: GPv2Settlement::Instance, native_token: H160, quote_inaccuracy_limit: BigRational, domain_separator: DomainSeparator, @@ -95,9 +93,10 @@ impl TradeVerifier { quote_inaccuracy_limit: BigDecimal, tokens_without_verification: HashSet, ) -> Result { - let settlement_contract = GPv2Settlement::at(&web3, settlement); + let settlement_contract = + GPv2Settlement::GPv2Settlement::new(settlement.into_alloy(), web3.alloy.clone()); let domain_separator = - DomainSeparator(settlement_contract.domain_separator().call().await?.0); + DomainSeparator(settlement_contract.domainSeparator().call().await?.0); Ok(Self { simulator, code_fetcher, @@ -154,9 +153,8 @@ impl TradeVerifier { out_amount, self.native_token, &self.domain_separator, - self.settlement.address(), + self.settlement.address().into_legacy(), )?; - let settlement = add_balance_queries( settlement, query, @@ -164,31 +162,25 @@ impl TradeVerifier { solver_address.into_alloy(), ); - let settlement = self - .settlement - .methods() - .settle( - settlement.tokens, - settlement.clearing_prices, - settlement.trades, - settlement.interactions, - ) - .tx; - + let settle_call = legacy_settlement_to_alloy(settlement).abi_encode(); let block = *self.block_stream.borrow(); let solver = Solver::Instance::new(solver_address.into_alloy(), self.web3.alloy.clone()); let swap_simulation = solver.swap( - self.settlement.address().into_alloy(), - tokens.iter().cloned().map(IntoAlloy::into_alloy).collect(), - verification.receiver.into_alloy(), - alloy::primitives::Bytes::from(settlement.data.unwrap().0), - ) + *self.settlement.address(), + tokens.iter().cloned().map(IntoAlloy::into_alloy).collect(), + verification.receiver.into_alloy(), + settle_call.into(), + ) // Initiate tx as solver so gas doesn't get deducted from user's ETH. - .from(solver_address.into_alloy()) - .to(solver_address.into_alloy()) - .gas(Self::DEFAULT_GAS) - .gas_price(u128::try_from(block.gas_price).map_err(|err| anyhow!(err)).context("converting gas price to u128")?); + .from(solver_address.into_alloy()) + .to(solver_address.into_alloy()) + .gas(Self::DEFAULT_GAS) + .gas_price( + u128::try_from(block.gas_price) + .map_err(|err| anyhow!(err)) + .context("converting gas price to u128")? + ); if let Some(tenderly) = &self.simulator && let Err(err) = tenderly.log_simulation_command( @@ -251,7 +243,7 @@ impl TradeVerifier { // It looks like the contract lost a lot of sell tokens but only because it was // the trader and had to pay for the trade. Adjust tokens lost downward. - if verification.from == self.settlement.address() { + if verification.from == self.settlement.address().into_legacy() { summary .tokens_lost .entry(query.sell_token) @@ -260,7 +252,7 @@ impl TradeVerifier { // It looks like the contract gained a lot of buy tokens (negative loss) but // only because it was the receiver and got the payout. Adjust the tokens lost // upward. - if verification.receiver == self.settlement.address() { + if verification.receiver == self.settlement.address().into_legacy() { summary .tokens_lost .entry(query.buy_token) @@ -399,7 +391,7 @@ impl TradeVerifier { .await .context("could not fetch authenticator")?; overrides.insert( - authenticator, + authenticator.into_legacy(), StateOverride { code: Some(web3::types::Bytes::from( AnyoneAuthenticator::AnyoneAuthenticator::DEPLOYED_BYTECODE.to_vec(), @@ -414,6 +406,50 @@ impl TradeVerifier { } } +fn legacy_settlement_to_alloy( + settlement: EncodedSettlement, +) -> GPv2Settlement::GPv2Settlement::settleCall { + GPv2Settlement::GPv2Settlement::settleCall { + tokens: settlement + .tokens + .into_iter() + .map(|t| t.into_alloy()) + .collect(), + clearingPrices: settlement + .clearing_prices + .into_iter() + .map(|p| p.into_alloy()) + .collect(), + interactions: settlement.interactions.map(|interactions| { + interactions + .into_iter() + .map(|i| GPv2Settlement::GPv2Interaction::Data { + target: i.0.into_alloy(), + value: i.1.into_alloy(), + callData: i.2.0.into(), + }) + .collect() + }), + trades: settlement + .trades + .into_iter() + .map(|t| GPv2Settlement::GPv2Trade::Data { + sellTokenIndex: t.0.into_alloy(), + buyTokenIndex: t.1.into_alloy(), + receiver: t.2.into_alloy(), + sellAmount: t.3.into_alloy(), + buyAmount: t.4.into_alloy(), + validTo: t.5, + appData: t.6.0.into(), + feeAmount: t.7.into_alloy(), + flags: t.8.into_alloy(), + executedAmount: t.9.into_alloy(), + signature: t.10.into_alloy(), + }) + .collect(), + } +} + #[async_trait::async_trait] impl TradeVerifying for TradeVerifier { #[instrument(skip_all)] diff --git a/crates/shared/src/signature_validator/mod.rs b/crates/shared/src/signature_validator/mod.rs index ce21a266bc..a415ba3347 100644 --- a/crates/shared/src/signature_validator/mod.rs +++ b/crates/shared/src/signature_validator/mod.rs @@ -4,6 +4,7 @@ use { BalanceOverriding, }, alloy::primitives::FixedBytes, + contracts::alloy::GPv2Settlement, ethrpc::{Web3, alloy::conversions::IntoAlloy}, hex_literal::hex, model::interaction::InteractionData, @@ -94,7 +95,7 @@ pub fn check_erc1271_result(result: FixedBytes<4>) -> Result<(), SignatureValida /// Contracts required for signature verification simulation. pub struct Contracts { - pub settlement: contracts::GPv2Settlement, + pub settlement: GPv2Settlement::Instance, pub signatures: contracts::alloy::support::Signatures::Instance, pub vault_relayer: H160, } diff --git a/crates/shared/src/signature_validator/simulation.rs b/crates/shared/src/signature_validator/simulation.rs index bdb1d39455..273e4da6a0 100644 --- a/crates/shared/src/signature_validator/simulation.rs +++ b/crates/shared/src/signature_validator/simulation.rs @@ -13,11 +13,12 @@ use { transports::RpcError, }, anyhow::{Context, Result}, - contracts::{ - alloy::{ERC1271SignatureValidator::ERC1271SignatureValidator, support::Signatures}, - errors::EthcontractErrorType, + contracts::alloy::{ + ERC1271SignatureValidator::ERC1271SignatureValidator, + GPv2Settlement, + support::Signatures, }, - ethcontract::{Bytes, state_overrides::StateOverrides}, + ethcontract::state_overrides::StateOverrides, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -29,7 +30,7 @@ use { pub struct Validator { signatures_address: Address, - settlement: contracts::GPv2Settlement, + settlement: GPv2Settlement::Instance, vault_relayer: Address, web3: Web3, balance_overrider: Arc, @@ -41,7 +42,7 @@ impl Validator { pub fn new( web3: &Web3, - settlement: contracts::GPv2Settlement, + settlement: GPv2Settlement::Instance, signatures_address: Address, vault_relayer: Address, balance_overrider: Arc, @@ -114,7 +115,7 @@ impl Validator { // a settlement let validate_call = Signatures::Signatures::validateCall { contracts: Signatures::Signatures::Contracts { - settlement: self.settlement.address().into_alloy(), + settlement: *self.settlement.address(), vaultRelayer: self.vault_relayer, }, signer: check.signer.into_alloy(), @@ -132,26 +133,23 @@ impl Validator { }; let simulation = self .settlement - .simulate_delegatecall( - self.signatures_address.into_legacy(), - Bytes(validate_call.abi_encode()), - ) - .from(crate::SIMULATION_ACCOUNT.clone()); - - let result = simulation - .clone() - .call_with_state_overrides(&overrides) - .await; - - let response_bytes = result.inspect_err(|err| { - tracing::debug!( - ?simulation, - ?check, - ?overrides, - ?err, - "signature verification failed" - ) - })?; + .simulateDelegatecall(self.signatures_address, validate_call.abi_encode().into()) + .state(overrides.clone().into_alloy()) + .from(crate::SIMULATION_ACCOUNT.address().into_alloy()); + + let result = simulation.clone().call().await; + + let response_bytes = result + .inspect_err(|err| { + tracing::debug!( + ?simulation, + ?check, + ?overrides, + ?err, + "signature verification failed" + ) + }) + .map_err(|_| SignatureValidationError::Invalid)?; let gas_used = >::abi_decode(&response_bytes.0) .with_context(|| { @@ -198,12 +196,3 @@ impl SignatureValidating for Validator { struct Simulation { gas_used: U256, } - -impl From for SignatureValidationError { - fn from(err: ethcontract::errors::MethodError) -> Self { - match EthcontractErrorType::classify(&err) { - EthcontractErrorType::Contract => Self::Invalid, - _ => Self::Other(err.into()), - } - } -} diff --git a/crates/solver/src/interactions/balancer_v2.rs b/crates/solver/src/interactions/balancer_v2.rs index b8786bd424..4acbb9818c 100644 --- a/crates/solver/src/interactions/balancer_v2.rs +++ b/crates/solver/src/interactions/balancer_v2.rs @@ -3,10 +3,7 @@ use { primitives::{Address, U256}, sol_types::SolCall, }, - contracts::{ - GPv2Settlement, - alloy::BalancerV2Vault::{BalancerV2Vault::swapCall, IVault}, - }, + contracts::alloy::BalancerV2Vault::{BalancerV2Vault::swapCall, IVault}, ethcontract::{Bytes, H256}, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, shared::{ @@ -18,7 +15,7 @@ use { #[derive(Clone, Debug)] pub struct BalancerSwapGivenOutInteraction { - pub settlement: GPv2Settlement, + pub settlement: Address, pub vault: Address, pub pool_id: H256, pub asset_in_max: TokenAmount, @@ -42,9 +39,9 @@ impl BalancerSwapGivenOutInteraction { userData: self.user_data.clone().into_alloy(), }; let funds = IVault::FundManagement { - sender: self.settlement.address().into_alloy(), + sender: self.settlement, fromInternalBalance: false, - recipient: self.settlement.address().into_alloy(), + recipient: self.settlement, toInternalBalance: false, }; @@ -68,13 +65,13 @@ impl Interaction for BalancerSwapGivenOutInteraction { #[cfg(test)] mod tests { - use {super::*, contracts::dummy_contract, primitive_types::H160}; + use {super::*, primitive_types::H160}; #[test] fn encode_unwrap_weth() { let vault_address = [0x01; 20].into(); let interaction = BalancerSwapGivenOutInteraction { - settlement: dummy_contract!(GPv2Settlement, [0x02; 20]), + settlement: Address::from_slice(&[0x02; 20]), vault: vault_address, pool_id: H256([0x03; 32]), asset_in_max: TokenAmount::new(H160([0x04; 20]), 1_337_000_000_000_000_000_000u128), diff --git a/crates/solver/src/interactions/uniswap_v2.rs b/crates/solver/src/interactions/uniswap_v2.rs index 39b6e0893e..02fcfa8359 100644 --- a/crates/solver/src/interactions/uniswap_v2.rs +++ b/crates/solver/src/interactions/uniswap_v2.rs @@ -1,6 +1,6 @@ use { alloy::{primitives::Address, sol_types::SolCall}, - contracts::{GPv2Settlement, alloy::IUniswapLikeRouter}, + contracts::alloy::IUniswapLikeRouter, ethcontract::Bytes, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, primitive_types::{H160, U256}, @@ -10,7 +10,7 @@ use { #[derive(Debug)] pub struct UniswapInteraction { pub router: Address, - pub settlement: GPv2Settlement, + pub settlement: Address, pub amount_out: U256, pub amount_in_max: U256, pub token_in: H160, @@ -29,7 +29,7 @@ impl UniswapInteraction { amountOut: self.amount_out.into_alloy(), amountInMax: self.amount_in_max.into_alloy(), path: vec![self.token_in.into_alloy(), self.token_out.into_alloy()], - to: self.settlement.address().into_alloy(), + to: self.settlement, deadline: ::alloy::primitives::U256::MAX, } .abi_encode(); @@ -61,10 +61,7 @@ mod tests { let payout_to = 9u8; let router_address = Address::from(&[1u8; 20]); - let settlement = GPv2Settlement::at( - &contracts::web3::dummy(), - H160::from_low_u64_be(payout_to as u64), - ); + let settlement = H160::from_low_u64_be(payout_to as u64).into_alloy(); let interaction = UniswapInteraction { router: router_address, settlement, diff --git a/crates/solver/src/liquidity/balancer_v2.rs b/crates/solver/src/liquidity/balancer_v2.rs index 524c33cb1f..60412e6e19 100644 --- a/crates/solver/src/liquidity/balancer_v2.rs +++ b/crates/solver/src/liquidity/balancer_v2.rs @@ -18,7 +18,6 @@ use { }, alloy::primitives::Address, anyhow::Result, - contracts::GPv2Settlement, ethcontract::H256, ethrpc::alloy::conversions::IntoLegacy, model::TokenPair, @@ -34,7 +33,7 @@ use { /// A liquidity provider for Balancer V2 weighted pools. pub struct BalancerV2Liquidity { - settlement: GPv2Settlement, + settlement: Address, vault: Address, pool_fetcher: Arc, allowance_manager: Box, @@ -44,10 +43,10 @@ impl BalancerV2Liquidity { pub fn new( web3: Web3, pool_fetcher: Arc, - settlement: GPv2Settlement, + settlement: Address, vault: Address, ) -> Self { - let allowance_manager = AllowanceManager::new(web3, settlement.address()); + let allowance_manager = AllowanceManager::new(web3, settlement.into_legacy()); Self { settlement, vault, @@ -72,7 +71,7 @@ impl BalancerV2Liquidity { let inner = Arc::new(Inner { allowances, - settlement: self.settlement.clone(), + settlement: self.settlement, vault: self.vault, }); @@ -135,18 +134,13 @@ pub struct SettlementHandler { } struct Inner { - settlement: GPv2Settlement, + settlement: Address, vault: Address, allowances: Allowances, } impl SettlementHandler { - pub fn new( - pool_id: H256, - settlement: GPv2Settlement, - vault: Address, - allowances: Allowances, - ) -> Self { + pub fn new(pool_id: H256, settlement: Address, vault: Address, allowances: Allowances) -> Self { SettlementHandler { pool_id, inner: Arc::new(Inner { @@ -171,7 +165,7 @@ impl SettlementHandler { output: TokenAmount, ) -> BalancerSwapGivenOutInteraction { BalancerSwapGivenOutInteraction { - settlement: self.inner.settlement.clone(), + settlement: self.inner.settlement, vault: self.inner.vault, pool_id: self.pool_id, asset_in_max: input_max, @@ -234,7 +228,7 @@ mod tests { use { super::*, crate::interactions::allowances::{Approval, MockAllowanceManaging}, - contracts::{alloy::BalancerV2Vault, dummy_contract}, + contracts::alloy::BalancerV2Vault, maplit::{btreemap, hashmap, hashset}, mockall::predicate::*, model::TokenPair, @@ -260,9 +254,9 @@ mod tests { }, }; - fn dummy_contracts() -> (GPv2Settlement, BalancerV2Vault::Instance) { + fn dummy_contracts() -> (Address, BalancerV2Vault::Instance) { ( - dummy_contract!(GPv2Settlement, H160([0xc0; 20])), + Address::from_slice(&[0xc0; 20]), BalancerV2Vault::Instance::new([0xc1; 20].into(), ethrpc::mock::web3().alloy), ) } @@ -453,7 +447,7 @@ mod tests { fn encodes_swaps_in_settlement() { let (settlement, vault) = dummy_contracts(); let inner = Arc::new(Inner { - settlement: settlement.clone(), + settlement, vault: *vault.address(), allowances: Allowances::new( vault.address().into_legacy(), @@ -502,7 +496,7 @@ mod tests { } .encode(), BalancerSwapGivenOutInteraction { - settlement: settlement.clone(), + settlement, vault: *vault.address(), pool_id: H256([0x90; 32]), asset_in_max: TokenAmount::new(H160([0x70; 20]), 10), diff --git a/crates/solver/src/liquidity/uniswap_v2.rs b/crates/solver/src/liquidity/uniswap_v2.rs index 79566bb3af..9e99d3734a 100644 --- a/crates/solver/src/liquidity/uniswap_v2.rs +++ b/crates/solver/src/liquidity/uniswap_v2.rs @@ -11,7 +11,6 @@ use { }, alloy::primitives::Address, anyhow::Result, - contracts::GPv2Settlement, ethrpc::alloy::conversions::IntoLegacy, model::TokenPair, primitive_types::H160, @@ -36,7 +35,7 @@ pub struct UniswapLikeLiquidity { pub struct Inner { router: Address, - gpv2_settlement: GPv2Settlement, + gpv2_settlement: Address, // Mapping of how much allowance the router has per token to spend on behalf of the settlement // contract allowances: Mutex, @@ -45,18 +44,18 @@ pub struct Inner { impl UniswapLikeLiquidity { pub fn new( router: Address, - gpv2_settlement: GPv2Settlement, + gpv2_settlement: Address, web3: Web3, pool_fetcher: Arc, ) -> Self { let settlement_allowances = - Box::new(AllowanceManager::new(web3, gpv2_settlement.address())); + Box::new(AllowanceManager::new(web3, gpv2_settlement.into_legacy())); Self::with_allowances(router, gpv2_settlement, settlement_allowances, pool_fetcher) } pub fn with_allowances( router: Address, - gpv2_settlement: GPv2Settlement, + gpv2_settlement: Address, settlement_allowances: Box, pool_fetcher: Arc, ) -> Self { @@ -118,11 +117,7 @@ impl LiquidityCollecting for UniswapLikeLiquidity { } impl Inner { - pub fn new( - router: Address, - gpv2_settlement: GPv2Settlement, - allowances: Mutex, - ) -> Self { + pub fn new(router: Address, gpv2_settlement: Address, allowances: Mutex) -> Self { Inner { router, gpv2_settlement, @@ -145,7 +140,7 @@ impl Inner { approval, UniswapInteraction { router: self.router, - settlement: self.gpv2_settlement.clone(), + settlement: self.gpv2_settlement, amount_out: token_amount_out.amount, amount_in_max: token_amount_in_max.amount, token_in: token_amount_in_max.token, @@ -181,19 +176,13 @@ impl SettlementHandling for Inner { #[cfg(test)] mod tests { - use { - super::*, - alloy::primitives::Address, - contracts::dummy_contract, - primitive_types::U256, - std::collections::HashMap, - }; + use {super::*, alloy::primitives::Address, primitive_types::U256, std::collections::HashMap}; impl Inner { fn new_dummy(allowances: HashMap) -> Self { Self { router: Address::default(), - gpv2_settlement: dummy_contract!(GPv2Settlement, H160::zero()), + gpv2_settlement: Default::default(), allowances: Mutex::new(Allowances::new(H160::zero(), allowances)), } } diff --git a/crates/solver/src/liquidity/uniswap_v3.rs b/crates/solver/src/liquidity/uniswap_v3.rs index f1d66aa82c..a83622b2a9 100644 --- a/crates/solver/src/liquidity/uniswap_v3.rs +++ b/crates/solver/src/liquidity/uniswap_v3.rs @@ -11,10 +11,7 @@ use { }, alloy::primitives::Address, anyhow::{Context, Result, ensure}, - contracts::{ - GPv2Settlement, - alloy::UniswapV3SwapRouterV2::IV3SwapRouter::ExactOutputSingleParams, - }, + contracts::alloy::UniswapV3SwapRouterV2::IV3SwapRouter::ExactOutputSingleParams, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, model::TokenPair, num::{CheckedMul, rational::Ratio}, @@ -39,7 +36,7 @@ pub struct UniswapV3Liquidity { } pub struct Inner { pub router: Address, - gpv2_settlement: GPv2Settlement, + gpv2_settlement: Address, // Mapping of how much allowance the router has per token to spend on behalf of the settlement // contract allowances: Mutex, @@ -53,7 +50,7 @@ pub struct UniswapV3SettlementHandler { impl UniswapV3SettlementHandler { pub fn new( router: Address, - gpv2_settlement: GPv2Settlement, + gpv2_settlement: Address, allowances: Mutex, fee: Ratio, ) -> Self { @@ -84,12 +81,12 @@ fn ratio_to_u32(ratio: Ratio) -> Result { impl UniswapV3Liquidity { pub fn new( router: Address, - gpv2_settlement: GPv2Settlement, + gpv2_settlement: Address, web3: Web3, pool_fetcher: Arc, ) -> Self { let settlement_allowances = - Box::new(AllowanceManager::new(web3, gpv2_settlement.address())); + Box::new(AllowanceManager::new(web3, gpv2_settlement.into_legacy())); Self { inner: Arc::new(Inner { router, @@ -178,7 +175,7 @@ impl UniswapV3SettlementHandler { tokenIn: token_amount_in_max.token.into_alloy(), tokenOut: token_amount_out.token.into_alloy(), fee, - recipient: self.inner.gpv2_settlement.address().into_alloy(), + recipient: self.inner.gpv2_settlement, amountOut: token_amount_out.amount.into_alloy(), amountInMaximum: token_amount_in_max.amount.into_alloy(), sqrtPriceLimitX96: alloy::primitives::U160::ZERO, @@ -210,20 +207,14 @@ impl SettlementHandling for UniswapV3SettlementHandler { #[cfg(test)] mod tests { - use { - super::*, - contracts::dummy_contract, - ethcontract::U256, - num::rational::Ratio, - std::collections::HashMap, - }; + use {super::*, ethcontract::U256, num::rational::Ratio, std::collections::HashMap}; impl UniswapV3SettlementHandler { fn new_dummy(allowances: HashMap, fee: u32) -> Self { Self { inner: Arc::new(Inner { router: Default::default(), - gpv2_settlement: dummy_contract!(GPv2Settlement, H160::zero()), + gpv2_settlement: Default::default(), allowances: Mutex::new(Allowances::new(H160::zero(), allowances)), }), fee, diff --git a/crates/solver/src/liquidity/zeroex.rs b/crates/solver/src/liquidity/zeroex.rs index 70bac4e903..31add35b9b 100644 --- a/crates/solver/src/liquidity/zeroex.rs +++ b/crates/solver/src/liquidity/zeroex.rs @@ -9,9 +9,10 @@ use { liquidity_collector::LiquidityCollecting, settlement::SettlementEncoder, }, + alloy::primitives::Address, anyhow::Result, arc_swap::ArcSwap, - contracts::{GPv2Settlement, alloy::IZeroex}, + contracts::alloy::IZeroex, ethrpc::{ alloy::conversions::IntoLegacy, block_stream::{CurrentBlockWatcher, into_stream}, @@ -48,16 +49,15 @@ impl ZeroExLiquidity { web3: Web3, api: Arc, zeroex: IZeroex::Instance, - gpv2: GPv2Settlement, + gpv2: Address, blocks_stream: CurrentBlockWatcher, ) -> Self { - let gpv2_address = gpv2.address(); - let allowance_manager = AllowanceManager::new(web3, gpv2_address); + let allowance_manager = AllowanceManager::new(web3, gpv2.into_legacy()); let orderbook_cache: Arc = Default::default(); let cache = orderbook_cache.clone(); - tokio::spawn(async move { - Self::run_orderbook_fetching(api, blocks_stream, cache, gpv2_address).await - }); + tokio::spawn( + async move { Self::run_orderbook_fetching(api, blocks_stream, cache, gpv2).await }, + ); Self { zeroex: Arc::new(zeroex), @@ -103,7 +103,7 @@ impl ZeroExLiquidity { api: Arc, blocks_stream: CurrentBlockWatcher, orderbook_cache: Arc, - gpv2_address: H160, + gpv2_address: Address, ) { let mut block_stream = into_stream(blocks_stream); while block_stream.next().await.is_some() { @@ -112,7 +112,7 @@ impl ZeroExLiquidity { OrdersQuery::default(), // orders fillable only by our settlement contract OrdersQuery { - sender: Some(gpv2_address), + sender: Some(gpv2_address.into_legacy()), ..Default::default() }, ]; From de5abf83e978b90c7755200e83e8ecb5bc0e028e Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Tue, 28 Oct 2025 19:49:01 +0100 Subject: [PATCH 058/117] Migrate settlement part 2 (#3834) # Description Follow up to https://github.com/cowprotocol/services/pull/3830 completely migrating the settlement contract to alloy --- .../src/boundary/events/settlement.rs | 41 ++++-- crates/autopilot/src/database/events.rs | 132 +++++++++++------- .../onchain_order_events/ethflow_events.rs | 10 +- .../src/domain/settlement/transaction/mod.rs | 64 ++++----- .../settlement/transaction/tokenized.rs | 98 +++---------- crates/autopilot/src/maintenance.rs | 4 +- crates/autopilot/src/run.rs | 6 +- crates/contracts/build.rs | 129 ----------------- crates/contracts/src/lib.rs | 1 - crates/e2e/src/setup/deploy.rs | 89 ++++++------ crates/e2e/tests/e2e/buffers.rs | 7 +- crates/e2e/tests/e2e/cow_amm.rs | 11 +- crates/e2e/tests/e2e/ethflow.rs | 8 +- crates/e2e/tests/e2e/hooks.rs | 4 +- .../e2e/liquidity_source_notification.rs | 4 +- crates/e2e/tests/e2e/protocol_fee.rs | 4 +- crates/e2e/tests/e2e/quote_verification.rs | 17 ++- crates/e2e/tests/e2e/smart_contract_orders.rs | 7 +- crates/e2e/tests/e2e/solver_competition.rs | 10 +- crates/e2e/tests/e2e/univ2.rs | 30 ++-- 20 files changed, 277 insertions(+), 399 deletions(-) diff --git a/crates/autopilot/src/boundary/events/settlement.rs b/crates/autopilot/src/boundary/events/settlement.rs index 0a4ea37148..1520b67b21 100644 --- a/crates/autopilot/src/boundary/events/settlement.rs +++ b/crates/autopilot/src/boundary/events/settlement.rs @@ -1,12 +1,36 @@ use { crate::{database::Postgres, domain::settlement}, + alloy::{ + primitives::Address, + rpc::types::{Filter, Log}, + }, anyhow::Result, - ethrpc::block_stream::RangeInclusive, - shared::{event_handling::EventStoring, impl_event_retrieving}, + contracts::alloy::GPv2Settlement::GPv2Settlement::GPv2SettlementEvents, + ethrpc::{AlloyProvider, block_stream::RangeInclusive}, + shared::event_handling::{AlloyEventRetrieving, EventStoring}, }; -impl_event_retrieving! { - pub GPv2SettlementContract for contracts::gpv2_settlement +pub struct GPv2SettlementContract { + provider: AlloyProvider, + address: Address, +} + +impl GPv2SettlementContract { + pub fn new(provider: AlloyProvider, address: Address) -> Self { + Self { provider, address } + } +} + +impl AlloyEventRetrieving for GPv2SettlementContract { + type Event = GPv2SettlementEvents; + + fn filter(&self) -> alloy::rpc::types::Filter { + Filter::new().address(self.address) + } + + fn provider(&self) -> &contracts::alloy::Provider { + &self.provider + } } pub struct Indexer { @@ -29,7 +53,7 @@ impl Indexer { pub(crate) const INDEX_NAME: &str = "settlements"; #[async_trait::async_trait] -impl EventStoring> for Indexer { +impl EventStoring<(GPv2SettlementEvents, Log)> for Indexer { async fn last_event_block(&self) -> Result { super::read_last_block_from_db(&self.db.pool, INDEX_NAME) .await @@ -42,7 +66,7 @@ impl EventStoring> for Ind async fn replace_events( &mut self, - events: Vec>, + events: Vec<(GPv2SettlementEvents, Log)>, range: RangeInclusive, ) -> Result<()> { let mut transaction = self.db.pool.begin().await?; @@ -55,10 +79,7 @@ impl EventStoring> for Ind Ok(()) } - async fn append_events( - &mut self, - events: Vec>, - ) -> Result<()> { + async fn append_events(&mut self, events: Vec<(GPv2SettlementEvents, Log)>) -> Result<()> { let mut transaction = self.db.pool.begin().await?; crate::database::events::append_events(&mut transaction, events).await?; transaction.commit().await?; diff --git a/crates/autopilot/src/database/events.rs b/crates/autopilot/src/database/events.rs index ff8eb36f85..47138a673b 100644 --- a/crates/autopilot/src/database/events.rs +++ b/crates/autopilot/src/database/events.rs @@ -1,51 +1,86 @@ use { alloy::rpc::types::Log, - anyhow::{Context, Result, anyhow}, - contracts::gpv2_settlement::{ - Event as ContractEvent, - event_data::{ - OrderInvalidated as ContractInvalidation, - PreSignature as ContractPreSignature, - Settlement as ContractSettlement, - Trade as ContractTrade, - }, - }, + anyhow::{Context, Result}, + contracts::alloy::GPv2Settlement::GPv2Settlement::{self, GPv2SettlementEvents}, database::{ OrderUid, PgTransaction, + TransactionHash, byte_array::ByteArray, events::{Event, EventIndex, Invalidation, PreSignature, Settlement, Trade}, }, - ethcontract::{Event as EthContractEvent, EventMetadata}, + ethcontract::EventMetadata, + ethrpc::alloy::conversions::IntoLegacy, number::conversions::u256_to_big_decimal, std::convert::TryInto, }; pub fn contract_to_db_events( - contract_events: Vec>, + contract_events: Vec<(GPv2SettlementEvents, Log)>, ) -> Result> { contract_events .into_iter() - .filter_map(|EthContractEvent { data, meta }| { - let meta = match meta { - Some(meta) => meta, - None => return Some(Err(anyhow!("event without metadata"))), - }; - match data { - ContractEvent::Trade(event) => Some(convert_trade(&event, &meta)), - ContractEvent::Settlement(event) => Some(Ok(convert_settlement(&event, &meta))), - ContractEvent::OrderInvalidated(event) => Some(convert_invalidation(&event, &meta)), - ContractEvent::PreSignature(event) => Some(convert_presignature(&event, &meta)), + .filter_map(|(event, log)| { + let log = ValidatedLog::try_from(log).ok()?; + match event { + GPv2SettlementEvents::Trade(event) => Some(convert_trade(&event, log)), + GPv2SettlementEvents::Settlement(event) => { + Some(Ok(convert_settlement(&event, log))) + } + GPv2SettlementEvents::OrderInvalidated(event) => { + Some(convert_invalidation(&event, log)) + } + GPv2SettlementEvents::PreSignature(event) => { + Some(convert_presignature(&event, log)) + } // TODO: handle new events - ContractEvent::Interaction(_) => None, + GPv2SettlementEvents::Interaction(_) => None, } }) .collect::>>() } +struct ValidatedLog { + block: i64, + tx_hash: TransactionHash, + log_index: i64, +} + +impl TryFrom for ValidatedLog { + type Error = anyhow::Error; + + fn try_from(log: Log) -> std::result::Result { + Ok(Self { + block: log + .block_number + .context("missing block_number")? + .try_into() + .context("could not convert block number to i64")?, + tx_hash: log + .transaction_hash + .map(|hash| ByteArray(hash.0)) + .context("missing transaction_hash")?, + log_index: log + .log_index + .context("missing log_index")? + .try_into() + .context("could not convert log index to i64")?, + }) + } +} + +impl From for EventIndex { + fn from(value: ValidatedLog) -> Self { + Self { + block_number: value.block, + log_index: value.log_index, + } + } +} + pub async fn append_events( transaction: &mut PgTransaction<'_>, - events: Vec>, + events: Vec<(GPv2SettlementEvents, Log)>, ) -> Result<()> { let _timer = super::Metrics::get() .database_queries @@ -61,7 +96,7 @@ pub async fn append_events( pub async fn replace_events( transaction: &mut PgTransaction<'_>, - events: Vec>, + events: Vec<(GPv2SettlementEvents, Log)>, from_block: u64, ) -> Result<()> { let _timer = super::Metrics::get() @@ -100,52 +135,45 @@ pub fn bytes_to_order_uid(bytes: &[u8]) -> Result { .map(ByteArray) } -fn convert_trade(trade: &ContractTrade, meta: &EventMetadata) -> Result<(EventIndex, Event)> { +fn convert_trade(trade: &GPv2Settlement::Trade, log: ValidatedLog) -> Result<(EventIndex, Event)> { let event = Trade { - order_uid: bytes_to_order_uid(&trade.order_uid.0)?, - sell_amount_including_fee: u256_to_big_decimal(&trade.sell_amount), - buy_amount: u256_to_big_decimal(&trade.buy_amount), - fee_amount: u256_to_big_decimal(&trade.fee_amount), + order_uid: bytes_to_order_uid(&trade.orderUid.0)?, + sell_amount_including_fee: u256_to_big_decimal(&trade.sellAmount.into_legacy()), + buy_amount: u256_to_big_decimal(&trade.buyAmount.into_legacy()), + fee_amount: u256_to_big_decimal(&trade.feeAmount.into_legacy()), }; - Ok((meta_to_event_index(meta), Event::Trade(event))) + Ok((log.into(), Event::Trade(event))) } fn convert_settlement( - settlement: &ContractSettlement, - meta: &EventMetadata, + settlement: &GPv2Settlement::Settlement, + log: ValidatedLog, ) -> (EventIndex, Event) { let event = Settlement { - solver: ByteArray(settlement.solver.0), - transaction_hash: ByteArray(meta.transaction_hash.0), + solver: ByteArray(settlement.solver.into()), + transaction_hash: log.tx_hash, }; - (meta_to_event_index(meta), Event::Settlement(event)) + (log.into(), Event::Settlement(event)) } fn convert_invalidation( - invalidation: &ContractInvalidation, - meta: &EventMetadata, + invalidation: &GPv2Settlement::OrderInvalidated, + log: ValidatedLog, ) -> Result<(EventIndex, Event)> { let event = Invalidation { - order_uid: bytes_to_order_uid(&invalidation.order_uid.0)?, + order_uid: bytes_to_order_uid(invalidation.orderUid.as_ref())?, }; - Ok((meta_to_event_index(meta), Event::Invalidation(event))) + Ok((log.into(), Event::Invalidation(event))) } fn convert_presignature( - presignature: &ContractPreSignature, - meta: &EventMetadata, + presignature: &GPv2Settlement::PreSignature, + log: ValidatedLog, ) -> Result<(EventIndex, Event)> { let event = PreSignature { - owner: ByteArray(presignature.owner.0), - order_uid: ByteArray( - presignature - .order_uid - .0 - .as_slice() - .try_into() - .context("trade event order_uid has wrong number of bytes")?, - ), + owner: ByteArray(presignature.owner.into()), + order_uid: bytes_to_order_uid(presignature.orderUid.as_ref())?, signed: presignature.signed, }; - Ok((meta_to_event_index(meta), Event::PreSignature(event))) + Ok((log.into(), Event::PreSignature(event))) } diff --git a/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs b/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs index 85c76f9bea..05f788cc67 100644 --- a/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs +++ b/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs @@ -3,13 +3,12 @@ use { crate::database::events::log_to_event_index, alloy::rpc::types::Log, anyhow::{Context, Result, anyhow}, - contracts::{ - GPv2Settlement, - alloy::CoWSwapOnchainOrders::CoWSwapOnchainOrders::{ + contracts::alloy::{ + CoWSwapOnchainOrders::CoWSwapOnchainOrders::{ CoWSwapOnchainOrdersEvents as ContractEvent, OrderPlacement as ContractOrderPlacement, }, - deployment_block, + GPv2Settlement, }, database::{ PgTransaction, @@ -150,7 +149,8 @@ async fn settlement_deployment_block_number_hash( web3: &Web3, chain_id: u64, ) -> Result { - let block_number = deployment_block(GPv2Settlement::raw_contract(), chain_id)?; + let block_number = + GPv2Settlement::deployment_block(&chain_id).context("no deployment block configured")?; block_number_to_block_number_hash(web3, U64::from(block_number).into()) .await .context("Deployment block not found") diff --git a/crates/autopilot/src/domain/settlement/transaction/mod.rs b/crates/autopilot/src/domain/settlement/transaction/mod.rs index f5a1768dc7..c1a673c4b4 100644 --- a/crates/autopilot/src/domain/settlement/transaction/mod.rs +++ b/crates/autopilot/src/domain/settlement/transaction/mod.rs @@ -3,10 +3,11 @@ use { boundary, domain::{self, auction::order, eth}, }, - contracts::alloy::GPv2AllowListAuthentication, - ethcontract::{BlockId, common::FunctionExt}, - ethrpc::alloy::conversions::IntoAlloy, - std::{collections::HashSet, sync::LazyLock}, + alloy::sol_types::SolCall, + contracts::alloy::{GPv2AllowListAuthentication, GPv2Settlement}, + ethcontract::BlockId, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, + std::collections::HashSet, }; mod tokenized; @@ -111,18 +112,20 @@ impl Transaction { gas_price: transaction.gas_price, solver: solver.ok_or(Error::MissingSolver)?, trades: { - let tokenized::Tokenized { - tokens, - clearing_prices, + let GPv2Settlement::GPv2Settlement::settleCall { trades: decoded_trades, - interactions: _interactions, - } = tokenized::Tokenized::try_new(&crate::util::Bytes(data.to_vec()))?; + tokens, + clearingPrices: clearing_prices, + .. + } = GPv2Settlement::GPv2Settlement::settleCall::abi_decode(data)?; let mut trades = Vec::with_capacity(decoded_trades.len()); for trade in decoded_trades { - let flags = tokenized::TradeFlags(trade.8); - let sell_token_index = trade.0.as_usize(); - let buy_token_index = trade.1.as_usize(); + let flags = tokenized::TradeFlags(trade.flags.into_legacy()); + let sell_token_index = usize::try_from(trade.sellTokenIndex) + .expect("SC was able to look up this index"); + let buy_token_index = usize::try_from(trade.buyTokenIndex) + .expect("SC was able to look up this index"); let sell_token = tokens[sell_token_index]; let buy_token = tokens[buy_token_index]; let uniform_sell_token_index = tokens @@ -135,36 +138,36 @@ impl Transaction { uid: tokenized::order_uid(&trade, &tokens, domain_separator) .map_err(Error::OrderUidRecover)?, sell: eth::Asset { - token: sell_token.into(), - amount: trade.3.into(), + token: sell_token.into_legacy().into(), + amount: trade.sellAmount.into_legacy().into(), }, buy: eth::Asset { - token: buy_token.into(), - amount: trade.4.into(), + token: buy_token.into_legacy().into(), + amount: trade.buyAmount.into_legacy().into(), }, side: flags.side(), - receiver: trade.2.into(), - valid_to: trade.5, - app_data: domain::auction::order::AppDataHash(trade.6.0), - fee_amount: trade.7.into(), + receiver: trade.receiver.into_legacy().into(), + valid_to: trade.validTo, + app_data: domain::auction::order::AppDataHash(trade.appData.into()), + fee_amount: trade.feeAmount.into_legacy().into(), sell_token_balance: flags.sell_token_balance().into(), buy_token_balance: flags.buy_token_balance().into(), partially_fillable: flags.partially_fillable(), signature: (boundary::Signature::from_bytes( flags.signing_scheme(), - &trade.10.0, + trade.signature.as_ref(), ) .map_err(Error::SignatureRecover)?) .into(), - executed: trade.9.into(), + executed: trade.executedAmount.into_legacy().into(), prices: Prices { uniform: ClearingPrices { - sell: clearing_prices[uniform_sell_token_index].into(), - buy: clearing_prices[uniform_buy_token_index].into(), + sell: clearing_prices[uniform_sell_token_index].into_legacy(), + buy: clearing_prices[uniform_buy_token_index].into_legacy(), }, custom: ClearingPrices { - sell: clearing_prices[sell_token_index].into(), - buy: clearing_prices[buy_token_index].into(), + sell: clearing_prices[sell_token_index].into_legacy(), + buy: clearing_prices[buy_token_index].into_legacy(), }, }, }) @@ -199,12 +202,9 @@ fn find_settlement_trace_and_callers( } fn is_settlement_trace(trace: ð::CallFrame, settlement_contract: eth::Address) -> bool { - static SETTLE_FUNCTION_SELECTOR: LazyLock<[u8; 4]> = LazyLock::new(|| { - let abi = &contracts::GPv2Settlement::raw_contract().interface.abi; - abi.function("settle").unwrap().selector() - }); + let settle_selector = &GPv2Settlement::GPv2Settlement::settleCall::SELECTOR; trace.to.unwrap_or_default() == settlement_contract - && trace.input.0.starts_with(&*SETTLE_FUNCTION_SELECTOR) + && trace.input.0.starts_with(settle_selector) } async fn find_solver_address( @@ -272,7 +272,7 @@ pub enum Error { #[error("missing auction id")] MissingAuctionId, #[error(transparent)] - Decoding(#[from] tokenized::error::Decoding), + Decoding(#[from] alloy::sol_types::Error), #[error("failed to recover order uid {0}")] OrderUidRecover(tokenized::error::Uid), #[error("failed to recover signature {0}")] diff --git a/crates/autopilot/src/domain/settlement/transaction/tokenized.rs b/crates/autopilot/src/domain/settlement/transaction/tokenized.rs index f9414c3c4d..a6c6b249cc 100644 --- a/crates/autopilot/src/domain/settlement/transaction/tokenized.rs +++ b/crates/autopilot/src/domain/settlement/transaction/tokenized.rs @@ -4,79 +4,35 @@ use { domain::{self, auction::order, eth}, }, app_data::AppDataHash, - ethcontract::{Address, Bytes, U256, common::FunctionExt, tokens::Tokenize}, + contracts::alloy::GPv2Settlement, + ethcontract::U256, + ethrpc::alloy::conversions::IntoLegacy, }; -// Original type for input of `GPv2Settlement.settle` function. -pub(super) struct Tokenized { - pub tokens: Vec
, - pub clearing_prices: Vec, - pub trades: Vec, - pub interactions: [Vec; 3], -} - -impl Tokenized { - pub fn try_new(calldata: ð::Calldata) -> Result { - let function = contracts::GPv2Settlement::raw_contract() - .interface - .abi - .function("settle") - .unwrap(); - let data = calldata - .0 - .strip_prefix(&function.selector()) - .ok_or(error::Decoding::InvalidSelector)?; - let tokenized = function - .decode_input(data) - .map_err(error::Decoding::Ethabi)?; - let (tokens, clearing_prices, trades, interactions) = - ::from_token(web3::ethabi::Token::Tuple(tokenized)) - .map_err(error::Decoding::Tokenizing)?; - Ok(Self { - tokens, - clearing_prices: clearing_prices.into_iter().map(Into::into).collect(), - trades, - interactions, - }) - } -} - -type Token = Address; -type Trade = ( - U256, // sellTokenIndex - U256, // buyTokenIndex - Address, // receiver - U256, // sellAmount - U256, // buyAmount - u32, // validTo - Bytes<[u8; 32]>, // appData - U256, // feeAmount - U256, // flags - U256, // executedAmount - Bytes>, // signature -); -type Interaction = (Address, U256, Bytes>); -type Solution = (Vec
, Vec, Vec, [Vec; 3]); - /// Recover order uid from order data and signature pub fn order_uid( - trade: &Trade, - tokens: &[Token], + trade: &GPv2Settlement::GPv2Trade::Data, + tokens: &[alloy::primitives::Address], domain_separator: ð::DomainSeparator, ) -> Result { - let flags = TradeFlags(trade.8); - let signature = crate::boundary::Signature::from_bytes(flags.signing_scheme(), &trade.10.0) - .map_err(error::Uid::Signature)?; + let flags = TradeFlags(trade.flags.into_legacy()); + let signature = + crate::boundary::Signature::from_bytes(flags.signing_scheme(), &trade.signature.0) + .map_err(error::Uid::Signature)?; let order = model::order::OrderData { - sell_token: tokens[trade.0.as_u64() as usize], - buy_token: tokens[trade.1.as_u64() as usize], - receiver: Some(trade.2), - sell_amount: trade.3, - buy_amount: trade.4, - valid_to: trade.5, - app_data: AppDataHash(trade.6.0), - fee_amount: trade.7, + sell_token: tokens + [usize::try_from(trade.sellTokenIndex).expect("SC was able to look up this index")] + .into_legacy(), + buy_token: tokens + [usize::try_from(trade.buyTokenIndex).expect("SC was able to look up this index")] + .into_legacy(), + receiver: Some(trade.receiver.into_legacy()), + sell_amount: trade.sellAmount.into_legacy(), + buy_amount: trade.buyAmount.into_legacy(), + valid_to: trade.validTo, + app_data: AppDataHash(trade.appData.0), + fee_amount: trade.feeAmount.into_legacy(), kind: match flags.side() { domain::auction::order::Side::Buy => model::order::OrderKind::Buy, domain::auction::order::Side::Sell => model::order::OrderKind::Sell, @@ -87,7 +43,7 @@ pub fn order_uid( }; let domain_separator = crate::boundary::DomainSeparator(domain_separator.0); let owner = signature - .recover_owner(&trade.10.0, &domain_separator, &order.hash_struct()) + .recover_owner(&trade.signature.0, &domain_separator, &order.hash_struct()) .map_err(error::Uid::RecoverOwner)?; Ok(order.uid(&domain_separator, &owner).into()) } @@ -158,14 +114,4 @@ pub mod error { #[error("recover owner {0}")] RecoverOwner(anyhow::Error), } - - #[derive(Debug, thiserror::Error)] - pub enum Decoding { - #[error("transaction calldata is not a settlement")] - InvalidSelector, - #[error("unable to decode settlement calldata: {0}")] - Ethabi(web3::ethabi::Error), - #[error("unable to tokenize calldata into expected format: {0}")] - Tokenizing(ethcontract::tokens::Error), - } } diff --git a/crates/autopilot/src/maintenance.rs b/crates/autopilot/src/maintenance.rs index 6249151358..56d331cce3 100644 --- a/crates/autopilot/src/maintenance.rs +++ b/crates/autopilot/src/maintenance.rs @@ -28,7 +28,7 @@ use { /// to ensure a consistent view of the system. pub struct Maintenance { /// Indexes and persists all events emited by the settlement contract. - settlement_indexer: EventUpdater, + settlement_indexer: EventUpdater>, /// Indexes ethflow orders (orders selling native ETH). ethflow_indexer: Option, /// Used for periodic cleanup tasks to not have the DB overflow with old @@ -42,7 +42,7 @@ pub struct Maintenance { impl Maintenance { pub fn new( - settlement_indexer: EventUpdater, + settlement_indexer: EventUpdater>, db_cleanup: Postgres, ) -> Self { Self { diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index ce2634abfb..aefdd4bb3f 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -460,9 +460,9 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { } }; let settlement_event_indexer = EventUpdater::new( - boundary::events::settlement::GPv2SettlementContract::new(contracts::GPv2Settlement::at( - &web3.legacy, - eth.contracts().settlement().address().into_legacy(), + AlloyEventRetriever(boundary::events::settlement::GPv2SettlementContract::new( + web3.alloy.clone(), + *eth.contracts().settlement().address(), )), boundary::events::settlement::Indexer::new( db_write.clone(), diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs index df00e008ad..805b62a231 100644 --- a/crates/contracts/build.rs +++ b/crates/contracts/build.rs @@ -1,8 +1,4 @@ use { - ethcontract::{ - Address, - common::{DeploymentInformation, contract::Network}, - }, ethcontract_generate::{ContractBuilder, loaders::TruffleLoader}, std::{env, path::Path}, }; @@ -10,20 +6,6 @@ use { #[path = "src/paths.rs"] mod paths; -const MAINNET: &str = "1"; -const GOERLI: &str = "5"; -const GNOSIS: &str = "100"; -const SEPOLIA: &str = "11155111"; -const ARBITRUM_ONE: &str = "42161"; -const BASE: &str = "8453"; -const POLYGON: &str = "137"; -const AVALANCHE: &str = "43114"; -const BNB: &str = "56"; -const OPTIMISM: &str = "10"; -const LENS: &str = "232"; -const LINEA: &str = "59144"; -const PLASMA: &str = "9745"; - fn main() { // NOTE: This is a workaround for `rerun-if-changed` directives for // non-existent files cause the crate's build unit to get flagged for a @@ -35,113 +17,6 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); generate_contract("ERC20"); - generate_contract_with_config("GPv2Settlement", |builder| { - builder - .contract_mod_override("gpv2_settlement") - .add_network( - MAINNET, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(12593265)), - }, - ) - .add_network( - GOERLI, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(7020473)), - }, - ) - .add_network( - GNOSIS, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(16465100)), - }, - ) - .add_network( - SEPOLIA, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(4717488)), - }, - ) - .add_network( - ARBITRUM_ONE, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - deployment_information: Some(DeploymentInformation::BlockNumber(204704802)), - }, - ) - .add_network( - BASE, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(21407238)), - }, - ) - .add_network( - AVALANCHE, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(59891356)), - }, - ) - .add_network( - BNB, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(48173641)), - }, - ) - .add_network( - OPTIMISM, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(134254624)), - }, - ) - .add_network( - POLYGON, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(45859743)), - }, - ) - .add_network( - LENS, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(2621745)), - }, - ) - .add_network( - LINEA, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(24333100)), - }, - ) - .add_network( - PLASMA, - Network { - address: addr("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), - // - deployment_information: Some(DeploymentInformation::BlockNumber(2621745)), - }, - ) - }); } fn generate_contract(name: &str) { @@ -169,7 +44,3 @@ fn generate_contract_with_config( .write_to_file(Path::new(&dest).join(format!("{name}.rs"))) .unwrap(); } - -fn addr(s: &str) -> Address { - s.parse().unwrap() -} diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 6b84625f5b..91fc45b6ef 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -50,7 +50,6 @@ macro_rules! include_contracts { include_contracts! { ERC20; - GPv2Settlement; } #[cfg(test)] diff --git a/crates/e2e/src/setup/deploy.rs b/crates/e2e/src/setup/deploy.rs index e58e2ffe65..c5765e2e7c 100644 --- a/crates/e2e/src/setup/deploy.rs +++ b/crates/e2e/src/setup/deploy.rs @@ -1,20 +1,17 @@ use { - crate::deploy, - contracts::{ + contracts::alloy::{ + BalancerV2Authorizer, + BalancerV2Vault, + CoWSwapEthFlow, + FlashLoanRouter, + GPv2AllowListAuthentication, GPv2Settlement, - alloy::{ - BalancerV2Authorizer, - BalancerV2Vault, - CoWSwapEthFlow, - FlashLoanRouter, - GPv2AllowListAuthentication, - HooksTrampoline, - InstanceExt, - UniswapV2Factory, - UniswapV2Router02, - WETH9, - support::{Balances, Signatures}, - }, + HooksTrampoline, + InstanceExt, + UniswapV2Factory, + UniswapV2Router02, + WETH9, + support::{Balances, Signatures}, }, ethcontract::{Address, H256}, ethrpc::alloy::{ @@ -34,7 +31,7 @@ pub struct DeployedContracts { pub struct Contracts { pub chain_id: u64, pub balancer_vault: BalancerV2Vault::Instance, - pub gp_settlement: GPv2Settlement, + pub gp_settlement: GPv2Settlement::Instance, pub signatures: Signatures::Instance, pub gp_authenticator: GPv2AllowListAuthentication::Instance, pub balances: Balances::Instance, @@ -58,7 +55,9 @@ impl Contracts { .to_string(); tracing::info!("connected to forked test network {}", network_id); - let gp_settlement = GPv2Settlement::deployed(web3).await.unwrap(); + let gp_settlement = GPv2Settlement::Instance::deployed(&web3.alloy) + .await + .unwrap(); let balances = match deployed.balances { Some(address) => Balances::Instance::new(address.into_alloy(), web3.alloy.clone()), None => Balances::Instance::deployed(&web3.alloy) @@ -92,13 +91,14 @@ impl Contracts { .unwrap(), weth: WETH9::Instance::deployed(&web3.alloy).await.unwrap(), allowance: gp_settlement - .vault_relayer() + .vaultRelayer() .call() .await - .expect("Couldn't get vault relayer address"), + .expect("Couldn't get vault relayer address") + .into_legacy(), domain_separator: DomainSeparator( gp_settlement - .domain_separator() + .domainSeparator() .call() .await .expect("Couldn't query domain separator") @@ -167,13 +167,13 @@ impl Contracts { .send_and_watch() .await .expect("failed to initialize manager"); - let gp_settlement = deploy!( - web3, - GPv2Settlement( - gp_authenticator.address().into_legacy(), - balancer_vault.address().into_legacy(), - ) - ); + let gp_settlement = GPv2Settlement::Instance::deploy( + web3.alloy.clone(), + *gp_authenticator.address(), + *balancer_vault.address(), + ) + .await + .unwrap(); let balances = Balances::Instance::deploy(web3.alloy.clone()) .await .unwrap(); @@ -185,23 +185,23 @@ impl Contracts { &balancer_authorizer, *balancer_vault.address(), gp_settlement - .vault_relayer() + .vaultRelayer() .call() .await - .expect("failed to retrieve Vault relayer contract address") - .into_alloy(), + .expect("failed to retrieve Vault relayer contract address"), ) .await .expect("failed to authorize Vault relayer"); let allowance = gp_settlement - .vault_relayer() + .vaultRelayer() .call() .await - .expect("Couldn't get vault relayer address"); + .expect("Couldn't get vault relayer address") + .into_legacy(); let domain_separator = DomainSeparator( gp_settlement - .domain_separator() + .domainSeparator() .call() .await .expect("Couldn't query domain separator") @@ -210,30 +210,25 @@ impl Contracts { let ethflow = CoWSwapEthFlow::Instance::deploy( web3.alloy.clone(), - gp_settlement.address().into_alloy(), + *gp_settlement.address(), *weth.address(), ) .await .unwrap(); let ethflow_secondary = CoWSwapEthFlow::Instance::deploy( web3.alloy.clone(), - gp_settlement.address().into_alloy(), + *gp_settlement.address(), *weth.address(), ) .await .unwrap(); - let hooks = HooksTrampoline::Instance::deploy( - web3.alloy.clone(), - gp_settlement.address().into_alloy(), - ) - .await - .unwrap(); - let flashloan_router = FlashLoanRouter::Instance::deploy( - web3.alloy.clone(), - gp_settlement.address().into_alloy(), - ) - .await - .unwrap(); + let hooks = HooksTrampoline::Instance::deploy(web3.alloy.clone(), *gp_settlement.address()) + .await + .unwrap(); + let flashloan_router = + FlashLoanRouter::Instance::deploy(web3.alloy.clone(), *gp_settlement.address()) + .await + .unwrap(); Self { chain_id: network_id diff --git a/crates/e2e/tests/e2e/buffers.rs b/crates/e2e/tests/e2e/buffers.rs index da22bd732d..56237ac9bd 100644 --- a/crates/e2e/tests/e2e/buffers.rs +++ b/crates/e2e/tests/e2e/buffers.rs @@ -32,7 +32,10 @@ async fn onchain_settlement_without_liquidity(web3: Web3) { // Fund trader, settlement accounts, and pool creation token_a.mint(trader.address(), to_wei(100)).await; token_b - .mint(onchain.contracts().gp_settlement.address(), to_wei(5)) + .mint( + onchain.contracts().gp_settlement.address().into_legacy(), + to_wei(5), + ) .await; token_a.mint(solver.address(), to_wei(1000)).await; token_b.mint(solver.address(), to_wei(1000)).await; @@ -120,7 +123,7 @@ async fn onchain_settlement_without_liquidity(web3: Web3) { // Check that settlement buffers were traded. let settlement_contract_balance = token_b - .balanceOf(onchain.contracts().gp_settlement.address().into_alloy()) + .balanceOf(*onchain.contracts().gp_settlement.address()) .call() .await .unwrap(); diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index 6a52bdd87c..179fa4009b 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -68,8 +68,11 @@ async fn cow_amm_jit(web3: Web3) { // Fund the buffers with a lot of buy tokens so we can pay out the required // tokens for 2 orders in the same direction without having to worry about // getting the liquidity on-chain. - dai.mint(onchain.contracts().gp_settlement.address(), to_wei(100_000)) - .await; + dai.mint( + onchain.contracts().gp_settlement.address().into_legacy(), + to_wei(100_000), + ) + .await; // set up cow_amm let oracle = @@ -80,7 +83,7 @@ async fn cow_amm_jit(web3: Web3) { let cow_amm_factory = contracts::alloy::cow_amm::CowAmmConstantProductFactory::Instance::deploy( web3.alloy.clone(), - onchain.contracts().gp_settlement.address().into_alloy(), + *onchain.contracts().gp_settlement.address(), ) .await .unwrap(); @@ -700,7 +703,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { let cow_amm_factory = contracts::alloy::cow_amm::CowAmmConstantProductFactory::Instance::deploy( web3.alloy.clone(), - onchain.contracts().gp_settlement.address().into_alloy(), + *onchain.contracts().gp_settlement.address(), ) .await .unwrap(); diff --git a/crates/e2e/tests/e2e/ethflow.rs b/crates/e2e/tests/e2e/ethflow.rs index 0f0cd6e934..821ad3dd48 100644 --- a/crates/e2e/tests/e2e/ethflow.rs +++ b/crates/e2e/tests/e2e/ethflow.rs @@ -244,7 +244,7 @@ async fn eth_flow_tx(web3: Web3) { // able to set an allowance on behalf of the settlement contract. let settlement = onchain.contracts().gp_settlement.address(); let allowance = dai - .allowance(settlement.into_alloy(), trader.address().into_alloy()) + .allowance(*settlement, trader.address().into_alloy()) .call() .await .unwrap(); @@ -253,7 +253,7 @@ async fn eth_flow_tx(web3: Web3) { let allowance = onchain .contracts() .weth - .allowance(settlement.into_alloy(), trader.address().into_alloy()) + .allowance(*settlement, trader.address().into_alloy()) .call() .await .unwrap(); @@ -774,7 +774,7 @@ impl ExtendedEthFlowOrder { let domain_separator = DomainSeparator( contracts .gp_settlement - .domain_separator() + .domainSeparator() .call() .await .expect("Couldn't query domain separator") @@ -797,7 +797,7 @@ impl ExtendedEthFlowOrder { let domain_separator = DomainSeparator( contracts .gp_settlement - .domain_separator() + .domainSeparator() .call() .await .expect("Couldn't query domain separator") diff --git a/crates/e2e/tests/e2e/hooks.rs b/crates/e2e/tests/e2e/hooks.rs index 4e8ccb4b6d..7fc910c923 100644 --- a/crates/e2e/tests/e2e/hooks.rs +++ b/crates/e2e/tests/e2e/hooks.rs @@ -218,7 +218,7 @@ async fn allowance(web3: Web3) { // Check malicious custom interactions did not work. let allowance = cow .allowance( - onchain.contracts().gp_settlement.address().into_alloy(), + *onchain.contracts().gp_settlement.address(), trader.address().into_alloy(), ) .call() @@ -229,7 +229,7 @@ async fn allowance(web3: Web3) { .contracts() .weth .allowance( - onchain.contracts().gp_settlement.address().into_alloy(), + *onchain.contracts().gp_settlement.address(), trader.address().into_alloy(), ) .call() diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index 2e4407be04..bf02e1ee12 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -222,8 +222,8 @@ http-timeout = "10s" let liquorice_order = api::liquorice::onchain::order::Single { rfq_id: "c99d2e3f-702b-49c9-8bb8-43775770f2f3".to_string(), nonce: U256::from(0), - trader: onchain.contracts().gp_settlement.address(), - effective_trader: onchain.contracts().gp_settlement.address(), + trader: onchain.contracts().gp_settlement.address().into_legacy(), + effective_trader: onchain.contracts().gp_settlement.address().into_legacy(), base_token: token_usdc.address(), quote_token: token_usdt.address(), base_token_amount: trade_amount, diff --git a/crates/e2e/tests/e2e/protocol_fee.rs b/crates/e2e/tests/e2e/protocol_fee.rs index ea4142c344..133f94dd6b 100644 --- a/crates/e2e/tests/e2e/protocol_fee.rs +++ b/crates/e2e/tests/e2e/protocol_fee.rs @@ -362,7 +362,7 @@ async fn combined_protocol_fees(web3: Web3) { ] .map(|token| async { token - .balanceOf(onchain.contracts().gp_settlement.address().into_alloy()) + .balanceOf(*onchain.contracts().gp_settlement.address()) .call() .await .map(IntoLegacy::into_legacy) @@ -746,7 +746,7 @@ async fn volume_fee_buy_order_test(web3: Web3) { // Check settlement contract balance let balance_after = token_gno - .balanceOf(onchain.contracts().gp_settlement.address().into_alloy()) + .balanceOf(*onchain.contracts().gp_settlement.address()) .call() .await .unwrap() diff --git a/crates/e2e/tests/e2e/quote_verification.rs b/crates/e2e/tests/e2e/quote_verification.rs index 19c394429a..8e59161bc8 100644 --- a/crates/e2e/tests/e2e/quote_verification.rs +++ b/crates/e2e/tests/e2e/quote_verification.rs @@ -147,7 +147,7 @@ async fn test_bypass_verification_for_rfq_quotes(web3: Web3) { Arc::new(web3.clone()), Arc::new(BalanceOverrides::default()), block_stream, - onchain.contracts().gp_settlement.address(), + onchain.contracts().gp_settlement.address().into_legacy(), onchain.contracts().weth.address().into_legacy(), BigDecimal::zero(), Default::default(), @@ -295,7 +295,10 @@ async fn verified_quote_for_settlement_contract(web3: Web3) { // Send 3 ETH to the settlement contract so we can get verified quotes for // selling WETH. onchain - .send_wei(onchain.contracts().gp_settlement.address(), to_wei(3)) + .send_wei( + onchain.contracts().gp_settlement.address().into_legacy(), + to_wei(3), + ) .await; tracing::info!("Starting services."); @@ -316,7 +319,7 @@ async fn verified_quote_for_settlement_contract(web3: Web3) { // quote where settlement contract is trader and implicit receiver let response = services .submit_quote(&OrderQuoteRequest { - from: onchain.contracts().gp_settlement.address(), + from: onchain.contracts().gp_settlement.address().into_legacy(), receiver: None, ..request.clone() }) @@ -327,8 +330,8 @@ async fn verified_quote_for_settlement_contract(web3: Web3) { // quote where settlement contract is trader and explicit receiver let response = services .submit_quote(&OrderQuoteRequest { - from: onchain.contracts().gp_settlement.address(), - receiver: Some(onchain.contracts().gp_settlement.address()), + from: onchain.contracts().gp_settlement.address().into_legacy(), + receiver: Some(onchain.contracts().gp_settlement.address().into_legacy()), ..request.clone() }) .await @@ -338,7 +341,7 @@ async fn verified_quote_for_settlement_contract(web3: Web3) { // quote where settlement contract is trader and not the receiver let response = services .submit_quote(&OrderQuoteRequest { - from: onchain.contracts().gp_settlement.address(), + from: onchain.contracts().gp_settlement.address().into_legacy(), receiver: Some(trader.address()), ..request.clone() }) @@ -350,7 +353,7 @@ async fn verified_quote_for_settlement_contract(web3: Web3) { let response = services .submit_quote(&OrderQuoteRequest { from: trader.address(), - receiver: Some(onchain.contracts().gp_settlement.address()), + receiver: Some(onchain.contracts().gp_settlement.address().into_legacy()), ..request.clone() }) .await diff --git a/crates/e2e/tests/e2e/smart_contract_orders.rs b/crates/e2e/tests/e2e/smart_contract_orders.rs index e3f515fd0c..eb17c02e2e 100644 --- a/crates/e2e/tests/e2e/smart_contract_orders.rs +++ b/crates/e2e/tests/e2e/smart_contract_orders.rs @@ -1,6 +1,6 @@ use { e2e::setup::{eth, safe::Safe, *}, - ethcontract::{Bytes, H160, U256}, + ethcontract::{H160, U256}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -122,11 +122,12 @@ async fn smart_contract_orders(web3: Web3) { order_status(uids[1]).await, OrderStatus::PresignaturePending ); - safe.exec_call( + safe.exec_alloy_call( onchain .contracts() .gp_settlement - .set_pre_signature(Bytes(uids[1].0.to_vec()), true), + .setPreSignature(uids[1].0.into(), true) + .into_transaction_request(), ) .await; diff --git a/crates/e2e/tests/e2e/solver_competition.rs b/crates/e2e/tests/e2e/solver_competition.rs index 3973d3ef97..608f371f56 100644 --- a/crates/e2e/tests/e2e/solver_competition.rs +++ b/crates/e2e/tests/e2e/solver_competition.rs @@ -312,10 +312,16 @@ async fn store_filtered_solutions(web3: Web3) { // give the settlement contract a ton of the traded tokens so that the mocked // solver solutions can simply give money away to make the trade execute token_b - .mint(onchain.contracts().gp_settlement.address(), to_wei(50)) + .mint( + onchain.contracts().gp_settlement.address().into_legacy(), + to_wei(50), + ) .await; token_c - .mint(onchain.contracts().gp_settlement.address(), to_wei(50)) + .mint( + onchain.contracts().gp_settlement.address().into_legacy(), + to_wei(50), + ) .await; // set up trader for their order diff --git a/crates/e2e/tests/e2e/univ2.rs b/crates/e2e/tests/e2e/univ2.rs index d9f7daa5b6..27792283f4 100644 --- a/crates/e2e/tests/e2e/univ2.rs +++ b/crates/e2e/tests/e2e/univ2.rs @@ -1,10 +1,8 @@ use { ::alloy::primitives::U256, + contracts::alloy::GPv2Settlement, database::order_events::{OrderEvent, OrderEventLabel}, - e2e::{ - setup::{eth, *}, - tx, - }, + e2e::setup::{eth, *}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -81,23 +79,27 @@ async fn test(web3: Web3) { // Mine a trivial settlement (not encoding auction ID). This mimics fee // withdrawals and asserts we can handle these gracefully. - tx!( - solver.account(), - onchain.contracts().gp_settlement.settle( + onchain + .contracts() + .gp_settlement + .settle( Default::default(), Default::default(), Default::default(), [ - vec![( - trader.address(), - U256::ZERO.into_legacy(), - Default::default() - )], + vec![GPv2Settlement::GPv2Interaction::Data { + target: trader.address().into_alloy(), + value: U256::ZERO, + callData: Default::default(), + }], + Default::default(), Default::default(), - Default::default() ], ) - ); + .from(solver.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); tracing::info!("Waiting for trade."); let trade_happened = || async { From d52c464180f0a90a7e847850c3644f387c37b690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Wed, 29 Oct 2025 10:20:05 +0000 Subject: [PATCH 059/117] Partially migrate ERC20 to alloy (part 2) (#3837) --- Cargo.lock | 14 ++ crates/driver/src/tests/setup/blockchain.rs | 51 ++++--- crates/driver/src/tests/setup/driver.rs | 17 ++- crates/driver/src/tests/setup/mod.rs | 19 +-- crates/driver/src/tests/setup/solver.rs | 14 +- crates/e2e/Cargo.toml | 2 +- crates/e2e/tests/e2e/banned_users.rs | 106 +++++++------ crates/e2e/tests/e2e/cow_amm.rs | 159 +++++++++++-------- crates/e2e/tests/e2e/limit_orders.rs | 161 +++++++++++--------- crates/shared/src/bad_token/trace_call.rs | 86 +++++++---- 10 files changed, 366 insertions(+), 263 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14affd5fea..1c1d499189 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -379,6 +379,7 @@ dependencies = [ "alloy-network-primitives", "alloy-primitives", "alloy-rpc-client", + "alloy-rpc-types-anvil", "alloy-rpc-types-eth", "alloy-signer", "alloy-sol-types", @@ -454,6 +455,19 @@ name = "alloy-rpc-types" version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339af7336571dd39ae3a15bde08ae6a647e62f75350bd415832640268af92c06" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-anvil", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-anvil" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d98fb386a462e143f5efa64350860af39950c49e7c0cbdba419c16793116ef" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", diff --git a/crates/driver/src/tests/setup/blockchain.rs b/crates/driver/src/tests/setup/blockchain.rs index 0d3d4c5541..be5808b0ee 100644 --- a/crates/driver/src/tests/setup/blockchain.rs +++ b/crates/driver/src/tests/setup/blockchain.rs @@ -5,12 +5,14 @@ use { tests::{self, boundary, cases::EtherExt}, }, alloy::{ - primitives::U256, + primitives::{Address, U256}, signers::local::{MnemonicBuilder, PrivateKeySigner}, + sol_types::SolCall, }, contracts::alloy::{ BalancerV2Authorizer, BalancerV2Vault, + ERC20, ERC20Mintable, FlashLoanRouter, GPv2AllowListAuthentication::GPv2AllowListAuthentication, @@ -195,8 +197,8 @@ impl QuotedOrder { fn boundary(&self, blockchain: &Blockchain, secret_key: SecretKey) -> tests::boundary::Order { tests::boundary::Order { - sell_token: blockchain.get_token(self.order.sell_token), - buy_token: blockchain.get_token(self.order.buy_token), + sell_token: blockchain.get_token(self.order.sell_token).into_legacy(), + buy_token: blockchain.get_token(self.order.buy_token).into_legacy(), sell_amount: self.sell_amount(), buy_amount: self.buy_amount(), valid_to: self.order.valid_to, @@ -750,10 +752,14 @@ impl Blockchain { let mut fulfillments = Vec::new(); for order in orders { // Find the pair to use for this order and calculate the buy and sell amounts. - let sell_token = - contracts::ERC20::at(&self.web3, self.get_token_wrapped(order.sell_token)); - let buy_token = - contracts::ERC20::at(&self.web3, self.get_token_wrapped(order.buy_token)); + let sell_token = ERC20::Instance::new( + self.get_token_wrapped(order.sell_token), + self.web3.alloy.clone(), + ); + let buy_token = ERC20::Instance::new( + self.get_token_wrapped(order.buy_token), + self.web3.alloy.clone(), + ); let pair = self.find_pair(order); let execution = self.execution(order); @@ -791,12 +797,11 @@ impl Blockchain { .unwrap(); // Create the interactions fulfilling the order. - let transfer_interaction = sell_token - .transfer(pair.contract.address().into_legacy(), execution.sell) - .tx - .data - .unwrap() - .0; + let transfer_interaction = ERC20::ERC20::transferCall { + recipient: *pair.contract.address(), + amount: execution.sell.into_alloy(), + } + .abi_encode(); let (amount_a_out, amount_b_out) = if pair.token_a == order.sell_token { (0.into(), execution.buy) } else { @@ -824,7 +829,7 @@ impl Blockchain { execution: execution.clone(), interactions: vec![ Interaction { - address: sell_token.address(), + address: sell_token.address().into_legacy(), calldata: match solution.calldata { super::Calldata::Valid { additional_bytes } => transfer_interaction .into_iter() @@ -845,12 +850,12 @@ impl Blockchain { } }, inputs: vec![eth::Asset { - token: sell_token.address().into(), + token: sell_token.address().into_legacy().into(), // Surplus fees stay in the contract. amount: (execution.sell - order.surplus_fee()).into(), }], outputs: vec![eth::Asset { - token: buy_token.address().into(), + token: buy_token.address().into_legacy().into(), amount: execution.buy.into(), }], internalize: order.internalize, @@ -862,20 +867,20 @@ impl Blockchain { } /// Returns the address of the token with the given symbol. - pub fn get_token(&self, token: &str) -> eth::H160 { + pub fn get_token(&self, token: &str) -> Address { match token { - "WETH" => self.weth.address().into_legacy(), - "ETH" => eth::ETH_TOKEN.into(), - _ => self.tokens.get(token).unwrap().address().into_legacy(), + "WETH" => *self.weth.address(), + "ETH" => eth::ETH_TOKEN.0.0.into_alloy(), + _ => *self.tokens.get(token).unwrap().address(), } } /// Returns the address of the token with the given symbol. Wrap ETH into /// WETH. - pub fn get_token_wrapped(&self, token: &str) -> eth::H160 { + pub fn get_token_wrapped(&self, token: &str) -> Address { match token { - "WETH" | "ETH" => self.weth.address().into_legacy(), - _ => self.tokens.get(token).unwrap().address().into_legacy(), + "WETH" | "ETH" => *self.weth.address(), + _ => *self.tokens.get(token).unwrap().address(), } } diff --git a/crates/driver/src/tests/setup/driver.rs b/crates/driver/src/tests/setup/driver.rs index f6afc2432d..1311775dbd 100644 --- a/crates/driver/src/tests/setup/driver.rs +++ b/crates/driver/src/tests/setup/driver.rs @@ -8,6 +8,7 @@ use { setup::{blockchain::Trade, orderbook::Orderbook}, }, }, + const_hex::ToHexExt, ethrpc::alloy::conversions::IntoLegacy, rand::seq::SliceRandom, serde_json::json, @@ -74,8 +75,8 @@ pub fn solve_req(test: &Test) -> serde_json::Value { for quote in quotes.iter() { let mut order = json!({ "uid": quote.order_uid(&test.blockchain), - "sellToken": hex_address(test.blockchain.get_token(quote.order.sell_token)), - "buyToken": hex_address(test.blockchain.get_token(quote.order.buy_token)), + "sellToken": test.blockchain.get_token(quote.order.sell_token).encode_hex_with_prefix(), + "buyToken": test.blockchain.get_token(quote.order.buy_token).encode_hex_with_prefix(), "sellAmount": quote.sell_amount().to_string(), "buyAmount": quote.buy_amount().to_string(), "protocolFees": match quote.order.kind { @@ -122,24 +123,24 @@ pub fn solve_req(test: &Test) -> serde_json::Value { match trade { Trade::Fulfillment(fulfillment) => { tokens_json.push(json!({ - "address": hex_address(test.blockchain.get_token_wrapped(fulfillment.quoted_order.order.sell_token)), + "address": test.blockchain.get_token_wrapped(fulfillment.quoted_order.order.sell_token).encode_hex_with_prefix(), "price": "1000000000000000000", "trusted": test.trusted.contains(fulfillment.quoted_order.order.sell_token), })); tokens_json.push(json!({ - "address": hex_address(test.blockchain.get_token_wrapped(fulfillment.quoted_order.order.buy_token)), + "address": test.blockchain.get_token_wrapped(fulfillment.quoted_order.order.buy_token).encode_hex_with_prefix(), "price": "1000000000000000000", "trusted": test.trusted.contains(fulfillment.quoted_order.order.buy_token), })); } Trade::Jit(jit) => { tokens_json.push(json!({ - "address": hex_address(test.blockchain.get_token_wrapped(jit.quoted_order.order.sell_token)), + "address": test.blockchain.get_token_wrapped(jit.quoted_order.order.sell_token).encode_hex_with_prefix(), "price": "1000000000000000000", "trusted": test.trusted.contains(jit.quoted_order.order.sell_token), })); tokens_json.push(json!({ - "address": hex_address(test.blockchain.get_token_wrapped(jit.quoted_order.order.buy_token)), + "address": test.blockchain.get_token_wrapped(jit.quoted_order.order.buy_token).encode_hex_with_prefix(), "price": "1000000000000000000", "trusted": test.trusted.contains(jit.quoted_order.order.buy_token), })); @@ -184,8 +185,8 @@ pub fn quote_req(test: &Test) -> serde_json::Value { let quote = test.quoted_orders.first().unwrap(); json!({ - "sellToken": hex_address(test.blockchain.get_token(quote.order.sell_token)), - "buyToken": hex_address(test.blockchain.get_token(quote.order.buy_token)), + "sellToken": test.blockchain.get_token(quote.order.sell_token).encode_hex_with_prefix(), + "buyToken": test.blockchain.get_token(quote.order.buy_token).encode_hex_with_prefix(), "amount": match quote.order.side { order::Side::Buy => quote.buy_amount().to_string(), order::Side::Sell => quote.sell_amount().to_string(), diff --git a/crates/driver/src/tests/setup/mod.rs b/crates/driver/src/tests/setup/mod.rs index b55a3ca162..2e751dfc4e 100644 --- a/crates/driver/src/tests/setup/mod.rs +++ b/crates/driver/src/tests/setup/mod.rs @@ -31,13 +31,13 @@ use { EtherExt, is_approximately_equal, }, - hex_address, setup::{ blockchain::{Blockchain, Interaction, Trade}, orderbook::Orderbook, }, }, }, + alloy::primitives::Address, bigdecimal::{BigDecimal, FromPrimitive}, ethcontract::dyns::DynTransport, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -47,6 +47,7 @@ use { number::serialization::HexOrDecimalU256, primitive_types::H160, secp256k1::SecretKey, + serde::{Deserialize, de::IntoDeserializer}, serde_with::serde_as, solvers_dto::solution::Flashloan, std::{ @@ -1307,15 +1308,15 @@ impl SolveOk<'_> { fn trade_matches(&self, trade: &serde_json::Value, expected: &JitOrder) -> bool { let u256 = |value: &serde_json::Value| eth::U256::from_dec_str(value.as_str().unwrap()).unwrap(); - let sell_token = trade.get("sellToken").unwrap().to_string(); - let sell_token = sell_token.trim_matches('"'); - let buy_token = trade.get("buyToken").unwrap().to_string(); - let buy_token = buy_token.trim_matches('"'); + let sell_token = + Address::deserialize(trade.get("sellToken").unwrap().into_deserializer()).unwrap(); + let buy_token = + Address::deserialize(trade.get("buyToken").unwrap().into_deserializer()).unwrap(); let sell_amount = u256(trade.get("executedSell").unwrap()); let buy_amount = u256(trade.get("executedBuy").unwrap()); - sell_token == hex_address(self.blockchain.get_token(expected.order.sell_token)) - && buy_token == hex_address(self.blockchain.get_token(expected.order.buy_token)) + sell_token == self.blockchain.get_token(expected.order.sell_token) + && buy_token == self.blockchain.get_token(expected.order.buy_token) && expected.order.expected_amounts.clone().unwrap().sell == sell_amount && expected.order.expected_amounts.clone().unwrap().buy == buy_amount } @@ -1517,8 +1518,8 @@ impl QuoteOk<'_> { .collect::>(); let amount = match quoted_order.order.side { - order::Side::Buy => clearing_prices.get(&buy_token).unwrap(), - order::Side::Sell => clearing_prices.get(&sell_token).unwrap(), + order::Side::Buy => clearing_prices.get(&buy_token.into_legacy()).unwrap(), + order::Side::Sell => clearing_prices.get(&sell_token.into_legacy()).unwrap(), }; let expected = match quoted_order.order.side { diff --git a/crates/driver/src/tests/setup/solver.rs b/crates/driver/src/tests/setup/solver.rs index f3f7026ead..31bfe5c864 100644 --- a/crates/driver/src/tests/setup/solver.rs +++ b/crates/driver/src/tests/setup/solver.rs @@ -13,6 +13,8 @@ use { infra::{self, Ethereum, blockchain::contracts::Addresses, config::file::FeeHandler}, tests::{hex_address, setup::blockchain::Trade}, }, + const_hex::ToHexExt, + contracts::alloy::ERC20, ethereum_types::H160, ethrpc::alloy::conversions::IntoLegacy, itertools::Itertools, @@ -122,8 +124,8 @@ impl Solver { let mut order = json!({ "uid": if config.quote { Default::default() } else { quote.order_uid(config.blockchain) }, - "sellToken": hex_address(config.blockchain.get_token(sell_token)), - "buyToken": hex_address(config.blockchain.get_token(buy_token)), + "sellToken": config.blockchain.get_token(sell_token).encode_hex_with_prefix(), + "buyToken": config.blockchain.get_token(buy_token).encode_hex_with_prefix(), "sellAmount": sell_amount, "fullSellAmount": if config.quote { sell_amount } else { quote.sell_amount().to_string() }, "buyAmount": buy_amount, @@ -409,17 +411,17 @@ impl Solver { .flat_map(|f| { let build_token = |token_name: String| async move { let token = config.blockchain.get_token_wrapped(token_name.as_str()); - let contract = contracts::ERC20::at(&config.blockchain.web3, token); - let settlement = config.blockchain.settlement.address().into_legacy(); + let contract = ERC20::Instance::new(token, config.blockchain.web3.alloy.clone()); + let settlement = config.blockchain.settlement.address(); ( - hex_address(token), + token.encode_hex_with_prefix(), json!({ "decimals": contract.decimals().call().await.ok(), "symbol": contract.symbol().call().await.ok(), "referencePrice": if config.quote { None } else { Some("1000000000000000000") }, // available balance might break if one test settles 2 auctions after // another - "availableBalance": contract.balance_of(settlement).call().await.unwrap().to_string(), + "availableBalance": contract.balanceOf(*settlement).call().await.unwrap().to_string(), "trusted": config.trusted.contains(token_name.as_str()), }), ) diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 80fb89344e..25923742c3 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -9,7 +9,7 @@ edition = "2024" license = "MIT OR Apache-2.0" [dependencies] -alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic"] } +alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic","provider-anvil-api"] } app-data = { workspace = true } anyhow = { workspace = true } autopilot = { workspace = true } diff --git a/crates/e2e/tests/e2e/banned_users.rs b/crates/e2e/tests/e2e/banned_users.rs index 909b20a2c6..abd741e855 100644 --- a/crates/e2e/tests/e2e/banned_users.rs +++ b/crates/e2e/tests/e2e/banned_users.rs @@ -1,18 +1,21 @@ use { - contracts::ERC20, - e2e::{ - nodes::forked_node::ForkedNodeApi, - setup::{ - OnchainComponents, - Services, - run_forked_test_with_block_number, - to_wei, - to_wei_with_exp, - }, - tx, + alloy::{ + primitives::{Address, address}, + providers::ext::{AnvilApi, ImpersonateConfig}, + }, + contracts::alloy::ERC20, + e2e::setup::{ + OnchainComponents, + Services, + eth, + run_forked_test_with_block_number, + to_wei, + to_wei_with_exp, + }, + ethrpc::{ + Web3, + alloy::conversions::{IntoAlloy, IntoLegacy}, }, - ethcontract::H160, - ethrpc::Web3, model::quote::{OrderQuoteRequest, OrderQuoteSide, SellAmount}, reqwest::StatusCode, }; @@ -32,49 +35,60 @@ async fn forked_node_mainnet_single_limit_order() { /// The block number from which we will fetch state for the forked tests. const FORK_BLOCK_MAINNET: u64 = 23112197; /// DAI whale address as per [FORK_BLOCK_MAINNET]. -const DAI_WHALE_MAINNET: H160 = H160(hex_literal::hex!( - "762d46904B93a1EEDBfF2fD50445CB8ffA41F9FB" -)); -const BANNED_USER: H160 = H160(hex_literal::hex!( - "7F367cC41522cE07553e823bf3be79A889DEbe1B" -)); +const DAI_WHALE_MAINNET: Address = address!("762d46904B93a1EEDBfF2fD50445CB8ffA41F9FB"); +const BANNED_USER: Address = address!("7F367cC41522cE07553e823bf3be79A889DEbe1B"); async fn forked_mainnet_onchain_banned_user_test(web3: Web3) { let mut onchain = OnchainComponents::deployed(web3.clone()).await; let [solver] = onchain.make_solvers_forked(to_wei(1)).await; - let forked_node_api = web3.api::>(); - let token_dai = ERC20::at( - &web3, - "0x6b175474e89094c44da98b954eedeac495271d0f" - .parse() - .unwrap(), + let token_dai = ERC20::Instance::new( + address!("6b175474e89094c44da98b954eedeac495271d0f"), + web3.alloy.clone(), ); - let token_usdt = ERC20::at( - &web3, - "0xdac17f958d2ee523a2206206994597c13d831ec7" - .parse() - .unwrap(), + let token_usdt = ERC20::Instance::new( + address!("dac17f958d2ee523a2206206994597c13d831ec7"), + web3.alloy.clone(), ); - let banned_user = forked_node_api.impersonate(&BANNED_USER).await.unwrap(); - - // Give trader some DAI - let dai_whale = forked_node_api - .impersonate(&DAI_WHALE_MAINNET) + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_dai + .transfer(BANNED_USER, to_wei_with_exp(1000, 18).into_alloy()) + .from(DAI_WHALE_MAINNET) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() .await .unwrap(); - tx!( - dai_whale, - token_dai.transfer(banned_user.address(), to_wei_with_exp(1000, 18)) - ); // Approve GPv2 for trading - tx!( - banned_user, - token_dai.approve(onchain.contracts().allowance, to_wei_with_exp(1000, 18)) - ); + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_dai + .approve( + onchain.contracts().allowance.into_alloy(), + to_wei_with_exp(1000, 18).into_alloy(), + ) + .from(BANNED_USER) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: Some(eth(1)), + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() + .await + .unwrap(); // Place Order let services = Services::new(&onchain).await; @@ -82,14 +96,14 @@ async fn forked_mainnet_onchain_banned_user_test(web3: Web3) { let result = services .submit_quote(&OrderQuoteRequest { - sell_token: token_dai.address(), - buy_token: token_usdt.address(), + sell_token: token_dai.address().into_legacy(), + buy_token: token_usdt.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: to_wei_with_exp(1000, 18).try_into().unwrap(), }, }, - from: banned_user.address(), + from: BANNED_USER.into_legacy(), ..Default::default() }) .await; diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index 179fa4009b..6e389aafec 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -1,27 +1,26 @@ use { - alloy::primitives::{Bytes, FixedBytes, U256}, - contracts::{ + alloy::{ + primitives::{Address, Bytes, FixedBytes, U256, address}, + providers::ext::{AnvilApi, ImpersonateConfig}, + }, + contracts::alloy::{ ERC20, - alloy::support::{Balances, Signatures}, + support::{Balances, Signatures}, }, driver::domain::eth::NonZeroU256, - e2e::{ - nodes::forked_node::ForkedNodeApi, - setup::{ - DeployedContracts, - OnchainComponents, - Services, - TIMEOUT, - colocation::{self, SolverEngine}, - eth, - mock::Mock, - run_forked_test_with_block_number, - run_test, - to_wei, - to_wei_with_exp, - wait_for_condition, - }, - tx, + e2e::setup::{ + DeployedContracts, + OnchainComponents, + Services, + TIMEOUT, + colocation::{self, SolverEngine}, + eth, + mock::Mock, + run_forked_test_with_block_number, + run_test, + to_wei, + to_wei_with_exp, + wait_for_condition, }, ethcontract::{BlockId, BlockNumber, H160}, ethrpc::alloy::{ @@ -412,33 +411,22 @@ async fn cow_amm_driver_support(web3: Web3) { } }; let mut onchain = OnchainComponents::deployed_with(web3.clone(), deployed_contracts).await; - let forked_node_api = web3.api::>(); let [solver] = onchain.make_solvers_forked(to_wei(11)).await; let [trader] = onchain.make_accounts(to_wei(1)).await; // find some USDC available onchain - const USDC_WHALE_MAINNET: H160 = H160(hex_literal::hex!( - "28c6c06298d514db089934071355e5743bf21d60" - )); - let usdc_whale = forked_node_api - .impersonate(&USDC_WHALE_MAINNET) - .await - .unwrap(); + const USDC_WHALE_MAINNET: Address = address!("28c6c06298d514db089934071355e5743bf21d60"); // create necessary token instances - let usdc = ERC20::at( - &web3, - "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" - .parse() - .unwrap(), + let usdc = ERC20::Instance::new( + address!("a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"), + web3.alloy.clone(), ); - let usdt = ERC20::at( - &web3, - "0xdac17f958d2ee523a2206206994597c13d831ec7" - .parse() - .unwrap(), + let usdt = ERC20::Instance::new( + address!("dac17f958d2ee523a2206206994597c13d831ec7"), + web3.alloy.clone(), ); // Unbalance the cow amm enough that baseline is able to rebalance @@ -478,43 +466,80 @@ async fn cow_amm_driver_support(web3: Web3) { .await .unwrap(); - let amm_usdc_balance_before = usdc.balance_of(USDC_WETH_COW_AMM).call().await.unwrap(); + let amm_usdc_balance_before = usdc + .balanceOf(USDC_WETH_COW_AMM.into_alloy()) + .call() + .await + .unwrap(); // Now we create an unfillable order just so the orderbook is not empty. // Otherwise all auctions would be skipped because there is no user order to // settle. // Give trader some USDC - tx!( - usdc_whale, - usdc.transfer(trader.address(), to_wei_with_exp(1000, 6)) - ); + web3.alloy + .anvil_send_impersonated_transaction_with_config( + usdc.transfer( + trader.address().into_alloy(), + to_wei_with_exp(1000, 6).into_alloy(), + ) + .from(USDC_WHALE_MAINNET) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() + .await + .unwrap(); // Approve GPv2 for trading - tx!( - trader.account(), - usdc.approve(onchain.contracts().allowance, to_wei_with_exp(1000, 6)) - ); + usdc.approve( + onchain.contracts().allowance.into_alloy(), + to_wei_with_exp(1000, 6).into_alloy(), + ) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); // Empty liquidity of one of the AMMs to test EmptyPoolRemoval maintenance job. - let zero_balance_amm = addr!("b3bf81714f704720dcb0351ff0d42eca61b069fc"); - let zero_balance_amm_account = forked_node_api - .impersonate(&zero_balance_amm) - .await - .unwrap(); - let pendle_token = ERC20::at(&web3, addr!("808507121b80c02388fad14726482e061b8da827")); + const ZERO_BALANCE_AMM: Address = address!("b3bf81714f704720dcb0351ff0d42eca61b069fc"); + let pendle_token = ERC20::Instance::new( + address!("808507121b80c02388fad14726482e061b8da827"), + web3.alloy.clone(), + ); let balance = pendle_token - .balance_of(zero_balance_amm) + .balanceOf(ZERO_BALANCE_AMM) .call() .await .unwrap(); - tx!( - zero_balance_amm_account, - pendle_token.transfer(addr!("027e1cbf2c299cba5eb8a2584910d04f1a8aa403"), balance) - ); + web3.alloy + .anvil_send_impersonated_transaction_with_config( + pendle_token + .transfer( + address!("027e1cbf2c299cba5eb8a2584910d04f1a8aa403"), + balance, + ) + .from(ZERO_BALANCE_AMM) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() + .await + .unwrap(); + assert!( pendle_token - .balance_of(zero_balance_amm) + .balanceOf(ZERO_BALANCE_AMM) .call() .await .unwrap() @@ -577,9 +602,9 @@ factory = "0xf76c421bAb7df8548604E60deCCcE50477C10462" // Place Orders let order = OrderCreation { - sell_token: usdc.address(), + sell_token: usdc.address().into_legacy(), sell_amount: to_wei_with_exp(1000, 6), - buy_token: usdt.address(), + buy_token: usdt.address().into_legacy(), buy_amount: to_wei_with_exp(2000, 6), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -595,8 +620,8 @@ factory = "0xf76c421bAb7df8548604E60deCCcE50477C10462" // may time out) let _ = services .submit_quote(&OrderQuoteRequest { - sell_token: usdc.address(), - buy_token: usdt.address(), + sell_token: usdc.address().into_legacy(), + buy_token: usdt.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: to_wei_with_exp(1000, 6).try_into().unwrap(), @@ -617,7 +642,11 @@ factory = "0xf76c421bAb7df8548604E60deCCcE50477C10462" onchain.mint_block().await; tokio::time::sleep(tokio::time::Duration::from_millis(1_000)).await; - let amm_usdc_balance_after = usdc.balance_of(USDC_WETH_COW_AMM).call().await.unwrap(); + let amm_usdc_balance_after = usdc + .balanceOf(USDC_WETH_COW_AMM.into_alloy()) + .call() + .await + .unwrap(); // CoW AMM traded automatically amm_usdc_balance_after != amm_usdc_balance_before }) @@ -661,7 +690,7 @@ factory = "0xf76c421bAb7df8548604E60deCCcE50477C10462" auction.orders.iter().any(|order| { order.owner == USDC_WETH_COW_AMM && order.sell_token == onchain.contracts().weth.address().into_legacy() - && order.buy_token == usdc.address() + && order.buy_token == usdc.address().into_legacy() }) }); diff --git a/crates/e2e/tests/e2e/limit_orders.rs b/crates/e2e/tests/e2e/limit_orders.rs index c6ff3a627c..0b0051afb8 100644 --- a/crates/e2e/tests/e2e/limit_orders.rs +++ b/crates/e2e/tests/e2e/limit_orders.rs @@ -1,16 +1,14 @@ use { crate::database::AuctionTransaction, - ::alloy::primitives::U256, + ::alloy::{ + primitives::{Address, U256, address}, + providers::ext::{AnvilApi, ImpersonateConfig}, + }, bigdecimal::BigDecimal, - contracts::ERC20, + contracts::alloy::ERC20, database::byte_array::ByteArray, driver::domain::eth::NonZeroU256, - e2e::{ - nodes::forked_node::ForkedNodeApi, - setup::{eth, *}, - tx, - }, - ethcontract::H160, + e2e::setup::{eth, *}, ethrpc::alloy::{ CallBuilderExt, conversions::{IntoAlloy, IntoLegacy}, @@ -67,9 +65,7 @@ async fn local_node_no_liquidity_limit_order() { /// The block number from which we will fetch state for the forked tests. const FORK_BLOCK_MAINNET: u64 = 23112197; /// USDC whale address as per [FORK_BLOCK_MAINNET]. -const USDC_WHALE_MAINNET: H160 = H160(hex_literal::hex!( - "28c6c06298d514db089934071355e5743bf21d60" -)); +const USDC_WHALE_MAINNET: Address = address!("28c6c06298d514db089934071355e5743bf21d60"); #[tokio::test] #[ignore] @@ -85,9 +81,7 @@ async fn forked_node_mainnet_single_limit_order() { const FORK_BLOCK_GNOSIS: u64 = 41502478; /// USDC whale address as per [FORK_BLOCK_GNOSIS]. -const USDC_WHALE_GNOSIS: H160 = H160(hex_literal::hex!( - "d4A39d219ADB43aB00739DC5D876D98Fdf0121Bf" -)); +const USDC_WHALE_GNOSIS: Address = address!("d4A39d219ADB43aB00739DC5D876D98Fdf0121Bf"); #[tokio::test] #[ignore] @@ -828,41 +822,52 @@ async fn limit_does_not_apply_to_in_market_orders_test(web3: Web3) { async fn forked_mainnet_single_limit_order_test(web3: Web3) { let mut onchain = OnchainComponents::deployed(web3.clone()).await; - let forked_node_api = web3.api::>(); let [solver] = onchain.make_solvers_forked(to_wei(1)).await; let [trader] = onchain.make_accounts(to_wei(1)).await; - let token_usdc = ERC20::at( - &web3, - "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" - .parse() - .unwrap(), + let token_usdc = ERC20::Instance::new( + address!("a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"), + web3.alloy.clone(), ); - let token_usdt = ERC20::at( - &web3, - "0xdac17f958d2ee523a2206206994597c13d831ec7" - .parse() - .unwrap(), + let token_usdt = ERC20::Instance::new( + address!("dac17f958d2ee523a2206206994597c13d831ec7"), + web3.alloy.clone(), ); // Give trader some USDC - let usdc_whale = forked_node_api - .impersonate(&USDC_WHALE_MAINNET) + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdc + .transfer( + trader.address().into_alloy(), + to_wei_with_exp(1000, 6).into_alloy(), + ) + .from(USDC_WHALE_MAINNET) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() .await .unwrap(); - tx!( - usdc_whale, - token_usdc.transfer(trader.address(), to_wei_with_exp(1000, 6)) - ); // Approve GPv2 for trading - tx!( - trader.account(), - token_usdc.approve(onchain.contracts().allowance, to_wei_with_exp(1000, 6)) - ); + token_usdc + .approve( + onchain.contracts().allowance.into_alloy(), + to_wei_with_exp(1000, 6).into_alloy(), + ) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); // Place Orders let services = Services::new(&onchain).await; @@ -871,9 +876,9 @@ async fn forked_mainnet_single_limit_order_test(web3: Web3) { onchain.mint_block().await; let order = OrderCreation { - sell_token: token_usdc.address(), + sell_token: token_usdc.address().into_legacy(), sell_amount: to_wei_with_exp(1000, 6), - buy_token: token_usdt.address(), + buy_token: token_usdt.address().into_legacy(), buy_amount: to_wei_with_exp(500, 6), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -889,8 +894,8 @@ async fn forked_mainnet_single_limit_order_test(web3: Web3) { // may time out) let _ = services .submit_quote(&OrderQuoteRequest { - sell_token: token_usdc.address(), - buy_token: token_usdt.address(), + sell_token: token_usdc.address().into_legacy(), + buy_token: token_usdt.address().into_legacy(), side: OrderQuoteSide::Sell { sell_amount: SellAmount::BeforeFee { value: to_wei_with_exp(1000, 6).try_into().unwrap(), @@ -901,12 +906,12 @@ async fn forked_mainnet_single_limit_order_test(web3: Web3) { .await; let sell_token_balance_before = token_usdc - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); let buy_token_balance_before = token_usdt - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); @@ -920,18 +925,19 @@ async fn forked_mainnet_single_limit_order_test(web3: Web3) { wait_for_condition(TIMEOUT, || async { onchain.mint_block().await; let sell_token_balance_after = token_usdc - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); let buy_token_balance_after = token_usdt - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); (sell_token_balance_before > sell_token_balance_after) - && (buy_token_balance_after >= buy_token_balance_before + to_wei_with_exp(500, 6)) + && (buy_token_balance_after + >= buy_token_balance_before + to_wei_with_exp(500, 6).into_alloy()) }) .await .unwrap(); @@ -939,50 +945,61 @@ async fn forked_mainnet_single_limit_order_test(web3: Web3) { async fn forked_gnosis_single_limit_order_test(web3: Web3) { let mut onchain = OnchainComponents::deployed(web3.clone()).await; - let forked_node_api = web3.api::>(); let [solver] = onchain.make_solvers_forked(to_wei(1)).await; let [trader] = onchain.make_accounts(to_wei(1)).await; - let token_usdc = ERC20::at( - &web3, - "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" - .parse() - .unwrap(), + let token_usdc = ERC20::Instance::new( + address!("ddafbb505ad214d7b80b1f830fccc89b60fb7a83"), + web3.alloy.clone(), ); - let token_wxdai = ERC20::at( - &web3, - "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d" - .parse() - .unwrap(), + let token_wxdai = ERC20::Instance::new( + address!("e91d153e0b41518a2ce8dd3d7944fa863463a97d"), + web3.alloy.clone(), ); // Give trader some USDC - let usdc_whale = forked_node_api - .impersonate(&USDC_WHALE_GNOSIS) + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdc + .transfer( + trader.address().into_alloy(), + to_wei_with_exp(1000, 6).into_alloy(), + ) + .from(USDC_WHALE_GNOSIS) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() .await .unwrap(); - tx!( - usdc_whale, - token_usdc.transfer(trader.address(), to_wei_with_exp(1000, 6)) - ); // Approve GPv2 for trading - tx!( - trader.account(), - token_usdc.approve(onchain.contracts().allowance, to_wei_with_exp(1000, 6)) - ); + token_usdc + .approve( + onchain.contracts().allowance.into_alloy(), + to_wei_with_exp(1000, 6).into_alloy(), + ) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); // Place Orders let services = Services::new(&onchain).await; services.start_protocol(solver).await; let order = OrderCreation { - sell_token: token_usdc.address(), + sell_token: token_usdc.address().into_legacy(), sell_amount: to_wei_with_exp(1000, 6), - buy_token: token_wxdai.address(), + buy_token: token_wxdai.address().into_legacy(), buy_amount: to_wei(500), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -994,12 +1011,12 @@ async fn forked_gnosis_single_limit_order_test(web3: Web3) { SecretKeyRef::from(&SecretKey::from_slice(trader.private_key()).unwrap()), ); let sell_token_balance_before = token_usdc - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); let buy_token_balance_before = token_wxdai - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); @@ -1012,18 +1029,18 @@ async fn forked_gnosis_single_limit_order_test(web3: Web3) { tracing::info!("Waiting for trade."); wait_for_condition(TIMEOUT, || async { let sell_token_balance_after = token_usdc - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); let buy_token_balance_after = token_wxdai - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); (sell_token_balance_before > sell_token_balance_after) - && (buy_token_balance_after >= buy_token_balance_before + to_wei(500)) + && (buy_token_balance_after >= buy_token_balance_before + eth(500)) }) .await .unwrap(); diff --git a/crates/shared/src/bad_token/trace_call.rs b/crates/shared/src/bad_token/trace_call.rs index 50b18bbfd6..8621f3cf31 100644 --- a/crates/shared/src/bad_token/trace_call.rs +++ b/crates/shared/src/bad_token/trace_call.rs @@ -1,14 +1,11 @@ use { super::{BadTokenDetecting, TokenQuality, token_owner_finder::TokenOwnerFinding}, crate::{ethrpc::Web3, trace_many}, + alloy::sol_types::SolCall, anyhow::{Context, Result, bail, ensure}, - contracts::ERC20, - ethcontract::{ - PrivateKey, - dyns::DynTransport, - jsonrpc::ErrorCode, - transaction::TransactionBuilder, - }, + contracts::alloy::ERC20, + ethcontract::{PrivateKey, jsonrpc::ErrorCode}, + ethrpc::alloy::conversions::IntoAlloy, model::interaction::InteractionData, primitive_types::{H160, U256}, std::{cmp, sync::Arc}, @@ -164,36 +161,64 @@ impl TraceCallDetectorRaw { } fn create_trace_request(&self, token: H160, amount: U256, take_from: H160) -> Vec { - let instance = ERC20::at(&self.web3, token); - let mut requests = Vec::new(); + let recipient = Self::arbitrary_recipient().into_alloy(); + let settlement_contract = self.settlement_contract.into_alloy(); // 0 - let tx = instance.balance_of(self.settlement_contract).m.tx; - requests.push(call_request(None, token, tx)); + let calldata = ERC20::ERC20::balanceOfCall { + account: settlement_contract, + } + .abi_encode(); + requests.push(call_request(None, token, calldata)); // 1 - let tx = instance.transfer(self.settlement_contract, amount).tx; - requests.push(call_request(Some(take_from), token, tx)); + let calldata = ERC20::ERC20::transferCall { + recipient: settlement_contract, + amount: amount.into_alloy(), + } + .abi_encode(); + requests.push(call_request(Some(take_from), token, calldata)); // 2 - let tx = instance.balance_of(self.settlement_contract).m.tx; - requests.push(call_request(None, token, tx)); + let calldata = ERC20::ERC20::balanceOfCall { + account: settlement_contract, + } + .abi_encode(); + requests.push(call_request(None, token, calldata)); // 3 - let recipient = Self::arbitrary_recipient(); - let tx = instance.balance_of(recipient).m.tx; - requests.push(call_request(None, token, tx)); + let calldata = ERC20::ERC20::balanceOfCall { account: recipient }.abi_encode(); + requests.push(call_request(None, token, calldata)); // 4 - let tx = instance.transfer(recipient, amount).tx; - requests.push(call_request(Some(self.settlement_contract), token, tx)); + let calldata = ERC20::ERC20::transferCall { + recipient, + amount: amount.into_alloy(), + } + .abi_encode(); + requests.push(call_request( + Some(self.settlement_contract), + token, + calldata, + )); // 5 - let tx = instance.balance_of(self.settlement_contract).m.tx; - requests.push(call_request(None, token, tx)); + let calldata = ERC20::ERC20::balanceOfCall { + account: settlement_contract, + } + .abi_encode(); + requests.push(call_request(None, token, calldata)); // 6 - let tx = instance.balance_of(recipient).m.tx; - requests.push(call_request(None, token, tx)); + let calldata = ERC20::ERC20::balanceOfCall { account: recipient }.abi_encode(); + requests.push(call_request(None, token, calldata)); // 7 - let tx = instance.approve(recipient, U256::MAX).tx; - requests.push(call_request(Some(self.settlement_contract), token, tx)); + let calldata = ERC20::ERC20::approveCall { + spender: recipient, + amount: alloy::primitives::U256::MAX, + } + .abi_encode(); + requests.push(call_request( + Some(self.settlement_contract), + token, + calldata, + )); requests } @@ -316,16 +341,11 @@ impl TraceCallDetectorRaw { } } -fn call_request( - from: Option, - to: H160, - transaction: TransactionBuilder, -) -> CallRequest { - let calldata = transaction.data.unwrap(); +fn call_request(from: Option, to: H160, calldata: Vec) -> CallRequest { CallRequest { from, to: Some(to), - data: Some(calldata), + data: Some(calldata.into()), ..Default::default() } } From e442efcc59d35e320fe751921bfb4165eb9d16e1 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Wed, 29 Oct 2025 11:43:40 +0100 Subject: [PATCH 060/117] [TRIVIAL] pin postgres to version 16 in playground (#3839) # Description Same as https://github.com/cowprotocol/services/pull/3814 but for the postgres images used by the playground. # Changes pinned postgres image version to 16 in the playground ## How to test run playground and verify that the migrations can be applied --- playground/docker-compose.fork.yml | 2 +- playground/docker-compose.non-interactive.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playground/docker-compose.fork.yml b/playground/docker-compose.fork.yml index e564106bea..6b68b9bef7 100644 --- a/playground/docker-compose.fork.yml +++ b/playground/docker-compose.fork.yml @@ -31,7 +31,7 @@ services: start_period: 5s db: - image: postgres + image: postgres:16 restart: always environment: - POSTGRES_USER diff --git a/playground/docker-compose.non-interactive.yml b/playground/docker-compose.non-interactive.yml index ccc1833cd2..f41847875b 100644 --- a/playground/docker-compose.non-interactive.yml +++ b/playground/docker-compose.non-interactive.yml @@ -34,7 +34,7 @@ services: start_period: 5s db: - image: postgres + image: postgres:16 restart: always environment: - POSTGRES_USER From 618357a16ef696003a149a88f3491e0bcc2f84bf Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Wed, 29 Oct 2025 19:40:34 +0100 Subject: [PATCH 061/117] [TRIVIAL] fix playground driver config (#3842) # Description The recently introduced `tx-gas-limit` argument expects a big integer so a hex or decimal encoded string instead of an integers literal. This currently causes the playground to not work. As a reference see this [configuration](https://github.com/cowprotocol/services/blob/main/crates/e2e/src/setup/colocation.rs#L179) in the e2e tests that work correctly. --- configs/local/driver.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/local/driver.toml b/configs/local/driver.toml index 5309fd6c10..dea62fd2c5 100644 --- a/configs/local/driver.toml +++ b/configs/local/driver.toml @@ -1,4 +1,4 @@ -tx-gas-limit = 45000000 +tx-gas-limit = "45000000" [[solver]] name = "baseline" # Arbitrary name given to this solver, must be unique From 3b9730c7294c1666461e7d008e1c3636ce04669a Mon Sep 17 00:00:00 2001 From: "Jan [Yann]" <4518474+fafk@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:56:36 +0100 Subject: [PATCH 062/117] Add Linea and Plasma to Settlement (#3846) # Description Got nuked during migration in this https://github.com/cowprotocol/services/pull/3834/files#diff-6af5d69f3228e39690de7e8ed1b8f39d971fccce306bb70303927c4a0a632534L128 but didn't get added to alloy.rs. --- crates/contracts/src/alloy.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 66bc1ce661..f586b1b616 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -693,6 +693,10 @@ crate::bindings!( POLYGON => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 45859743), // LENS => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 2621745), + // + LINEA => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 24333100), + // + PLASMA => (address!("0x9008D19f58AAbD9eD0D60971565AA8510560ab41"), 3439711), } ); From 3723ed40e50deab764e7aa0a5688ca14840022e5 Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Thu, 30 Oct 2025 09:05:01 +0100 Subject: [PATCH 063/117] Only fetch `auctionStartBlock` instead of the entire auction (#3847) # Description Currently we need to know the block at which we started the auction. We do this by fetching the HUGE JSON that contains ALL the data of the auction only to get 1 number out. # Changes This PR introduces a new query that only fetches that one number. ## How to test existing tests for correctness ran a build that does both queries and compares them in prod mainnet, reduces the time from 20m to 2ms. --- crates/autopilot/src/infra/persistence/mod.rs | 6 +++--- crates/database/src/solver_competition.rs | 20 ++++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/crates/autopilot/src/infra/persistence/mod.rs b/crates/autopilot/src/infra/persistence/mod.rs index 24c00e7731..13fa4d6a22 100644 --- a/crates/autopilot/src/infra/persistence/mod.rs +++ b/crates/autopilot/src/infra/persistence/mod.rs @@ -429,12 +429,12 @@ impl Persistence { }; let block = { - let competition = database::solver_competition::load_by_id(&mut ex, auction_id) + let block = database::solver_competition::auction_start_block(&mut ex, auction_id) .await? .ok_or(error::Auction::NotFound)?; - serde_json::from_value::(competition.json) + block + .parse::() .map_err(|_| error::Auction::NotFound)? - .auction_start_block .into() }; diff --git a/crates/database/src/solver_competition.rs b/crates/database/src/solver_competition.rs index 555440ad09..5f73c7b7e2 100644 --- a/crates/database/src/solver_competition.rs +++ b/crates/database/src/solver_competition.rs @@ -36,6 +36,16 @@ pub struct LoadCompetition { pub tx_hashes: Vec, } +#[instrument(skip_all)] +pub async fn auction_start_block( + ex: &mut PgConnection, + id: AuctionId, +) -> Result, sqlx::Error> { + const QUERY: &str = + r#"SELECT json->>'auctionStartBlock' FROM solver_competitions sc WHERE sc.id = $1;"#; + sqlx::query_scalar(QUERY).bind(id).fetch_optional(ex).await +} + #[instrument(skip_all)] pub async fn load_by_id( ex: &mut PgConnection, @@ -110,6 +120,7 @@ mod tests { byte_array::ByteArray, events::{EventIndex, Settlement}, }, + serde_json::json, sqlx::Connection, }; @@ -120,14 +131,21 @@ mod tests { let mut db = db.begin().await.unwrap(); crate::clear_DANGER_(&mut db).await.unwrap(); - let value = JsonValue::Bool(true); + let value = json!({ + "auctionStartBlock": 1234, + }); let value_str = serde_json::to_string(&value).unwrap(); save(&mut db, 0, &value_str).await.unwrap(); + // auction_start_block works + let value_ = auction_start_block(&mut db, 0).await.unwrap().unwrap(); + assert_eq!(value_, "1234"); + // load by id works let value_ = load_by_id(&mut db, 0).await.unwrap().unwrap(); assert_eq!(value, value_.json); assert!(value_.tx_hashes.is_empty()); + // load as latest works let value_ = load_latest_competition(&mut db).await.unwrap().unwrap(); assert_eq!(value, value_.json); From c5d764a97d86a5788f219af726126a202a0addfd Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Thu, 30 Oct 2025 09:42:59 +0100 Subject: [PATCH 064/117] Speedup settlement indexing (simplified) (#3840) # Description Second attempt at speeding up settlement indexing. See https://github.com/cowprotocol/services/pull/3654 for the context. This PR again tries to speed up the underlying DB query that takes a long time during the indexing step. Last time rebuilding the entire query completely to squeeze out peak performance broke the indexing logic which was very painful to recover from. To not repeat this mistake this PR is a lot more conservative and only changes 1 thing. # Changes Instead of fetching all orders of the entire original auction plus their quotes and fee policies we only fetch those for the orders that were actually traded in the given settlement. So the underlying queries are identical we just try to avoid fetching irrelevant data. For reference the only place where the queried fee policies are used is [here](https://github.com/cowprotocol/services/blob/f8598be39cce699a68e0d1af5602fad945f165a9/crates/autopilot/src/domain/settlement/trade/math.rs#L208-L218) where we need to look up the policy of every traded order to figure out how much we collected in fees. Because there is no need to compute the fees for orders that haven't been traded in the auction we can simply not fetch fee policies for those orders. I decided to not add any filtering logic to `surplus_capturing_jit_order_owners` or `prices` because the queries should be trivial and should mostly save network bandwidth but not really query execution time. ## How to test existing tests for correctness briefly ran the new code on prod in a shadow mode and it lowers the time for the DB queries from ~200ms to ~15ms. --- .../src/domain/settlement/auction.rs | 4 ++++ crates/autopilot/src/domain/settlement/mod.rs | 2 +- crates/autopilot/src/infra/persistence/mod.rs | 20 ++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/crates/autopilot/src/domain/settlement/auction.rs b/crates/autopilot/src/domain/settlement/auction.rs index 5622de22ed..a1ce9ad618 100644 --- a/crates/autopilot/src/domain/settlement/auction.rs +++ b/crates/autopilot/src/domain/settlement/auction.rs @@ -5,6 +5,10 @@ use { std::collections::{HashMap, HashSet}, }; +/// This struct gets populated with data for a specific transaction +/// so it's allowed to prune state that is irrelevant for handling +/// that particular transaction (e.g. `prices` might only contain +/// prices for tokens that were traded in that transaction). #[derive(Debug)] pub struct Auction { pub id: domain::auction::Id, diff --git a/crates/autopilot/src/domain/settlement/mod.rs b/crates/autopilot/src/domain/settlement/mod.rs index ee7e517ef0..ea01d27e12 100644 --- a/crates/autopilot/src/domain/settlement/mod.rs +++ b/crates/autopilot/src/domain/settlement/mod.rs @@ -159,7 +159,7 @@ impl Settlement { ) -> Result { let (auction, solver_winning_solutions) = tokio::try_join!( persistence - .get_auction(settled.auction_id) + .get_auction(settled.auction_id, &settled.trades) .map_err(Error::from), persistence .get_solver_winning_solutions(settled.auction_id, settled.solver) diff --git a/crates/autopilot/src/infra/persistence/mod.rs b/crates/autopilot/src/infra/persistence/mod.rs index 13fa4d6a22..3645d95e0e 100644 --- a/crates/autopilot/src/infra/persistence/mod.rs +++ b/crates/autopilot/src/infra/persistence/mod.rs @@ -2,7 +2,7 @@ use { crate::{ boundary, database::{Postgres, order_events::store_order_events}, - domain::{self, eth}, + domain::{self, eth, settlement::transaction::EncodedTrade}, infra::persistence::dto::AuctionId, }, anyhow::Context, @@ -327,10 +327,11 @@ impl Persistence { Ok(ex.commit().await?) } - /// Get auction data. + /// Get auction data to post-process the given trades. pub async fn get_auction( &self, auction_id: domain::auction::Id, + trades: &[EncodedTrade], ) -> Result { let _timer = Metrics::get() .database_queries @@ -368,7 +369,6 @@ impl Persistence { .collect::>()?; let orders = { - // get all orders from a competition auction let auction_orders = database::auction::get_order_uids(&mut ex, auction_id) .await .map_err(error::Auction::DatabaseError)? @@ -376,11 +376,21 @@ impl Persistence { .into_iter() .map(|order| domain::OrderUid(order.0)) .collect::>(); + // Code that uses the data assembled by this function determines JIT orders + // by their presence in the `orders => fee_policies` mapping. If an order has + // a mapping it is assumed that this was a regular order and not a JIT order. + // So in order to not misclassify JIT orders as regular orders we only fetch + // fee policies for orders that were part of the original auction. + let relevant_orders: HashSet<_> = trades + .iter() + .filter(|t| auction_orders.contains(&t.uid)) + .map(|t| t.uid) + .collect(); // get fee policies for all orders that were part of the competition auction let fee_policies = database::fee_policies::fetch_all( &mut ex, - auction_orders + relevant_orders .iter() .map(|o| (auction_id, ByteArray(o.0))) .collect::>() @@ -411,7 +421,7 @@ impl Persistence { // compile order data let mut orders = HashMap::new(); - for order in auction_orders.iter() { + for order in relevant_orders.iter() { let order_policies = match fee_policies.get(order) { Some(policies) => policies .iter() From 750c9fdaed26994cefd9a5304049d4cc8f3ede7d Mon Sep 17 00:00:00 2001 From: "Jan [Yann]" <4518474+fafk@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:07:10 +0100 Subject: [PATCH 065/117] Don't trace order event inserts (#3848) --- crates/database/src/order_events.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/database/src/order_events.rs b/crates/database/src/order_events.rs index 3d77888b4b..e4656ebb1c 100644 --- a/crates/database/src/order_events.rs +++ b/crates/database/src/order_events.rs @@ -48,7 +48,6 @@ pub struct OrderEvent { /// Inserts a row into the `order_events` table only if the latest event for the /// corresponding order UID has a different label than the provided event.. -#[instrument(skip_all)] pub async fn insert_order_event( ex: &mut PgConnection, event: &OrderEvent, From 9ea9f396bb583207f4822018b28002fbbab57fba Mon Sep 17 00:00:00 2001 From: Martin Magnus Date: Thu, 30 Oct 2025 13:40:16 +0100 Subject: [PATCH 066/117] Index ethflow orders in the background (#3849) # Description This moves ethflow order indexing from the critical path between 2 auctions to a background task. The reason is an insane influx of ethflow orders that significantly slow down the auction process at the moment. This is primarily intended as a bandaid. # Changes ethflow indexing now happens in a background task ## How to test updated the ethflow specific tests to continuously mint new blocks since the indexing of new ethflow orders is no longer synced to building auctions. --- crates/autopilot/src/maintenance.rs | 21 +++++-------- crates/autopilot/src/run.rs | 2 +- crates/e2e/tests/e2e/ethflow.rs | 47 +++++++++++++---------------- 3 files changed, 30 insertions(+), 40 deletions(-) diff --git a/crates/autopilot/src/maintenance.rs b/crates/autopilot/src/maintenance.rs index 56d331cce3..e23a042de5 100644 --- a/crates/autopilot/src/maintenance.rs +++ b/crates/autopilot/src/maintenance.rs @@ -29,8 +29,6 @@ use { pub struct Maintenance { /// Indexes and persists all events emited by the settlement contract. settlement_indexer: EventUpdater>, - /// Indexes ethflow orders (orders selling native ETH). - ethflow_indexer: Option, /// Used for periodic cleanup tasks to not have the DB overflow with old /// data. db_cleanup: Postgres, @@ -49,7 +47,6 @@ impl Maintenance { settlement_indexer, db_cleanup, cow_amm_indexer: Default::default(), - ethflow_indexer: None, last_processed: Default::default(), } } @@ -90,7 +87,6 @@ impl Maintenance { self.settlement_indexer.run_maintenance() ), Self::timed_future("db_cleanup", self.db_cleanup.run_maintenance()), - Self::timed_future("ethflow_indexer", self.index_ethflow_orders()), )?; Ok(()) @@ -98,21 +94,20 @@ impl Maintenance { /// Registers all maintenance tasks that are necessary to correctly support /// ethflow orders. - pub fn with_ethflow(&mut self, ethflow_indexer: EthflowIndexer) { - self.ethflow_indexer = Some(ethflow_indexer); + pub fn spawn_ethflow_indexer(&mut self, ethflow_indexer: EthflowIndexer) { + tokio::task::spawn(async move { + loop { + let _ = + Self::timed_future("ethflow_indexer", ethflow_indexer.run_maintenance()).await; + tokio::time::sleep(std::time::Duration::from_millis(1_000)).await; + } + }); } pub fn with_cow_amms(&mut self, registry: &cow_amm::Registry) { self.cow_amm_indexer = registry.maintenance_tasks().clone(); } - async fn index_ethflow_orders(&self) -> Result<()> { - if let Some(indexer) = &self.ethflow_indexer { - return indexer.run_maintenance().await; - } - Ok(()) - } - /// Runs the future and collects runtime metrics. async fn timed_future(label: &str, fut: impl Future) -> T { let _timer = metrics() diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index aefdd4bb3f..79c270de35 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -632,7 +632,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { .await .expect("Should be able to initialize event updater. Database read issues?"); - maintenance.with_ethflow(onchain_order_indexer); + maintenance.spawn_ethflow_indexer(onchain_order_indexer); // refunds are not critical for correctness and can therefore be indexed // sporadically in a background task let service_maintainer = ServiceMaintenance::new(vec![Arc::new(refund_event_handler)]); diff --git a/crates/e2e/tests/e2e/ethflow.rs b/crates/e2e/tests/e2e/ethflow.rs index 821ad3dd48..93edb6f4e6 100644 --- a/crates/e2e/tests/e2e/ethflow.rs +++ b/crates/e2e/tests/e2e/ethflow.rs @@ -7,22 +7,19 @@ use { autopilot::database::onchain_order_events::ethflow_events::WRAP_ALL_SELECTOR, contracts::alloy::{CoWSwapEthFlow, ERC20Mintable, WETH9}, database::order_events::OrderEventLabel, - e2e::{ - nodes::local_node::TestNodeApi, - setup::{ - ACCOUNT_ENDPOINT, - API_HOST, - Contracts, - OnchainComponents, - Services, - TIMEOUT, - TRADES_ENDPOINT, - TestAccount, - eth, - run_test, - to_wei, - wait_for_condition, - }, + e2e::setup::{ + ACCOUNT_ENDPOINT, + API_HOST, + Contracts, + OnchainComponents, + Services, + TIMEOUT, + TRADES_ENDPOINT, + TestAccount, + eth, + run_test, + to_wei, + wait_for_condition, }, ethcontract::{Account, H160, H256, U256}, ethrpc::{ @@ -194,7 +191,7 @@ async fn eth_flow_tx(web3: Web3) { tracing::info!("waiting for trade"); - test_order_was_settled(ðflow_order, &web3).await; + test_order_was_settled(ðflow_order, &onchain).await; // make sure the fee was charged for zero fee limit orders let fee_charged = || async { @@ -308,7 +305,7 @@ async fn eth_flow_without_quote(web3: Web3) { .await; tracing::info!("waiting for trade"); - test_order_was_settled(ðflow_order, &web3).await; + test_order_was_settled(ðflow_order, &onchain).await; } async fn eth_flow_indexing_after_refund(web3: Web3) { @@ -347,10 +344,7 @@ async fn eth_flow_indexing_after_refund(web3: Web3) { ethflow_contract, ) .await; - web3.api::>() - .mine_pending_block() - .await - .unwrap(); + onchain.mint_block().await; dummy_order .mine_order_invalidation(dummy_trader.address().into_alloy(), ethflow_contract) @@ -386,7 +380,7 @@ async fn eth_flow_indexing_after_refund(web3: Web3) { .await; tracing::info!("waiting for trade"); - test_order_was_settled(ðflow_order, &web3).await; + test_order_was_settled(ðflow_order, &onchain).await; // Check order events let events = crate::database::events_of_order( @@ -505,11 +499,12 @@ async fn test_trade_availability_in_api( } } -async fn test_order_was_settled(ethflow_order: &ExtendedEthFlowOrder, web3: &Web3) { +async fn test_order_was_settled(ethflow_order: &ExtendedEthFlowOrder, onchain: &OnchainComponents) { wait_for_condition(TIMEOUT, || async { + onchain.mint_block().await; let buy_token = ERC20Mintable::Instance::new( ethflow_order.0.buy_token.into_alloy(), - web3.alloy.clone(), + onchain.web3().alloy.clone(), ); let receiver_buy_token_balance = buy_token .balanceOf(ethflow_order.0.receiver.into_alloy()) @@ -920,5 +915,5 @@ async fn eth_flow_zero_buy_amount(web3: Web3) { // Although the auction contains a problematic order we can // still settle good orders. tracing::info!("waiting for trade"); - test_order_was_settled(&order_b, &web3).await; + test_order_was_settled(&order_b, &onchain).await; } From 5bbffc58441b662dc9125921f5c04a4927e916fb Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 30 Oct 2025 16:34:29 +0300 Subject: [PATCH 067/117] Migrate `CurrentBlockWatcher` to alloy (#3832) # Description Migrates the CurrentBlockWatcher's transport to alloy. # Changes - [ ] Introduces and uses unbuffered alloy transport to avoid latency issues on chains with a very high block frequency. - [ ] Executes batches the same way as before: all at once in parallel. - [ ] By default, alloy fetches blocks without txs: https://github.com/alloy-rs/alloy/blob/d8277e9eee813c58550eb95a43f73d34727f63f0/crates/provider/src/provider/get_block.rs#L85-L95 + https://github.com/alloy-rs/alloy/blob/d0653048a219043591d25466b80595cf4cfa72d3/crates/network-primitives/src/block.rs#L309-L317 ## How to test Existing tests + mainnet shadow. ## Further implementation It should be safe to migrate to WS using alloy's [WsConnect](https://github.com/alloy-rs/examples/blob/main/examples/subscriptions/examples/subscribe_blocks.rs), which implements a reconnection logic internally. That should reduce the RPC load. --- .../onchain_order_events/ethflow_events.rs | 32 ++- .../src/database/onchain_order_events/mod.rs | 5 +- crates/autopilot/src/run.rs | 5 +- crates/cow-amm/src/registry.rs | 2 +- crates/e2e/tests/e2e/ethflow.rs | 21 +- crates/e2e/tests/e2e/refunder.rs | 5 +- crates/ethrpc/src/alloy/mod.rs | 33 +++ crates/ethrpc/src/block_stream/mod.rs | 222 +++++++++--------- crates/refunder/src/refund_service.rs | 2 +- crates/shared/src/current_block.rs | 2 +- crates/shared/src/event_handling.rs | 39 +-- 11 files changed, 210 insertions(+), 158 deletions(-) diff --git a/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs b/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs index 05f788cc67..9dd67203b7 100644 --- a/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs +++ b/crates/autopilot/src/database/onchain_order_events/ethflow_events.rs @@ -1,7 +1,7 @@ use { super::{OnchainOrderCustomData, OnchainOrderParsing}, crate::database::events::log_to_event_index, - alloy::rpc::types::Log, + alloy::{eips::BlockNumberOrTag, rpc::types::Log}, anyhow::{Context, Result, anyhow}, contracts::alloy::{ CoWSwapOnchainOrders::CoWSwapOnchainOrders::{ @@ -19,6 +19,7 @@ use { orders::{ExecutionTime, Interaction, Order}, }, ethrpc::{ + AlloyProvider, Web3, block_stream::{BlockNumberHash, block_number_to_block_number_hash}, }, @@ -26,7 +27,6 @@ use { sqlx::{PgPool, types::BigDecimal}, std::{collections::HashMap, convert::TryInto}, tracing::instrument, - web3::types::U64, }; // 4c84c1c8 is the identifier of the following function: @@ -146,12 +146,12 @@ fn convert_to_quote_id_and_user_valid_to( } async fn settlement_deployment_block_number_hash( - web3: &Web3, + provider: &AlloyProvider, chain_id: u64, ) -> Result { let block_number = GPv2Settlement::deployment_block(&chain_id).context("no deployment block configured")?; - block_number_to_block_number_hash(web3, U64::from(block_number).into()) + block_number_to_block_number_hash(provider, BlockNumberOrTag::Number(block_number)) .await .context("Deployment block not found") } @@ -261,19 +261,25 @@ async fn find_indexing_start_block( .context("failed to read last indexed block from db")?; if last_indexed_block > 0 { - return block_number_to_block_number_hash(web3, U64::from(last_indexed_block).into()) - .await - .map(Some) - .context("failed to fetch block"); + return block_number_to_block_number_hash( + &web3.alloy, + BlockNumberOrTag::Number(last_indexed_block), + ) + .await + .map(Some) + .context("failed to fetch block"); } if let Some(start_block) = fallback_start_block { - return block_number_to_block_number_hash(web3, start_block.into()) - .await - .map(Some) - .context("failed to fetch fallback indexing start block"); + return block_number_to_block_number_hash( + &web3.alloy, + BlockNumberOrTag::Number(start_block), + ) + .await + .map(Some) + .context("failed to fetch fallback indexing start block"); } if let Some(chain_id) = settlement_fallback_chain_id { - return settlement_deployment_block_number_hash(web3, chain_id) + return settlement_deployment_block_number_hash(&web3.alloy, chain_id) .await .map(Some) .context("failed to fetch settlement deployment block"); diff --git a/crates/autopilot/src/database/onchain_order_events/mod.rs b/crates/autopilot/src/database/onchain_order_events/mod.rs index 9b3285960a..c7a7a12738 100644 --- a/crates/autopilot/src/database/onchain_order_events/mod.rs +++ b/crates/autopilot/src/database/onchain_order_events/mod.rs @@ -5,6 +5,7 @@ use { super::{Metrics as DatabaseMetrics, Postgres, events::bytes_to_order_uid}, crate::database::events::log_to_event_index, alloy::{ + eips::BlockNumberOrTag, primitives::{Address, TxHash, U256}, rpc::types::Log, }, @@ -64,7 +65,6 @@ use { }, sqlx::PgConnection, std::{collections::HashMap, sync::Arc}, - web3::types::U64, }; pub struct OnchainOrderParser { @@ -396,7 +396,8 @@ async fn get_block_numbers_of_events( .into_iter() .map(|block_number| async move { let timestamp = - timestamp_of_block_in_seconds(web3, U64::from(block_number).into()).await?; + timestamp_of_block_in_seconds(&web3.alloy, BlockNumberOrTag::Number(block_number)) + .await?; Ok((block_number, timestamp)) }); let block_number_timestamp_pair: Vec> = diff --git a/crates/autopilot/src/run.rs b/crates/autopilot/src/run.rs index 79c270de35..0c2837c53a 100644 --- a/crates/autopilot/src/run.rs +++ b/crates/autopilot/src/run.rs @@ -24,10 +24,11 @@ use { shutdown_controller::ShutdownController, solvable_orders::SolvableOrdersCache, }, + alloy::eips::BlockNumberOrTag, chain::Chain, clap::Parser, contracts::alloy::{BalancerV2Vault, GPv2Settlement, IUniswapV3Factory, InstanceExt, WETH9}, - ethcontract::{BlockNumber, H160}, + ethcontract::H160, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -428,7 +429,7 @@ pub async fn run(args: Arguments, shutdown_controller: ShutdownController) { let skip_event_sync_start = if args.skip_event_sync { Some( - block_number_to_block_number_hash(&web3, BlockNumber::Latest) + block_number_to_block_number_hash(&web3.alloy, BlockNumberOrTag::Latest) .await .expect("Failed to fetch latest block"), ) diff --git a/crates/cow-amm/src/registry.rs b/crates/cow-amm/src/registry.rs index a2162ca97b..068347eb94 100644 --- a/crates/cow-amm/src/registry.rs +++ b/crates/cow-amm/src/registry.rs @@ -57,7 +57,7 @@ impl Registry { address: factory, }; let event_handler = EventHandler::new( - Arc::new(self.web3.clone()), + Arc::new(self.web3.alloy.clone()), AlloyEventRetriever(indexer), storage, None, diff --git a/crates/e2e/tests/e2e/ethflow.rs b/crates/e2e/tests/e2e/ethflow.rs index 93edb6f4e6..eb3d487539 100644 --- a/crates/e2e/tests/e2e/ethflow.rs +++ b/crates/e2e/tests/e2e/ethflow.rs @@ -166,7 +166,9 @@ async fn eth_flow_tx(web3: Web3) { let quote: OrderQuoteResponse = test_submit_quote(&services, "e_request).await; let valid_to = chrono::offset::Utc::now().timestamp() as u32 - + timestamp_of_current_block_in_seconds(&web3).await.unwrap() + + timestamp_of_current_block_in_seconds(&web3.alloy) + .await + .unwrap() + 3600; let ethflow_order = ExtendedEthFlowOrder::from_quote("e, valid_to).include_slippage_bps(300); @@ -272,7 +274,9 @@ async fn eth_flow_without_quote(web3: Web3) { services.start_protocol(solver).await; let valid_to = chrono::offset::Utc::now().timestamp() as u32 - + timestamp_of_current_block_in_seconds(&web3).await.unwrap() + + timestamp_of_current_block_in_seconds(&web3.alloy) + .await + .unwrap() + 3600; let ethflow_order = ExtendedEthFlowOrder(EthflowOrder { buy_token: dai.address().into_legacy(), @@ -321,7 +325,10 @@ async fn eth_flow_indexing_after_refund(web3: Web3) { services.start_protocol(solver).await; // Create an order that only exists to be cancelled. - let valid_to = timestamp_of_current_block_in_seconds(&web3).await.unwrap() + 60; + let valid_to = timestamp_of_current_block_in_seconds(&web3.alloy) + .await + .unwrap() + + 60; let dummy_order = ExtendedEthFlowOrder::from_quote( &test_submit_quote( &services, @@ -355,7 +362,9 @@ async fn eth_flow_indexing_after_refund(web3: Web3) { let receiver = H160([0x42; 20]); let sell_amount = to_wei(1); let valid_to = chrono::offset::Utc::now().timestamp() as u32 - + timestamp_of_current_block_in_seconds(&web3).await.unwrap() + + timestamp_of_current_block_in_seconds(&web3.alloy) + .await + .unwrap() + 60; let ethflow_order = ExtendedEthFlowOrder::from_quote( &test_submit_quote( @@ -871,7 +880,9 @@ async fn eth_flow_zero_buy_amount(web3: Web3) { let place_order = async |trader: TestAccount, buy_amount: u64| { let valid_to = chrono::offset::Utc::now().timestamp() as u32 - + timestamp_of_current_block_in_seconds(&web3).await.unwrap() + + timestamp_of_current_block_in_seconds(&web3.alloy) + .await + .unwrap() + 3600; let ethflow_order = ExtendedEthFlowOrder(EthflowOrder { buy_token: dai.address().into_legacy(), diff --git a/crates/e2e/tests/e2e/refunder.rs b/crates/e2e/tests/e2e/refunder.rs index 8b75cd1811..19a784d5fd 100644 --- a/crates/e2e/tests/e2e/refunder.rs +++ b/crates/e2e/tests/e2e/refunder.rs @@ -58,7 +58,10 @@ async fn refunder_tx(web3: Web3) { let quote_response = services.submit_quote("e).await.unwrap(); let validity_duration = 600; - let valid_to = timestamp_of_current_block_in_seconds(&web3).await.unwrap() + validity_duration; + let valid_to = timestamp_of_current_block_in_seconds(&web3.alloy) + .await + .unwrap() + + validity_duration; // Accounting for slippage is necessary for the order to be picked up by the // refunder let ethflow_order = diff --git a/crates/ethrpc/src/alloy/mod.rs b/crates/ethrpc/src/alloy/mod.rs index 8161d559a9..33f1dbcea7 100644 --- a/crates/ethrpc/src/alloy/mod.rs +++ b/crates/ethrpc/src/alloy/mod.rs @@ -32,6 +32,39 @@ fn rpc(url: &str) -> RpcClient { .http(url.parse().unwrap()) } +/// Creates an unbuffered [`RpcClient`] from the given URL with +/// [`LabelingLayer`] and [`InstrumentationLayer`] but WITHOUT +/// [`BatchCallLayer`]. +/// +/// This is useful for components that need to avoid batching (e.g., block +/// stream polling on high-frequency chains). +fn unbuffered_rpc(url: &str) -> RpcClient { + ClientBuilder::default() + .layer(LabelingLayer { + label: "main_unbuffered".into(), + }) + .layer(InstrumentationLayer) + .http(url.parse().unwrap()) +} + +/// Creates an unbuffered provider for the given URL and label. +/// +/// Unlike [`provider()`], this does not include batching. +/// Useful for read-only operations like block polling. +/// +/// Returns a copy of the [`MutWallet`] so the caller can modify it later. +pub fn unbuffered_provider(url: &str) -> (AlloyProvider, MutWallet) { + let rpc = unbuffered_rpc(url); + let wallet = MutWallet::default(); + let provider = ProviderBuilder::new() + .wallet(wallet.clone()) + .with_simple_nonce_management() + .connect_client(rpc) + .erased(); + + (provider, wallet) +} + /// Creates a provider with the provided URL and an empty [`MutWallet`]. /// /// Returns a copy of the [`MutWallet`] so the caller can modify it later. diff --git a/crates/ethrpc/src/block_stream/mod.rs b/crates/ethrpc/src/block_stream/mod.rs index fbdc6bf85b..1edc29d5be 100644 --- a/crates/ethrpc/src/block_stream/mod.rs +++ b/crates/ethrpc/src/block_stream/mod.rs @@ -1,7 +1,15 @@ use { - crate::{Web3, Web3Transport, http::HttpTransport, instrumented::instrument_with_label}, + crate::{ + AlloyProvider, + alloy::{ProviderLabelingExt, conversions::IntoLegacy}, + }, + alloy::{ + eips::{BlockId, BlockNumberOrTag}, + providers::Provider, + rpc::types::Block, + }, anyhow::{Context as _, Result, anyhow, ensure}, - futures::StreamExt, + futures::{StreamExt, TryStreamExt, stream::FuturesUnordered}, primitive_types::{H256, U256}, std::{ fmt::Debug, @@ -12,12 +20,6 @@ use { tokio_stream::wrappers::WatchStream, tracing::{Instrument, instrument}, url::Url, - web3::{ - BatchTransport, - Transport, - helpers, - types::{Block, BlockId, BlockNumber, U64}, - }, }; pub type BlockNumberHash = (u64, H256); @@ -85,17 +87,21 @@ impl PartialEq for BlockInfo { } } -impl TryFrom> for BlockInfo { +impl TryFrom for BlockInfo { type Error = anyhow::Error; - fn try_from(value: Block) -> std::result::Result { + fn try_from(value: Block) -> std::result::Result { Ok(Self { - number: value.number.context("block missing number")?.as_u64(), - hash: value.hash.context("block missing hash")?, - parent_hash: value.parent_hash, - timestamp: value.timestamp.as_u64(), - gas_limit: value.gas_limit, - gas_price: value.base_fee_per_gas.context("no gas price")?, + number: value.header.number, + hash: value.header.hash.into_legacy(), + parent_hash: value.header.parent_hash.into_legacy(), + timestamp: value.header.timestamp, + gas_limit: primitive_types::U256::from(value.header.gas_limit), + gas_price: value + .header + .base_fee_per_gas + .map(primitive_types::U256::from) + .context("no gas price")?, observed_at: Instant::now(), }) } @@ -118,23 +124,12 @@ pub async fn current_block_stream( url: Url, poll_interval: Duration, ) -> Result { - // Build new Web3 specifically for the current block stream to avoid batching - // requests together on chains with a very high block frequency. - let web3 = web3::Web3::new(Web3Transport::new(HttpTransport::new( - Default::default(), - url.clone(), - "block_stream".into(), - ))); - let (alloy, wallet) = crate::alloy::provider(url.as_str()); - let web3 = crate::Web3 { - legacy: web3, - // TODO: replace this with an unbuffered alloy provider - alloy, - wallet, - }; - let web3 = instrument_with_label(&web3, "base_currentBlockStream".into()); + // Build an alloy transport specifically for the current block stream to avoid + // batching requests together on chains with a very high block frequency. + let (provider, _) = crate::alloy::unbuffered_provider(url.as_str()); + let provider = provider.labeled("base_currentBlockStream".into()); - let first_block = web3.current_block().await?; + let first_block = provider.current_block().await?; tracing::debug!(number=%first_block.number, hash=?first_block.hash, "polled block"); let (sender, receiver) = watch::channel(first_block); @@ -142,7 +137,7 @@ pub async fn current_block_stream( let mut previous_block = first_block; loop { tokio::time::sleep(poll_interval).await; - let block = match web3.current_block().await { + let block = match provider.current_block().await { Ok(block) => block, Err(err) => { tracing::warn!("failed to get current block: {:?}", err); @@ -252,116 +247,108 @@ pub trait BlockRetrieving: Debug + Send + Sync + 'static { } #[async_trait::async_trait] -impl BlockRetrieving for crate::Web3 { +impl BlockRetrieving for AlloyProvider { async fn current_block(&self) -> Result { - get_block_at_id(self, BlockNumber::Latest.into()) - .await? - .try_into() + get_block_at_id(self, BlockId::latest()).await?.try_into() } async fn block(&self, number: u64) -> Result { - let block = get_block_at_id(self, U64::from(number).into()).await?; - Ok(( - block.number.context("missing block_number")?.as_u64(), - block.hash.context("missing block_hash")?, - )) + let block = get_block_at_id(self, BlockId::number(number)).await?; + Ok((block.header.number, block.header.hash.into_legacy())) } /// Gets all blocks requested in the range. For successful results it's /// enforced that all the blocks are present, in the correct order and that - /// there are not reorgs in the block range. + /// there are no reorgs in the block range. async fn blocks(&self, range: RangeInclusive) -> Result> { - let include_txs = helpers::serialize(&false); - let (start, end) = range.clone().into_inner(); - let mut batch_request = Vec::with_capacity((end - start + 1) as usize); - for i in start..=end { - let num = helpers::serialize(&BlockNumber::Number(i.into())); - let request = self - .transport() - .prepare("eth_getBlockByNumber", vec![num, include_txs.clone()]); - batch_request.push(request); + let (start, end) = range.into_inner(); + + // Uses FuturesUnordered instead of try_join_all, since the latter + // starts using FuturesOrdered once the number of futures exceeds 30, which + // doesn't support fail-fast behavior. + let futures = FuturesUnordered::new(); + for block_num in start..=end { + let block_id = BlockNumberOrTag::Number(block_num).into(); + let provider = self.clone(); + futures.push(async move { + provider + .get_block(block_id) + .await + .with_context(|| format!("failed to fetch block {block_num}"))? + .with_context(|| format!("missing block {block_num}")) + }); } + let mut blocks: Vec = futures.try_collect().await?; + + // Sort the same way as the requested range + blocks.sort_by_key(|block| block.number()); + let mut prev_hash = None; + let mut result = Vec::with_capacity(blocks.len()); + + for block in blocks { + let current_hash: H256 = block.header.hash.into_legacy(); + if prev_hash.is_some_and(|prev| prev != block.header.parent_hash.into_legacy()) { + tracing::debug!( + start, + end, + ?prev_hash, + parent_hash = ?block.header.parent_hash, + block_number = ?block.number(), + "inconsistent parent in block range" + ); + return Err(anyhow!("inconsistent block range")); + } + prev_hash = Some(current_hash); - // send_batch guarantees the size and order of the responses to match the - // requests - self.transport() - .send_batch(batch_request.iter().cloned()) - .await? - .into_iter() - .map(|response| match response { - Ok(response) => { - serde_json::from_value::>(response.clone()) - .with_context(|| format!("unexpected response format: {response:?}")) - .and_then(|response| { - let current_hash = response.hash.context("missing hash")?; - let current_block = response.number.context("missing number")?.as_u64(); - if prev_hash.is_some_and(|prev| prev != response.parent_hash) { - tracing::debug!( - ?range, - ?prev_hash, - parent_hash = ?response.parent_hash, - "inconsistent parent in block range" - ); - return Err(anyhow!("inconsistent block range")); - } - prev_hash = Some(current_hash); - - Ok((current_block, current_hash)) - }) - } - Err(err) => Err(anyhow!("web3 error: {}", err)), - }) - .collect() + result.push((block.number(), current_hash)); + } + + Ok(result) } } -async fn get_block_at_id(web3: &Web3, id: BlockId) -> Result> { - web3.eth() - .block(id) +async fn get_block_at_id(provider: &AlloyProvider, id: BlockId) -> Result { + let block = provider + .get_block(id) .await .with_context(|| format!("failed to get block for {id:?}"))? - .with_context(|| format!("no block for {id:?}")) + .with_context(|| format!("no block for {id:?}"))?; + + Ok(block) } -pub async fn timestamp_of_block_in_seconds(web3: &Web3, block_number: BlockNumber) -> Result { - Ok(web3 - .eth() - .block(block_number.into()) - .await - .context("failed to get latest block")? - .context("block should exists")? - .timestamp - .as_u32()) +pub async fn timestamp_of_block_in_seconds( + provider: &AlloyProvider, + block_number: BlockNumberOrTag, +) -> Result { + u32::try_from( + provider + .get_block_by_number(block_number) + .await + .with_context(|| format!("failed to get block {block_number:?}"))? + .with_context(|| format!("no block for {block_number:?}"))? + .header + .timestamp, + ) + .with_context(|| format!("block {block_number:?} timestamp is not u32")) } -pub async fn timestamp_of_current_block_in_seconds(web3: &Web3) -> Result { - timestamp_of_block_in_seconds(web3, BlockNumber::Latest).await +pub async fn timestamp_of_current_block_in_seconds(provider: &AlloyProvider) -> Result { + timestamp_of_block_in_seconds(provider, BlockNumberOrTag::Latest).await } #[instrument(skip_all)] pub async fn block_number_to_block_number_hash( - web3: &Web3, - block_number: BlockNumber, + provider: &AlloyProvider, + block_number: BlockNumberOrTag, ) -> Result { - let block = web3 - .eth() - .block(BlockId::Number(block_number)) + let block = provider + .get_block_by_number(block_number) .await? .context("block should exists")?; - Ok(( - block.number.expect("number must exist").as_u64(), - block.hash.expect("hash must exist"), - )) -} - -pub async fn block_by_number(web3: &Web3, block_number: BlockNumber) -> Option> { - web3.eth() - .block(BlockId::Number(block_number)) - .await - .ok() - .flatten() + Ok((block.header.number, block.header.hash.into_legacy())) } #[derive(prometheus_metric_storage::MetricStorage)] @@ -411,6 +398,7 @@ pub async fn next_block(current_block: &CurrentBlockWatcher) -> BlockInfo { mod tests { use { super::*, + crate::Web3, futures::StreamExt, tokio::time::{Duration, timeout}, }; @@ -445,13 +433,13 @@ mod tests { // single block let range = RangeInclusive::try_new(5, 5).unwrap(); - let blocks = web3.blocks(range).await.unwrap(); + let blocks = web3.alloy.blocks(range).await.unwrap(); assert_eq!(blocks.len(), 1); assert_eq!(blocks.last().unwrap().0, 5); // multiple blocks let range = RangeInclusive::try_new(5, 8).unwrap(); - let blocks = web3.blocks(range).await.unwrap(); + let blocks = web3.alloy.blocks(range).await.unwrap(); assert_eq!(blocks.len(), 4); assert_eq!(blocks.last().unwrap().0, 8); assert_eq!(blocks.first().unwrap().0, 5); @@ -464,7 +452,7 @@ mod tests { current_block_number, ) .unwrap(); - let blocks = web3.blocks(range).await.unwrap(); + let blocks = web3.alloy.blocks(range).await.unwrap(); assert_eq!(blocks.len(), 6); assert_eq!(blocks.last().unwrap().0, 5); assert_eq!(blocks.first().unwrap().0, 0); diff --git a/crates/refunder/src/refund_service.rs b/crates/refunder/src/refund_service.rs index 8c2d4dd6fe..9e8a0aa354 100644 --- a/crates/refunder/src/refund_service.rs +++ b/crates/refunder/src/refund_service.rs @@ -81,7 +81,7 @@ impl RefundService { } pub async fn get_refundable_ethflow_orders_from_db(&self) -> Result> { - let block_time = timestamp_of_current_block_in_seconds(&self.web3).await? as i64; + let block_time = timestamp_of_current_block_in_seconds(&self.web3.alloy).await? as i64; let mut ex = self.db.acquire().await?; refundable_orders( diff --git a/crates/shared/src/current_block.rs b/crates/shared/src/current_block.rs index 86e78667a0..176cb0116d 100644 --- a/crates/shared/src/current_block.rs +++ b/crates/shared/src/current_block.rs @@ -32,7 +32,7 @@ pub struct Arguments { impl Arguments { pub fn retriever(&self, web3: Web3) -> Arc { - Arc::new(web3) + Arc::new(web3.alloy.clone()) } pub async fn stream(&self, rpc: Url) -> Result { diff --git a/crates/shared/src/event_handling.rs b/crates/shared/src/event_handling.rs index 1cce5232fe..90b36fd622 100644 --- a/crates/shared/src/event_handling.rs +++ b/crates/shared/src/event_handling.rs @@ -772,6 +772,7 @@ fn track_block_range(range: &str) { mod tests { use { super::*, + alloy::eips::BlockNumberOrTag, contracts::alloy::{GPv2Settlement, InstanceExt}, ethcontract::{BlockNumber, H256}, ethrpc::{Web3, block_stream::block_number_to_block_number_hash}, @@ -972,8 +973,12 @@ mod tests { .unwrap(), ), ]; - let event_handler = - EventHandler::new(Arc::new(web3), AlloyEventRetriever(contract), storage, None); + let event_handler = EventHandler::new( + Arc::new(web3.alloy.clone()), + AlloyEventRetriever(contract), + storage, + None, + ); let (replacement_blocks, _) = event_handler.past_events_by_block_hashes(&blocks).await; assert_eq!(replacement_blocks, blocks[..2]); } @@ -1001,7 +1006,7 @@ mod tests { .unwrap(); let block = (block.number.unwrap().as_u64(), block.hash.unwrap()); let mut event_handler = EventHandler::new( - Arc::new(web3), + Arc::new(web3.alloy.clone()), AlloyEventRetriever(contract), storage, Some(block), @@ -1034,7 +1039,7 @@ mod tests { .unwrap(); let block = (block.number.unwrap().as_u64(), block.hash.unwrap()); let mut event_handler = EventHandler::new( - Arc::new(web3), + Arc::new(web3.alloy.clone()), AlloyEventRetriever(contract), storage, Some(block), @@ -1074,12 +1079,14 @@ mod tests { const RANGE_SIZE: u64 = 24 * 3600 / 12; let storage_empty = EventStorage { events: vec![] }; - let event_start = - block_number_to_block_number_hash(&web3, (current_block - RANGE_SIZE).into()) - .await - .unwrap(); + let event_start = block_number_to_block_number_hash( + &web3.alloy, + BlockNumberOrTag::Number((current_block - RANGE_SIZE).as_u64()), + ) + .await + .unwrap(); let mut base_event_handler = EventHandler::new( - Arc::new(web3.clone()), + Arc::new(web3.alloy.clone()), AlloyEventRetriever(contract.clone()), storage_empty, Some(event_start), @@ -1094,12 +1101,14 @@ mod tests { // We collect events again with an event handler generated from the same start // date but using `new_skip_blocks_before` if there are no events let storage_empty = EventStorage { events: vec![] }; - let event_start = - block_number_to_block_number_hash(&web3, (current_block - RANGE_SIZE).into()) - .await - .unwrap(); + let event_start = block_number_to_block_number_hash( + &web3.alloy, + BlockNumberOrTag::Number((current_block - RANGE_SIZE).as_u64()), + ) + .await + .unwrap(); let mut base_block_skip_event_handler = EventHandler::new_skip_blocks_before( - Arc::new(web3.clone()), + Arc::new(web3.alloy.clone()), AlloyEventRetriever(contract.clone()), storage_empty, event_start, @@ -1137,7 +1146,7 @@ mod tests { events: vec![last_event.clone()], }; let mut nonempty_event_handler = EventHandler::new_skip_blocks_before( - Arc::new(web3.clone()), + Arc::new(web3.alloy.clone()), AlloyEventRetriever(contract), storage_nonempty, // Same event start as for the two previous event handlers. The test checks that this From f6ba583b983baa65f9858f0ea9a160f4c8d4d5ab Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 30 Oct 2025 17:22:53 +0300 Subject: [PATCH 068/117] [EASY] Use unbuffered alloy provider (#3843) # Description The following function uses unbuffered legacy web3 transport, while for Alloy it uses a regular provider. This PR fixes that. https://github.com/cowprotocol/services/blob/7fbb222595631f4d6b8099840e94bbe73870a845/crates/autopilot/src/run.rs#L106-L117 ## How to test N/A --- crates/ethrpc/src/lib.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/crates/ethrpc/src/lib.rs b/crates/ethrpc/src/lib.rs index 37f67052f8..fe306109d0 100644 --- a/crates/ethrpc/src/lib.rs +++ b/crates/ethrpc/src/lib.rs @@ -115,12 +115,21 @@ pub fn web3( ) -> Web3 { let http = http_factory.cookie_store(true).build().unwrap(); let http = HttpTransport::new(http, url.clone(), name.to_string()); - let transport = match args.into_buffered_configuration() { - Some(config) => Web3Transport::new(BufferedTransport::with_config(http, config)), - None => Web3Transport::new(http), + let buffered_config = args.into_buffered_configuration(); + let (legacy, alloy, wallet) = match buffered_config { + Some(config) => { + let legacy = Web3Transport::new(BufferedTransport::with_config(http, config)); + let (alloy, wallet) = alloy::provider(url.as_str()); + (legacy, alloy, wallet) + } + None => { + let legacy = Web3Transport::new(http); + let (alloy, wallet) = alloy::unbuffered_provider(url.as_str()); + (legacy, alloy, wallet) + } }; - let instrumented = instrumented::InstrumentedTransport::new(name.to_string(), transport); - let (alloy, wallet) = alloy::provider(url.as_str()); + let instrumented = instrumented::InstrumentedTransport::new(name.to_string(), legacy); + Web3 { legacy: web3::Web3::new(Web3Transport::new(instrumented)), alloy, From 5172042c79facc048a79bc8d13e8e324b49c8a5f Mon Sep 17 00:00:00 2001 From: Mayank Sharma <82099885+codersharma2001@users.noreply.github.com> Date: Fri, 31 Oct 2025 02:26:49 +0530 Subject: [PATCH 069/117] chore: fix flaky liquidity_source_notification test (#3748) (#3763) Fix flaky test in forked_node_liquidity_source_notification_mainnet This PR addresses #3748 by making the Liquorice notification test wait until the mock server has actually recorded a request before asserting, which removes the race that caused the intermittent failure. Local validation steps Installed Anvil (Foundry) and spun up a fork at mainnet block 23326100. Warmed the fork so the snapshot could be re-used offline (USDC/USDT contract reads, block fetch, etc.). Re-ran the test against the local forked RPC (FORK_URL_MAINNET=http://127.0.0.1:8545), confirming it now passes consistently. Removed the temporary notification-count logging after verifying the race was gone. Closes #3748 --------- Co-authored-by: ilya --- crates/e2e/tests/e2e/liquidity_source_notification.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index bf02e1ee12..9d560fd2fc 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -332,6 +332,13 @@ http-timeout = "10s" assert!(trade.is_some()); // Ensure that notification was delivered to Liquorice API + wait_for_condition(TIMEOUT, || async { + let state = liquorice_api.get_state().await; + !state.notification_requests.is_empty() + }) + .await + .unwrap(); + let notification = liquorice_api .get_state() .await From 13ae5c5c1a0235f63b3e9e72d6ce5730f59236ae Mon Sep 17 00:00:00 2001 From: Igor Markin Date: Fri, 31 Oct 2025 00:24:48 +0300 Subject: [PATCH 070/117] refactor(e2e): use alloy bindings and primitives in liquidity_source_notification test (#3788) # Description A follow up to https://github.com/cowprotocol/services/pull/3735#discussion_r2398851263 # Changes Refactored test code to use alloy contract bindings and primitives ## How to test `$ FORK_URL_MAINNET="...." cargo test -p e2e forked_node_liquidity_source_notification_mainnet -- --ignored` --------- Co-authored-by: ilya Co-authored-by: ilya --- .../artifacts/ILiquoriceSettlement.json | 1078 ----- .../artifacts/LiquoriceSettlement.json | 4191 +++++++++++++++++ crates/contracts/src/alloy.rs | 2 +- crates/contracts/src/bin/vendor.rs | 2 +- .../liquidity_sources/liquorice/notifier.rs | 10 +- crates/e2e/Cargo.toml | 2 +- crates/e2e/src/api/liquorice/mod.rs | 1 - crates/e2e/src/api/liquorice/onchain.rs | 227 - .../e2e/liquidity_source_notification.rs | 98 +- 9 files changed, 4246 insertions(+), 1365 deletions(-) delete mode 100644 crates/contracts/artifacts/ILiquoriceSettlement.json create mode 100644 crates/contracts/artifacts/LiquoriceSettlement.json delete mode 100644 crates/e2e/src/api/liquorice/onchain.rs diff --git a/crates/contracts/artifacts/ILiquoriceSettlement.json b/crates/contracts/artifacts/ILiquoriceSettlement.json deleted file mode 100644 index 3831c2a8bd..0000000000 --- a/crates/contracts/artifacts/ILiquoriceSettlement.json +++ /dev/null @@ -1,1078 +0,0 @@ -{ - "abi": [ - { - "type": "function", - "name": "AUTHENTICATOR", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IAllowListAuthentication" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "BALANCE_MANAGER", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IBalanceManager" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "REPOSITORY", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IRepository" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isValidSignature", - "inputs": [ - { - "name": "_hash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "_signature", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "settle", - "inputs": [ - { - "name": "_signer", - "type": "address", - "internalType": "address" - }, - { - "name": "_filledTakerAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_order", - "type": "tuple", - "internalType": "struct ILiquoriceSettlement.Order", - "components": [ - { - "name": "market", - "type": "address", - "internalType": "address" - }, - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "rfqId", - "type": "string", - "internalType": "string" - }, - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "trader", - "type": "address", - "internalType": "address" - }, - { - "name": "effectiveTrader", - "type": "address", - "internalType": "address" - }, - { - "name": "quoteExpiry", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "recipient", - "type": "address", - "internalType": "address" - }, - { - "name": "minFillAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "baseTokenData", - "type": "tuple", - "internalType": "struct ILiquoriceSettlement.BaseTokenData", - "components": [ - { - "name": "addr", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "toRecipient", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "toRepay", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "toSupply", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "name": "quoteTokenData", - "type": "tuple", - "internalType": "struct ILiquoriceSettlement.QuoteTokenData", - "components": [ - { - "name": "addr", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "toTrader", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "toWithdraw", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "toBorrow", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ] - }, - { - "name": "_interactions", - "type": "tuple[]", - "internalType": "struct GPv2Interaction.Data[]", - "components": [ - { - "name": "target", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "callData", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "_hooks", - "type": "tuple", - "internalType": "struct GPv2Interaction.Hooks", - "components": [ - { - "name": "beforeSettle", - "type": "tuple[]", - "internalType": "struct GPv2Interaction.Data[]", - "components": [ - { - "name": "target", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "callData", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "afterSettle", - "type": "tuple[]", - "internalType": "struct GPv2Interaction.Data[]", - "components": [ - { - "name": "target", - "type": "address", - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "callData", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ] - }, - { - "name": "_makerSignature", - "type": "tuple", - "internalType": "struct Signature.TypedSignature", - "components": [ - { - "name": "signatureType", - "type": "uint8", - "internalType": "enum Signature.Type" - }, - { - "name": "transferCommand", - "type": "uint8", - "internalType": "enum Signature.TransferCommand" - }, - { - "name": "signatureBytes", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "_takerSignature", - "type": "tuple", - "internalType": "struct Signature.TypedSignature", - "components": [ - { - "name": "signatureType", - "type": "uint8", - "internalType": "enum Signature.Type" - }, - { - "name": "transferCommand", - "type": "uint8", - "internalType": "enum Signature.TransferCommand" - }, - { - "name": "signatureBytes", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "settleSingle", - "inputs": [ - { - "name": "_signer", - "type": "address", - "internalType": "address" - }, - { - "name": "_order", - "type": "tuple", - "internalType": "struct ILiquoriceSettlement.Single", - "components": [ - { - "name": "rfqId", - "type": "string", - "internalType": "string" - }, - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "trader", - "type": "address", - "internalType": "address" - }, - { - "name": "effectiveTrader", - "type": "address", - "internalType": "address" - }, - { - "name": "baseToken", - "type": "address", - "internalType": "address" - }, - { - "name": "quoteToken", - "type": "address", - "internalType": "address" - }, - { - "name": "baseTokenAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "quoteTokenAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minFillAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "quoteExpiry", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "recipient", - "type": "address", - "internalType": "address" - } - ] - }, - { - "name": "_makerSignature", - "type": "tuple", - "internalType": "struct Signature.TypedSignature", - "components": [ - { - "name": "signatureType", - "type": "uint8", - "internalType": "enum Signature.Type" - }, - { - "name": "transferCommand", - "type": "uint8", - "internalType": "enum Signature.TransferCommand" - }, - { - "name": "signatureBytes", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "_filledTakerAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_takerSignature", - "type": "tuple", - "internalType": "struct Signature.TypedSignature", - "components": [ - { - "name": "signatureType", - "type": "uint8", - "internalType": "enum Signature.Type" - }, - { - "name": "transferCommand", - "type": "uint8", - "internalType": "enum Signature.TransferCommand" - }, - { - "name": "signatureBytes", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ], - "outputs": [], - "stateMutability": "payable" - } - ], - "methodIdentifiers": { - "AUTHENTICATOR()": "c6186181", - "BALANCE_MANAGER()": "29bcdc95", - "REPOSITORY()": "6f35d2d2", - "isValidSignature(bytes32,bytes)": "1626ba7e", - "settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))": "cba673a7", - "settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))": "9935c868" - }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AUTHENTICATOR\",\"outputs\":[{\"internalType\":\"contract IAllowListAuthentication\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALANCE_MANAGER\",\"outputs\":[{\"internalType\":\"contract IBalanceManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REPOSITORY\",\"outputs\":[{\"internalType\":\"contract IRepository\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_signature\",\"type\":\"bytes\"}],\"name\":\"isValidSignature\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_filledTakerAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"baseTokenData\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"quoteTokenData\",\"type\":\"tuple\"}],\"internalType\":\"struct ILiquoriceSettlement.Order\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"_interactions\",\"type\":\"tuple[]\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"beforeSettle\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"afterSettle\",\"type\":\"tuple[]\"}],\"internalType\":\"struct GPv2Interaction.Hooks\",\"name\":\"_hooks\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_makerSignature\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_takerSignature\",\"type\":\"tuple\"}],\"name\":\"settle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"quoteToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"struct ILiquoriceSettlement.Single\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_makerSignature\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_filledTakerAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_takerSignature\",\"type\":\"tuple\"}],\"name\":\"settleSingle\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"AUTHENTICATOR()\":{\"returns\":{\"_0\":\"IAllowListAuthentication Authenticator interface\"}},\"BALANCE_MANAGER()\":{\"returns\":{\"_0\":\"IBalanceManager The balance manager interface\"}},\"REPOSITORY()\":{\"returns\":{\"_0\":\"IRepository Repository interface\"}},\"isValidSignature(bytes32,bytes)\":{\"params\":{\"_hash\":\"Hash of the data\",\"_signature\":\"Signature to validate\"},\"returns\":{\"_0\":\"Magic value if signature is valid, otherwise 0xffffffff\"}},\"settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))\":{\"params\":{\"_filledTakerAmount\":\"Amount filled by the taker\",\"_hooks\":\"Hooks to be called before and after settlement\",\"_interactions\":\"Array of interaction data to be executed during settlement\",\"_makerSignature\":\"Typed signature of the maker\",\"_order\":\"Order data\",\"_signer\":\"Address that signed the order\",\"_takerSignature\":\"Typed signature of the taker\"}},\"settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))\":{\"params\":{\"_filledTakerAmount\":\"Amount filled by the taker\",\"_makerSignature\":\"Signature of the maker\",\"_order\":\"Single order data\",\"_signer\":\"Address that signed the order\",\"_takerSignature\":\"Signature of the taker\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"AUTHENTICATOR()\":{\"notice\":\"Returns the address of the authenticator contract\"},\"BALANCE_MANAGER()\":{\"notice\":\"Returns the address of the balance manager contract\"},\"REPOSITORY()\":{\"notice\":\"Returns the address of the repository contract\"},\"isValidSignature(bytes32,bytes)\":{\"notice\":\"Validates a signature\"},\"settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))\":{\"notice\":\"Settles a signed order with the given interactions and hooks\"},\"settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))\":{\"notice\":\"Settles a single order\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/ILiquoriceSettlement.sol\":\"ILiquoriceSettlement\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[\":@chainlink/=lib/chainlink/contracts/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/\",\":chainlink/=lib/chainlink/\",\":contracts/=src/contracts/\",\":ds-test/=node_modules/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/\",\":interfaces/=src/interfaces/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/\",\":openzeppelin-upgrades/=lib/openzeppelin-upgrades/\",\":solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/\"]},\"sources\":{\"src/contracts/lib/GPv2Interaction.sol\":{\"keccak256\":\"0x55968a83f6ae3d8d806b8faf02360abc676fb7476d05f33c0c9d324e6336fd0f\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://2d813e60c3fa006d02c8fd1aed73d2d47f9f153ac3c410d408384f3084e46de3\",\"dweb:/ipfs/QmdNyQMmyscMH6CVUkhQQfGdKdxgqhqDEe5K4iwrvcWDsk\"]},\"src/contracts/lib/Signature.sol\":{\"keccak256\":\"0xc084fe793244e2e7b0f4a51440df7dbf97d39b4ad6450a2b8a082cb6d86993b5\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://9bff9732e68149a83f2e044c7f1700432997750166cd15f4a54f73bd68a475aa\",\"dweb:/ipfs/QmZJMNppHQ3nUDcJhAkrMYa4QWhGLDr4Tzah6LndgrDCib\"]},\"src/interfaces/IACLManager.sol\":{\"keccak256\":\"0xeee5cbedcfaff01733979b8f439a817aa67b09d9e330d21e11f180dceebed024\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://814431cd9df23d0d7cc0f9761927e2aa18fc7fa599f34422f332ee6352580d69\",\"dweb:/ipfs/QmXLdGsdMyeX5j64rAaByz35SwEMPMQ7usXwruWjEPo6Cz\"]},\"src/interfaces/IAllowListAuthentication.sol\":{\"keccak256\":\"0xbabb9eda80757d9355ab9863fccb3fdb1f15c1cbce458c3236d792d007077a9e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f6fa97e90b315ffc3cae3998adda6810c856ea96be015e797723e13b436d1a10\",\"dweb:/ipfs/Qme1dzXXcMDQpeqyqfuSbZDY6GKWjyrRBQrNDjitPeXQEF\"]},\"src/interfaces/IBalanceManager.sol\":{\"keccak256\":\"0xc4cff6f33170df6d91a866ee69263c9b90091e94027bea04038558c315e6e127\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://867164a381fb78da320c89db6b15978becd49be61e2349abc805362904bffb4e\",\"dweb:/ipfs/QmPY9UYCi9YVdCC8A1UxmTPcnV5BmMj93Gq1nqxBv4fMJ7\"]},\"src/interfaces/IInterestRateModel.sol\":{\"keccak256\":\"0xccd4c1dea98176c392de07cb8f5a2ac969405090d42d831310fa53464c0d9264\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a22b5b87be29e616142b6c4677e109e9246157c4b7e6378334fbc7ba403d82de\",\"dweb:/ipfs/QmXmSF34VsktTfqSCJU8Mz9sTaXGVk7xdYQwr9NcsR3k43\"]},\"src/interfaces/ILiquoriceSettlement.sol\":{\"keccak256\":\"0xa4a36d51f174d9994c39287f89e63bbea57ff5adcd2a9bc649c67bb5cae75272\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8562fe9fc033c3e3320c5d95ad10e49f5e23ea50a5e9eaf186cbf53d9f1ce7a6\",\"dweb:/ipfs/QmXKSjRi8oxmS5xd5V95HofYtFzYfehbL6s8t2MKoXR7y1\"]},\"src/interfaces/IPriceProvider.sol\":{\"keccak256\":\"0x75812be8d692287010f5ee9ce13556df1bd8299faa64b42c49cd08cf7cc53847\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://623d4faa57b078a33a2afe0d13fc426c4a750ae7f07f9d826000047dab54148e\",\"dweb:/ipfs/QmYmFpZnLug6FBG9C8s1mxPBjZHwiCk7cRBC7A9WXtyGKE\"]},\"src/interfaces/IRepository.sol\":{\"keccak256\":\"0xf08a5812ce10042564d518994db487c49d9f35d511da07a5103b9b886b6e2607\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b602c9f5a61c9796f711330ee56d4f0287adc656c686acf391d4e8c45453e6d0\",\"dweb:/ipfs/QmQ7XJ1qERgRxWurpkS3t1XDtuBUTpQEz14h4eXBc8vp9t\"]}},\"version\":1}", - "metadata": { - "compiler": { - "version": "0.8.23+commit.f704f362" - }, - "language": "Solidity", - "output": { - "abi": [ - { - "inputs": [], - "stateMutability": "view", - "type": "function", - "name": "AUTHENTICATOR", - "outputs": [ - { - "internalType": "contract IAllowListAuthentication", - "name": "", - "type": "address" - } - ] - }, - { - "inputs": [], - "stateMutability": "view", - "type": "function", - "name": "BALANCE_MANAGER", - "outputs": [ - { - "internalType": "contract IBalanceManager", - "name": "", - "type": "address" - } - ] - }, - { - "inputs": [], - "stateMutability": "view", - "type": "function", - "name": "REPOSITORY", - "outputs": [ - { - "internalType": "contract IRepository", - "name": "", - "type": "address" - } - ] - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "_signature", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function", - "name": "isValidSignature", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ] - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_signer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_filledTakerAmount", - "type": "uint256" - }, - { - "internalType": "struct ILiquoriceSettlement.Order", - "name": "_order", - "type": "tuple", - "components": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "rfqId", - "type": "string" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "address", - "name": "effectiveTrader", - "type": "address" - }, - { - "internalType": "uint256", - "name": "quoteExpiry", - "type": "uint256" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minFillAmount", - "type": "uint256" - }, - { - "internalType": "struct ILiquoriceSettlement.BaseTokenData", - "name": "baseTokenData", - "type": "tuple", - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "toRecipient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "toRepay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "toSupply", - "type": "uint256" - } - ] - }, - { - "internalType": "struct ILiquoriceSettlement.QuoteTokenData", - "name": "quoteTokenData", - "type": "tuple", - "components": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "toTrader", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "toWithdraw", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "toBorrow", - "type": "uint256" - } - ] - } - ] - }, - { - "internalType": "struct GPv2Interaction.Data[]", - "name": "_interactions", - "type": "tuple[]", - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ] - }, - { - "internalType": "struct GPv2Interaction.Hooks", - "name": "_hooks", - "type": "tuple", - "components": [ - { - "internalType": "struct GPv2Interaction.Data[]", - "name": "beforeSettle", - "type": "tuple[]", - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ] - }, - { - "internalType": "struct GPv2Interaction.Data[]", - "name": "afterSettle", - "type": "tuple[]", - "components": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - } - ] - } - ] - }, - { - "internalType": "struct Signature.TypedSignature", - "name": "_makerSignature", - "type": "tuple", - "components": [ - { - "internalType": "enum Signature.Type", - "name": "signatureType", - "type": "uint8" - }, - { - "internalType": "enum Signature.TransferCommand", - "name": "transferCommand", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "signatureBytes", - "type": "bytes" - } - ] - }, - { - "internalType": "struct Signature.TypedSignature", - "name": "_takerSignature", - "type": "tuple", - "components": [ - { - "internalType": "enum Signature.Type", - "name": "signatureType", - "type": "uint8" - }, - { - "internalType": "enum Signature.TransferCommand", - "name": "transferCommand", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "signatureBytes", - "type": "bytes" - } - ] - } - ], - "stateMutability": "nonpayable", - "type": "function", - "name": "settle" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_signer", - "type": "address" - }, - { - "internalType": "struct ILiquoriceSettlement.Single", - "name": "_order", - "type": "tuple", - "components": [ - { - "internalType": "string", - "name": "rfqId", - "type": "string" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "address", - "name": "trader", - "type": "address" - }, - { - "internalType": "address", - "name": "effectiveTrader", - "type": "address" - }, - { - "internalType": "address", - "name": "baseToken", - "type": "address" - }, - { - "internalType": "address", - "name": "quoteToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "baseTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "quoteTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minFillAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "quoteExpiry", - "type": "uint256" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ] - }, - { - "internalType": "struct Signature.TypedSignature", - "name": "_makerSignature", - "type": "tuple", - "components": [ - { - "internalType": "enum Signature.Type", - "name": "signatureType", - "type": "uint8" - }, - { - "internalType": "enum Signature.TransferCommand", - "name": "transferCommand", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "signatureBytes", - "type": "bytes" - } - ] - }, - { - "internalType": "uint256", - "name": "_filledTakerAmount", - "type": "uint256" - }, - { - "internalType": "struct Signature.TypedSignature", - "name": "_takerSignature", - "type": "tuple", - "components": [ - { - "internalType": "enum Signature.Type", - "name": "signatureType", - "type": "uint8" - }, - { - "internalType": "enum Signature.TransferCommand", - "name": "transferCommand", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "signatureBytes", - "type": "bytes" - } - ] - } - ], - "stateMutability": "payable", - "type": "function", - "name": "settleSingle" - } - ], - "devdoc": { - "kind": "dev", - "methods": { - "AUTHENTICATOR()": { - "returns": { - "_0": "IAllowListAuthentication Authenticator interface" - } - }, - "BALANCE_MANAGER()": { - "returns": { - "_0": "IBalanceManager The balance manager interface" - } - }, - "REPOSITORY()": { - "returns": { - "_0": "IRepository Repository interface" - } - }, - "isValidSignature(bytes32,bytes)": { - "params": { - "_hash": "Hash of the data", - "_signature": "Signature to validate" - }, - "returns": { - "_0": "Magic value if signature is valid, otherwise 0xffffffff" - } - }, - "settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))": { - "params": { - "_filledTakerAmount": "Amount filled by the taker", - "_hooks": "Hooks to be called before and after settlement", - "_interactions": "Array of interaction data to be executed during settlement", - "_makerSignature": "Typed signature of the maker", - "_order": "Order data", - "_signer": "Address that signed the order", - "_takerSignature": "Typed signature of the taker" - } - }, - "settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))": { - "params": { - "_filledTakerAmount": "Amount filled by the taker", - "_makerSignature": "Signature of the maker", - "_order": "Single order data", - "_signer": "Address that signed the order", - "_takerSignature": "Signature of the taker" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "AUTHENTICATOR()": { - "notice": "Returns the address of the authenticator contract" - }, - "BALANCE_MANAGER()": { - "notice": "Returns the address of the balance manager contract" - }, - "REPOSITORY()": { - "notice": "Returns the address of the repository contract" - }, - "isValidSignature(bytes32,bytes)": { - "notice": "Validates a signature" - }, - "settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))": { - "notice": "Settles a signed order with the given interactions and hooks" - }, - "settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))": { - "notice": "Settles a single order" - } - }, - "version": 1 - } - }, - "settings": { - "remappings": [ - "@chainlink/=lib/chainlink/contracts/", - "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", - "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/", - "chainlink/=lib/chainlink/", - "contracts/=src/contracts/", - "ds-test/=node_modules/ds-test/src/", - "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", - "forge-std/=lib/forge-std/src/", - "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", - "interfaces/=src/interfaces/", - "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", - "openzeppelin-contracts/=lib/openzeppelin-contracts/", - "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/", - "openzeppelin-upgrades/=lib/openzeppelin-upgrades/", - "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/" - ], - "optimizer": { - "enabled": true, - "runs": 10000 - }, - "metadata": { - "bytecodeHash": "ipfs" - }, - "compilationTarget": { - "src/interfaces/ILiquoriceSettlement.sol": "ILiquoriceSettlement" - }, - "evmVersion": "shanghai", - "libraries": {} - }, - "sources": { - "src/contracts/lib/GPv2Interaction.sol": { - "keccak256": "0x55968a83f6ae3d8d806b8faf02360abc676fb7476d05f33c0c9d324e6336fd0f", - "urls": [ - "bzz-raw://2d813e60c3fa006d02c8fd1aed73d2d47f9f153ac3c410d408384f3084e46de3", - "dweb:/ipfs/QmdNyQMmyscMH6CVUkhQQfGdKdxgqhqDEe5K4iwrvcWDsk" - ], - "license": "LGPL-3.0-or-later" - }, - "src/contracts/lib/Signature.sol": { - "keccak256": "0xc084fe793244e2e7b0f4a51440df7dbf97d39b4ad6450a2b8a082cb6d86993b5", - "urls": [ - "bzz-raw://9bff9732e68149a83f2e044c7f1700432997750166cd15f4a54f73bd68a475aa", - "dweb:/ipfs/QmZJMNppHQ3nUDcJhAkrMYa4QWhGLDr4Tzah6LndgrDCib" - ], - "license": "BUSL-1.1" - }, - "src/interfaces/IACLManager.sol": { - "keccak256": "0xeee5cbedcfaff01733979b8f439a817aa67b09d9e330d21e11f180dceebed024", - "urls": [ - "bzz-raw://814431cd9df23d0d7cc0f9761927e2aa18fc7fa599f34422f332ee6352580d69", - "dweb:/ipfs/QmXLdGsdMyeX5j64rAaByz35SwEMPMQ7usXwruWjEPo6Cz" - ], - "license": "MIT" - }, - "src/interfaces/IAllowListAuthentication.sol": { - "keccak256": "0xbabb9eda80757d9355ab9863fccb3fdb1f15c1cbce458c3236d792d007077a9e", - "urls": [ - "bzz-raw://f6fa97e90b315ffc3cae3998adda6810c856ea96be015e797723e13b436d1a10", - "dweb:/ipfs/Qme1dzXXcMDQpeqyqfuSbZDY6GKWjyrRBQrNDjitPeXQEF" - ], - "license": "MIT" - }, - "src/interfaces/IBalanceManager.sol": { - "keccak256": "0xc4cff6f33170df6d91a866ee69263c9b90091e94027bea04038558c315e6e127", - "urls": [ - "bzz-raw://867164a381fb78da320c89db6b15978becd49be61e2349abc805362904bffb4e", - "dweb:/ipfs/QmPY9UYCi9YVdCC8A1UxmTPcnV5BmMj93Gq1nqxBv4fMJ7" - ], - "license": "MIT" - }, - "src/interfaces/IInterestRateModel.sol": { - "keccak256": "0xccd4c1dea98176c392de07cb8f5a2ac969405090d42d831310fa53464c0d9264", - "urls": [ - "bzz-raw://a22b5b87be29e616142b6c4677e109e9246157c4b7e6378334fbc7ba403d82de", - "dweb:/ipfs/QmXmSF34VsktTfqSCJU8Mz9sTaXGVk7xdYQwr9NcsR3k43" - ], - "license": "MIT" - }, - "src/interfaces/ILiquoriceSettlement.sol": { - "keccak256": "0xa4a36d51f174d9994c39287f89e63bbea57ff5adcd2a9bc649c67bb5cae75272", - "urls": [ - "bzz-raw://8562fe9fc033c3e3320c5d95ad10e49f5e23ea50a5e9eaf186cbf53d9f1ce7a6", - "dweb:/ipfs/QmXKSjRi8oxmS5xd5V95HofYtFzYfehbL6s8t2MKoXR7y1" - ], - "license": "MIT" - }, - "src/interfaces/IPriceProvider.sol": { - "keccak256": "0x75812be8d692287010f5ee9ce13556df1bd8299faa64b42c49cd08cf7cc53847", - "urls": [ - "bzz-raw://623d4faa57b078a33a2afe0d13fc426c4a750ae7f07f9d826000047dab54148e", - "dweb:/ipfs/QmYmFpZnLug6FBG9C8s1mxPBjZHwiCk7cRBC7A9WXtyGKE" - ], - "license": "MIT" - }, - "src/interfaces/IRepository.sol": { - "keccak256": "0xf08a5812ce10042564d518994db487c49d9f35d511da07a5103b9b886b6e2607", - "urls": [ - "bzz-raw://b602c9f5a61c9796f711330ee56d4f0287adc656c686acf391d4e8c45453e6d0", - "dweb:/ipfs/QmQ7XJ1qERgRxWurpkS3t1XDtuBUTpQEz14h4eXBc8vp9t" - ], - "license": "MIT" - } - }, - "version": 1 - }, - "id": 108 -} diff --git a/crates/contracts/artifacts/LiquoriceSettlement.json b/crates/contracts/artifacts/LiquoriceSettlement.json new file mode 100644 index 0000000000..f34c403bdf --- /dev/null +++ b/crates/contracts/artifacts/LiquoriceSettlement.json @@ -0,0 +1,4191 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [ + { + "name": "authenticator_", + "type": "address", + "internalType": "contract IAllowListAuthentication" + }, + { + "name": "repository_", + "type": "address", + "internalType": "contract IRepository" + }, + { + "name": "permit2_", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, + { + "type": "function", + "name": "AUTHENTICATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IAllowListAuthentication" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "BALANCE_MANAGER", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IBalanceManager" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "REPOSITORY", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IRepository" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "cancelLimitOrder", + "inputs": [ + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "hashBaseTokenData", + "inputs": [ + { + "name": "_baseTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRecipient", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRepay", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toSupply", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "hashOrder", + "inputs": [ + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Order", + "components": [ + { + "name": "market", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "baseTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRecipient", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRepay", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toSupply", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "quoteTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toTrader", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWithdraw", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toBorrow", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "hashQuoteTokenData", + "inputs": [ + { + "name": "_quoteTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toTrader", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWithdraw", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toBorrow", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "hashSingleOrder", + "inputs": [ + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Single", + "components": [ + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "baseToken", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteToken", + "type": "address", + "internalType": "address" + }, + { + "name": "baseTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + } + ] + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isValidSignature", + "inputs": [ + { + "name": "_hash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_signature", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "settle", + "inputs": [ + { + "name": "_signer", + "type": "address", + "internalType": "address" + }, + { + "name": "_filledTakerAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Order", + "components": [ + { + "name": "market", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "baseTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRecipient", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRepay", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toSupply", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "quoteTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toTrader", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWithdraw", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toBorrow", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + }, + { + "name": "_interactions", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_hooks", + "type": "tuple", + "internalType": "struct GPv2Interaction.Hooks", + "components": [ + { + "name": "beforeSettle", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "afterSettle", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "_makerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_takerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "settleSingle", + "inputs": [ + { + "name": "_signer", + "type": "address", + "internalType": "address" + }, + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Single", + "components": [ + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "baseToken", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteToken", + "type": "address", + "internalType": "address" + }, + { + "name": "baseTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + } + ] + }, + { + "name": "_makerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_filledTakerAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_takerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "settleSingleWithPermitsSignatures", + "inputs": [ + { + "name": "_signer", + "type": "address", + "internalType": "address" + }, + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Single", + "components": [ + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "baseToken", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteToken", + "type": "address", + "internalType": "address" + }, + { + "name": "baseTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + } + ] + }, + { + "name": "_makerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_filledTakerAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_takerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_takerPermitInfo", + "type": "tuple", + "internalType": "struct Signature.TakerPermitInfo", + "components": [ + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "nonce", + "type": "uint48", + "internalType": "uint48" + }, + { + "name": "deadline", + "type": "uint48", + "internalType": "uint48" + } + ] + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "settleWithPermitsSignatures", + "inputs": [ + { + "name": "_signer", + "type": "address", + "internalType": "address" + }, + { + "name": "_filledTakerAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Order", + "components": [ + { + "name": "market", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "baseTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRecipient", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRepay", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toSupply", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "quoteTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toTrader", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWithdraw", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toBorrow", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + }, + { + "name": "_interactions", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_hooks", + "type": "tuple", + "internalType": "struct GPv2Interaction.Hooks", + "components": [ + { + "name": "beforeSettle", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "afterSettle", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + }, + { + "name": "_makerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_takerSignature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "_takerPermitInfo", + "type": "tuple", + "internalType": "struct Signature.TakerPermitInfo", + "components": [ + { + "name": "signature", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "nonce", + "type": "uint48", + "internalType": "uint48" + }, + { + "name": "deadline", + "type": "uint48", + "internalType": "uint48" + } + ] + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "validateHooks", + "inputs": [ + { + "name": "_repository", + "type": "address", + "internalType": "contract IRepository" + }, + { + "name": "_hooks", + "type": "tuple", + "internalType": "struct GPv2Interaction.Hooks", + "components": [ + { + "name": "beforeSettle", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "afterSettle", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "view" + }, + { + "type": "function", + "name": "validateInteractions", + "inputs": [ + { + "name": "_repository", + "type": "address", + "internalType": "contract IRepository" + }, + { + "name": "_signer", + "type": "address", + "internalType": "address" + }, + { + "name": "_isPartialFill", + "type": "bool", + "internalType": "bool" + }, + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Order", + "components": [ + { + "name": "market", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "baseTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRecipient", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRepay", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toSupply", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "quoteTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toTrader", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWithdraw", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toBorrow", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + }, + { + "name": "_interactions", + "type": "tuple[]", + "internalType": "struct GPv2Interaction.Data[]", + "components": [ + { + "name": "target", + "type": "address", + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "callData", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "view" + }, + { + "type": "function", + "name": "validateOrderAmounts", + "inputs": [ + { + "name": "_order", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.Order", + "components": [ + { + "name": "market", + "type": "address", + "internalType": "address" + }, + { + "name": "chainId", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "rfqId", + "type": "string", + "internalType": "string" + }, + { + "name": "nonce", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "trader", + "type": "address", + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "internalType": "address" + }, + { + "name": "quoteExpiry", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "internalType": "address" + }, + { + "name": "minFillAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "baseTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRecipient", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toRepay", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toSupply", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "quoteTokenData", + "type": "tuple", + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toTrader", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toWithdraw", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "toBorrow", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "validateSignature", + "inputs": [ + { + "name": "_validationAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "_hash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_signature", + "type": "tuple", + "internalType": "struct Signature.TypedSignature", + "components": [ + { + "name": "signatureType", + "type": "uint8", + "internalType": "enum Signature.Type" + }, + { + "name": "transferCommand", + "type": "uint8", + "internalType": "enum Signature.TransferCommand" + }, + { + "name": "signatureBytes", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [], + "stateMutability": "view" + }, + { + "type": "event", + "name": "Interaction", + "inputs": [ + { + "name": "target", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "selector", + "type": "bytes4", + "indexed": false, + "internalType": "bytes4" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "TradeOrder", + "inputs": [ + { + "name": "rfqId", + "type": "string", + "indexed": true, + "internalType": "string" + }, + { + "name": "trader", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "effectiveTrader", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "baseToken", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "quoteToken", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "baseTokenAmount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "quoteTokenAmount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "recipient", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ECDSAInvalidSignature", + "inputs": [] + }, + { + "type": "error", + "name": "ECDSAInvalidSignatureLength", + "inputs": [ + { + "name": "length", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ECDSAInvalidSignatureS", + "inputs": [ + { + "name": "s", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "InvalidAmount", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAsset", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidBaseTokenAmounts", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidDestination", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidEIP1271Signature", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidEIP712Signature", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidETHSignSignature", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidFillAmount", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidHooksTarget", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInteractionsBaseTokenAmounts", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInteractionsQuoteTokenAmounts", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidLendingPoolInteraction", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidQuoteTokenAmounts", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidSignatureType", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidSigner", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidSource", + "inputs": [] + }, + { + "type": "error", + "name": "NonceInvalid", + "inputs": [] + }, + { + "type": "error", + "name": "NotMaker", + "inputs": [] + }, + { + "type": "error", + "name": "NotSolver", + "inputs": [] + }, + { + "type": "error", + "name": "OrderExpired", + "inputs": [] + }, + { + "type": "error", + "name": "PartialFillNotSupported", + "inputs": [] + }, + { + "type": "error", + "name": "ReceiverNotManager", + "inputs": [] + }, + { + "type": "error", + "name": "ReentrancyGuardReentrantCall", + "inputs": [] + }, + { + "type": "error", + "name": "SafeERC20FailedOperation", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "SignatureIsExpired", + "inputs": [] + }, + { + "type": "error", + "name": "SignatureIsNotEmpty", + "inputs": [] + }, + { + "type": "error", + "name": "UpdatedMakerAmountsTooLow", + "inputs": [] + }, + { + "type": "error", + "name": "ZeroMakerAmount", + "inputs": [] + } + ], + "bytecode": { + "object": "0x61012060405234801562000011575f80fd5b5060405162004ef638038062004ef6833981016040819052620000349162000175565b4660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f64afec7be651c92f86754beb2bd5eeaf2fa95e83faf4aee989877dde08e4498c918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201526080810192909252309082015260c00160408051601f19818403018152908290528051602090910120608052600180556001600160a01b03841660c05230908290620000fe906200014f565b6001600160a01b03928316815291166020820152604001604051809103905ff0801580156200012f573d5f803e3d5ffd5b506001600160a01b0390811660e052919091166101005250620001c69050565b610963806200459383390190565b6001600160a01b038116811462000172575f80fd5b50565b5f805f6060848603121562000188575f80fd5b835162000195816200015d565b6020850151909350620001a8816200015d565b6040850151909250620001bb816200015d565b809150509250925092565b60805160a05160c05160e0516101005161432d620002665f395f81816102570152818161078401526116dc01525f8181610197015281816107ba0152818161188c01528181611e2c01528181611f1e0152818161202c0152818161230b01528181612427015261303c01525f818161033801528181610412015281816106a70152818161152001526115ff01525f6104da01525f6105a4015261432d5ff3fe608060405260043610610126575f3560e01c8063a5cdc8fc116100a1578063c618618111610071578063db58772811610057578063db58772814610379578063e242924e1461038c578063fa5cd56c146103ab575f80fd5b8063c618618114610327578063cba673a71461035a575f80fd5b8063a5cdc8fc146102ab578063a7ab49bc146102ca578063ae80c584146102e9578063b11f126214610308575f80fd5b806351d46815116100f65780636f35d2d2116100dc5780636f35d2d214610246578063875530ff146102795780639935c86814610298575f80fd5b806351d46815146102125780635aa0e95d14610227575f80fd5b80631626ba7e1461013157806329bcdc95146101865780633644e515146101d15780634c9e03d3146101f3575f80fd5b3661012d57005b5f80fd5b34801561013c575f80fd5b5061015061014b366004613595565b6103ca565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b348015610191575f80fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161017d565b3480156101dc575f80fd5b506101e56104d7565b60405190815260200161017d565b3480156101fe575f80fd5b506101e561020d366004613620565b6105c6565b6102256102203660046136d7565b610667565b005b348015610232575f80fd5b506102256102413660046137e1565b6109e8565b348015610251575f80fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610284575f80fd5b506101e5610293366004613620565b610c30565b6102256102a636600461383f565b610c5f565b3480156102b6575f80fd5b506102256102c53660046138dd565b610c7f565b3480156102d5575f80fd5b506102256102e4366004613901565b610c8c565b3480156102f4575f80fd5b5061022561030336600461399d565b611067565b348015610313575f80fd5b506101e56103223660046139f2565b6112eb565b348015610332575f80fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610365575f80fd5b50610225610374366004613a24565b6114ea565b610225610387366004613b0b565b611878565b348015610397575f80fd5b506101e56103a6366004613bc9565b61194c565b3480156103b6575f80fd5b506102256103c5366004613bc9565b611a8e565b5f806103d7858585611b50565b6040517fe75600c30000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063e75600c390602401602060405180830381865afa158015610459573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061047d9190613bfb565b156104ab577f1626ba7e356f5979dd355a3d2bfb43e80420a480c3b854edce286a82d74968699150506104d0565b507fffffffff0000000000000000000000000000000000000000000000000000000090505b9392505050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146105a157604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f64afec7be651c92f86754beb2bd5eeaf2fa95e83faf4aee989877dde08e4498c918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b5f7f68b8e94dc077458241d6c8d89f0a7665c7cda2cfe70c9eb4437efee1663c66fe6105f56020840184613c16565b836020013584604001358560600135866080013560405160200161064a969594939291909586526001600160a01b0394909416602086015260408501929092526060840152608083015260a082015260c00190565b604051602081830303815290604052805190602001209050919050565b61066f611bdb565b6040517fe75600c30000000000000000000000000000000000000000000000000000000081526001600160a01b038a811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063e75600c390602401602060405180830381865afa1580156106ec573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107109190613bfb565b610746576040517fb331e42100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610200870135881580159061076057506101608801358911155b1561077f5761077c896102008a01356101608b01356001611c1e565b90505b6107b07f00000000000000000000000000000000000000000000000000000000000000008b838b8b8b8b8b8b611c69565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663bc1178e66107ef60c08b0160a08c01613c16565b6108016101408c016101208d01613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526108449291906101608e0135908890600401613c8d565b5f604051808303815f87803b15801561085b575f80fd5b505af115801561086d573d5f803e3d5ffd5b505050506108b4888b838c5f148061088957506101608c01358d115b610893578c61089a565b6101608c01355b898c8c60026108af60408e0160208f01613d61565b611e01565b6108c16040890189613d7f565b6040516108cf929190613de0565b6040519081900390207f0fce007c38c6c8ed9e545b3a148095762738618f8c21b673222613e4d45734b661090960a08b0160808c01613c16565b61091960c08c0160a08d01613c16565b61092b6101408d016101208e01613c16565b61093d6101e08e016101c08f01613c16565b8e158061094e57506101608e01358f115b610958578e61095f565b6101408e01355b6102008f013588146109715787610978565b6101e08f01355b8f60e001602081019061098b9190613c16565b604080516001600160a01b0398891681529688166020880152948716948601949094529185166060850152608084015260a083015290911660c082015260e00160405180910390a2506109dd60018055565b505050505050505050565b5f5b6109f48280613def565b9050811015610b065736610a088380613def565b83818110610a1857610a18613e53565b9050602002810190610a2a9190613e80565b90506001600160a01b03841663a8c4bc95610a486020840184613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610aa2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ac69190613bfb565b15610afd576040517fc99e887200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001016109ea565b505f5b610b166020830183613def565b9050811015610c2b5736610b2d6020840184613def565b83818110610b3d57610b3d613e53565b9050602002810190610b4f9190613e80565b90506001600160a01b03841663a8c4bc95610b6d6020840184613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610bc7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610beb9190613bfb565b15610c22576040517fc99e887200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101610b09565b505050565b5f7fae676bf6913ac2689b7331293c989fe7723124faf8b5d275f06fbcebc77950096105f56020840184613c16565b610c698482612212565b610c78858585856001806122c9565b5050505050565b610c89338261261e565b50565b610cbf6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f5b828110156110535736848483818110610cdc57610cdc613e53565b9050602002810190610cee9190613e80565b9050365f610cff6040840184613d7f565b90925090506001600160a01b038b1663a8c4bc95610d206020860186613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610d7a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d9e9190613bfb565b15611045575f8915610ddc576040517f7d617bb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048210610de8575081355b7fc03a9de9000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610e5657610e3d83838d8c6126c4565b86602001818151610e4e9190613ebc565b905250611043565b7f243a4b7f000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610ebc57610eab83838d8c6127da565b86606001818151610e4e9190613ebc565b7f7dc4f458000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610f4757610f1183838d8c61294e565b60a088015260808701819052606087018051610f2e908390613ebc565b90525060a0860151602087018051610e4e908390613ebc565b7f68931b6b000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610fab57610f9c83838d8c612bb6565b86518790610e4e908390613ebc565b7f0c9be7e4000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216016110115761100083838d8c612cc0565b86604001818151610e4e9190613ebc565b6040517f0561d8b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050806001019050610cc1565b5061105e8482612e29565b50505050505050565b60036110766020830183613f21565b600381111561108757611087613ef4565b036110ec576001600160a01b0383166110ac836110a76040850185613d7f565b611b50565b6001600160a01b031614610c2b576040517fb81d58e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016110fb6020830183613f21565b600381111561110c5761110c613ef4565b036111a0577f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f908152601c839052603c90206001600160a01b03841661115a826110a76040860186613d7f565b6001600160a01b03161461119a576040517f644ae6c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60026111af6020830183613f21565b60038111156111c0576111c0613ef4565b036112b9577f1626ba7e000000000000000000000000000000000000000000000000000000006001600160a01b038416631626ba7e846112036040860186613d7f565b6040518463ffffffff1660e01b815260040161122193929190613f3f565b602060405180830381865afa15801561123c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112609190613f58565b7fffffffff000000000000000000000000000000000000000000000000000000001614610c2b576040517f5d52cbe300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f60cd402d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112f46104d7565b7fd28e809b708f5ee38be8347d6d869d8232493c094ab2dde98369e4102369a99d61131f8480613d7f565b604051602001611330929190613f97565b60405160208183030381529060405280519060200120846020013585604001602081019061135e9190613c16565b60408051602081019590955284019290925260608301526001600160a01b0316608082015260a001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526113c46080850160608601613c16565b6113d460a0860160808701613c16565b6113e460c0870160a08801613c16565b60c087013560e08801356101008901356101208a013561140c6101608c016101408d01613c16565b604080516001600160a01b03998a166020820152978916908801529487166060870152608086019390935260a085019190915260c084015260e083015290911661010082015261012001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526114929291602001613fd7565b6040516020818303038152906040528051906020012060405160200161064a9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6114f2611bdb565b6040517f02cc250d0000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302cc250d90602401602060405180830381865afa15801561156d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115919190613bfb565b6115c7576040517fc139eabd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fe75600c30000000000000000000000000000000000000000000000000000000081526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063e75600c390602401602060405180830381865afa158015611644573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116689190613bfb565b61169e576040517fb331e42100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61020086013587158015906116b857506101608701358811155b156116d7576116d4886102008901356101608a01356001611c1e565b90505b6117087f00000000000000000000000000000000000000000000000000000000000000008a838a8a8a8a8a8a611c69565b611745878a838b158061171f57506101608b01358c115b611729578b611730565b6101608b01355b888b8b60016108af60408d0160208e01613d61565b6117526040880188613d7f565b604051611760929190613de0565b6040519081900390207f0fce007c38c6c8ed9e545b3a148095762738618f8c21b673222613e4d45734b661179a60a08a0160808b01613c16565b6117aa60c08b0160a08c01613c16565b6117bc6101408c016101208d01613c16565b6117ce6101e08d016101c08e01613c16565b8d15806117df57506101608d01358e115b6117e9578d6117f0565b6101408d01355b6102008e013588146118025787611809565b6101e08e01355b8e60e001602081019061181c9190613c16565b604080516001600160a01b0398891681529688166020880152948716948601949094529185166060850152608084015260a083015290911660c082015260e00160405180910390a25061186e60018055565b5050505050505050565b6118828583612212565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663bc1178e66118c16080880160608901613c16565b6118d160a0890160808a01613c16565b8860c00135856040518563ffffffff1660e01b81526004016118f69493929190613c8d565b5f604051808303815f87803b15801561190d575f80fd5b505af115801561191f573d5f803e3d5ffd5b5050505061194486868686600289602001602081019061193f9190613d61565b6122c9565b505050505050565b5f6119556104d7565b7fc994d2ca0375d6d473785e0ce0b1d203f069121bac1314f72c5c0fe601eb39106119836040850185613d7f565b604051602001611994929190613f97565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012060608501356119df60a0870160808801613c16565b6119ef60c0880160a08901613c16565b60c0880135611a056101008a0160e08b01613c16565b60408051602081019890985287019590955260608601939093526001600160a01b039182166080860152811660a085015260c08401919091521660e0820152610100808501359082015261012001604051602081830303815290604052611a6f8461012001610c30565b611a7c856101c0016105c6565b60405160200161149293929190613feb565b6101a0810135611aa8610180830135610160840135613ebc565b611ab29190613ebc565b61014082013514611aef576040517fc04377d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610240810135611b09610220830135610200840135613ebc565b611b139190613ebc565b6101e082013514610c89576040517f877630be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80611b918585858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250612ed692505050565b90506001600160a01b038116611bd3576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b949350505050565b600260015403611c17576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b5f611c4b611c2b83612f00565b8015611c4657505f8480611c4157611c41614008565b868809115b151590565b611c56868686612f2c565b611c609190613ebc565b95945050505050565b5f611c738761194c565b9050611c80898285611067565b611c9060c0880160a08901613c16565b6001600160a01b0316336001600160a01b031614611cc757611cc2611cbb60c0890160a08a01613c16565b8284611067565b611d0e565b611cd46040830183613d7f565b90505f03611d0e576040517f0e364efc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d2b611d2160c0890160a08a01613c16565b886060013561261e565b8660c00135421115611d69576040517f133df02900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f88118015611d7c575086610100013588105b15611db3576040517f9469744400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611dbc87611a8e565b611dc68a856109e8565b611de78a8a5f8b118015611ddf57506102008a01358b14155b8a8a8a610c8c565b611df589886060013561261e565b50505050505050505050565b611e13611e0e8680613def565b613001565b5f611e286101808b01356101a08c0135613ebc565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808d60a0016020810190611e779190613c16565b6001600160a01b03168152602001306001600160a01b031681526020018d610120015f016020810190611eaa9190613c16565b6001600160a01b03168152602001848152602001866002811115611ed057611ed0613ef4565b8152506040518263ffffffff1660e01b8152600401611eef9190614035565b5f604051808303815f87803b158015611f06575f80fd5b505af1158015611f18573d5f803e3d5ffd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808d60a0016020810190611f699190613c16565b6001600160a01b031681526020018d60e0016020810190611f8a9190613c16565b6001600160a01b031681526020018d610120015f016020810190611fae9190613c16565b6001600160a01b031681526020018a8152602001866002811115611fd457611fd4613ef4565b8152506040518263ffffffff1660e01b8152600401611ff39190614035565b5f604051808303815f87803b15801561200a575f80fd5b505af115801561201c573d5f803e3d5ffd5b5050505061202a8585613001565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808c6001600160a01b031681526020018d60800160208101906120869190613c16565b6001600160a01b031681526020018d6101c0015f0160208101906120aa9190613c16565b6001600160a01b031681526020018b81526020018560028111156120d0576120d0613ef4565b8152506040518263ffffffff1660e01b81526004016120ef9190614035565b5f604051808303815f87803b158015612106575f80fd5b505af1158015612118573d5f803e3d5ffd5b5061212e9250611e0e9150506020880188613def565b5f6121416101408c016101208d01613c16565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561219e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121c291906140b4565b90508015612205576122056121de6101008d0160e08e01613c16565b828d610120015f0160208101906121f59190613c16565b6001600160a01b03169190613139565b5050505050505050505050565b6122226080830160608401613c16565b6001600160a01b0316336001600160a01b0316146122615761225c61224d6080840160608501613c16565b612256846112eb565b83611067565b6122a8565b61226e6040820182613d7f565b90505f036122a8576040517f0e364efc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122c56122bb6080840160608501613c16565b836020013561261e565b5050565b60e085013583158015906122e057508560c0013584105b156122fd576122fa848760e001358860c001356001611c1e565b90505b612309878288886131b9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808960600160208101906123569190613c16565b6001600160a01b031681526020016123766101608b016101408c01613c16565b6001600160a01b0316815260200161239460a08b0160808c01613c16565b6001600160a01b031681526020018715806123b257508960c0013588115b6123bc57876123c2565b8960c001355b81526020018660028111156123d9576123d9613ef4565b8152506040518263ffffffff1660e01b81526004016123f89190614035565b5f604051808303815f87803b15801561240f575f80fd5b505af1158015612421573d5f803e3d5ffd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808a6001600160a01b031681526020018960400160208101906124819190613c16565b6001600160a01b0316815260200161249f60c08b0160a08c01613c16565b6001600160a01b031681526020018481526020018560028111156124c5576124c5613ef4565b8152506040518263ffffffff1660e01b81526004016124e49190614035565b5f604051808303815f87803b1580156124fb575f80fd5b505af115801561250d573d5f803e3d5ffd5b5061251e9250889150819050613d7f565b60405161252c929190613de0565b60405180910390207f0fce007c38c6c8ed9e545b3a148095762738618f8c21b673222613e4d45734b68760400160208101906125689190613c16565b61257860808a0160608b01613c16565b61258860a08b0160808c01613c16565b61259860c08c0160a08d01613c16565b8915806125a857508b60c001358a115b6125b257896125b8565b8b60c001355b878d6101400160208101906125cd9190613c16565b604080516001600160a01b0398891681529688166020880152948716948601949094529185166060850152608084015260a083015290911660c082015260e00160405180910390a250505050505050565b6001600160a01b0382165f9081526020818152604080832084845290915290205460ff1615612679576040517fbc0da7d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b039091165f908152602081815260408083209383529290522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b5f8080806126d5876004818b6140cb565b8101906126e291906140f2565b50919450925090506126fc61014086016101208701613c16565b6001600160a01b0316836001600160a01b031614612746576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316866001600160a01b031614612791576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101a085013581146127cf576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b979650505050505050565b5f808080806127ec886004818c6140cb565b8101906127f99190614142565b929650909450925090506128156101e087016101c08801613c16565b6001600160a01b0316846001600160a01b03161461285f576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600160a01b0316876001600160a01b0316146128aa576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6128ba60a0870160808801613c16565b6001600160a01b0316826001600160a01b031614612904576040517fac6b05f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102408601358114612942576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b98975050505050505050565b5f805f805f805f805f8c8c600490809261296a939291906140cb565b8101906129779190614190565b959c50939a50919850965094509250905061299a6101e08b016101c08c01613c16565b6001600160a01b0316876001600160a01b0316146129e4576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b856001600160a01b03168b6001600160a01b031614612a2f576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385163014612a71576040517f8154374b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a8160a08b0160808c01613c16565b6001600160a01b0316846001600160a01b031614612acb576040517fac6b05f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102408a01358314612b09576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b1b6101408b016101208c01613c16565b6001600160a01b0316826001600160a01b031614612b65576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101a08a01358114612ba3576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919c919b50909950505050505050505050565b5f808080612bc7876004818b6140cb565b810190612bd4919061420f565b91945092509050612bed61014086016101208701613c16565b6001600160a01b0316836001600160a01b031614612c37576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316866001600160a01b031614612c82576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61018085013581146127cf576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80808080612cd2886004818c6140cb565b810190612cdf919061424d565b5092965090945092509050612cfc6101e087016101c08801613c16565b6001600160a01b0316846001600160a01b031614612d46576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600160a01b0316876001600160a01b031614612d91576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612da160a0870160808801613c16565b6001600160a01b0316826001600160a01b031614612deb576040517fac6b05f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102208601358114612942576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051610180830135141580612e47575060208101516101a083013514155b15612e7e576040517f4a55da2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040810151610220830135141580612e9f5750606081015161024083013514155b156122c5576040517f77a5920300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805f80612ee4868661325c565b925092509250612ef482826132a5565b50909150505b92915050565b5f6002826003811115612f1557612f15613ef4565b612f1f91906142b1565b60ff166001149050919050565b5f838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870982811083820303915050805f03612f7f57838281612f7557612f75614008565b04925050506104d0565b808411612f9657612f9660038515026011186133ad565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b5f5b81811015610c2b573683838381811061301e5761301e613e53565b90506020028101906130309190613e80565b90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166130696020830183613c16565b6001600160a01b0316036130a9576040517f79a1bff000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6130b2816133be565b6130bf6020820182613c16565b6001600160a01b03167fed99827efb37016f2275f98c4bcf71c7551c75d59e9b450f79fa32e60be672c282602001356130f784613401565b604080519283527fffffffff0000000000000000000000000000000000000000000000000000000090911660208301520160405180910390a250600101613003565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610c2b90849061342a565b5f831180156131cc575081610100013583105b15613203576040517f9469744400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61321084612256846112eb565b61321e84836020013561261e565b428261012001351161119a576040517fc56873ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805f8351604103613293576020840151604085015160608601515f1a613285888285856134af565b95509550955050505061329e565b505081515f91506002905b9250925092565b5f8260038111156132b8576132b8613ef4565b036132c1575050565b60018260038111156132d5576132d5613ef4565b0361330c576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282600381111561332057613320613ef4565b0361335f576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b600382600381111561337357613373613ef4565b036122c5576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401613356565b634e487b715f52806020526024601cfd5b5f6133cc6020830183613c16565b90506020820135365f6133e26040860186613d7f565b91509150604051818382375f80838387895af1611944573d5f803e3d5ffd5b5f36816134116040850185613d7f565b90925090506004811061342357813592505b5050919050565b5f8060205f8451602086015f885af180613449576040513d5f823e3d81fd5b50505f513d9150811561346057806001141561346d565b6001600160a01b0384163b155b1561119a576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401613356565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156134e857505f9150600390508261358b565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613539573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b03811661358257505f92506001915082905061358b565b92505f91508190505b9450945094915050565b5f805f604084860312156135a7575f80fd5b83359250602084013567ffffffffffffffff808211156135c5575f80fd5b818601915086601f8301126135d8575f80fd5b8135818111156135e6575f80fd5b8760208285010111156135f7575f80fd5b6020830194508093505050509250925092565b5f60a0828403121561361a575f80fd5b50919050565b5f60a08284031215613630575f80fd5b6104d0838361360a565b6001600160a01b0381168114610c89575f80fd5b80356136598161363a565b919050565b5f610260828403121561361a575f80fd5b5f8083601f84011261367f575f80fd5b50813567ffffffffffffffff811115613696575f80fd5b6020830191508360208260051b85010111156136b0575f80fd5b9250929050565b5f6040828403121561361a575f80fd5b5f6060828403121561361a575f80fd5b5f805f805f805f805f6101008a8c0312156136f0575f80fd5b6136f98a61364e565b985060208a0135975060408a013567ffffffffffffffff8082111561371c575f80fd5b6137288d838e0161365e565b985060608c013591508082111561373d575f80fd5b6137498d838e0161366f565b909850965060808c0135915080821115613761575f80fd5b61376d8d838e016136b7565b955060a08c0135915080821115613782575f80fd5b61378e8d838e016136c7565b945060c08c01359150808211156137a3575f80fd5b6137af8d838e016136c7565b935060e08c01359150808211156137c4575f80fd5b506137d18c828d016136c7565b9150509295985092959850929598565b5f80604083850312156137f2575f80fd5b82356137fd8161363a565b9150602083013567ffffffffffffffff811115613818575f80fd5b613824858286016136b7565b9150509250929050565b5f610160828403121561361a575f80fd5b5f805f805f60a08688031215613853575f80fd5b853561385e8161363a565b9450602086013567ffffffffffffffff8082111561387a575f80fd5b61388689838a0161382e565b9550604088013591508082111561389b575f80fd5b6138a789838a016136c7565b94506060880135935060808801359150808211156138c3575f80fd5b506138d0888289016136c7565b9150509295509295909350565b5f602082840312156138ed575f80fd5b5035919050565b8015158114610c89575f80fd5b5f805f805f8060a08789031215613916575f80fd5b86356139218161363a565b955060208701356139318161363a565b94506040870135613941816138f4565b9350606087013567ffffffffffffffff8082111561395d575f80fd5b6139698a838b0161365e565b9450608089013591508082111561397e575f80fd5b5061398b89828a0161366f565b979a9699509497509295939492505050565b5f805f606084860312156139af575f80fd5b83356139ba8161363a565b925060208401359150604084013567ffffffffffffffff8111156139dc575f80fd5b6139e8868287016136c7565b9150509250925092565b5f60208284031215613a02575f80fd5b813567ffffffffffffffff811115613a18575f80fd5b611bd38482850161382e565b5f805f805f805f8060e0898b031215613a3b575f80fd5b613a448961364e565b975060208901359650604089013567ffffffffffffffff80821115613a67575f80fd5b613a738c838d0161365e565b975060608b0135915080821115613a88575f80fd5b613a948c838d0161366f565b909750955060808b0135915080821115613aac575f80fd5b613ab88c838d016136b7565b945060a08b0135915080821115613acd575f80fd5b613ad98c838d016136c7565b935060c08b0135915080821115613aee575f80fd5b50613afb8b828c016136c7565b9150509295985092959890939650565b5f805f805f8060c08789031215613b20575f80fd5b613b298761364e565b9550602087013567ffffffffffffffff80821115613b45575f80fd5b613b518a838b0161382e565b96506040890135915080821115613b66575f80fd5b613b728a838b016136c7565b9550606089013594506080890135915080821115613b8e575f80fd5b613b9a8a838b016136c7565b935060a0890135915080821115613baf575f80fd5b50613bbc89828a016136c7565b9150509295509295509295565b5f60208284031215613bd9575f80fd5b813567ffffffffffffffff811115613bef575f80fd5b611bd38482850161365e565b5f60208284031215613c0b575f80fd5b81516104d0816138f4565b5f60208284031215613c26575f80fd5b81356104d08161363a565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b803565ffffffffffff81168114613659575f80fd5b5f6001600160a01b0380871683528086166020840152508360408301526080606083015282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ce2575f80fd5b830160208101903567ffffffffffffffff811115613cfe575f80fd5b803603821315613d0c575f80fd5b60606080850152613d2160e085018284613c31565b915050613d3060208501613c78565b65ffffffffffff80821660a086015280613d4c60408801613c78565b1660c086015250508091505095945050505050565b5f60208284031215613d71575f80fd5b8135600381106104d0575f80fd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613db2575f80fd5b83018035915067ffffffffffffffff821115613dcc575f80fd5b6020019150368190038213156136b0575f80fd5b818382375f9101908152919050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613e22575f80fd5b83018035915067ffffffffffffffff821115613e3c575f80fd5b6020019150600581901b36038213156136b0575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112613eb2575f80fd5b9190910192915050565b80820180821115612efa577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f60208284031215613f31575f80fd5b8135600481106104d0575f80fd5b838152604060208201525f611c60604083018486613c31565b5f60208284031215613f68575f80fd5b81517fffffffff00000000000000000000000000000000000000000000000000000000811681146104d0575f80fd5b602081525f611bd3602083018486613c31565b5f81515f5b81811015613fc95760208185018101518683015201613faf565b505f93019283525090919050565b5f611bd3613fe58386613faa565b84613faa565b5f613ff68286613faa565b93845250506020820152604001919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f60a0820190506001600160a01b0380845116835280602085015116602084015280604085015116604084015250606083015160608301526080830151600381106140a7577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b8060808401525092915050565b5f602082840312156140c4575f80fd5b5051919050565b5f80858511156140d9575f80fd5b838611156140e5575f80fd5b5050820193919092039150565b5f805f8060808587031215614105575f80fd5b84356141108161363a565b935060208501356141208161363a565b9250604085013591506060850135614137816138f4565b939692955090935050565b5f805f8060808587031215614155575f80fd5b84356141608161363a565b935060208501356141708161363a565b925060408501356141808161363a565b9396929550929360600135925050565b5f805f805f805f60e0888a0312156141a6575f80fd5b87356141b18161363a565b965060208801356141c18161363a565b955060408801356141d18161363a565b945060608801356141e18161363a565b93506080880135925060a08801356141f88161363a565b8092505060c0880135905092959891949750929550565b5f805f60608486031215614221575f80fd5b833561422c8161363a565b9250602084013561423c8161363a565b929592945050506040919091013590565b5f805f805f60a08688031215614261575f80fd5b853561426c8161363a565b9450602086013561427c8161363a565b9350604086013561428c8161363a565b92506060860135915060808601356142a3816138f4565b809150509295509295909350565b5f60ff8316806142e8577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b8060ff8416069150509291505056fea26469706673582212209be58acada353061a2a202cc7011f3c91393e0f2e305e9202445b042fc4a4ce664736f6c6343000817003360c060405234801561000f575f80fd5b5060405161096338038061096383398101604081905261002e91610060565b6001600160a01b039182166080521660a052610091565b80516001600160a01b038116811461005b575f80fd5b919050565b5f8060408385031215610071575f80fd5b61007a83610045565b915061008860208401610045565b90509250929050565b60805160a05161089e6100c55f395f81816048015281816101f2015261038101525f818160d30152610327015261089e5ff3fe608060405234801561000f575f80fd5b506004361061003f575f3560e01c80636afdd85014610043578063b519d36914610093578063bc1178e6146100a8575b5f80fd5b61006a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100a66100a136600461060a565b6100bb565b005b6100a66100b6366004610648565b61030f565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016811461012b576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060820135156101af57600161014760a08401608085016106dd565b6002811115610158576101586106b0565b036101b3576101af61016d6020840184610702565b61017d6040850160208601610702565b606085018035906101919060408801610702565b73ffffffffffffffffffffffffffffffffffffffff169291906104cc565b5050565b60026101c560a08401608085016106dd565b60028111156101d6576101d66106b0565b036102dd5773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166336c785166102246020850185610702565b6102346040860160208701610702565b606086018035906102489060408901610702565b60405160e086901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff94851660048201529284166024840152908316604483015290911660648201526084015f604051808303815f87803b1580156102c3575f80fd5b505af11580156102d5573d5f803e3d5ffd5b505050505050565b6040517fc79aaa4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016811461037f576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632b67b57086604051806060016040528060405180608001604052808a73ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff16815260200188604001602081019061041d919061071b565b65ffffffffffff16815260200188602001602081019061043d919061071b565b65ffffffffffff1690528152306020820152604090810190610465906060890190890161071b565b65ffffffffffff1690526104798680610740565b6040518563ffffffff1660e01b815260040161049894939291906107a8565b5f604051808303815f87803b1580156104af575f80fd5b505af11580156104c1573d5f803e3d5ffd5b505050505050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610561908590610567565b50505050565b5f8060205f8451602086015f885af180610586576040513d5f823e3d81fd5b50505f513d9150811561059d5780600114156105b7565b73ffffffffffffffffffffffffffffffffffffffff84163b155b15610561576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240160405180910390fd5b5f60a0828403121561061a575f80fd5b50919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610643575f80fd5b919050565b5f805f806080858703121561065b575f80fd5b61066485610620565b935061067260208601610620565b925060408501359150606085013567ffffffffffffffff811115610694575f80fd5b8501606081880312156106a5575f80fd5b939692955090935050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f602082840312156106ed575f80fd5b8135600381106106fb575f80fd5b9392505050565b5f60208284031215610712575f80fd5b6106fb82610620565b5f6020828403121561072b575f80fd5b813565ffffffffffff811681146106fb575f80fd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610773575f80fd5b83018035915067ffffffffffffffff82111561078d575f80fd5b6020019150368190038213156107a1575f80fd5b9250929050565b5f61010073ffffffffffffffffffffffffffffffffffffffff80881684528651818151166020860152816020820151166040860152604081015165ffffffffffff80821660608801528060608401511660808801525050508060208801511660a085015250604086015160c08401528060e08401528381840152506101208385828501375f838501820152601f9093017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910190910194935050505056fea2646970667358221220f3565f6589500276fcbb6fb33d3ee3b534d9566c5b2732fe10a6039b753c3a0764736f6c63430008170033", + "sourceMap": "975:10890:90:-:0;;;2483:234;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3749:13:91;3730:32;;;;3811:93;;;1026:66;3811:93;;;1092:25:169;879:32:91;1133:18:169;;;1126:34;;;;957:14:91;1176:18:169;;;1169:34;1219:18;;;1212:34;;;;3898:4:91;1262:19:169;;;1255:61;1064:19;;3811:93:91;;;-1:-1:-1;;3811:93:91;;;;;;;;;;3801:104;;3811:93;3801:104;;;;3768:137;;1857:1:44;2061:21;;-1:-1:-1;;;;;2585:30:90;;;;2666:4;;2673:8;;2639:43;;;:::i;:::-;-1:-1:-1;;;;;1557:15:169;;;1539:34;;1609:15;;1604:2;1589:18;;1582:43;1489:2;1474:18;2639:43:90;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2621:61:90;;;;;2688:24;;;;;;-1:-1:-1;975:10890:90;;-1:-1:-1;975:10890:90;;;;;;;;;:::o;14:157:169:-;-1:-1:-1;;;;;115:31:169;;105:42;;95:70;;161:1;158;151:12;95:70;14:157;:::o;176:652::-;319:6;327;335;388:2;376:9;367:7;363:23;359:32;356:52;;;404:1;401;394:12;356:52;436:9;430:16;455:57;506:5;455:57;:::i;:::-;581:2;566:18;;560:25;531:5;;-1:-1:-1;594:59:169;560:25;594:59;:::i;:::-;724:2;709:18;;703:25;672:7;;-1:-1:-1;737:59:169;703:25;737:59;:::i;:::-;815:7;805:17;;;176:652;;;;;:::o;1327:304::-;975:10890:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x608060405260043610610126575f3560e01c8063a5cdc8fc116100a1578063c618618111610071578063db58772811610057578063db58772814610379578063e242924e1461038c578063fa5cd56c146103ab575f80fd5b8063c618618114610327578063cba673a71461035a575f80fd5b8063a5cdc8fc146102ab578063a7ab49bc146102ca578063ae80c584146102e9578063b11f126214610308575f80fd5b806351d46815116100f65780636f35d2d2116100dc5780636f35d2d214610246578063875530ff146102795780639935c86814610298575f80fd5b806351d46815146102125780635aa0e95d14610227575f80fd5b80631626ba7e1461013157806329bcdc95146101865780633644e515146101d15780634c9e03d3146101f3575f80fd5b3661012d57005b5f80fd5b34801561013c575f80fd5b5061015061014b366004613595565b6103ca565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b348015610191575f80fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161017d565b3480156101dc575f80fd5b506101e56104d7565b60405190815260200161017d565b3480156101fe575f80fd5b506101e561020d366004613620565b6105c6565b6102256102203660046136d7565b610667565b005b348015610232575f80fd5b506102256102413660046137e1565b6109e8565b348015610251575f80fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610284575f80fd5b506101e5610293366004613620565b610c30565b6102256102a636600461383f565b610c5f565b3480156102b6575f80fd5b506102256102c53660046138dd565b610c7f565b3480156102d5575f80fd5b506102256102e4366004613901565b610c8c565b3480156102f4575f80fd5b5061022561030336600461399d565b611067565b348015610313575f80fd5b506101e56103223660046139f2565b6112eb565b348015610332575f80fd5b506101b97f000000000000000000000000000000000000000000000000000000000000000081565b348015610365575f80fd5b50610225610374366004613a24565b6114ea565b610225610387366004613b0b565b611878565b348015610397575f80fd5b506101e56103a6366004613bc9565b61194c565b3480156103b6575f80fd5b506102256103c5366004613bc9565b611a8e565b5f806103d7858585611b50565b6040517fe75600c30000000000000000000000000000000000000000000000000000000081526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063e75600c390602401602060405180830381865afa158015610459573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061047d9190613bfb565b156104ab577f1626ba7e356f5979dd355a3d2bfb43e80420a480c3b854edce286a82d74968699150506104d0565b507fffffffff0000000000000000000000000000000000000000000000000000000090505b9392505050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146105a157604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f64afec7be651c92f86754beb2bd5eeaf2fa95e83faf4aee989877dde08e4498c918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b5f7f68b8e94dc077458241d6c8d89f0a7665c7cda2cfe70c9eb4437efee1663c66fe6105f56020840184613c16565b836020013584604001358560600135866080013560405160200161064a969594939291909586526001600160a01b0394909416602086015260408501929092526060840152608083015260a082015260c00190565b604051602081830303815290604052805190602001209050919050565b61066f611bdb565b6040517fe75600c30000000000000000000000000000000000000000000000000000000081526001600160a01b038a811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063e75600c390602401602060405180830381865afa1580156106ec573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107109190613bfb565b610746576040517fb331e42100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610200870135881580159061076057506101608801358911155b1561077f5761077c896102008a01356101608b01356001611c1e565b90505b6107b07f00000000000000000000000000000000000000000000000000000000000000008b838b8b8b8b8b8b611c69565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663bc1178e66107ef60c08b0160a08c01613c16565b6108016101408c016101208d01613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526108449291906101608e0135908890600401613c8d565b5f604051808303815f87803b15801561085b575f80fd5b505af115801561086d573d5f803e3d5ffd5b505050506108b4888b838c5f148061088957506101608c01358d115b610893578c61089a565b6101608c01355b898c8c60026108af60408e0160208f01613d61565b611e01565b6108c16040890189613d7f565b6040516108cf929190613de0565b6040519081900390207f0fce007c38c6c8ed9e545b3a148095762738618f8c21b673222613e4d45734b661090960a08b0160808c01613c16565b61091960c08c0160a08d01613c16565b61092b6101408d016101208e01613c16565b61093d6101e08e016101c08f01613c16565b8e158061094e57506101608e01358f115b610958578e61095f565b6101408e01355b6102008f013588146109715787610978565b6101e08f01355b8f60e001602081019061098b9190613c16565b604080516001600160a01b0398891681529688166020880152948716948601949094529185166060850152608084015260a083015290911660c082015260e00160405180910390a2506109dd60018055565b505050505050505050565b5f5b6109f48280613def565b9050811015610b065736610a088380613def565b83818110610a1857610a18613e53565b9050602002810190610a2a9190613e80565b90506001600160a01b03841663a8c4bc95610a486020840184613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610aa2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ac69190613bfb565b15610afd576040517fc99e887200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001016109ea565b505f5b610b166020830183613def565b9050811015610c2b5736610b2d6020840184613def565b83818110610b3d57610b3d613e53565b9050602002810190610b4f9190613e80565b90506001600160a01b03841663a8c4bc95610b6d6020840184613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610bc7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610beb9190613bfb565b15610c22576040517fc99e887200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101610b09565b505050565b5f7fae676bf6913ac2689b7331293c989fe7723124faf8b5d275f06fbcebc77950096105f56020840184613c16565b610c698482612212565b610c78858585856001806122c9565b5050505050565b610c89338261261e565b50565b610cbf6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f5b828110156110535736848483818110610cdc57610cdc613e53565b9050602002810190610cee9190613e80565b9050365f610cff6040840184613d7f565b90925090506001600160a01b038b1663a8c4bc95610d206020860186613c16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610d7a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d9e9190613bfb565b15611045575f8915610ddc576040517f7d617bb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048210610de8575081355b7fc03a9de9000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610e5657610e3d83838d8c6126c4565b86602001818151610e4e9190613ebc565b905250611043565b7f243a4b7f000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610ebc57610eab83838d8c6127da565b86606001818151610e4e9190613ebc565b7f7dc4f458000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610f4757610f1183838d8c61294e565b60a088015260808701819052606087018051610f2e908390613ebc565b90525060a0860151602087018051610e4e908390613ebc565b7f68931b6b000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821601610fab57610f9c83838d8c612bb6565b86518790610e4e908390613ebc565b7f0c9be7e4000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216016110115761100083838d8c612cc0565b86604001818151610e4e9190613ebc565b6040517f0561d8b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050806001019050610cc1565b5061105e8482612e29565b50505050505050565b60036110766020830183613f21565b600381111561108757611087613ef4565b036110ec576001600160a01b0383166110ac836110a76040850185613d7f565b611b50565b6001600160a01b031614610c2b576040517fb81d58e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016110fb6020830183613f21565b600381111561110c5761110c613ef4565b036111a0577f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f908152601c839052603c90206001600160a01b03841661115a826110a76040860186613d7f565b6001600160a01b03161461119a576040517f644ae6c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b60026111af6020830183613f21565b60038111156111c0576111c0613ef4565b036112b9577f1626ba7e000000000000000000000000000000000000000000000000000000006001600160a01b038416631626ba7e846112036040860186613d7f565b6040518463ffffffff1660e01b815260040161122193929190613f3f565b602060405180830381865afa15801561123c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112609190613f58565b7fffffffff000000000000000000000000000000000000000000000000000000001614610c2b576040517f5d52cbe300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f60cd402d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6112f46104d7565b7fd28e809b708f5ee38be8347d6d869d8232493c094ab2dde98369e4102369a99d61131f8480613d7f565b604051602001611330929190613f97565b60405160208183030381529060405280519060200120846020013585604001602081019061135e9190613c16565b60408051602081019590955284019290925260608301526001600160a01b0316608082015260a001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526113c46080850160608601613c16565b6113d460a0860160808701613c16565b6113e460c0870160a08801613c16565b60c087013560e08801356101008901356101208a013561140c6101608c016101408d01613c16565b604080516001600160a01b03998a166020820152978916908801529487166060870152608086019390935260a085019190915260c084015260e083015290911661010082015261012001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526114929291602001613fd7565b6040516020818303038152906040528051906020012060405160200161064a9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6114f2611bdb565b6040517f02cc250d0000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302cc250d90602401602060405180830381865afa15801561156d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115919190613bfb565b6115c7576040517fc139eabd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fe75600c30000000000000000000000000000000000000000000000000000000081526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063e75600c390602401602060405180830381865afa158015611644573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116689190613bfb565b61169e576040517fb331e42100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61020086013587158015906116b857506101608701358811155b156116d7576116d4886102008901356101608a01356001611c1e565b90505b6117087f00000000000000000000000000000000000000000000000000000000000000008a838a8a8a8a8a8a611c69565b611745878a838b158061171f57506101608b01358c115b611729578b611730565b6101608b01355b888b8b60016108af60408d0160208e01613d61565b6117526040880188613d7f565b604051611760929190613de0565b6040519081900390207f0fce007c38c6c8ed9e545b3a148095762738618f8c21b673222613e4d45734b661179a60a08a0160808b01613c16565b6117aa60c08b0160a08c01613c16565b6117bc6101408c016101208d01613c16565b6117ce6101e08d016101c08e01613c16565b8d15806117df57506101608d01358e115b6117e9578d6117f0565b6101408d01355b6102008e013588146118025787611809565b6101e08e01355b8e60e001602081019061181c9190613c16565b604080516001600160a01b0398891681529688166020880152948716948601949094529185166060850152608084015260a083015290911660c082015260e00160405180910390a25061186e60018055565b5050505050505050565b6118828583612212565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663bc1178e66118c16080880160608901613c16565b6118d160a0890160808a01613c16565b8860c00135856040518563ffffffff1660e01b81526004016118f69493929190613c8d565b5f604051808303815f87803b15801561190d575f80fd5b505af115801561191f573d5f803e3d5ffd5b5050505061194486868686600289602001602081019061193f9190613d61565b6122c9565b505050505050565b5f6119556104d7565b7fc994d2ca0375d6d473785e0ce0b1d203f069121bac1314f72c5c0fe601eb39106119836040850185613d7f565b604051602001611994929190613f97565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012060608501356119df60a0870160808801613c16565b6119ef60c0880160a08901613c16565b60c0880135611a056101008a0160e08b01613c16565b60408051602081019890985287019590955260608601939093526001600160a01b039182166080860152811660a085015260c08401919091521660e0820152610100808501359082015261012001604051602081830303815290604052611a6f8461012001610c30565b611a7c856101c0016105c6565b60405160200161149293929190613feb565b6101a0810135611aa8610180830135610160840135613ebc565b611ab29190613ebc565b61014082013514611aef576040517fc04377d300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610240810135611b09610220830135610200840135613ebc565b611b139190613ebc565b6101e082013514610c89576040517f877630be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80611b918585858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250612ed692505050565b90506001600160a01b038116611bd3576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b949350505050565b600260015403611c17576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b5f611c4b611c2b83612f00565b8015611c4657505f8480611c4157611c41614008565b868809115b151590565b611c56868686612f2c565b611c609190613ebc565b95945050505050565b5f611c738761194c565b9050611c80898285611067565b611c9060c0880160a08901613c16565b6001600160a01b0316336001600160a01b031614611cc757611cc2611cbb60c0890160a08a01613c16565b8284611067565b611d0e565b611cd46040830183613d7f565b90505f03611d0e576040517f0e364efc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d2b611d2160c0890160a08a01613c16565b886060013561261e565b8660c00135421115611d69576040517f133df02900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f88118015611d7c575086610100013588105b15611db3576040517f9469744400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611dbc87611a8e565b611dc68a856109e8565b611de78a8a5f8b118015611ddf57506102008a01358b14155b8a8a8a610c8c565b611df589886060013561261e565b50505050505050505050565b611e13611e0e8680613def565b613001565b5f611e286101808b01356101a08c0135613ebc565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808d60a0016020810190611e779190613c16565b6001600160a01b03168152602001306001600160a01b031681526020018d610120015f016020810190611eaa9190613c16565b6001600160a01b03168152602001848152602001866002811115611ed057611ed0613ef4565b8152506040518263ffffffff1660e01b8152600401611eef9190614035565b5f604051808303815f87803b158015611f06575f80fd5b505af1158015611f18573d5f803e3d5ffd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808d60a0016020810190611f699190613c16565b6001600160a01b031681526020018d60e0016020810190611f8a9190613c16565b6001600160a01b031681526020018d610120015f016020810190611fae9190613c16565b6001600160a01b031681526020018a8152602001866002811115611fd457611fd4613ef4565b8152506040518263ffffffff1660e01b8152600401611ff39190614035565b5f604051808303815f87803b15801561200a575f80fd5b505af115801561201c573d5f803e3d5ffd5b5050505061202a8585613001565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808c6001600160a01b031681526020018d60800160208101906120869190613c16565b6001600160a01b031681526020018d6101c0015f0160208101906120aa9190613c16565b6001600160a01b031681526020018b81526020018560028111156120d0576120d0613ef4565b8152506040518263ffffffff1660e01b81526004016120ef9190614035565b5f604051808303815f87803b158015612106575f80fd5b505af1158015612118573d5f803e3d5ffd5b5061212e9250611e0e9150506020880188613def565b5f6121416101408c016101208d01613c16565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561219e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121c291906140b4565b90508015612205576122056121de6101008d0160e08e01613c16565b828d610120015f0160208101906121f59190613c16565b6001600160a01b03169190613139565b5050505050505050505050565b6122226080830160608401613c16565b6001600160a01b0316336001600160a01b0316146122615761225c61224d6080840160608501613c16565b612256846112eb565b83611067565b6122a8565b61226e6040820182613d7f565b90505f036122a8576040517f0e364efc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122c56122bb6080840160608501613c16565b836020013561261e565b5050565b60e085013583158015906122e057508560c0013584105b156122fd576122fa848760e001358860c001356001611c1e565b90505b612309878288886131b9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808960600160208101906123569190613c16565b6001600160a01b031681526020016123766101608b016101408c01613c16565b6001600160a01b0316815260200161239460a08b0160808c01613c16565b6001600160a01b031681526020018715806123b257508960c0013588115b6123bc57876123c2565b8960c001355b81526020018660028111156123d9576123d9613ef4565b8152506040518263ffffffff1660e01b81526004016123f89190614035565b5f604051808303815f87803b15801561240f575f80fd5b505af1158015612421573d5f803e3d5ffd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b519d3696040518060a001604052808a6001600160a01b031681526020018960400160208101906124819190613c16565b6001600160a01b0316815260200161249f60c08b0160a08c01613c16565b6001600160a01b031681526020018481526020018560028111156124c5576124c5613ef4565b8152506040518263ffffffff1660e01b81526004016124e49190614035565b5f604051808303815f87803b1580156124fb575f80fd5b505af115801561250d573d5f803e3d5ffd5b5061251e9250889150819050613d7f565b60405161252c929190613de0565b60405180910390207f0fce007c38c6c8ed9e545b3a148095762738618f8c21b673222613e4d45734b68760400160208101906125689190613c16565b61257860808a0160608b01613c16565b61258860a08b0160808c01613c16565b61259860c08c0160a08d01613c16565b8915806125a857508b60c001358a115b6125b257896125b8565b8b60c001355b878d6101400160208101906125cd9190613c16565b604080516001600160a01b0398891681529688166020880152948716948601949094529185166060850152608084015260a083015290911660c082015260e00160405180910390a250505050505050565b6001600160a01b0382165f9081526020818152604080832084845290915290205460ff1615612679576040517fbc0da7d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b039091165f908152602081815260408083209383529290522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b5f8080806126d5876004818b6140cb565b8101906126e291906140f2565b50919450925090506126fc61014086016101208701613c16565b6001600160a01b0316836001600160a01b031614612746576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316866001600160a01b031614612791576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101a085013581146127cf576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b979650505050505050565b5f808080806127ec886004818c6140cb565b8101906127f99190614142565b929650909450925090506128156101e087016101c08801613c16565b6001600160a01b0316846001600160a01b03161461285f576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600160a01b0316876001600160a01b0316146128aa576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6128ba60a0870160808801613c16565b6001600160a01b0316826001600160a01b031614612904576040517fac6b05f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102408601358114612942576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b98975050505050505050565b5f805f805f805f805f8c8c600490809261296a939291906140cb565b8101906129779190614190565b959c50939a50919850965094509250905061299a6101e08b016101c08c01613c16565b6001600160a01b0316876001600160a01b0316146129e4576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b856001600160a01b03168b6001600160a01b031614612a2f576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385163014612a71576040517f8154374b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a8160a08b0160808c01613c16565b6001600160a01b0316846001600160a01b031614612acb576040517fac6b05f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102408a01358314612b09576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b1b6101408b016101208c01613c16565b6001600160a01b0316826001600160a01b031614612b65576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101a08a01358114612ba3576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919c919b50909950505050505050505050565b5f808080612bc7876004818b6140cb565b810190612bd4919061420f565b91945092509050612bed61014086016101208701613c16565b6001600160a01b0316836001600160a01b031614612c37576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316866001600160a01b031614612c82576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61018085013581146127cf576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80808080612cd2886004818c6140cb565b810190612cdf919061424d565b5092965090945092509050612cfc6101e087016101c08801613c16565b6001600160a01b0316846001600160a01b031614612d46576040517fc891add200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600160a01b0316876001600160a01b031614612d91576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612da160a0870160808801613c16565b6001600160a01b0316826001600160a01b031614612deb576040517fac6b05f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102208601358114612942576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051610180830135141580612e47575060208101516101a083013514155b15612e7e576040517f4a55da2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040810151610220830135141580612e9f5750606081015161024083013514155b156122c5576040517f77a5920300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805f80612ee4868661325c565b925092509250612ef482826132a5565b50909150505b92915050565b5f6002826003811115612f1557612f15613ef4565b612f1f91906142b1565b60ff166001149050919050565b5f838302817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85870982811083820303915050805f03612f7f57838281612f7557612f75614008565b04925050506104d0565b808411612f9657612f9660038515026011186133ad565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b5f5b81811015610c2b573683838381811061301e5761301e613e53565b90506020028101906130309190613e80565b90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166130696020830183613c16565b6001600160a01b0316036130a9576040517f79a1bff000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6130b2816133be565b6130bf6020820182613c16565b6001600160a01b03167fed99827efb37016f2275f98c4bcf71c7551c75d59e9b450f79fa32e60be672c282602001356130f784613401565b604080519283527fffffffff0000000000000000000000000000000000000000000000000000000090911660208301520160405180910390a250600101613003565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610c2b90849061342a565b5f831180156131cc575081610100013583105b15613203576040517f9469744400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61321084612256846112eb565b61321e84836020013561261e565b428261012001351161119a576040517fc56873ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805f8351604103613293576020840151604085015160608601515f1a613285888285856134af565b95509550955050505061329e565b505081515f91506002905b9250925092565b5f8260038111156132b8576132b8613ef4565b036132c1575050565b60018260038111156132d5576132d5613ef4565b0361330c576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282600381111561332057613320613ef4565b0361335f576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024015b60405180910390fd5b600382600381111561337357613373613ef4565b036122c5576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401613356565b634e487b715f52806020526024601cfd5b5f6133cc6020830183613c16565b90506020820135365f6133e26040860186613d7f565b91509150604051818382375f80838387895af1611944573d5f803e3d5ffd5b5f36816134116040850185613d7f565b90925090506004811061342357813592505b5050919050565b5f8060205f8451602086015f885af180613449576040513d5f823e3d81fd5b50505f513d9150811561346057806001141561346d565b6001600160a01b0384163b155b1561119a576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401613356565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156134e857505f9150600390508261358b565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613539573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b03811661358257505f92506001915082905061358b565b92505f91508190505b9450945094915050565b5f805f604084860312156135a7575f80fd5b83359250602084013567ffffffffffffffff808211156135c5575f80fd5b818601915086601f8301126135d8575f80fd5b8135818111156135e6575f80fd5b8760208285010111156135f7575f80fd5b6020830194508093505050509250925092565b5f60a0828403121561361a575f80fd5b50919050565b5f60a08284031215613630575f80fd5b6104d0838361360a565b6001600160a01b0381168114610c89575f80fd5b80356136598161363a565b919050565b5f610260828403121561361a575f80fd5b5f8083601f84011261367f575f80fd5b50813567ffffffffffffffff811115613696575f80fd5b6020830191508360208260051b85010111156136b0575f80fd5b9250929050565b5f6040828403121561361a575f80fd5b5f6060828403121561361a575f80fd5b5f805f805f805f805f6101008a8c0312156136f0575f80fd5b6136f98a61364e565b985060208a0135975060408a013567ffffffffffffffff8082111561371c575f80fd5b6137288d838e0161365e565b985060608c013591508082111561373d575f80fd5b6137498d838e0161366f565b909850965060808c0135915080821115613761575f80fd5b61376d8d838e016136b7565b955060a08c0135915080821115613782575f80fd5b61378e8d838e016136c7565b945060c08c01359150808211156137a3575f80fd5b6137af8d838e016136c7565b935060e08c01359150808211156137c4575f80fd5b506137d18c828d016136c7565b9150509295985092959850929598565b5f80604083850312156137f2575f80fd5b82356137fd8161363a565b9150602083013567ffffffffffffffff811115613818575f80fd5b613824858286016136b7565b9150509250929050565b5f610160828403121561361a575f80fd5b5f805f805f60a08688031215613853575f80fd5b853561385e8161363a565b9450602086013567ffffffffffffffff8082111561387a575f80fd5b61388689838a0161382e565b9550604088013591508082111561389b575f80fd5b6138a789838a016136c7565b94506060880135935060808801359150808211156138c3575f80fd5b506138d0888289016136c7565b9150509295509295909350565b5f602082840312156138ed575f80fd5b5035919050565b8015158114610c89575f80fd5b5f805f805f8060a08789031215613916575f80fd5b86356139218161363a565b955060208701356139318161363a565b94506040870135613941816138f4565b9350606087013567ffffffffffffffff8082111561395d575f80fd5b6139698a838b0161365e565b9450608089013591508082111561397e575f80fd5b5061398b89828a0161366f565b979a9699509497509295939492505050565b5f805f606084860312156139af575f80fd5b83356139ba8161363a565b925060208401359150604084013567ffffffffffffffff8111156139dc575f80fd5b6139e8868287016136c7565b9150509250925092565b5f60208284031215613a02575f80fd5b813567ffffffffffffffff811115613a18575f80fd5b611bd38482850161382e565b5f805f805f805f8060e0898b031215613a3b575f80fd5b613a448961364e565b975060208901359650604089013567ffffffffffffffff80821115613a67575f80fd5b613a738c838d0161365e565b975060608b0135915080821115613a88575f80fd5b613a948c838d0161366f565b909750955060808b0135915080821115613aac575f80fd5b613ab88c838d016136b7565b945060a08b0135915080821115613acd575f80fd5b613ad98c838d016136c7565b935060c08b0135915080821115613aee575f80fd5b50613afb8b828c016136c7565b9150509295985092959890939650565b5f805f805f8060c08789031215613b20575f80fd5b613b298761364e565b9550602087013567ffffffffffffffff80821115613b45575f80fd5b613b518a838b0161382e565b96506040890135915080821115613b66575f80fd5b613b728a838b016136c7565b9550606089013594506080890135915080821115613b8e575f80fd5b613b9a8a838b016136c7565b935060a0890135915080821115613baf575f80fd5b50613bbc89828a016136c7565b9150509295509295509295565b5f60208284031215613bd9575f80fd5b813567ffffffffffffffff811115613bef575f80fd5b611bd38482850161365e565b5f60208284031215613c0b575f80fd5b81516104d0816138f4565b5f60208284031215613c26575f80fd5b81356104d08161363a565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b803565ffffffffffff81168114613659575f80fd5b5f6001600160a01b0380871683528086166020840152508360408301526080606083015282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ce2575f80fd5b830160208101903567ffffffffffffffff811115613cfe575f80fd5b803603821315613d0c575f80fd5b60606080850152613d2160e085018284613c31565b915050613d3060208501613c78565b65ffffffffffff80821660a086015280613d4c60408801613c78565b1660c086015250508091505095945050505050565b5f60208284031215613d71575f80fd5b8135600381106104d0575f80fd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613db2575f80fd5b83018035915067ffffffffffffffff821115613dcc575f80fd5b6020019150368190038213156136b0575f80fd5b818382375f9101908152919050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613e22575f80fd5b83018035915067ffffffffffffffff821115613e3c575f80fd5b6020019150600581901b36038213156136b0575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112613eb2575f80fd5b9190910192915050565b80820180821115612efa577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f60208284031215613f31575f80fd5b8135600481106104d0575f80fd5b838152604060208201525f611c60604083018486613c31565b5f60208284031215613f68575f80fd5b81517fffffffff00000000000000000000000000000000000000000000000000000000811681146104d0575f80fd5b602081525f611bd3602083018486613c31565b5f81515f5b81811015613fc95760208185018101518683015201613faf565b505f93019283525090919050565b5f611bd3613fe58386613faa565b84613faa565b5f613ff68286613faa565b93845250506020820152604001919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f60a0820190506001600160a01b0380845116835280602085015116602084015280604085015116604084015250606083015160608301526080830151600381106140a7577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b8060808401525092915050565b5f602082840312156140c4575f80fd5b5051919050565b5f80858511156140d9575f80fd5b838611156140e5575f80fd5b5050820193919092039150565b5f805f8060808587031215614105575f80fd5b84356141108161363a565b935060208501356141208161363a565b9250604085013591506060850135614137816138f4565b939692955090935050565b5f805f8060808587031215614155575f80fd5b84356141608161363a565b935060208501356141708161363a565b925060408501356141808161363a565b9396929550929360600135925050565b5f805f805f805f60e0888a0312156141a6575f80fd5b87356141b18161363a565b965060208801356141c18161363a565b955060408801356141d18161363a565b945060608801356141e18161363a565b93506080880135925060a08801356141f88161363a565b8092505060c0880135905092959891949750929550565b5f805f60608486031215614221575f80fd5b833561422c8161363a565b9250602084013561423c8161363a565b929592945050506040919091013590565b5f805f805f60a08688031215614261575f80fd5b853561426c8161363a565b9450602086013561427c8161363a565b9350604086013561428c8161363a565b92506060860135915060808601356142a3816138f4565b809150509295509295909350565b5f60ff8316806142e8577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b8060ff8416069150509291505056fea26469706673582212209be58acada353061a2a202cc7011f3c91393e0f2e305e9202445b042fc4a4ce664736f6c63430008170033", + "sourceMap": "975:10890:90:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7809:308;;;;;;;;;;-1:-1:-1;7809:308:90;;;;;:::i;:::-;;:::i;:::-;;;852:66:169;840:79;;;822:98;;810:2;795:18;7809:308:90;;;;;;;;1318:57;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1120:55:169;;;1102:74;;1090:2;1075:18;1318:57:90;931:251:169;6790:255:91;;;;;;;;;;;;;:::i;:::-;;;1333:25:169;;;1321:2;1306:18;6790:255:91;1187:177:169;5478:391:91;;;;;;;;;;-1:-1:-1;5478:391:91;;;;;:::i;:::-;;:::i;5859:1907:90:-;;;;;;:::i;:::-;;:::i;:::-;;14436:563:91;;;;;;;;;;-1:-1:-1;14436:563:91;;;;;:::i;:::-;;:::i;1440:48:90:-;;;;;;;;;;;;;;;5092:382:91;;;;;;;;;;-1:-1:-1;5092:382:91;;;;;:::i;:::-;;:::i;4627:523:90:-;;;;;;:::i;:::-;;:::i;4091:109:91:-;;;;;;;;;;-1:-1:-1;4091:109:91;;;;;:::i;:::-;;:::i;7272:1606::-;;;;;;;;;;-1:-1:-1;7272:1606:91;;;;;:::i;:::-;;:::i;15182:1005::-;;;;;;;;;;-1:-1:-1;15182:1005:91;;;;;:::i;:::-;;:::i;6025:761::-;;;;;;;;;;-1:-1:-1;6025:761:91;;;;;:::i;:::-;;:::i;1196:64:90:-;;;;;;;;;;;;;;;2894:1690;;;;;;;;;;-1:-1:-1;2894:1690:90;;;;;:::i;:::-;;:::i;5154:701::-;;;;;;:::i;:::-;;:::i;4336:752:91:-;;;;;;;;;;-1:-1:-1;4336:752:91;;;;;:::i;:::-;;:::i;13818:485::-;;;;;;;;;;-1:-1:-1;13818:485:91;;;;;:::i;:::-;;:::i;7809:308:90:-;7909:6;7923:23;7949:35;7966:5;7973:10;;7949:16;:35::i;:::-;7994:38;;;;;-1:-1:-1;;;;;1120:55:169;;;7994:38:90;;;1102:74:169;7923:61:90;;-1:-1:-1;7994:13:90;:21;;;;;;1075:18:169;;7994:38:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;7990:123;;;1905:44:91;8042:26:90;;;;;7990:123;-1:-1:-1;8089:17:90;;-1:-1:-1;7809:308:90;;;;;;:::o;6790:255:91:-;6839:7;6878:16;6861:13;:33;:179;;6946:93;;;1026:66;6946:93;;;13746:25:169;879:32:91;13787:18:169;;;13780:34;;;;957:14:91;13830:18:169;;;13823:34;7010:13:91;13873:18:169;;;13866:34;7033:4:91;13916:19:169;;;13909:84;13718:19;;6946:93:91;;;;;;;;;;;;6936:104;;;;;;6854:186;;6790:255;:::o;6861:179::-;-1:-1:-1;6903:24:91;;6790:255::o;5478:391::-;5597:7;2314:68;5694:20;;;;:15;:20;:::i;:::-;5724:15;:22;;;5756:15;:24;;;5790:15;:26;;;5826:15;:24;;;5636:222;;;;;;;;;;;;14543:25:169;;;-1:-1:-1;;;;;14604:55:169;;;;14599:2;14584:18;;14577:83;14691:2;14676:18;;14669:34;;;;14734:2;14719:18;;14712:34;14777:3;14762:19;;14755:35;14821:3;14806:19;;14799:35;14530:3;14515:19;;14256:584;5636:222:91;;;;;;;;;;;;;5619:245;;;;;;5612:252;;5478:391;;;:::o;5859:1907:90:-;2500:21:44;:19;:21::i;:::-;6282:30:90::1;::::0;;;;-1:-1:-1;;;;;1120:55:169;;;6282:30:90::1;::::0;::::1;1102:74:169::0;6282:13:90::1;:21;::::0;::::1;::::0;1075:18:169;;6282:30:90::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6277:54;;6321:10;;;;;;;;;;;;;;6277:54;6366:30:::0;;;::::1;6406:22:::0;;;;;:80:::1;;-1:-1:-1::0;6454:32:90;;;::::1;6432:54:::0;::::1;;6406:80;6402:254;;;6516:133;6537:18:::0;6557:30;;;::::1;6589:32:::0;;;::::1;6623:18;6516:11;:133::i;:::-;6496:153;;6402:254;6662:130;6683:10;6695:7;6704:17;6723:6;6731:13;;6746:6;6754:15;6771;6662:13;:130::i;:::-;-1:-1:-1::0;;;;;6799:15:90::1;:28;;6835:22;::::0;;;::::1;::::0;::::1;;:::i;:::-;6859:25;::::0;;;:20:::1;::::0;::::1;:25;:::i;:::-;6886:32;6799:143:::0;;::::1;::::0;;;;;;::::1;::::0;;;6886:32;;;::::1;::::0;6920:16;;6799:143:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;6949:357;6970:6;6984:7;6999:17;7024:18;7046:1;7024:23;:80;;;-1:-1:-1::0;7072:32:90;;;::::1;7051:53:::0;::::1;7024:80;:152;;7158:18;7024:152;;;7115:32:::0;;;::::1;7024:152;7184:6:::0;7198:13;;7219:42:::1;7269:31;::::0;;;::::1;::::0;::::1;;:::i;:::-;6949:13;:357::i;:::-;7336:12;;::::0;::::1;:6:::0;:12:::1;:::i;:::-;7318:443;;;;;;;:::i;:::-;;::::0;;;;::::1;::::0;;::::1;7356:13;::::0;;;::::1;::::0;::::1;;:::i;:::-;7377:22;::::0;;;::::1;::::0;::::1;;:::i;:::-;7407:25;::::0;;;:20:::1;::::0;::::1;:25;:::i;:::-;7440:26;::::0;;;:21:::1;::::0;::::1;:26;:::i;:::-;7474:23:::0;;;:80:::1;;-1:-1:-1::0;7522:32:90;;;::::1;7501:53:::0;::::1;7474:80;:147;;7603:18;7474:147;;;7565:27:::0;;;::::1;7474:147;7650:30:::0;;;::::1;7629:51:::0;::::1;:102;;7714:17;7629:102;;;7683:28:::0;;;::::1;7629:102;7739:6;:16;;;;;;;;;;:::i;:::-;7318:443;::::0;;-1:-1:-1;;;;;18257:15:169;;;18239:34;;18309:15;;;18304:2;18289:18;;18282:43;18361:15;;;18341:18;;;18334:43;;;;18413:15;;;18408:2;18393:18;;18386:43;18460:3;18445:19;;18438:35;18504:3;18489:19;;18482:35;18554:15;;;18548:3;18533:19;;18526:44;18165:3;18150:19;7318:443:90::1;;;;;;;6271:1495;2542:20:44::0;1857:1;3068:21;;2888:208;2542:20;5859:1907:90;;;;;;;;;:::o;14436:563:91:-;14546:9;14541:225;14561:19;:6;;:19;:::i;:::-;:26;;14557:1;:30;14541:225;;;14602:34;14639:19;:6;;:19;:::i;:::-;14659:1;14639:22;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;14602:59;-1:-1:-1;;;;;;14674:25:91;;;14700:11;;;;14602:59;14700:11;:::i;:::-;14674:38;;;;;;;;;;-1:-1:-1;;;;;1120:55:169;;;14674:38:91;;;1102:74:169;1075:18;;14674:38:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;14670:90;;;14731:20;;;;;;;;;;;;;;14670:90;-1:-1:-1;14589:3:91;;14541:225;;;;14777:9;14772:223;14792:18;;;;:6;:18;:::i;:::-;:25;;14788:1;:29;14772:223;;;14832:34;14869:18;;;;:6;:18;:::i;:::-;14888:1;14869:21;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;14832:58;-1:-1:-1;;;;;;14903:25:91;;;14929:11;;;;14832:58;14929:11;:::i;:::-;14903:38;;;;;;;;;;-1:-1:-1;;;;;1120:55:169;;;14903:38:91;;;1102:74:169;1075:18;;14903:38:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;14899:90;;;14960:20;;;;;;;;;;;;;;14899:90;-1:-1:-1;14819:3:91;;14772:223;;;;14436:563;;:::o;5092:382::-;5208:7;2182:67;5304:19;;;;:14;:19;:::i;4627:523:90:-;4876:62;4914:6;4922:15;4876:37;:62::i;:::-;4944:201;4971:7;4986:6;5000:15;5023:18;5049:41;5098;4944:19;:201::i;:::-;4627:523;;;;;:::o;4091:109:91:-;4155:40;4177:10;4189:5;4155:21;:40::i;:::-;4091:109;:::o;7272:1606::-;7498:27;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7498:27:91;7537:9;7532:1297;7548:24;;;7532:1297;;;7587:41;7631:13;;7645:1;7631:16;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;7587:60;-1:-1:-1;7655:23:91;;7681:20;;;;7587:60;7681:20;:::i;:::-;7655:46;;-1:-1:-1;7655:46:91;-1:-1:-1;;;;;;7714:25:91;;;7740:18;;;;:11;:18;:::i;:::-;7714:45;;;;;;;;;;-1:-1:-1;;;;;1120:55:169;;;7714:45:91;;;1102:74:169;1075:18;;7714:45:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;7710:1113;;;7771:10;7796:14;7792:52;;;7819:25;;;;;;;;;;;;;;7792:52;7878:1;7859:20;;7855:119;;-1:-1:-1;7923:29:91;;7855:119;7988:33;;;;;7984:831;;8049:45;8068:8;;8078:7;8087:6;8049:18;:45::i;:::-;8035:1;:10;;:59;;;;;;;:::i;:::-;;;-1:-1:-1;7984:831:91;;;8115:33;;;;;8111:704;;8176:45;8195:8;;8205:7;8214:6;8176:18;:45::i;:::-;8162:1;:10;;:59;;;;;;;:::i;8111:704::-;8242:39;;;;;8238:577;;8340:50;8364:8;;8374:7;8383:6;8340:23;:50::i;:::-;8317:19;;;8295:95;8296:19;;;8295:95;;;8402:10;;;:33;;;;8295:95;;8402:33;:::i;:::-;;;-1:-1:-1;8461:19:91;;;;8447:10;;;:33;;;;8461:19;;8447:33;:::i;8238:577::-;8501:32;;;;;8497:318;;8560:44;8578:8;;8588:7;8597:6;8560:17;:44::i;:::-;8547:57;;:1;;:57;;;;;:::i;8497:318::-;8625:35;;;;;8621:194;;8690:47;8711:8;;8721:7;8730:6;8690:20;:47::i;:::-;8674:1;:12;;:63;;;;;;;:::i;8621:194::-;8773:31;;;;;;;;;;;;;;8621:194;7761:1062;7710:1113;7579:1250;;;7574:3;;;;;7532:1297;;;;8835:38;8863:6;8871:1;8835:27;:38::i;:::-;7492:1386;7272:1606;;;;;;:::o;15182:1005::-;15364:21;15336:24;;;;:10;:24;:::i;:::-;:49;;;;;;;;:::i;:::-;;15332:851;;-1:-1:-1;;;;;15399:72:91;;:50;15416:5;15423:25;;;;:10;:25;:::i;:::-;15399:16;:50::i;:::-;-1:-1:-1;;;;;15399:72:91;;15395:128;;15490:24;;;;;;;;;;;;;;15332:851;15567:22;15539:24;;;;:10;:24;:::i;:::-;:50;;;;;;;;:::i;:::-;;15535:648;;15655:20;15599:19;15645:31;;;15692:2;15685:17;;;15739:2;15726:16;;-1:-1:-1;;;;;15761:78:91;;:56;15726:16;15791:25;;;;:10;:25;:::i;15761:56::-;-1:-1:-1;;;;;15761:78:91;;15757:135;;15858:25;;;;;;;;;;;;;;15757:135;15591:307;14772:223;14436:563;;:::o;15535:648::-;15936:22;15908:24;;;;:10;:24;:::i;:::-;:50;;;;;;;;:::i;:::-;;15904:279;;15972:102;-1:-1:-1;;;;;15972:45:91;;;16018:5;16025:25;;;;:10;:25;:::i;:::-;15972:79;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:102;;;15968:159;;16093:25;;;;;;;;;;;;;;15904:279;16154:22;;;;;;;;;;;;;;6025:761;6124:7;6209:18;:16;:18::i;:::-;2011:107;6381:12;:6;;:12;:::i;:::-;6370:24;;;;;;;;;:::i;:::-;;;;;;;;;;;;;6360:35;;;;;;6397:6;:12;;;6411:6;:13;;;;;;;;;;:::i;:::-;6323:102;;;;;;22262:25:169;;;;22303:18;;22296:34;;;;22346:18;;;22339:34;-1:-1:-1;;;;;22409:55:169;22389:18;;;22382:83;22234:19;;6323:102:91;;;;;;;;;;;;;6465:22;;;;;;;;:::i;:::-;6503:16;;;;;;;;:::i;:::-;6535:17;;;;;;;;:::i;:::-;6568:22;;;;6606:23;;;;6645:20;;;;6681:18;;;;6715:16;;;;;;;;:::i;:::-;6439:306;;;-1:-1:-1;;;;;22898:15:169;;;6439:306:91;;;22880:34:169;22950:15;;;22930:18;;;22923:43;23002:15;;;22982:18;;;22975:43;23034:18;;;23027:34;;;;23077:19;;;23070:35;;;;23121:19;;;23114:35;23165:19;;;23158:35;23230:15;;;23209:19;;;23202:44;22791:19;;6439:306:91;;;;;;;;;;;;;;6258:499;;;6439:306;6258:499;;:::i;:::-;;;;;;;;;;;;;6237:530;;;;;;6163:612;;;;;;;;24120:66:169;24108:79;;24212:1;24203:11;;24196:27;;;;24248:2;24239:12;;24232:28;24285:2;24276:12;;23850:444;2894:1690:90;2500:21:44;:19;:21::i;:::-;2266:34:90::1;::::0;;;;2289:10:::1;2266:34;::::0;::::1;1102:74:169::0;2266:13:90::1;-1:-1:-1::0;;;;;2266:22:90::1;::::0;::::1;::::0;1075:18:169;;2266:34:90::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2261:59;;2309:11;;;;;;;;;;;;;;2261:59;3251:30:::2;::::0;;;;-1:-1:-1;;;;;1120:55:169;;;3251:30:90::2;::::0;::::2;1102:74:169::0;3251:13:90::2;:21;::::0;::::2;::::0;1075:18:169;;3251:30:90::2;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3246:54;;3290:10;;;;;;;;;;;;;;3246:54;3335:30:::0;;;::::2;3375:22:::0;;;;;:80:::2;;-1:-1:-1::0;3423:32:90;;;::::2;3401:54:::0;::::2;;3375:80;3371:254;;;3485:133;3506:18:::0;3526:30;;;::::2;3558:32:::0;;;::::2;3592:18;3485:11;:133::i;:::-;3465:153;;3371:254;3631:130;3652:10;3664:7;3673:17;3692:6;3700:13;;3715:6;3723:15;3740;3631:13;:130::i;:::-;3768:356;3789:6:::0;3803:7;3818:17;3843:23;;;:80:::2;;-1:-1:-1::0;3891:32:90;;;::::2;3870:53:::0;::::2;3843:80;:152;;3977:18;3843:152;;;3934:32:::0;;;::::2;3843:152;4003:6:::0;4017:13;;4038:41:::2;4087:31;::::0;;;::::2;::::0;::::2;;:::i;3768:356::-;4154:12;;::::0;::::2;:6:::0;:12:::2;:::i;:::-;4136:443;;;;;;;:::i;:::-;;::::0;;;;::::2;::::0;;::::2;4174:13;::::0;;;::::2;::::0;::::2;;:::i;:::-;4195:22;::::0;;;::::2;::::0;::::2;;:::i;:::-;4225:25;::::0;;;:20:::2;::::0;::::2;:25;:::i;:::-;4258:26;::::0;;;:21:::2;::::0;::::2;:26;:::i;:::-;4292:23:::0;;;:80:::2;;-1:-1:-1::0;4340:32:90;;;::::2;4319:53:::0;::::2;4292:80;:147;;4421:18;4292:147;;;4383:27:::0;;;::::2;4292:147;4468:30:::0;;;::::2;4447:51:::0;::::2;:102;;4532:17;4447:102;;;4501:28:::0;;;::::2;4447:102;4557:6;:16;;;;;;;;;;:::i;:::-;4136:443;::::0;;-1:-1:-1;;;;;18257:15:169;;;18239:34;;18309:15;;;18304:2;18289:18;;18282:43;18361:15;;;18341:18;;;18334:43;;;;18413:15;;;18408:2;18393:18;;18386:43;18460:3;18445:19;;18438:35;18504:3;18489:19;;18482:35;18554:15;;;18548:3;18533:19;;18526:44;18165:3;18150:19;4136:443:90::2;;;;;;;3240:1344;2542:20:44::0;1857:1;3068:21;;2888:208;2542:20;2894:1690:90;;;;;;;;:::o;5154:701::-;5472:62;5510:6;5518:15;5472:37;:62::i;:::-;-1:-1:-1;;;;;5540:15:90;:28;;5569:22;;;;;;;;:::i;:::-;5593:16;;;;;;;;:::i;:::-;5611:6;:22;;;5635:16;5540:112;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5658:192;5685:7;5700:6;5714:15;5737:18;5763:42;5813:15;:31;;;;;;;;;;:::i;:::-;5658:19;:192::i;:::-;5154:701;;;;;;:::o;4336:752:91:-;4428:7;4513:18;:16;:18::i;:::-;2439:220;4714:12;;;;:6;:12;:::i;:::-;4703:24;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;4693:35;;4703:24;4693:35;;;;4744:12;;;;4772:13;;;;;;;;:::i;:::-;4801:22;;;;;;;;:::i;:::-;4839:18;;;;4873:16;;;;;;;;:::i;:::-;4627:312;;;;;;24642:25:169;;;;24683:18;;24676:34;;;;24726:18;;;24719:34;;;;-1:-1:-1;;;;;24850:15:169;;;24830:18;;;24823:43;24903:15;;24882:19;;;24875:44;24935:19;;;24928:35;;;;25000:15;24979:19;;;24972:44;4905:20:91;;;;;25032:19:169;;;25025:35;24614:19;;4627:312:91;;;;;;;;;;;;4953:39;4971:6;:20;;4953:17;:39::i;:::-;5006:41;5025:6;:21;;5006:18;:41::i;:::-;4562:497;;;;;;;;;;:::i;13818:485::-;14034:29;;;;13968:63;14003:28;;;;13968:32;;;;:63;:::i;:::-;:95;;;;:::i;:::-;13929:27;;;;:134;13918:184;;14077:25;;;;;;;;;;;;;;13918:184;14228:30;;;;14160:65;14193:32;;;;14160:30;;;;:65;:::i;:::-;:98;;;;:::i;:::-;14120:28;;;;:138;14109:189;;14272:26;;;;;;;;;;;;;;16423:233;16514:7;16529:14;16546:32;16560:5;16567:10;;16546:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;16546:13:91;;-1:-1:-1;;;16546:32:91:i;:::-;16529:49;-1:-1:-1;;;;;;16588:20:91;;16584:48;;16617:15;;;;;;;;;;;;;;16584:48;16645:6;16423:233;-1:-1:-1;;;;16423:233:91:o;2575:307:44:-;1899:1;2702:7;;:18;2698:86;;2743:30;;;;;;;;;;;;;;2698:86;1899:1;2858:7;:17;2575:307::o;9351:238:48:-;9452:7;9506:76;9522:26;9539:8;9522:16;:26::i;:::-;:59;;;;;9580:1;9565:11;9552:25;;;;;:::i;:::-;9562:1;9559;9552:25;:29;9522:59;34914:9:49;34907:17;;34795:145;9506:76:48;9478:25;9485:1;9488;9491:11;9478:6;:25::i;:::-;:104;;;;:::i;:::-;9471:111;9351:238;-1:-1:-1;;;;;9351:238:48:o;17073:1250:91:-;17445:17;17465;17475:6;17465:9;:17::i;:::-;17445:37;;17488:54;17506:7;17515:9;17526:15;17488:17;:54::i;:::-;17567:22;;;;;;;;:::i;:::-;-1:-1:-1;;;;;17553:36:91;:10;-1:-1:-1;;;;;17553:36:91;;17549:223;;17599:69;17617:22;;;;;;;;:::i;:::-;17641:9;17652:15;17599:17;:69::i;:::-;17549:223;;;17693:30;;;;:15;:30;:::i;:::-;:37;;17734:1;17693:42;17689:76;;17744:21;;;;;;;;;;;;;;17689:76;17777:59;17799:22;;;;;;;;:::i;:::-;17823:6;:12;;;17777:21;:59::i;:::-;17865:6;:18;;;17847:15;:36;17843:69;;;17892:20;;;;;;;;;;;;;;17843:69;17939:1;17922:14;:18;:61;;;;;17962:6;:20;;;17945:14;:37;17922:61;17918:93;;;17992:19;;;;;;;;;;;;;;17918:93;18018:28;18039:6;18018:20;:28::i;:::-;18053:34;18067:11;18080:6;18053:13;:34::i;:::-;18094:173;18122:11;18141:7;18173:1;18156:14;:18;:70;;;;-1:-1:-1;18196:30:91;;;;18178:48;;;18156:70;18234:6;18248:13;;18094:20;:173::i;:::-;18274:44;18296:7;18305:6;:12;;;18274:21;:44::i;:::-;17439:884;17073:1250;;;;;;;;;:::o;8812:1368:90:-;9164:40;9184:19;:6;;:19;:::i;:::-;9164;:40::i;:::-;9211:23;9237:60;9269:28;;;;9237:29;;;;:60;:::i;:::-;9211:86;;9304:15;-1:-1:-1;;;;;9304:30:90;;9342:150;;;;;;;;9380:6;:22;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9342:150:90;;;;;9412:4;-1:-1:-1;;;;;9342:150:90;;;;;9419:6;:20;;:25;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9342:150:90;;;;;9446:15;9342:150;;;;9463:21;9342:150;;;;;;;;:::i;:::-;;;;9304:194;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9505:15;-1:-1:-1;;;;;9505:30:90;;9543:155;;;;;;;;9581:6;:22;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9543:155:90;;;;;9605:6;:16;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9543:155:90;;;;;9623:6;:20;;:25;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9543:155:90;;;;;9650:17;9543:155;;;;9669:21;9543:155;;;;;;;;:::i;:::-;;;;9505:199;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9711:34;9731:13;;9711:19;:34::i;:::-;9752:15;-1:-1:-1;;;;;9752:30:90;;9790:138;;;;;;;;9828:7;-1:-1:-1;;;;;9790:138:90;;;;;9837:6;:13;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9790:138:90;;;;;9852:6;:21;;:26;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;9790:138:90;;;;;9880:17;9790:138;;;;9899:21;9790:138;;;;;;;;:::i;:::-;;;;9752:182;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9941:39:90;;-1:-1:-1;9961:18:90;;-1:-1:-1;;9961:18:90;;;:6;:18;:::i;9941:39::-;9987:15;10012:25;;;;:20;;;:25;:::i;:::-;10005:58;;;;;10057:4;10005:58;;;1102:74:169;-1:-1:-1;;;;;10005:43:90;;;;;;;1075:18:169;;10005:58:90;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;9987:76;-1:-1:-1;10074:12:90;;10070:106;;10096:73;10143:16;;;;;;;;:::i;:::-;10161:7;10103:6;:20;;:25;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;10096:46:90;;:73;:46;:73::i;:::-;9158:1022;;8812:1368;;;;;;;;;:::o;18485:482:91:-;18673:22;;;;;;;;:::i;:::-;-1:-1:-1;;;;;18659:36:91;:10;-1:-1:-1;;;;;18659:36:91;;18655:237;;18705:83;18723:22;;;;;;;;:::i;:::-;18747:23;18763:6;18747:15;:23::i;:::-;18772:15;18705:17;:83::i;:::-;18655:237;;;18813:30;;;;:15;:30;:::i;:::-;:37;;18854:1;18813:42;18809:76;;18864:21;;;;;;;;;;;;;;18809:76;18897:65;18925:22;;;;;;;;:::i;:::-;18949:6;:12;;;18897:27;:65::i;:::-;18485:482;;:::o;10379:1484:90:-;10694:23;;;;10727;;;;;:70;;;10775:6;:22;;;10754:18;:43;10727:70;10723:216;;;10832:100;10844:18;10864:6;:23;;;10889:6;:22;;;10913:18;10832:11;:100::i;:::-;10807:125;;10723:216;10945:70;10966:7;10975:14;10991:6;10999:15;10945:20;:70::i;:::-;11022:15;-1:-1:-1;;;;;11022:30:90;;11060:297;;;;;;;;11098:6;:22;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11060:297:90;;;;;11130:16;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11060:297:90;;;;;11156:16;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11060:297:90;;;;;11182:23;;;:70;;;11230:6;:22;;;11209:18;:43;11182:70;:136;;11300:18;11182:136;;;11265:6;:22;;;11182:136;11060:297;;;;11328:21;11060:297;;;;;;;;:::i;:::-;;;;11022:341;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11370:15;-1:-1:-1;;;;;11370:30:90;;11408:110;;;;;;;;11437:7;-1:-1:-1;;;;;11408:110:90;;;;;11446:6;:13;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11408:110:90;;;;;11461:17;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11408:110:90;;;;;11480:14;11408:110;;;;11496:21;11408:110;;;;;;;;:::i;:::-;;;;11370:154;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;11554:12:90;;-1:-1:-1;11554:6:90;;-1:-1:-1;11554:6:90;;-1:-1:-1;11554:12:90;:::i;:::-;11536:322;;;;;;;:::i;:::-;;;;;;;;;11574:6;:13;;;;;;;;;;:::i;:::-;11595:22;;;;;;;;:::i;:::-;11625:16;;;;;;;;:::i;:::-;11649:17;;;;;;;;:::i;:::-;11674:23;;;:70;;;11722:6;:22;;;11701:18;:43;11674:70;:132;;11788:18;11674:132;;;11755:6;:22;;;11674:132;11814:14;11836:6;:16;;;;;;;;;;:::i;:::-;11536:322;;;-1:-1:-1;;;;;18257:15:169;;;18239:34;;18309:15;;;18304:2;18289:18;;18282:43;18361:15;;;18341:18;;;18334:43;;;;18413:15;;;18408:2;18393:18;;18386:43;18460:3;18445:19;;18438:35;18504:3;18489:19;;18482:35;18554:15;;;18548:3;18533:19;;18526:44;18165:3;18150:19;11536:322:90;;;;;;;10663:1200;10379:1484;;;;;;:::o;20053:172:91:-;-1:-1:-1;;;;;20136:16:91;;:7;:16;;;;;;;;;;;:24;;;;;;;;;;;20132:51;;;20169:14;;;;;;;;;;;;;;20132:51;-1:-1:-1;;;;;20189:16:91;;;:7;:16;;;;;;;;;;;:24;;;;;;;:31;;;;20216:4;20189:31;;;20053:172::o;9090:497::-;9242:7;;;;9321:12;:8;9330:1;9321:8;;:12;:::i;:::-;9310:59;;;;;;;:::i;:::-;-1:-1:-1;9257:112:91;;-1:-1:-1;9257:112:91;-1:-1:-1;9257:112:91;-1:-1:-1;9388:25:91;;;;:20;;;:25;:::i;:::-;-1:-1:-1;;;;;9379:34:91;:5;-1:-1:-1;;;;;9379:34:91;;9375:61;;9422:14;;;;;;;;;;;;;;9375:61;9457:8;-1:-1:-1;;;;;9446:19:91;:7;-1:-1:-1;;;;;9446:19:91;;9442:47;;9474:15;;;;;;;;;;;;;;9442:47;9509:29;;;;9499:39;;9495:67;;9547:15;;;;;;;;;;;;;;9495:67;9576:6;9090:497;-1:-1:-1;;;;;;;9090:497:91:o;9799:589::-;9951:7;;;;;10053:12;:8;10062:1;10053:8;;:12;:::i;:::-;10042:62;;;;;;;:::i;:::-;9966:138;;-1:-1:-1;9966:138:91;;-1:-1:-1;9966:138:91;-1:-1:-1;9966:138:91;-1:-1:-1;10123:26:91;;;;:21;;;:26;:::i;:::-;-1:-1:-1;;;;;10114:35:91;:5;-1:-1:-1;;;;;10114:35:91;;10110:62;;10158:14;;;;;;;;;;;;;;10110:62;10193:8;-1:-1:-1;;;;;10182:19:91;:7;-1:-1:-1;;;;;10182:19:91;;10178:47;;10210:15;;;;;;;;;;;;;;10178:47;10247:13;;;;;;;;:::i;:::-;-1:-1:-1;;;;;10235:25:91;:8;-1:-1:-1;;;;;10235:25:91;;10231:58;;10269:20;;;;;;;;;;;;;;10231:58;10309:30;;;;10299:40;;10295:68;;10348:15;;;;;;;;;;;;;;10295:68;10377:6;9799:589;-1:-1:-1;;;;;;;;9799:589:91:o;10633:953::-;10790:7;10799;10822:13;10843:16;10867:14;10889:17;10914:14;10936:18;10962:19;11001:8;;11010:1;11001:12;;;;;;;;;:::i;:::-;10990:89;;;;;;;:::i;:::-;10814:265;;-1:-1:-1;10814:265:91;;-1:-1:-1;10814:265:91;;-1:-1:-1;10814:265:91;-1:-1:-1;10814:265:91;-1:-1:-1;10814:265:91;-1:-1:-1;10814:265:91;-1:-1:-1;11098:26:91;;;;:21;;;:26;:::i;:::-;-1:-1:-1;;;;;11089:35:91;:5;-1:-1:-1;;;;;11089:35:91;;11085:62;;11133:14;;;;;;;;;;;;;;11085:62;11168:8;-1:-1:-1;;;;;11157:19:91;:7;-1:-1:-1;;;;;11157:19:91;;11153:47;;11185:15;;;;;;;;;;;;;;11153:47;-1:-1:-1;;;;;11210:23:91;;11228:4;11210:23;11206:51;;11242:15;;;;;;;;;;;;;;11206:51;11280:13;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11267:26:91;:9;-1:-1:-1;;;;;11267:26:91;;11263:59;;11302:20;;;;;;;;;;;;;;11263:59;11342:30;;;;11332:40;;11328:68;;11381:15;;;;;;;;;;;;;;11328:68;11420:25;;;;:20;;;:25;:::i;:::-;-1:-1:-1;;;;;11406:39:91;:10;-1:-1:-1;;;;;11406:39:91;;11402:66;;11454:14;;;;;;;;;;;;;;11402:66;11493:29;;;;11478:44;;11474:72;;11531:15;;;;;;;;;;;;;;11474:72;11561:6;;;;-1:-1:-1;10633:953:91;;-1:-1:-1;;;;;;;;;;10633:953:91:o;11796:488::-;11947:7;;;;12025:12;:8;12034:1;12025:8;;:12;:::i;:::-;12014:53;;;;;;;:::i;:::-;11962:105;;-1:-1:-1;11962:105:91;-1:-1:-1;11962:105:91;-1:-1:-1;12086:25:91;;;;:20;;;:25;:::i;:::-;-1:-1:-1;;;;;12077:34:91;:5;-1:-1:-1;;;;;12077:34:91;;12073:61;;12120:14;;;;;;;;;;;;;;12073:61;12155:8;-1:-1:-1;;;;;12144:19:91;:7;-1:-1:-1;;;;;12144:19:91;;12140:47;;12172:15;;;;;;;;;;;;;;12140:47;12207:28;;;;12197:38;;12193:66;;12244:15;;;;;;;;;;;;;;12500:602;12654:7;;;;;12758:12;:8;12767:1;12758:8;;:12;:::i;:::-;12747:68;;;;;;;:::i;:::-;-1:-1:-1;12669:146:91;;-1:-1:-1;12669:146:91;;-1:-1:-1;12669:146:91;-1:-1:-1;12669:146:91;-1:-1:-1;12834:26:91;;;;:21;;;:26;:::i;:::-;-1:-1:-1;;;;;12825:35:91;:5;-1:-1:-1;;;;;12825:35:91;;12821:62;;12869:14;;;;;;;;;;;;;;12821:62;12904:9;-1:-1:-1;;;;;12893:20:91;:7;-1:-1:-1;;;;;12893:20:91;;12889:48;;12922:15;;;;;;;;;;;;;;12889:48;12959:13;;;;;;;;:::i;:::-;-1:-1:-1;;;;;12947:25:91;:8;-1:-1:-1;;;;;12947:25:91;;12943:58;;12981:20;;;;;;;;;;;;;;12943:58;13021:32;;;;13011:42;;13007:70;;13062:15;;;;;;;;;;;;;;13259:466;13404:9;;13417:28;;;;13404:41;;;:88;;-1:-1:-1;13449:10:91;;;;13463:29;;;;13449:43;;13404:88;13400:153;;;13509:37;;;;;;;;;;;;;;13400:153;13563:12;;;;13579:32;;;;13563:48;;;:96;;-1:-1:-1;13615:10:91;;;;13629:30;;;;13615:44;;13563:96;13559:162;;;13676:38;;;;;;;;;;;;;;3714:255:45;3792:7;3812:17;3831:18;3851:16;3871:27;3882:4;3888:9;3871:10;:27::i;:::-;3811:87;;;;;;3908:28;3920:5;3927:8;3908:11;:28::i;:::-;-1:-1:-1;3953:9:45;;-1:-1:-1;;3714:255:45;;;;;:::o;29533:122:48:-;29601:4;29642:1;29630:8;29624:15;;;;;;;;:::i;:::-;:19;;;;:::i;:::-;:24;;29647:1;29624:24;29617:31;;29533:122;;;:::o;4996:4226::-;5078:14;5449:5;;;5078:14;5634:6;5453:1;5449;5621:20;5694:5;5690:2;5687:13;5679:5;5675:2;5671:14;5667:34;5658:43;;;5796:5;5805:1;5796:10;5792:368;;6134:11;6126:5;:19;;;;;:::i;:::-;;6119:26;;;;;;5792:368;6285:5;6270:11;:20;6266:143;;6310:84;3066:5;6330:16;;3065:36;940:4:43;3060:42:48;6310:11;:84::i;:::-;6664:17;6799:11;6796:1;6793;6786:25;7199:12;7229:15;;;7214:31;;7348:22;;;;;8094:1;8075;:15;;8074:21;;8327;;;8323:25;;8312:36;8397:21;;;8393:25;;8382:36;8469:21;;;8465:25;;8454:36;8540:21;;;8536:25;;8525:36;8613:21;;;8609:25;;8598:36;8687:21;;;8683:25;;;8672:36;7597:12;;;;7593:23;;;7618:1;7589:31;6913:20;;;6902:32;;;7709:12;;;;6960:21;;;;7446:16;;;;7700:21;;;;9163:15;;;;;-1:-1:-1;;4996:4226:48;;;;;:::o;8348:460:90:-;8452:9;8447:357;8463:24;;;8447:357;;;8502:41;8546:13;;8560:1;8546:16;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;8502:60;-1:-1:-1;;;;;;8605:15:90;8575:46;:18;;;;8502:60;8575:18;:::i;:::-;-1:-1:-1;;;;;8575:46:90;;8571:79;;8630:20;;;;;;;;;;;;;;8571:79;8658:36;8682:11;8658:23;:36::i;:::-;8720:18;;;;:11;:18;:::i;:::-;-1:-1:-1;;;;;8708:89:90;;8740:11;:17;;;8759:37;8784:11;8759:24;:37::i;:::-;8708:89;;;30953:25:169;;;31026:66;31014:79;;;31009:2;30994:18;;30987:107;30926:18;8708:89:90;;;;;;;-1:-1:-1;8489:3:90;;8447:357;;1219:160:39;1328:43;;;-1:-1:-1;;;;;31297:55:169;;1328:43:39;;;31279:74:169;31369:18;;;;31362:34;;;1328:43:39;;;;;;;;;;31252:18:169;;;;1328:43:39;;;;;;;;;;;;;;1301:71;;1321:5;;1301:19;:71::i;19109:500:91:-;19332:1;19315:14;:18;:61;;;;;19355:6;:20;;;19338:14;:37;19315:61;19311:93;;;19385:19;;;;;;;;;;;;;;19311:93;19410:68;19428:7;19437:23;19453:6;19437:15;:23::i;19410:68::-;19484:50;19512:7;19521:6;:12;;;19484:27;:50::i;:::-;19566:15;19544:6;:18;;;:37;19540:64;;19590:14;;;;;;;;;;;;;;2129:778:45;2232:17;2251:16;2269:14;2299:9;:16;2319:2;2299:22;2295:606;;2604:4;2589:20;;2583:27;2653:4;2638:20;;2632:27;2710:4;2695:20;;2689:27;2337:9;2681:36;2751:25;2762:4;2681:36;2583:27;2632;2751:10;:25::i;:::-;2744:32;;;;;;;;;;;2295:606;-1:-1:-1;;2872:16:45;;2823:1;;-1:-1:-1;2827:35:45;;2295:606;2129:778;;;;;:::o;7280:532::-;7375:20;7366:5;:29;;;;;;;;:::i;:::-;;7362:444;;7280:532;;:::o;7362:444::-;7471:29;7462:5;:38;;;;;;;;:::i;:::-;;7458:348;;7523:23;;;;;;;;;;;;;;7458:348;7576:35;7567:5;:44;;;;;;;;:::i;:::-;;7563:243;;7634:46;;;;;;;;1333:25:169;;;1306:18;;7634:46:45;;;;;;;;7563:243;7710:30;7701:5;:39;;;;;;;;:::i;:::-;;7697:109;;7763:32;;;;;;;;1333:25:169;;;1306:18;;7763:32:45;1187:177:169;1776:194:43;1881:10;1875:4;1868:24;1918:4;1912;1905:18;1949:4;1943;1936:18;582:989:72;649:14;666:18;;;;:11;:18;:::i;:::-;649:35;-1:-1:-1;706:17:72;;;;729:23;690:13;755:20;;;;706:11;755:20;:::i;:::-;729:46;;;;1305:4;1299:11;1366:15;1349;1330:17;1317:65;1465:1;1462;1445:15;1426:17;1419:5;1411:6;1404:5;1399:68;1389:172;;1500:16;1497:1;1494;1479:38;1536:16;1533:1;1526:27;1798:809;1874:13;1895:23;1874:13;1921:20;;;;:11;:20;:::i;:::-;1895:46;;-1:-1:-1;1895:46:72;-1:-1:-1;1970:1:72;1951:20;;1947:656;;2573:15;2560:29;2550:39;;1947:656;1889:718;;1798:809;;;:::o;8370:720:39:-;8450:18;8478:19;8616:4;8613:1;8606:4;8600:11;8593:4;8587;8583:15;8580:1;8573:5;8566;8561:60;8673:7;8663:176;;8717:4;8711:11;8762:16;8759:1;8754:3;8739:40;8808:16;8803:3;8796:29;8663:176;-1:-1:-1;;8916:1:39;8910:8;8866:16;;-1:-1:-1;8942:15:39;;:68;;8994:11;9009:1;8994:16;;8942:68;;;-1:-1:-1;;;;;8960:26:39;;;:31;8942:68;8938:146;;;9033:40;;;;;-1:-1:-1;;;;;1120:55:169;;9033:40:39;;;1102:74:169;1075:18;;9033:40:39;931:251:169;5203:1551:45;5329:17;;;6283:66;6270:79;;6266:164;;;-1:-1:-1;6381:1:45;;-1:-1:-1;6385:30:45;;-1:-1:-1;6417:1:45;6365:54;;6266:164;6541:24;;;6524:14;6541:24;;;;;;;;;31816:25:169;;;31889:4;31877:17;;31857:18;;;31850:45;;;;31911:18;;;31904:34;;;31954:18;;;31947:34;;;6541:24:45;;31788:19:169;;6541:24:45;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6541:24:45;;;;;;-1:-1:-1;;;;;;;6579:20:45;;6575:113;;-1:-1:-1;6631:1:45;;-1:-1:-1;6635:29:45;;-1:-1:-1;6631:1:45;;-1:-1:-1;6615:62:45;;6575:113;6706:6;-1:-1:-1;6714:20:45;;-1:-1:-1;6714:20:45;;-1:-1:-1;5203:1551:45;;;;;;;;;:::o;14:659:169:-;93:6;101;109;162:2;150:9;141:7;137:23;133:32;130:52;;;178:1;175;168:12;130:52;214:9;201:23;191:33;;275:2;264:9;260:18;247:32;298:18;339:2;331:6;328:14;325:34;;;355:1;352;345:12;325:34;393:6;382:9;378:22;368:32;;438:7;431:4;427:2;423:13;419:27;409:55;;460:1;457;450:12;409:55;500:2;487:16;526:2;518:6;515:14;512:34;;;542:1;539;532:12;512:34;587:7;582:2;573:6;569:2;565:15;561:24;558:37;555:57;;;608:1;605;598:12;555:57;639:2;635;631:11;621:21;;661:6;651:16;;;;;14:659;;;;;:::o;1369:163::-;1436:5;1481:3;1472:6;1467:3;1463:16;1459:26;1456:46;;;1498:1;1495;1488:12;1456:46;-1:-1:-1;1520:6:169;1369:163;-1:-1:-1;1369:163:169:o;1537:254::-;1631:6;1684:3;1672:9;1663:7;1659:23;1655:33;1652:53;;;1701:1;1698;1691:12;1652:53;1724:61;1777:7;1766:9;1724:61;:::i;1796:154::-;-1:-1:-1;;;;;1875:5:169;1871:54;1864:5;1861:65;1851:93;;1940:1;1937;1930:12;1955:134;2023:20;;2052:31;2023:20;2052:31;:::i;:::-;1955:134;;;:::o;2094:154::-;2152:5;2197:3;2188:6;2183:3;2179:16;2175:26;2172:46;;;2214:1;2211;2204:12;2253:380;2329:8;2339:6;2393:3;2386:4;2378:6;2374:17;2370:27;2360:55;;2411:1;2408;2401:12;2360:55;-1:-1:-1;2434:20:169;;2477:18;2466:30;;2463:50;;;2509:1;2506;2499:12;2463:50;2546:4;2538:6;2534:17;2522:29;;2606:3;2599:4;2589:6;2586:1;2582:14;2574:6;2570:27;2566:38;2563:47;2560:67;;;2623:1;2620;2613:12;2560:67;2253:380;;;;;:::o;2638:153::-;2696:5;2741:2;2732:6;2727:3;2723:16;2719:25;2716:45;;;2757:1;2754;2747:12;2796:162;2863:5;2908:2;2899:6;2894:3;2890:16;2886:25;2883:45;;;2924:1;2921;2914:12;2963:1853;3295:6;3303;3311;3319;3327;3335;3343;3351;3359;3412:3;3400:9;3391:7;3387:23;3383:33;3380:53;;;3429:1;3426;3419:12;3380:53;3452:29;3471:9;3452:29;:::i;:::-;3442:39;;3528:2;3517:9;3513:18;3500:32;3490:42;;3583:2;3572:9;3568:18;3555:32;3606:18;3647:2;3639:6;3636:14;3633:34;;;3663:1;3660;3653:12;3633:34;3686:65;3743:7;3734:6;3723:9;3719:22;3686:65;:::i;:::-;3676:75;;3804:2;3793:9;3789:18;3776:32;3760:48;;3833:2;3823:8;3820:16;3817:36;;;3849:1;3846;3839:12;3817:36;3888:85;3965:7;3954:8;3943:9;3939:24;3888:85;:::i;:::-;3992:8;;-1:-1:-1;3862:111:169;-1:-1:-1;4080:3:169;4065:19;;4052:33;;-1:-1:-1;4097:16:169;;;4094:36;;;4126:1;4123;4116:12;4094:36;4149:67;4208:7;4197:8;4186:9;4182:24;4149:67;:::i;:::-;4139:77;;4269:3;4258:9;4254:19;4241:33;4225:49;;4299:2;4289:8;4286:16;4283:36;;;4315:1;4312;4305:12;4283:36;4338:76;4406:7;4395:8;4384:9;4380:24;4338:76;:::i;:::-;4328:86;;4467:3;4456:9;4452:19;4439:33;4423:49;;4497:2;4487:8;4484:16;4481:36;;;4513:1;4510;4503:12;4481:36;4536:76;4604:7;4593:8;4582:9;4578:24;4536:76;:::i;:::-;4526:86;;4665:3;4654:9;4650:19;4637:33;4621:49;;4695:2;4685:8;4682:16;4679:36;;;4711:1;4708;4701:12;4679:36;;4734:76;4802:7;4791:8;4780:9;4776:24;4734:76;:::i;:::-;4724:86;;;2963:1853;;;;;;;;;;;:::o;4821:509::-;4936:6;4944;4997:2;4985:9;4976:7;4972:23;4968:32;4965:52;;;5013:1;5010;5003:12;4965:52;5052:9;5039:23;5071:31;5096:5;5071:31;:::i;:::-;5121:5;-1:-1:-1;5177:2:169;5162:18;;5149:32;5204:18;5193:30;;5190:50;;;5236:1;5233;5226:12;5190:50;5259:65;5316:7;5307:6;5296:9;5292:22;5259:65;:::i;:::-;5249:75;;;4821:509;;;;;:::o;5845:155::-;5904:5;5949:3;5940:6;5935:3;5931:16;5927:26;5924:46;;;5966:1;5963;5956:12;6005:1079;6197:6;6205;6213;6221;6229;6282:3;6270:9;6261:7;6257:23;6253:33;6250:53;;;6299:1;6296;6289:12;6250:53;6338:9;6325:23;6357:31;6382:5;6357:31;:::i;:::-;6407:5;-1:-1:-1;6463:2:169;6448:18;;6435:32;6486:18;6516:14;;;6513:34;;;6543:1;6540;6533:12;6513:34;6566:66;6624:7;6615:6;6604:9;6600:22;6566:66;:::i;:::-;6556:76;;6685:2;6674:9;6670:18;6657:32;6641:48;;6714:2;6704:8;6701:16;6698:36;;;6730:1;6727;6720:12;6698:36;6753:76;6821:7;6810:8;6799:9;6795:24;6753:76;:::i;:::-;6743:86;;6876:2;6865:9;6861:18;6848:32;6838:42;;6933:3;6922:9;6918:19;6905:33;6889:49;;6963:2;6953:8;6950:16;6947:36;;;6979:1;6976;6969:12;6947:36;;7002:76;7070:7;7059:8;7048:9;7044:24;7002:76;:::i;:::-;6992:86;;;6005:1079;;;;;;;;:::o;7089:180::-;7148:6;7201:2;7189:9;7180:7;7176:23;7172:32;7169:52;;;7217:1;7214;7207:12;7169:52;-1:-1:-1;7240:23:169;;7089:180;-1:-1:-1;7089:180:169:o;7274:118::-;7360:5;7353:13;7346:21;7339:5;7336:32;7326:60;;7382:1;7379;7372:12;7397:1161;7588:6;7596;7604;7612;7620;7628;7681:3;7669:9;7660:7;7656:23;7652:33;7649:53;;;7698:1;7695;7688:12;7649:53;7737:9;7724:23;7756:31;7781:5;7756:31;:::i;:::-;7806:5;-1:-1:-1;7863:2:169;7848:18;;7835:32;7876:33;7835:32;7876:33;:::i;:::-;7928:7;-1:-1:-1;7987:2:169;7972:18;;7959:32;8000:30;7959:32;8000:30;:::i;:::-;8049:7;-1:-1:-1;8107:2:169;8092:18;;8079:32;8130:18;8160:14;;;8157:34;;;8187:1;8184;8177:12;8157:34;8210:65;8267:7;8258:6;8247:9;8243:22;8210:65;:::i;:::-;8200:75;;8328:3;8317:9;8313:19;8300:33;8284:49;;8358:2;8348:8;8345:16;8342:36;;;8374:1;8371;8364:12;8342:36;;8413:85;8490:7;8479:8;8468:9;8464:24;8413:85;:::i;:::-;7397:1161;;;;-1:-1:-1;7397:1161:169;;-1:-1:-1;7397:1161:169;;8517:8;;7397:1161;-1:-1:-1;;;7397:1161:169:o;8563:574::-;8675:6;8683;8691;8744:2;8732:9;8723:7;8719:23;8715:32;8712:52;;;8760:1;8757;8750:12;8712:52;8799:9;8786:23;8818:31;8843:5;8818:31;:::i;:::-;8868:5;-1:-1:-1;8920:2:169;8905:18;;8892:32;;-1:-1:-1;8975:2:169;8960:18;;8947:32;9002:18;8991:30;;8988:50;;;9034:1;9031;9024:12;8988:50;9057:74;9123:7;9114:6;9103:9;9099:22;9057:74;:::i;:::-;9047:84;;;8563:574;;;;;:::o;9142:355::-;9228:6;9281:2;9269:9;9260:7;9256:23;9252:32;9249:52;;;9297:1;9294;9287:12;9249:52;9337:9;9324:23;9370:18;9362:6;9359:30;9356:50;;;9402:1;9399;9392:12;9356:50;9425:66;9483:7;9474:6;9463:9;9459:22;9425:66;:::i;9767:1602::-;10054:6;10062;10070;10078;10086;10094;10102;10110;10163:3;10151:9;10142:7;10138:23;10134:33;10131:53;;;10180:1;10177;10170:12;10131:53;10203:29;10222:9;10203:29;:::i;:::-;10193:39;;10279:2;10268:9;10264:18;10251:32;10241:42;;10334:2;10323:9;10319:18;10306:32;10357:18;10398:2;10390:6;10387:14;10384:34;;;10414:1;10411;10404:12;10384:34;10437:65;10494:7;10485:6;10474:9;10470:22;10437:65;:::i;:::-;10427:75;;10555:2;10544:9;10540:18;10527:32;10511:48;;10584:2;10574:8;10571:16;10568:36;;;10600:1;10597;10590:12;10568:36;10639:85;10716:7;10705:8;10694:9;10690:24;10639:85;:::i;:::-;10743:8;;-1:-1:-1;10613:111:169;-1:-1:-1;10831:3:169;10816:19;;10803:33;;-1:-1:-1;10848:16:169;;;10845:36;;;10877:1;10874;10867:12;10845:36;10900:67;10959:7;10948:8;10937:9;10933:24;10900:67;:::i;:::-;10890:77;;11020:3;11009:9;11005:19;10992:33;10976:49;;11050:2;11040:8;11037:16;11034:36;;;11066:1;11063;11056:12;11034:36;11089:76;11157:7;11146:8;11135:9;11131:24;11089:76;:::i;:::-;11079:86;;11218:3;11207:9;11203:19;11190:33;11174:49;;11248:2;11238:8;11235:16;11232:36;;;11264:1;11261;11254:12;11232:36;;11287:76;11355:7;11344:8;11333:9;11329:24;11287:76;:::i;:::-;11277:86;;;9767:1602;;;;;;;;;;;:::o;11374:1269::-;11611:6;11619;11627;11635;11643;11651;11704:3;11692:9;11683:7;11679:23;11675:33;11672:53;;;11721:1;11718;11711:12;11672:53;11744:29;11763:9;11744:29;:::i;:::-;11734:39;;11824:2;11813:9;11809:18;11796:32;11847:18;11888:2;11880:6;11877:14;11874:34;;;11904:1;11901;11894:12;11874:34;11927:66;11985:7;11976:6;11965:9;11961:22;11927:66;:::i;:::-;11917:76;;12046:2;12035:9;12031:18;12018:32;12002:48;;12075:2;12065:8;12062:16;12059:36;;;12091:1;12088;12081:12;12059:36;12114:76;12182:7;12171:8;12160:9;12156:24;12114:76;:::i;:::-;12104:86;;12237:2;12226:9;12222:18;12209:32;12199:42;;12294:3;12283:9;12279:19;12266:33;12250:49;;12324:2;12314:8;12311:16;12308:36;;;12340:1;12337;12330:12;12308:36;12363:76;12431:7;12420:8;12409:9;12405:24;12363:76;:::i;:::-;12353:86;;12492:3;12481:9;12477:19;12464:33;12448:49;;12522:2;12512:8;12509:16;12506:36;;;12538:1;12535;12528:12;12506:36;;12561:76;12629:7;12618:8;12607:9;12603:24;12561:76;:::i;:::-;12551:86;;;11374:1269;;;;;;;;:::o;12648:353::-;12733:6;12786:2;12774:9;12765:7;12761:23;12757:32;12754:52;;;12802:1;12799;12792:12;12754:52;12842:9;12829:23;12875:18;12867:6;12864:30;12861:50;;;12907:1;12904;12897:12;12861:50;12930:65;12987:7;12978:6;12967:9;12963:22;12930:65;:::i;13237:245::-;13304:6;13357:2;13345:9;13336:7;13332:23;13328:32;13325:52;;;13373:1;13370;13363:12;13325:52;13405:9;13399:16;13424:28;13446:5;13424:28;:::i;14004:247::-;14063:6;14116:2;14104:9;14095:7;14091:23;14087:32;14084:52;;;14132:1;14129;14122:12;14084:52;14171:9;14158:23;14190:31;14215:5;14190:31;:::i;14845:325::-;14933:6;14928:3;14921:19;14985:6;14978:5;14971:4;14966:3;14962:14;14949:43;;15037:1;15030:4;15021:6;15016:3;15012:16;15008:27;15001:38;14903:3;15159:4;15089:66;15084:2;15076:6;15072:15;15068:88;15063:3;15059:98;15055:109;15048:116;;14845:325;;;;:::o;15175:167::-;15242:20;;15302:14;15291:26;;15281:37;;15271:65;;15332:1;15329;15322:12;15347:1365;15593:4;-1:-1:-1;;;;;15703:2:169;15695:6;15691:15;15680:9;15673:34;15755:2;15747:6;15743:15;15738:2;15727:9;15723:18;15716:43;;15795:6;15790:2;15779:9;15775:18;15768:34;15838:3;15833:2;15822:9;15818:18;15811:31;15890:6;15877:20;15973:66;15964:6;15948:14;15944:27;15940:100;15920:18;15916:125;15906:153;;16055:1;16052;16045:12;15906:153;16081:31;;16189:2;16178:14;;;16135:19;16215:18;16204:30;;16201:50;;;16247:1;16244;16237:12;16201:50;16296:6;16280:14;16276:27;16267:7;16263:41;16260:61;;;16317:1;16314;16307:12;16260:61;16358:2;16352:3;16341:9;16337:19;16330:31;16384:63;16442:3;16431:9;16427:19;16419:6;16410:7;16384:63;:::i;:::-;16370:77;;;16476:34;16506:2;16498:6;16494:15;16476:34;:::i;:::-;16529:14;16598:2;16584:12;16580:21;16574:3;16563:9;16559:19;16552:50;16679:2;16643:34;16673:2;16665:6;16661:15;16643:34;:::i;:::-;16639:43;16633:3;16622:9;16618:19;16611:72;;;16700:6;16692:14;;;15347:1365;;;;;;;:::o;16717:277::-;16797:6;16850:2;16838:9;16829:7;16825:23;16821:32;16818:52;;;16866:1;16863;16856:12;16818:52;16905:9;16892:23;16944:1;16937:5;16934:12;16924:40;;16960:1;16957;16950:12;16999:581;17077:4;17083:6;17143:11;17130:25;17233:66;17222:8;17206:14;17202:29;17198:102;17178:18;17174:127;17164:155;;17315:1;17312;17305:12;17164:155;17342:33;;17394:20;;;-1:-1:-1;17437:18:169;17426:30;;17423:50;;;17469:1;17466;17459:12;17423:50;17502:4;17490:17;;-1:-1:-1;17533:14:169;17529:27;;;17519:38;;17516:58;;;17570:1;17567;17560:12;17585:273;17770:6;17762;17757:3;17744:33;17726:3;17796:16;;17821:13;;;17796:16;17585:273;-1:-1:-1;17585:273:169:o;18581:629::-;18699:4;18705:6;18765:11;18752:25;18855:66;18844:8;18828:14;18824:29;18820:102;18800:18;18796:127;18786:155;;18937:1;18934;18927:12;18786:155;18964:33;;19016:20;;;-1:-1:-1;19059:18:169;19048:30;;19045:50;;;19091:1;19088;19081:12;19045:50;19124:4;19112:17;;-1:-1:-1;19175:1:169;19171:14;;;19155;19151:35;19141:46;;19138:66;;;19200:1;19197;19190:12;19215:184;19267:77;19264:1;19257:88;19364:4;19361:1;19354:15;19388:4;19385:1;19378:15;19404:381;19495:4;19553:11;19540:25;19643:66;19632:8;19616:14;19612:29;19608:102;19588:18;19584:127;19574:155;;19725:1;19722;19715:12;19574:155;19746:33;;;;;19404:381;-1:-1:-1;;19404:381:169:o;20375:279::-;20440:9;;;20461:10;;;20458:190;;;20504:77;20501:1;20494:88;20605:4;20602:1;20595:15;20633:4;20630:1;20623:15;20659:184;20711:77;20708:1;20701:88;20808:4;20805:1;20798:15;20832:4;20829:1;20822:15;20848:266;20917:6;20970:2;20958:9;20949:7;20945:23;20941:32;20938:52;;;20986:1;20983;20976:12;20938:52;21025:9;21012:23;21064:1;21057:5;21054:12;21044:40;;21080:1;21077;21070:12;21119:315;21304:6;21293:9;21286:25;21347:2;21342;21331:9;21327:18;21320:30;21267:4;21367:61;21424:2;21413:9;21409:18;21401:6;21393;21367:61;:::i;21439:336::-;21508:6;21561:2;21549:9;21540:7;21536:23;21532:32;21529:52;;;21577:1;21574;21567:12;21529:52;21609:9;21603:16;21659:66;21652:5;21648:78;21641:5;21638:89;21628:117;;21741:1;21738;21731:12;21780:246;21939:2;21928:9;21921:21;21902:4;21959:61;22016:2;22005:9;22001:18;21993:6;21985;21959:61;:::i;23257:322::-;23298:3;23336:5;23330:12;23360:1;23370:128;23384:6;23381:1;23378:13;23370:128;;;23481:4;23466:13;;;23462:24;;23456:31;23443:11;;;23436:52;23399:12;23370:128;;;-1:-1:-1;23553:1:169;23517:16;;23542:13;;;-1:-1:-1;23517:16:169;;23257:322;-1:-1:-1;23257:322:169:o;23584:261::-;23759:3;23784:55;23809:29;23834:3;23826:6;23809:29;:::i;:::-;23801:6;23784:55;:::i;25071:350::-;25256:3;25287:29;25312:3;25304:6;25287:29;:::i;:::-;25325:21;;;-1:-1:-1;;25373:2:169;25362:14;;25355:30;25412:2;25401:14;;25071:350;-1:-1:-1;25071:350:169:o;25426:184::-;25478:77;25475:1;25468:88;25575:4;25572:1;25565:15;25599:4;25596:1;25589:15;25615:844;25769:4;25811:3;25800:9;25796:19;25788:27;;-1:-1:-1;;;;;25922:2:169;25913:6;25907:13;25903:22;25892:9;25885:41;25994:2;25986:4;25978:6;25974:17;25968:24;25964:33;25957:4;25946:9;25942:20;25935:63;26066:2;26058:4;26050:6;26046:17;26040:24;26036:33;26029:4;26018:9;26014:20;26007:63;;26126:4;26118:6;26114:17;26108:24;26101:4;26090:9;26086:20;26079:54;26180:4;26172:6;26168:17;26162:24;26222:1;26208:12;26205:19;26195:207;;26258:77;26255:1;26248:88;26359:4;26356:1;26349:15;26387:4;26384:1;26377:15;26195:207;26440:12;26433:4;26422:9;26418:20;26411:42;;25615:844;;;;:::o;26464:184::-;26534:6;26587:2;26575:9;26566:7;26562:23;26558:32;26555:52;;;26603:1;26600;26593:12;26555:52;-1:-1:-1;26626:16:169;;26464:184;-1:-1:-1;26464:184:169:o;26653:331::-;26758:9;26769;26811:8;26799:10;26796:24;26793:44;;;26833:1;26830;26823:12;26793:44;26862:6;26852:8;26849:20;26846:40;;;26882:1;26879;26872:12;26846:40;-1:-1:-1;;26908:23:169;;;26953:25;;;;;-1:-1:-1;26653:331:169:o;26989:608::-;27088:6;27096;27104;27112;27165:3;27153:9;27144:7;27140:23;27136:33;27133:53;;;27182:1;27179;27172:12;27133:53;27221:9;27208:23;27240:31;27265:5;27240:31;:::i;:::-;27290:5;-1:-1:-1;27347:2:169;27332:18;;27319:32;27360:33;27319:32;27360:33;:::i;:::-;27412:7;-1:-1:-1;27466:2:169;27451:18;;27438:32;;-1:-1:-1;27522:2:169;27507:18;;27494:32;27535:30;27494:32;27535:30;:::i;:::-;26989:608;;;;-1:-1:-1;26989:608:169;;-1:-1:-1;;26989:608:169:o;27602:622::-;27712:6;27720;27728;27736;27789:3;27777:9;27768:7;27764:23;27760:33;27757:53;;;27806:1;27803;27796:12;27757:53;27845:9;27832:23;27864:31;27889:5;27864:31;:::i;:::-;27914:5;-1:-1:-1;27971:2:169;27956:18;;27943:32;27984:33;27943:32;27984:33;:::i;:::-;28036:7;-1:-1:-1;28095:2:169;28080:18;;28067:32;28108:33;28067:32;28108:33;:::i;:::-;27602:622;;;;-1:-1:-1;28160:7:169;;28214:2;28199:18;28186:32;;-1:-1:-1;;27602:622:169:o;28229:991::-;28382:6;28390;28398;28406;28414;28422;28430;28483:3;28471:9;28462:7;28458:23;28454:33;28451:53;;;28500:1;28497;28490:12;28451:53;28539:9;28526:23;28558:31;28583:5;28558:31;:::i;:::-;28608:5;-1:-1:-1;28665:2:169;28650:18;;28637:32;28678:33;28637:32;28678:33;:::i;:::-;28730:7;-1:-1:-1;28789:2:169;28774:18;;28761:32;28802:33;28761:32;28802:33;:::i;:::-;28854:7;-1:-1:-1;28913:2:169;28898:18;;28885:32;28926:33;28885:32;28926:33;:::i;:::-;28978:7;-1:-1:-1;29032:3:169;29017:19;;29004:33;;-1:-1:-1;29089:3:169;29074:19;;29061:33;29103;29061;29103;:::i;:::-;29155:7;29145:17;;;29209:3;29198:9;29194:19;29181:33;29171:43;;28229:991;;;;;;;;;;:::o;29225:472::-;29318:6;29326;29334;29387:2;29375:9;29366:7;29362:23;29358:32;29355:52;;;29403:1;29400;29393:12;29355:52;29442:9;29429:23;29461:31;29486:5;29461:31;:::i;:::-;29511:5;-1:-1:-1;29568:2:169;29553:18;;29540:32;29581:33;29540:32;29581:33;:::i;:::-;29225:472;;29633:7;;-1:-1:-1;;;29687:2:169;29672:18;;;;29659:32;;29225:472::o;29702:758::-;29818:6;29826;29834;29842;29850;29903:3;29891:9;29882:7;29878:23;29874:33;29871:53;;;29920:1;29917;29910:12;29871:53;29959:9;29946:23;29978:31;30003:5;29978:31;:::i;:::-;30028:5;-1:-1:-1;30085:2:169;30070:18;;30057:32;30098:33;30057:32;30098:33;:::i;:::-;30150:7;-1:-1:-1;30209:2:169;30194:18;;30181:32;30222:33;30181:32;30222:33;:::i;:::-;30274:7;-1:-1:-1;30328:2:169;30313:18;;30300:32;;-1:-1:-1;30384:3:169;30369:19;;30356:33;30398:30;30356:33;30398:30;:::i;:::-;30447:7;30437:17;;;29702:758;;;;;;;;:::o;30465:311::-;30495:1;30529:4;30526:1;30522:12;30553:3;30543:191;;30590:77;30587:1;30580:88;30691:4;30688:1;30681:15;30719:4;30716:1;30709:15;30543:191;30766:3;30759:4;30756:1;30752:12;30748:22;30743:27;;;30465:311;;;;:::o", + "linkReferences": {}, + "immutableReferences": { + "65518": [ + { + "start": 824, + "length": 32 + }, + { + "start": 1042, + "length": 32 + }, + { + "start": 1703, + "length": 32 + }, + { + "start": 5408, + "length": 32 + }, + { + "start": 5631, + "length": 32 + } + ], + "65523": [ + { + "start": 407, + "length": 32 + }, + { + "start": 1978, + "length": 32 + }, + { + "start": 6284, + "length": 32 + }, + { + "start": 7724, + "length": 32 + }, + { + "start": 7966, + "length": 32 + }, + { + "start": 8236, + "length": 32 + }, + { + "start": 8971, + "length": 32 + }, + { + "start": 9255, + "length": 32 + }, + { + "start": 12348, + "length": 32 + } + ], + "65528": [ + { + "start": 599, + "length": 32 + }, + { + "start": 1924, + "length": 32 + }, + { + "start": 5852, + "length": 32 + } + ], + "66488": [ + { + "start": 1444, + "length": 32 + } + ], + "66490": [ + { + "start": 1242, + "length": 32 + } + ] + } + }, + "methodIdentifiers": { + "AUTHENTICATOR()": "c6186181", + "BALANCE_MANAGER()": "29bcdc95", + "DOMAIN_SEPARATOR()": "3644e515", + "REPOSITORY()": "6f35d2d2", + "cancelLimitOrder(uint256)": "a5cdc8fc", + "hashBaseTokenData((address,uint256,uint256,uint256,uint256))": "875530ff", + "hashOrder((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))": "e242924e", + "hashQuoteTokenData((address,uint256,uint256,uint256,uint256))": "4c9e03d3", + "hashSingleOrder((string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address))": "b11f1262", + "isValidSignature(bytes32,bytes)": "1626ba7e", + "settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))": "cba673a7", + "settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))": "9935c868", + "settleSingleWithPermitsSignatures(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes),(bytes,uint48,uint48))": "db587728", + "settleWithPermitsSignatures(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes),(bytes,uint48,uint48))": "51d46815", + "validateHooks(address,((address,uint256,bytes)[],(address,uint256,bytes)[]))": "5aa0e95d", + "validateInteractions(address,address,bool,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[])": "a7ab49bc", + "validateOrderAmounts((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))": "fa5cd56c", + "validateSignature(address,bytes32,(uint8,uint8,bytes))": "ae80c584" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IAllowListAuthentication\",\"name\":\"authenticator_\",\"type\":\"address\"},{\"internalType\":\"contract IRepository\",\"name\":\"repository_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"permit2_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAsset\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidBaseTokenAmounts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDestination\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidEIP1271Signature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidEIP712Signature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidETHSignSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFillAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidHooksTarget\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInteractionsBaseTokenAmounts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInteractionsQuoteTokenAmounts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidLendingPoolInteraction\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidQuoteTokenAmounts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignatureType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonceInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotMaker\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSolver\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PartialFillNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReceiverNotManager\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrancyGuardReentrantCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignatureIsExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SignatureIsNotEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UpdatedMakerAmountsTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroMakerAmount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes4\",\"name\":\"selector\",\"type\":\"bytes4\"}],\"name\":\"Interaction\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"baseToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"quoteToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quoteTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"TradeOrder\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHENTICATOR\",\"outputs\":[{\"internalType\":\"contract IAllowListAuthentication\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALANCE_MANAGER\",\"outputs\":[{\"internalType\":\"contract IBalanceManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REPOSITORY\",\"outputs\":[{\"internalType\":\"contract IRepository\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"cancelLimitOrder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"_baseTokenData\",\"type\":\"tuple\"}],\"name\":\"hashBaseTokenData\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"baseTokenData\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"quoteTokenData\",\"type\":\"tuple\"}],\"internalType\":\"struct ILiquoriceSettlement.Order\",\"name\":\"_order\",\"type\":\"tuple\"}],\"name\":\"hashOrder\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"_quoteTokenData\",\"type\":\"tuple\"}],\"name\":\"hashQuoteTokenData\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"quoteToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"struct ILiquoriceSettlement.Single\",\"name\":\"_order\",\"type\":\"tuple\"}],\"name\":\"hashSingleOrder\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_signature\",\"type\":\"bytes\"}],\"name\":\"isValidSignature\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_filledTakerAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"baseTokenData\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"quoteTokenData\",\"type\":\"tuple\"}],\"internalType\":\"struct ILiquoriceSettlement.Order\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"_interactions\",\"type\":\"tuple[]\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"beforeSettle\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"afterSettle\",\"type\":\"tuple[]\"}],\"internalType\":\"struct GPv2Interaction.Hooks\",\"name\":\"_hooks\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_makerSignature\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_takerSignature\",\"type\":\"tuple\"}],\"name\":\"settle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"quoteToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"struct ILiquoriceSettlement.Single\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_makerSignature\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_filledTakerAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_takerSignature\",\"type\":\"tuple\"}],\"name\":\"settleSingle\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"quoteToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"struct ILiquoriceSettlement.Single\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_makerSignature\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_filledTakerAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_takerSignature\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"deadline\",\"type\":\"uint48\"}],\"internalType\":\"struct Signature.TakerPermitInfo\",\"name\":\"_takerPermitInfo\",\"type\":\"tuple\"}],\"name\":\"settleSingleWithPermitsSignatures\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_filledTakerAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"baseTokenData\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"quoteTokenData\",\"type\":\"tuple\"}],\"internalType\":\"struct ILiquoriceSettlement.Order\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"_interactions\",\"type\":\"tuple[]\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"beforeSettle\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"afterSettle\",\"type\":\"tuple[]\"}],\"internalType\":\"struct GPv2Interaction.Hooks\",\"name\":\"_hooks\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_makerSignature\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_takerSignature\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"uint48\",\"name\":\"nonce\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"deadline\",\"type\":\"uint48\"}],\"internalType\":\"struct Signature.TakerPermitInfo\",\"name\":\"_takerPermitInfo\",\"type\":\"tuple\"}],\"name\":\"settleWithPermitsSignatures\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRepository\",\"name\":\"_repository\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"beforeSettle\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"afterSettle\",\"type\":\"tuple[]\"}],\"internalType\":\"struct GPv2Interaction.Hooks\",\"name\":\"_hooks\",\"type\":\"tuple\"}],\"name\":\"validateHooks\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRepository\",\"name\":\"_repository\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_signer\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_isPartialFill\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"baseTokenData\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"quoteTokenData\",\"type\":\"tuple\"}],\"internalType\":\"struct ILiquoriceSettlement.Order\",\"name\":\"_order\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"}],\"internalType\":\"struct GPv2Interaction.Data[]\",\"name\":\"_interactions\",\"type\":\"tuple[]\"}],\"name\":\"validateInteractions\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"rfqId\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"effectiveTrader\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quoteExpiry\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minFillAmount\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRecipient\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toSupply\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.BaseTokenData\",\"name\":\"baseTokenData\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toTrader\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toWithdraw\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toBorrow\",\"type\":\"uint256\"}],\"internalType\":\"struct ILiquoriceSettlement.QuoteTokenData\",\"name\":\"quoteTokenData\",\"type\":\"tuple\"}],\"internalType\":\"struct ILiquoriceSettlement.Order\",\"name\":\"_order\",\"type\":\"tuple\"}],\"name\":\"validateOrderAmounts\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_validationAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"enum Signature.Type\",\"name\":\"signatureType\",\"type\":\"uint8\"},{\"internalType\":\"enum Signature.TransferCommand\",\"name\":\"transferCommand\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"signatureBytes\",\"type\":\"bytes\"}],\"internalType\":\"struct Signature.TypedSignature\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"validateSignature\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ReentrancyGuardReentrantCall()\":[{\"details\":\"Unauthorized reentrant call.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC-20 token failed.\"}]},\"events\":{\"Interaction(address,uint256,bytes4)\":{\"params\":{\"selector\":\"Selector of the interaction function\",\"target\":\"Address of the interaction target\",\"value\":\"Value associated with the interaction\"}}},\"kind\":\"dev\",\"methods\":{\"cancelLimitOrder(uint256)\":{\"params\":{\"nonce\":\"Nonce of the order to be canceled\"}},\"hashOrder((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))\":{\"params\":{\"_order\":\"Order data to hash\"},\"returns\":{\"_0\":\"bytes32 Hash of the order\"}},\"hashSingleOrder((string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address))\":{\"params\":{\"_order\":\"Single order data to hash\"},\"returns\":{\"_0\":\"bytes32 Hash of the single order\"}},\"isValidSignature(bytes32,bytes)\":{\"params\":{\"_hash\":\"Hash of the data\",\"_signature\":\"Signature to validate\"},\"returns\":{\"_0\":\"Magic value if signature is valid, otherwise 0xffffffff\"}},\"settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))\":{\"params\":{\"_filledTakerAmount\":\"Amount filled by the taker\",\"_hooks\":\"Hooks to be called before and after settlement\",\"_interactions\":\"Array of interaction data to be executed during settlement\",\"_makerSignature\":\"Typed signature of the maker\",\"_order\":\"Order data\",\"_signer\":\"Address that signed the order\",\"_takerSignature\":\"Typed signature of the taker\"}},\"settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))\":{\"params\":{\"_filledTakerAmount\":\"Amount filled by the taker\",\"_makerSignature\":\"Signature of the maker\",\"_order\":\"Single order data\",\"_signer\":\"Address that signed the order\",\"_takerSignature\":\"Signature of the taker\"}},\"validateHooks(address,((address,uint256,bytes)[],(address,uint256,bytes)[]))\":{\"params\":{\"_hooks\":\"Hooks data\",\"_repository\":\"Repository interface\"}},\"validateInteractions(address,address,bool,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[])\":{\"params\":{\"_interactions\":\"Array of interaction data\",\"_order\":\"Order data\",\"_repository\":\"Repository interface\",\"_signer\":\"Signer address\"}},\"validateOrderAmounts((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))\":{\"params\":{\"_order\":\"Order data\"}},\"validateSignature(address,bytes32,(uint8,uint8,bytes))\":{\"params\":{\"_hash\":\"Hash of the data\",\"_signature\":\"Signature data\",\"_validationAddress\":\"Address to validate against\"}}},\"title\":\"Liquorice Settlement Contract\",\"version\":1},\"userdoc\":{\"events\":{\"Interaction(address,uint256,bytes4)\":{\"notice\":\"Emitted when an interaction is executed\"}},\"kind\":\"user\",\"methods\":{\"AUTHENTICATOR()\":{\"notice\":\"Authenticator for verifying solvers and makers\"},\"BALANCE_MANAGER()\":{\"notice\":\"Manager for handling balance transfers\"},\"REPOSITORY()\":{\"notice\":\"Repository that stores data for Lending Pools\"},\"cancelLimitOrder(uint256)\":{\"notice\":\"Cancels a limit order by invalidating its nonce\"},\"hashOrder((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))\":{\"notice\":\"Computes the hash of an order\"},\"hashSingleOrder((string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address))\":{\"notice\":\"Computes the hash of a single order\"},\"isValidSignature(bytes32,bytes)\":{\"notice\":\"Validates a signature\"},\"settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))\":{\"notice\":\"Settles a signed order with the given interactions and hooks\"},\"settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))\":{\"notice\":\"Settles a single order\"},\"validateHooks(address,((address,uint256,bytes)[],(address,uint256,bytes)[]))\":{\"notice\":\"Validates hooks for an order\"},\"validateInteractions(address,address,bool,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[])\":{\"notice\":\"Validates interactions for an order\"},\"validateOrderAmounts((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))\":{\"notice\":\"Validates the amounts in an order\"},\"validateSignature(address,bytes32,(uint8,uint8,bytes))\":{\"notice\":\"Validates a signature\"}},\"notice\":\"Handles settlement of orders and interactions\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/contracts/settlement/LiquoriceSettlement.sol\":\"LiquoriceSettlement\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[\":@chainlink/=lib/chainlink/contracts/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/\",\":chainlink/=lib/chainlink/\",\":contracts/=src/contracts/\",\":ds-test/=node_modules/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/\",\":interfaces/=src/interfaces/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\",\":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/\",\":openzeppelin-upgrades/=lib/openzeppelin-upgrades/\",\":solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/\"]},\"sources\":{\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol\":{\"keccak256\":\"0xc92e946b954f185c3ca5ee56f9721aa73d64464456a46459384cb0ccf3c3856e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ae178b4e7b259557d8b93f3dd4f6f909ac72f914a9e92676e59b8d737f0423e2\",\"dweb:/ipfs/QmXeqyUJYzn6w8wyivQAtSzmwwFQnHaFYPvGad66RW1sPf\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol\":{\"keccak256\":\"0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://da62d6be1f5c6edf577f0cb45666a8aa9c2086a4bac87d95d65f02e2f4c36a4b\",\"dweb:/ipfs/QmNkpvBpoCMvX8JwAFNSc5XxJ2q5BXJpL5L1txb4QkqVFF\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol\":{\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://11fea9f8bc98949ac6709f0c1699db7430d2948137aa94d5a9e95a91f61a710a\",\"dweb:/ipfs/QmQdfRXxQjwP6yn3DVo1GHPpriKNcFghSPi94Z1oKEFUNS\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol\":{\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2608291cb038b388d80b79a06b6118a42f7894ff67b7da10ec0dbbf5b2973ba\",\"dweb:/ipfs/QmWohqcBLbcxmA4eGPhZDXe5RYMMEEpFq22nfkaUMvTfw1\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db\",\"dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol\":{\"keccak256\":\"0x6dd0cb67846da3fa1241c520faaa215d6bec8226e37beac6056c51e8af44d24e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://650e533e62b30dcc6edea2b6c91358d5659da3bde42e56adf7316c493b916a15\",\"dweb:/ipfs/QmYkmK2vPE6FjdAoQVpZSJxamTLGno9wzGS495TcMNFViV\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Panic.sol\":{\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a\",\"dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol\":{\"keccak256\":\"0x11a5a79827df29e915a12740caf62fe21ebe27c08c9ae3e09abe9ee3ba3866d3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3cf0c69ab827e3251db9ee6a50647d62c90ba580a4d7bbff21f2bea39e7b2f4a\",\"dweb:/ipfs/QmZiKwtKU1SBX4RGfQtY7PZfiapbbu6SZ9vizGQD9UHjRA\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol\":{\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9\",\"dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f6fda447a62815e8064f47eff0dd1cf58d9207ad69b5d32280f8d7ed1d1e4621\",\"dweb:/ipfs/QmfDRc7pxfaXB2Dh9np5Uf29Na3pQ7tafRS684wd3GLjVL\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/Math.sol\":{\"keccak256\":\"0x6f61a65c733690afafb4cf528b5677e704828c8350b60b948dbc1d3bb6d7689c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://00265b985b303af62ee243e10db819fa8cf890d9f122f82f4f03f55b02f62654\",\"dweb:/ipfs/QmNneFqZn2uKK6dECxatH6aENk1EMCTETi58dGaz5NCWQe\"]},\"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8\",\"dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy\"]},\"src/contracts/lib/GPv2Interaction.sol\":{\"keccak256\":\"0x55968a83f6ae3d8d806b8faf02360abc676fb7476d05f33c0c9d324e6336fd0f\",\"license\":\"LGPL-3.0-or-later\",\"urls\":[\"bzz-raw://2d813e60c3fa006d02c8fd1aed73d2d47f9f153ac3c410d408384f3084e46de3\",\"dweb:/ipfs/QmdNyQMmyscMH6CVUkhQQfGdKdxgqhqDEe5K4iwrvcWDsk\"]},\"src/contracts/lib/Signature.sol\":{\"keccak256\":\"0xc084fe793244e2e7b0f4a51440df7dbf97d39b4ad6450a2b8a082cb6d86993b5\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://9bff9732e68149a83f2e044c7f1700432997750166cd15f4a54f73bd68a475aa\",\"dweb:/ipfs/QmZJMNppHQ3nUDcJhAkrMYa4QWhGLDr4Tzah6LndgrDCib\"]},\"src/contracts/settlement/BalanceManager.sol\":{\"keccak256\":\"0x82d5d0de5cf88ff8882f1f7a2d05b98ed32bb3f2a6b9eab728ce55ae943e67c3\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://ebcbe822ad5c68896a12ecd60e17ba6a2ed0ba8e0544c7ad54d88d1c25206b5c\",\"dweb:/ipfs/QmYEZeKUEz7Nw6MW9uZHnXvkeRTmmcS1WZhx77s9kUWSWw\"]},\"src/contracts/settlement/LiquoriceSettlement.sol\":{\"keccak256\":\"0xcac528919829fc8e021cec4325b38835866a7d0630b61349deae6ecfbe0ddaef\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://6d6dafbba3885b42cb97be6d190ac1f611548ceb2116e9b6ed7da9bf422c8b58\",\"dweb:/ipfs/QmZQk6WQNgYqsu9Z85tPF2VQGXgaYzvpEqc7VEmJ4zEEJU\"]},\"src/contracts/settlement/Signing.sol\":{\"keccak256\":\"0xad9e59ae740627e5b71fa1ebde019999084480664d06d18f0a01e4d31fa32ef6\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://ea0e0021cd0074292b04f9921f6ca3cc77a6799c86cacabb9dc6ff7dadbd7933\",\"dweb:/ipfs/QmPjY69PntfUGW5eNrNe98DCTemq6daRqUiLFkcYvVWuvh\"]},\"src/interfaces/IACLManager.sol\":{\"keccak256\":\"0xeee5cbedcfaff01733979b8f439a817aa67b09d9e330d21e11f180dceebed024\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://814431cd9df23d0d7cc0f9761927e2aa18fc7fa599f34422f332ee6352580d69\",\"dweb:/ipfs/QmXLdGsdMyeX5j64rAaByz35SwEMPMQ7usXwruWjEPo6Cz\"]},\"src/interfaces/IAllowListAuthentication.sol\":{\"keccak256\":\"0xbabb9eda80757d9355ab9863fccb3fdb1f15c1cbce458c3236d792d007077a9e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f6fa97e90b315ffc3cae3998adda6810c856ea96be015e797723e13b436d1a10\",\"dweb:/ipfs/Qme1dzXXcMDQpeqyqfuSbZDY6GKWjyrRBQrNDjitPeXQEF\"]},\"src/interfaces/IBalanceManager.sol\":{\"keccak256\":\"0xc4cff6f33170df6d91a866ee69263c9b90091e94027bea04038558c315e6e127\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://867164a381fb78da320c89db6b15978becd49be61e2349abc805362904bffb4e\",\"dweb:/ipfs/QmPY9UYCi9YVdCC8A1UxmTPcnV5BmMj93Gq1nqxBv4fMJ7\"]},\"src/interfaces/IInterestRateModel.sol\":{\"keccak256\":\"0xccd4c1dea98176c392de07cb8f5a2ac969405090d42d831310fa53464c0d9264\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a22b5b87be29e616142b6c4677e109e9246157c4b7e6378334fbc7ba403d82de\",\"dweb:/ipfs/QmXmSF34VsktTfqSCJU8Mz9sTaXGVk7xdYQwr9NcsR3k43\"]},\"src/interfaces/ILiquoriceSettlement.sol\":{\"keccak256\":\"0xa4a36d51f174d9994c39287f89e63bbea57ff5adcd2a9bc649c67bb5cae75272\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8562fe9fc033c3e3320c5d95ad10e49f5e23ea50a5e9eaf186cbf53d9f1ce7a6\",\"dweb:/ipfs/QmXKSjRi8oxmS5xd5V95HofYtFzYfehbL6s8t2MKoXR7y1\"]},\"src/interfaces/IPriceProvider.sol\":{\"keccak256\":\"0x75812be8d692287010f5ee9ce13556df1bd8299faa64b42c49cd08cf7cc53847\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://623d4faa57b078a33a2afe0d13fc426c4a750ae7f07f9d826000047dab54148e\",\"dweb:/ipfs/QmYmFpZnLug6FBG9C8s1mxPBjZHwiCk7cRBC7A9WXtyGKE\"]},\"src/interfaces/IRepository.sol\":{\"keccak256\":\"0xf08a5812ce10042564d518994db487c49d9f35d511da07a5103b9b886b6e2607\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b602c9f5a61c9796f711330ee56d4f0287adc656c686acf391d4e8c45453e6d0\",\"dweb:/ipfs/QmQ7XJ1qERgRxWurpkS3t1XDtuBUTpQEz14h4eXBc8vp9t\"]},\"src/interfaces/external/permit/IAllowanceTransfer.sol\":{\"keccak256\":\"0x23986b17f0c10296cb8afadb43014cd7901f56dac5ba85067d18ca7db7d3e37e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5f6ec55ce038e045b15a89a7f19fa45aa09d42a52517dd1846968d16777d3a9b\",\"dweb:/ipfs/QmZXthQLUtRFgqGv3bFbijmNk5Vviacrf7VnRDbXEQjdBQ\"]},\"src/interfaces/external/permit/IEIP712.sol\":{\"keccak256\":\"0x07e44e64248ed6316fe1db6f44c80468b950e6d1ab4bfdf21a65cbbd27718f77\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://58487548bc5289e7f5a4d4c278e5c7e9a7829d8a5be024a42938943f8c8fb63b\",\"dweb:/ipfs/QmYg63mq3SgXH6H4Wyvznb1E5fEjw6W7NeLASUcRjMuKYa\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.23+commit.f704f362" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "contract IAllowListAuthentication", + "name": "authenticator_", + "type": "address" + }, + { + "internalType": "contract IRepository", + "name": "repository_", + "type": "address" + }, + { + "internalType": "address", + "name": "permit2_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "type": "error", + "name": "ECDSAInvalidSignature" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "type": "error", + "name": "ECDSAInvalidSignatureLength" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "type": "error", + "name": "ECDSAInvalidSignatureS" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidAmount" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidAsset" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidBaseTokenAmounts" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidDestination" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidEIP1271Signature" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidEIP712Signature" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidETHSignSignature" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidFillAmount" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidHooksTarget" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidInteractionsBaseTokenAmounts" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidInteractionsQuoteTokenAmounts" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidLendingPoolInteraction" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidQuoteTokenAmounts" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidSignatureType" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidSigner" + }, + { + "inputs": [], + "type": "error", + "name": "InvalidSource" + }, + { + "inputs": [], + "type": "error", + "name": "NonceInvalid" + }, + { + "inputs": [], + "type": "error", + "name": "NotMaker" + }, + { + "inputs": [], + "type": "error", + "name": "NotSolver" + }, + { + "inputs": [], + "type": "error", + "name": "OrderExpired" + }, + { + "inputs": [], + "type": "error", + "name": "PartialFillNotSupported" + }, + { + "inputs": [], + "type": "error", + "name": "ReceiverNotManager" + }, + { + "inputs": [], + "type": "error", + "name": "ReentrancyGuardReentrantCall" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "type": "error", + "name": "SafeERC20FailedOperation" + }, + { + "inputs": [], + "type": "error", + "name": "SignatureIsExpired" + }, + { + "inputs": [], + "type": "error", + "name": "SignatureIsNotEmpty" + }, + { + "inputs": [], + "type": "error", + "name": "UpdatedMakerAmountsTooLow" + }, + { + "inputs": [], + "type": "error", + "name": "ZeroMakerAmount" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address", + "indexed": true + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256", + "indexed": false + }, + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4", + "indexed": false + } + ], + "type": "event", + "name": "Interaction", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "string", + "name": "rfqId", + "type": "string", + "indexed": true + }, + { + "internalType": "address", + "name": "trader", + "type": "address", + "indexed": false + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address", + "indexed": false + }, + { + "internalType": "address", + "name": "baseToken", + "type": "address", + "indexed": false + }, + { + "internalType": "address", + "name": "quoteToken", + "type": "address", + "indexed": false + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256", + "indexed": false + }, + { + "internalType": "uint256", + "name": "quoteTokenAmount", + "type": "uint256", + "indexed": false + }, + { + "internalType": "address", + "name": "recipient", + "type": "address", + "indexed": false + } + ], + "type": "event", + "name": "TradeOrder", + "anonymous": false + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "AUTHENTICATOR", + "outputs": [ + { + "internalType": "contract IAllowListAuthentication", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "BALANCE_MANAGER", + "outputs": [ + { + "internalType": "contract IBalanceManager", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "REPOSITORY", + "outputs": [ + { + "internalType": "contract IRepository", + "name": "", + "type": "address" + } + ] + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "cancelLimitOrder" + }, + { + "inputs": [ + { + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "name": "_baseTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRecipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRepay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toSupply", + "type": "uint256" + } + ] + } + ], + "stateMutability": "pure", + "type": "function", + "name": "hashBaseTokenData", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "struct ILiquoriceSettlement.Order", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "name": "baseTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRecipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRepay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toSupply", + "type": "uint256" + } + ] + }, + { + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "name": "quoteTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTrader", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toBorrow", + "type": "uint256" + } + ] + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "hashOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "name": "_quoteTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTrader", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toBorrow", + "type": "uint256" + } + ] + } + ], + "stateMutability": "pure", + "type": "function", + "name": "hashQuoteTokenData", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "struct ILiquoriceSettlement.Single", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "address", + "name": "baseToken", + "type": "address" + }, + { + "internalType": "address", + "name": "quoteToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "hashSingleOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_signature", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function", + "name": "isValidSignature", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_signer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_filledTakerAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.Order", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "name": "baseTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRecipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRepay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toSupply", + "type": "uint256" + } + ] + }, + { + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "name": "quoteTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTrader", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toBorrow", + "type": "uint256" + } + ] + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "_interactions", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Hooks", + "name": "_hooks", + "type": "tuple", + "components": [ + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "beforeSettle", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "afterSettle", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + } + ] + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_makerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_takerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "settle" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_signer", + "type": "address" + }, + { + "internalType": "struct ILiquoriceSettlement.Single", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "address", + "name": "baseToken", + "type": "address" + }, + { + "internalType": "address", + "name": "quoteToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ] + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_makerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + }, + { + "internalType": "uint256", + "name": "_filledTakerAmount", + "type": "uint256" + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_takerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + } + ], + "stateMutability": "payable", + "type": "function", + "name": "settleSingle" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_signer", + "type": "address" + }, + { + "internalType": "struct ILiquoriceSettlement.Single", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "address", + "name": "baseToken", + "type": "address" + }, + { + "internalType": "address", + "name": "quoteToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ] + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_makerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + }, + { + "internalType": "uint256", + "name": "_filledTakerAmount", + "type": "uint256" + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_takerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + }, + { + "internalType": "struct Signature.TakerPermitInfo", + "name": "_takerPermitInfo", + "type": "tuple", + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint48", + "name": "nonce", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + } + ] + } + ], + "stateMutability": "payable", + "type": "function", + "name": "settleSingleWithPermitsSignatures" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_signer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_filledTakerAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.Order", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "name": "baseTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRecipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRepay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toSupply", + "type": "uint256" + } + ] + }, + { + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "name": "quoteTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTrader", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toBorrow", + "type": "uint256" + } + ] + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "_interactions", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Hooks", + "name": "_hooks", + "type": "tuple", + "components": [ + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "beforeSettle", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "afterSettle", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + } + ] + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_makerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_takerSignature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + }, + { + "internalType": "struct Signature.TakerPermitInfo", + "name": "_takerPermitInfo", + "type": "tuple", + "components": [ + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint48", + "name": "nonce", + "type": "uint48" + }, + { + "internalType": "uint48", + "name": "deadline", + "type": "uint48" + } + ] + } + ], + "stateMutability": "payable", + "type": "function", + "name": "settleWithPermitsSignatures" + }, + { + "inputs": [ + { + "internalType": "contract IRepository", + "name": "_repository", + "type": "address" + }, + { + "internalType": "struct GPv2Interaction.Hooks", + "name": "_hooks", + "type": "tuple", + "components": [ + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "beforeSettle", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "afterSettle", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "validateHooks" + }, + { + "inputs": [ + { + "internalType": "contract IRepository", + "name": "_repository", + "type": "address" + }, + { + "internalType": "address", + "name": "_signer", + "type": "address" + }, + { + "internalType": "bool", + "name": "_isPartialFill", + "type": "bool" + }, + { + "internalType": "struct ILiquoriceSettlement.Order", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "name": "baseTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRecipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRepay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toSupply", + "type": "uint256" + } + ] + }, + { + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "name": "quoteTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTrader", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toBorrow", + "type": "uint256" + } + ] + } + ] + }, + { + "internalType": "struct GPv2Interaction.Data[]", + "name": "_interactions", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "validateInteractions" + }, + { + "inputs": [ + { + "internalType": "struct ILiquoriceSettlement.Order", + "name": "_order", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "rfqId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "trader", + "type": "address" + }, + { + "internalType": "address", + "name": "effectiveTrader", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quoteExpiry", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minFillAmount", + "type": "uint256" + }, + { + "internalType": "struct ILiquoriceSettlement.BaseTokenData", + "name": "baseTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRecipient", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toRepay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toSupply", + "type": "uint256" + } + ] + }, + { + "internalType": "struct ILiquoriceSettlement.QuoteTokenData", + "name": "quoteTokenData", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toTrader", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "toBorrow", + "type": "uint256" + } + ] + } + ] + } + ], + "stateMutability": "pure", + "type": "function", + "name": "validateOrderAmounts" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_validationAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_hash", + "type": "bytes32" + }, + { + "internalType": "struct Signature.TypedSignature", + "name": "_signature", + "type": "tuple", + "components": [ + { + "internalType": "enum Signature.Type", + "name": "signatureType", + "type": "uint8" + }, + { + "internalType": "enum Signature.TransferCommand", + "name": "transferCommand", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "signatureBytes", + "type": "bytes" + } + ] + } + ], + "stateMutability": "view", + "type": "function", + "name": "validateSignature" + }, + { + "inputs": [], + "stateMutability": "payable", + "type": "receive" + } + ], + "devdoc": { + "kind": "dev", + "methods": { + "cancelLimitOrder(uint256)": { + "params": { + "nonce": "Nonce of the order to be canceled" + } + }, + "hashOrder((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))": { + "params": { + "_order": "Order data to hash" + }, + "returns": { + "_0": "bytes32 Hash of the order" + } + }, + "hashSingleOrder((string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address))": { + "params": { + "_order": "Single order data to hash" + }, + "returns": { + "_0": "bytes32 Hash of the single order" + } + }, + "isValidSignature(bytes32,bytes)": { + "params": { + "_hash": "Hash of the data", + "_signature": "Signature to validate" + }, + "returns": { + "_0": "Magic value if signature is valid, otherwise 0xffffffff" + } + }, + "settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))": { + "params": { + "_filledTakerAmount": "Amount filled by the taker", + "_hooks": "Hooks to be called before and after settlement", + "_interactions": "Array of interaction data to be executed during settlement", + "_makerSignature": "Typed signature of the maker", + "_order": "Order data", + "_signer": "Address that signed the order", + "_takerSignature": "Typed signature of the taker" + } + }, + "settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))": { + "params": { + "_filledTakerAmount": "Amount filled by the taker", + "_makerSignature": "Signature of the maker", + "_order": "Single order data", + "_signer": "Address that signed the order", + "_takerSignature": "Signature of the taker" + } + }, + "validateHooks(address,((address,uint256,bytes)[],(address,uint256,bytes)[]))": { + "params": { + "_hooks": "Hooks data", + "_repository": "Repository interface" + } + }, + "validateInteractions(address,address,bool,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[])": { + "params": { + "_interactions": "Array of interaction data", + "_order": "Order data", + "_repository": "Repository interface", + "_signer": "Signer address" + } + }, + "validateOrderAmounts((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))": { + "params": { + "_order": "Order data" + } + }, + "validateSignature(address,bytes32,(uint8,uint8,bytes))": { + "params": { + "_hash": "Hash of the data", + "_signature": "Signature data", + "_validationAddress": "Address to validate against" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "AUTHENTICATOR()": { + "notice": "Authenticator for verifying solvers and makers" + }, + "BALANCE_MANAGER()": { + "notice": "Manager for handling balance transfers" + }, + "REPOSITORY()": { + "notice": "Repository that stores data for Lending Pools" + }, + "cancelLimitOrder(uint256)": { + "notice": "Cancels a limit order by invalidating its nonce" + }, + "hashOrder((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))": { + "notice": "Computes the hash of an order" + }, + "hashSingleOrder((string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address))": { + "notice": "Computes the hash of a single order" + }, + "isValidSignature(bytes32,bytes)": { + "notice": "Validates a signature" + }, + "settle(address,uint256,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[],((address,uint256,bytes)[],(address,uint256,bytes)[]),(uint8,uint8,bytes),(uint8,uint8,bytes))": { + "notice": "Settles a signed order with the given interactions and hooks" + }, + "settleSingle(address,(string,uint256,address,address,address,address,uint256,uint256,uint256,uint256,address),(uint8,uint8,bytes),uint256,(uint8,uint8,bytes))": { + "notice": "Settles a single order" + }, + "validateHooks(address,((address,uint256,bytes)[],(address,uint256,bytes)[]))": { + "notice": "Validates hooks for an order" + }, + "validateInteractions(address,address,bool,(address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)),(address,uint256,bytes)[])": { + "notice": "Validates interactions for an order" + }, + "validateOrderAmounts((address,uint256,string,uint256,address,address,uint256,address,uint256,(address,uint256,uint256,uint256,uint256),(address,uint256,uint256,uint256,uint256)))": { + "notice": "Validates the amounts in an order" + }, + "validateSignature(address,bytes32,(uint8,uint8,bytes))": { + "notice": "Validates a signature" + } + }, + "version": 1 + } + }, + "settings": { + "remappings": [ + "@chainlink/=lib/chainlink/contracts/", + "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", + "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/", + "chainlink/=lib/chainlink/", + "contracts/=src/contracts/", + "ds-test/=node_modules/ds-test/src/", + "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", + "forge-std/=lib/forge-std/src/", + "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/", + "interfaces/=src/interfaces/", + "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", + "openzeppelin-contracts/=lib/openzeppelin-contracts/", + "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/", + "openzeppelin-upgrades/=lib/openzeppelin-upgrades/", + "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/" + ], + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/contracts/settlement/LiquoriceSettlement.sol": "LiquoriceSettlement" + }, + "evmVersion": "shanghai", + "libraries": {} + }, + "sources": { + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol": { + "keccak256": "0xc92e946b954f185c3ca5ee56f9721aa73d64464456a46459384cb0ccf3c3856e", + "urls": [ + "bzz-raw://ae178b4e7b259557d8b93f3dd4f6f909ac72f914a9e92676e59b8d737f0423e2", + "dweb:/ipfs/QmXeqyUJYzn6w8wyivQAtSzmwwFQnHaFYPvGad66RW1sPf" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol": { + "keccak256": "0x9b6b3e7803bc5f2f8cd7ad57db8ac1def61a9930a5a3107df4882e028a9605d7", + "urls": [ + "bzz-raw://da62d6be1f5c6edf577f0cb45666a8aa9c2086a4bac87d95d65f02e2f4c36a4b", + "dweb:/ipfs/QmNkpvBpoCMvX8JwAFNSc5XxJ2q5BXJpL5L1txb4QkqVFF" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol": { + "keccak256": "0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724", + "urls": [ + "bzz-raw://11fea9f8bc98949ac6709f0c1699db7430d2948137aa94d5a9e95a91f61a710a", + "dweb:/ipfs/QmQdfRXxQjwP6yn3DVo1GHPpriKNcFghSPi94Z1oKEFUNS" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol": { + "keccak256": "0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c", + "urls": [ + "bzz-raw://a2608291cb038b388d80b79a06b6118a42f7894ff67b7da10ec0dbbf5b2973ba", + "dweb:/ipfs/QmWohqcBLbcxmA4eGPhZDXe5RYMMEEpFq22nfkaUMvTfw1" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": { + "keccak256": "0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7", + "urls": [ + "bzz-raw://df6f0c459663c9858b6cba2cda1d14a7d05a985bed6d2de72bd8e78c25ee79db", + "dweb:/ipfs/QmeTTxZ7qVk9rjEv2R4CpCwdf8UMCcRqDNMvzNxHc3Fnn9" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol": { + "keccak256": "0x6dd0cb67846da3fa1241c520faaa215d6bec8226e37beac6056c51e8af44d24e", + "urls": [ + "bzz-raw://650e533e62b30dcc6edea2b6c91358d5659da3bde42e56adf7316c493b916a15", + "dweb:/ipfs/QmYkmK2vPE6FjdAoQVpZSJxamTLGno9wzGS495TcMNFViV" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Panic.sol": { + "keccak256": "0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a", + "urls": [ + "bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a", + "dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol": { + "keccak256": "0x11a5a79827df29e915a12740caf62fe21ebe27c08c9ae3e09abe9ee3ba3866d3", + "urls": [ + "bzz-raw://3cf0c69ab827e3251db9ee6a50647d62c90ba580a4d7bbff21f2bea39e7b2f4a", + "dweb:/ipfs/QmZiKwtKU1SBX4RGfQtY7PZfiapbbu6SZ9vizGQD9UHjRA" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol": { + "keccak256": "0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84", + "urls": [ + "bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9", + "dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": { + "keccak256": "0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8", + "urls": [ + "bzz-raw://f6fda447a62815e8064f47eff0dd1cf58d9207ad69b5d32280f8d7ed1d1e4621", + "dweb:/ipfs/QmfDRc7pxfaXB2Dh9np5Uf29Na3pQ7tafRS684wd3GLjVL" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/Math.sol": { + "keccak256": "0x6f61a65c733690afafb4cf528b5677e704828c8350b60b948dbc1d3bb6d7689c", + "urls": [ + "bzz-raw://00265b985b303af62ee243e10db819fa8cf890d9f122f82f4f03f55b02f62654", + "dweb:/ipfs/QmNneFqZn2uKK6dECxatH6aENk1EMCTETi58dGaz5NCWQe" + ], + "license": "MIT" + }, + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol": { + "keccak256": "0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54", + "urls": [ + "bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8", + "dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy" + ], + "license": "MIT" + }, + "src/contracts/lib/GPv2Interaction.sol": { + "keccak256": "0x55968a83f6ae3d8d806b8faf02360abc676fb7476d05f33c0c9d324e6336fd0f", + "urls": [ + "bzz-raw://2d813e60c3fa006d02c8fd1aed73d2d47f9f153ac3c410d408384f3084e46de3", + "dweb:/ipfs/QmdNyQMmyscMH6CVUkhQQfGdKdxgqhqDEe5K4iwrvcWDsk" + ], + "license": "LGPL-3.0-or-later" + }, + "src/contracts/lib/Signature.sol": { + "keccak256": "0xc084fe793244e2e7b0f4a51440df7dbf97d39b4ad6450a2b8a082cb6d86993b5", + "urls": [ + "bzz-raw://9bff9732e68149a83f2e044c7f1700432997750166cd15f4a54f73bd68a475aa", + "dweb:/ipfs/QmZJMNppHQ3nUDcJhAkrMYa4QWhGLDr4Tzah6LndgrDCib" + ], + "license": "BUSL-1.1" + }, + "src/contracts/settlement/BalanceManager.sol": { + "keccak256": "0x82d5d0de5cf88ff8882f1f7a2d05b98ed32bb3f2a6b9eab728ce55ae943e67c3", + "urls": [ + "bzz-raw://ebcbe822ad5c68896a12ecd60e17ba6a2ed0ba8e0544c7ad54d88d1c25206b5c", + "dweb:/ipfs/QmYEZeKUEz7Nw6MW9uZHnXvkeRTmmcS1WZhx77s9kUWSWw" + ], + "license": "BUSL-1.1" + }, + "src/contracts/settlement/LiquoriceSettlement.sol": { + "keccak256": "0xcac528919829fc8e021cec4325b38835866a7d0630b61349deae6ecfbe0ddaef", + "urls": [ + "bzz-raw://6d6dafbba3885b42cb97be6d190ac1f611548ceb2116e9b6ed7da9bf422c8b58", + "dweb:/ipfs/QmZQk6WQNgYqsu9Z85tPF2VQGXgaYzvpEqc7VEmJ4zEEJU" + ], + "license": "BUSL-1.1" + }, + "src/contracts/settlement/Signing.sol": { + "keccak256": "0xad9e59ae740627e5b71fa1ebde019999084480664d06d18f0a01e4d31fa32ef6", + "urls": [ + "bzz-raw://ea0e0021cd0074292b04f9921f6ca3cc77a6799c86cacabb9dc6ff7dadbd7933", + "dweb:/ipfs/QmPjY69PntfUGW5eNrNe98DCTemq6daRqUiLFkcYvVWuvh" + ], + "license": "BUSL-1.1" + }, + "src/interfaces/IACLManager.sol": { + "keccak256": "0xeee5cbedcfaff01733979b8f439a817aa67b09d9e330d21e11f180dceebed024", + "urls": [ + "bzz-raw://814431cd9df23d0d7cc0f9761927e2aa18fc7fa599f34422f332ee6352580d69", + "dweb:/ipfs/QmXLdGsdMyeX5j64rAaByz35SwEMPMQ7usXwruWjEPo6Cz" + ], + "license": "MIT" + }, + "src/interfaces/IAllowListAuthentication.sol": { + "keccak256": "0xbabb9eda80757d9355ab9863fccb3fdb1f15c1cbce458c3236d792d007077a9e", + "urls": [ + "bzz-raw://f6fa97e90b315ffc3cae3998adda6810c856ea96be015e797723e13b436d1a10", + "dweb:/ipfs/Qme1dzXXcMDQpeqyqfuSbZDY6GKWjyrRBQrNDjitPeXQEF" + ], + "license": "MIT" + }, + "src/interfaces/IBalanceManager.sol": { + "keccak256": "0xc4cff6f33170df6d91a866ee69263c9b90091e94027bea04038558c315e6e127", + "urls": [ + "bzz-raw://867164a381fb78da320c89db6b15978becd49be61e2349abc805362904bffb4e", + "dweb:/ipfs/QmPY9UYCi9YVdCC8A1UxmTPcnV5BmMj93Gq1nqxBv4fMJ7" + ], + "license": "MIT" + }, + "src/interfaces/IInterestRateModel.sol": { + "keccak256": "0xccd4c1dea98176c392de07cb8f5a2ac969405090d42d831310fa53464c0d9264", + "urls": [ + "bzz-raw://a22b5b87be29e616142b6c4677e109e9246157c4b7e6378334fbc7ba403d82de", + "dweb:/ipfs/QmXmSF34VsktTfqSCJU8Mz9sTaXGVk7xdYQwr9NcsR3k43" + ], + "license": "MIT" + }, + "src/interfaces/ILiquoriceSettlement.sol": { + "keccak256": "0xa4a36d51f174d9994c39287f89e63bbea57ff5adcd2a9bc649c67bb5cae75272", + "urls": [ + "bzz-raw://8562fe9fc033c3e3320c5d95ad10e49f5e23ea50a5e9eaf186cbf53d9f1ce7a6", + "dweb:/ipfs/QmXKSjRi8oxmS5xd5V95HofYtFzYfehbL6s8t2MKoXR7y1" + ], + "license": "MIT" + }, + "src/interfaces/IPriceProvider.sol": { + "keccak256": "0x75812be8d692287010f5ee9ce13556df1bd8299faa64b42c49cd08cf7cc53847", + "urls": [ + "bzz-raw://623d4faa57b078a33a2afe0d13fc426c4a750ae7f07f9d826000047dab54148e", + "dweb:/ipfs/QmYmFpZnLug6FBG9C8s1mxPBjZHwiCk7cRBC7A9WXtyGKE" + ], + "license": "MIT" + }, + "src/interfaces/IRepository.sol": { + "keccak256": "0xf08a5812ce10042564d518994db487c49d9f35d511da07a5103b9b886b6e2607", + "urls": [ + "bzz-raw://b602c9f5a61c9796f711330ee56d4f0287adc656c686acf391d4e8c45453e6d0", + "dweb:/ipfs/QmQ7XJ1qERgRxWurpkS3t1XDtuBUTpQEz14h4eXBc8vp9t" + ], + "license": "MIT" + }, + "src/interfaces/external/permit/IAllowanceTransfer.sol": { + "keccak256": "0x23986b17f0c10296cb8afadb43014cd7901f56dac5ba85067d18ca7db7d3e37e", + "urls": [ + "bzz-raw://5f6ec55ce038e045b15a89a7f19fa45aa09d42a52517dd1846968d16777d3a9b", + "dweb:/ipfs/QmZXthQLUtRFgqGv3bFbijmNk5Vviacrf7VnRDbXEQjdBQ" + ], + "license": "MIT" + }, + "src/interfaces/external/permit/IEIP712.sol": { + "keccak256": "0x07e44e64248ed6316fe1db6f44c80468b950e6d1ab4bfdf21a65cbbd27718f77", + "urls": [ + "bzz-raw://58487548bc5289e7f5a4d4c278e5c7e9a7829d8a5be024a42938943f8c8fb63b", + "dweb:/ipfs/QmYg63mq3SgXH6H4Wyvznb1E5fEjw6W7NeLASUcRjMuKYa" + ], + "license": "MIT" + } + }, + "version": 1 + }, + "id": 90 +} \ No newline at end of file diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index f586b1b616..55938c0675 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -594,7 +594,7 @@ crate::bindings!( ); crate::bindings!( - ILiquoriceSettlement, + LiquoriceSettlement, crate::deployments! { // MAINNET => address!("0x0448633eb8B0A42EfED924C42069E0DcF08fb552"), diff --git a/crates/contracts/src/bin/vendor.rs b/crates/contracts/src/bin/vendor.rs index bf1db9862b..bd58d0b377 100644 --- a/crates/contracts/src/bin/vendor.rs +++ b/crates/contracts/src/bin/vendor.rs @@ -107,7 +107,7 @@ fn run() -> Result<()> { "Manually vendored ABI and bytecode for hooks trampoline contract", ) .manual( - "ILiquoriceSettlement", + "LiquoriceSettlement", "Liquorice does not publish its code", ) .npm( diff --git a/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs b/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs index b321a1979d..f951392ddf 100644 --- a/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs +++ b/crates/driver/src/infra/notify/liquidity_sources/liquorice/notifier.rs @@ -20,7 +20,7 @@ use { alloy::primitives::Address, anyhow::{Context, Result, anyhow}, chrono::Utc, - contracts::alloy::ILiquoriceSettlement, + contracts::alloy::LiquoriceSettlement, }; const NOTIFICATION_SOURCE: &str = "cow_protocol"; @@ -40,7 +40,7 @@ impl Notifier { chain: chain::Chain, ) -> Result { let liquorice_settlement_contract_address = - ILiquoriceSettlement::deployment_address(&chain.id()) + LiquoriceSettlement::deployment_address(&chain.id()) .ok_or(anyhow!("Liquorice settlement contract not found"))?; Ok(Self { @@ -85,11 +85,11 @@ impl LiquiditySourceNotifying for Notifier { mod utils { use { crate::domain::{ - competition::{solution, solution::Settlement}, + competition::solution::{self, Settlement}, eth, }, alloy::{primitives::Address, sol_types::SolCall}, - contracts::alloy::ILiquoriceSettlement, + contracts::alloy::LiquoriceSettlement, ethrpc::alloy::conversions::IntoAlloy, std::collections::HashSet, }; @@ -150,7 +150,7 @@ mod utils { } // Decode the calldata using the Liquorice settlement contract ABI - let input = ILiquoriceSettlement::ILiquoriceSettlement::settleSingleCall::abi_decode( + let input = LiquoriceSettlement::LiquoriceSettlement::settleSingleCall::abi_decode( &interaction.call_data.0, ) .ok()?; diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index 25923742c3..d0161b5a75 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -9,7 +9,7 @@ edition = "2024" license = "MIT OR Apache-2.0" [dependencies] -alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic","provider-anvil-api"] } +alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic", "provider-anvil-api", "sol-types"] } app-data = { workspace = true } anyhow = { workspace = true } autopilot = { workspace = true } diff --git a/crates/e2e/src/api/liquorice/mod.rs b/crates/e2e/src/api/liquorice/mod.rs index 0870e6cd46..74f47ad347 100644 --- a/crates/e2e/src/api/liquorice/mod.rs +++ b/crates/e2e/src/api/liquorice/mod.rs @@ -1,2 +1 @@ -pub mod onchain; pub mod server; diff --git a/crates/e2e/src/api/liquorice/onchain.rs b/crates/e2e/src/api/liquorice/onchain.rs deleted file mode 100644 index d2d2154556..0000000000 --- a/crates/e2e/src/api/liquorice/onchain.rs +++ /dev/null @@ -1,227 +0,0 @@ -pub use order::signature::DomainSeparator; -pub mod order { - pub use {signature::Signature, single::Single}; - pub mod single { - use { - super::signature::{DomainSeparator, Signature}, - crate::setup::TestAccount, - ethcontract::common::abi::{Token, encode}, - hex_literal::hex, - secp256k1::SecretKey, - web3::{ - signing, - signing::{Key, SecretKeyRef}, - types::{H160, U256}, - }, - }; - - pub struct Single { - pub rfq_id: String, - pub nonce: U256, - pub trader: H160, - pub effective_trader: H160, - pub base_token: H160, - pub quote_token: H160, - pub base_token_amount: U256, - pub quote_token_amount: U256, - pub min_fill_amount: U256, - pub quote_expiry: U256, - pub recipient: H160, - } - - impl Single { - // See - const LIQUORICE_SINGLE_ORDER_TYPEHASH: [u8; 32] = - hex!("d28e809b708f5ee38be8347d6d869d8232493c094ab2dde98369e4102369a99d"); - - pub fn sign( - &self, - domain_separator: &DomainSeparator, - hash: [u8; 32], - signer: &TestAccount, - ) -> Signature { - let hashed_signing_message = { - let mut msg = [0u8; 66]; - msg[0..2].copy_from_slice(&[0x19, 0x01]); - msg[2..34].copy_from_slice(&domain_separator.0); - msg[34..66].copy_from_slice(hash.as_ref()); - signing::keccak256(&msg) - }; - - let signature = - SecretKeyRef::from(&SecretKey::from_slice(signer.private_key()).unwrap()) - .sign(&hashed_signing_message, None) - .unwrap(); - - Signature { - signature_type: 3, // EIP-712 - transfer_command: 1, // Transfer command standard - signature_bytes: { - let mut sig_bytes = Vec::new(); - sig_bytes.extend_from_slice(&signature.r.0); - sig_bytes.extend_from_slice(&signature.s.0); - sig_bytes.extend_from_slice(&(signature.v as u8).to_be_bytes()); - ethcontract::Bytes(sig_bytes) - }, - } - } - - // See - pub fn hash(&self) -> [u8; 32] { - let order_data_part_1 = { - let mut hash_data = [0u8; 128]; - - hash_data[0..32].copy_from_slice(&Self::LIQUORICE_SINGLE_ORDER_TYPEHASH); - hash_data[32..64].copy_from_slice( - signing::keccak256( - encode(&[Token::String(self.rfq_id.clone())]).as_slice(), - ) - .as_slice(), - ); - self.nonce.to_big_endian(&mut hash_data[64..96]); - hash_data[108..128].clone_from_slice(self.trader.as_fixed_bytes()); - hash_data - }; - - let order_data_part_2 = { - let mut hash_data = [0u8; 256]; - - hash_data[12..32].copy_from_slice(self.effective_trader.as_fixed_bytes()); - hash_data[44..64].copy_from_slice(self.base_token.as_fixed_bytes()); - hash_data[76..96].copy_from_slice(self.quote_token.as_fixed_bytes()); - self.base_token_amount - .to_big_endian(&mut hash_data[96..128]); - self.quote_token_amount - .to_big_endian(&mut hash_data[128..160]); - self.min_fill_amount.to_big_endian(&mut hash_data[160..192]); - self.quote_expiry.to_big_endian(&mut hash_data[192..224]); - hash_data[236..256].copy_from_slice(self.recipient.as_fixed_bytes()); - hash_data - }; - - signing::keccak256( - [&order_data_part_1[..], &order_data_part_2[..]] - .concat() - .as_slice(), - ) - } - - pub fn as_tuple( - &self, - ) -> ( - String, - U256, - H160, - H160, - H160, - H160, - U256, - U256, - U256, - U256, - H160, - ) { - ( - self.rfq_id.clone(), - self.nonce, - self.trader, - self.effective_trader, - self.base_token, - self.quote_token, - self.base_token_amount, - self.quote_token_amount, - self.min_fill_amount, - self.quote_expiry, - self.recipient, - ) - } - } - - #[cfg(test)] - mod tests { - use { - super::Single, - hex_literal::hex, - web3::types::{H160, U256}, - }; - - #[test] - fn test_order_hash() { - let order = Single { - rfq_id: "c99d2e3f-702b-49c9-8bb8-43775770f2f3".to_string(), - nonce: U256::from(0), - trader: H160::from(hex!("48426Ef27C3555D44DACDD647D8f9bd0A7C06155")), - effective_trader: H160::from(hex!("033F42e758cEbEbC70Ee147F56ff92C9f7CA45F4")), - base_token: H160::from(hex!("82aF49447D8a07e3bd95BD0d56f35241523fBab1")), - quote_token: H160::from(hex!("2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f")), - base_token_amount: U256::from(1), - quote_token_amount: U256::from(2), - min_fill_amount: U256::from(1), - quote_expiry: U256::from(1715787259), - recipient: H160::from(hex!("033F42e758cEbEbC70Ee147F56ff92C9f7CA45F4")), - }; - - let hash = order.hash(); - - assert_eq!( - "d11023397b6e58bf8137e479bc552f06eb3b7527652528a047eae91bb391858d", - const_hex::encode(hash) - ); - } - } - } - - pub mod signature { - use { - autopilot::domain::eth::H160, - ethcontract::common::abi::{Token, encode}, - std::sync::LazyLock, - web3::signing, - }; - - #[derive(Copy, Clone, Default, Eq, PartialEq)] - pub struct DomainSeparator(pub [u8; 32]); - - impl DomainSeparator { - pub fn new(chain_id: u64, contract_address: H160) -> Self { - static DOMAIN_TYPE_HASH: LazyLock<[u8; 32]> = LazyLock::new(|| { - signing::keccak256( - b"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)", - ) - }); - - static DOMAIN_NAME: LazyLock<[u8; 32]> = - LazyLock::new(|| signing::keccak256(b"LiquoriceSettlement")); - - static DOMAIN_VERSION: LazyLock<[u8; 32]> = - LazyLock::new(|| signing::keccak256(b"1")); - - let abi_encode_string = encode(&[ - Token::Uint((*DOMAIN_TYPE_HASH).into()), - Token::Uint((*DOMAIN_NAME).into()), - Token::Uint((*DOMAIN_VERSION).into()), - Token::Uint(chain_id.into()), - Token::Address(contract_address), - ]); - - Self(signing::keccak256(abi_encode_string.as_slice())) - } - } - #[derive(Default)] - pub struct Signature { - pub signature_type: u8, - pub transfer_command: u8, - pub signature_bytes: ethcontract::Bytes>, - } - - impl Signature { - pub fn as_tuple(&self) -> (u8, u8, ethcontract::Bytes>) { - ( - self.signature_type, - self.transfer_command, - self.signature_bytes.clone(), - ) - } - } - } -} diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index 9d560fd2fc..f60442b5fc 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -1,11 +1,14 @@ use { - alloy::primitives::Bytes, + alloy::{ + primitives::{Address, Bytes, U256, address}, + signers::{SignerSync, local::PrivateKeySigner}, + }, chrono::Utc, contracts::{ ERC20, - alloy::{ILiquoriceSettlement, InstanceExt}, + alloy::{InstanceExt, LiquoriceSettlement}, }, - driver::{domain::eth::H160, infra}, + driver::infra, e2e::{ api, nodes::forked_node::ForkedNodeApi, @@ -22,12 +25,10 @@ use { }, tx, }, - ethcontract::prelude::U256, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, }, - hex_literal::hex, model::{ order::{OrderCreation, OrderKind}, signature::EcdsaSigningScheme, @@ -40,8 +41,8 @@ use { /// The block number from which we will fetch state for the forked tests. pub const FORK_BLOCK: u64 = 23326100; -pub const USDT_WHALE: H160 = H160(hex!("6AC38D1b2f0c0c3b9E816342b1CA14d91D5Ff60B")); -pub const USDC_WHALE: H160 = H160(hex!("01b8697695eab322a339c4bf75740db75dc9375e")); +pub const USDT_WHALE: Address = address!("6AC38D1b2f0c0c3b9E816342b1CA14d91D5Ff60B"); +pub const USDC_WHALE: Address = address!("01b8697695eab322a339c4bf75740db75dc9375e"); #[tokio::test] #[ignore] @@ -90,7 +91,10 @@ async fn liquidity_source_notification(web3: Web3) { // CoW onchain setup { // Fund trader - let usdc_whale = forked_node_api.impersonate(&USDC_WHALE).await.unwrap(); + let usdc_whale = forked_node_api + .impersonate(&USDC_WHALE.into_legacy()) + .await + .unwrap(); tx!( usdc_whale, token_usdc.transfer(trader.address(), trade_amount) @@ -105,7 +109,7 @@ async fn liquidity_source_notification(web3: Web3) { // Trader gives approval to the CoW allowance contract tx!( trader.account(), - token_usdc.approve(onchain.contracts().allowance, U256::MAX) + token_usdc.approve(onchain.contracts().allowance, ethcontract::U256::MAX) ); } @@ -113,9 +117,10 @@ async fn liquidity_source_notification(web3: Web3) { // Liquorice settlement contract through which we will trade with the // `liquorice_maker` - let liquorice_settlement = ILiquoriceSettlement::Instance::deployed(&web3.alloy) + let liquorice_settlement = LiquoriceSettlement::Instance::deployed(&web3.alloy) .await .unwrap(); + let liquorice_balance_manager_address = liquorice_settlement .BALANCE_MANAGER() .call() @@ -125,7 +130,10 @@ async fn liquidity_source_notification(web3: Web3) { // Fund `liquorice_maker` { - let usdt_whale = forked_node_api.impersonate(&USDT_WHALE).await.unwrap(); + let usdt_whale = forked_node_api + .impersonate(&USDT_WHALE.into_legacy()) + .await + .unwrap(); tx!( usdt_whale, token_usdt.transfer(liquorice_maker.address(), trade_amount) @@ -135,7 +143,7 @@ async fn liquidity_source_notification(web3: Web3) { // Maker gives approval to the Liquorice balance manager contract tx!( liquorice_maker.account(), - token_usdt.approve(liquorice_balance_manager_address, U256::MAX) + token_usdt.approve(liquorice_balance_manager_address, ethcontract::U256::MAX) ); // Liquorice API setup @@ -219,57 +227,45 @@ http-timeout = "10s" // Prepare Liquorice solution // Create Liquorice order - let liquorice_order = api::liquorice::onchain::order::Single { - rfq_id: "c99d2e3f-702b-49c9-8bb8-43775770f2f3".to_string(), + let liquorice_order = LiquoriceSettlement::ILiquoriceSettlement::Single { + rfqId: "c99d2e3f-702b-49c9-8bb8-43775770f2f3".to_string(), nonce: U256::from(0), - trader: onchain.contracts().gp_settlement.address().into_legacy(), - effective_trader: onchain.contracts().gp_settlement.address().into_legacy(), - base_token: token_usdc.address(), - quote_token: token_usdt.address(), - base_token_amount: trade_amount, - quote_token_amount: trade_amount, - min_fill_amount: U256::from(1), - quote_expiry: U256::from(Utc::now().timestamp() as u64 + 10), - recipient: liquorice_maker.address(), + trader: *onchain.contracts().gp_settlement.address(), + effectiveTrader: *onchain.contracts().gp_settlement.address(), + baseToken: token_usdc.address().into_alloy(), + quoteToken: token_usdt.address().into_alloy(), + baseTokenAmount: trade_amount.into_alloy(), + quoteTokenAmount: trade_amount.into_alloy(), + minFillAmount: U256::from(1), + quoteExpiry: U256::from(Utc::now().timestamp() as u64 + 10), + recipient: liquorice_maker.address().into_alloy(), }; // Create calldata let liquorice_solution_calldata = { + let liquorice_order_hash = liquorice_settlement + .hashSingleOrder(liquorice_order.clone()) + .call() + .await + .unwrap(); + // Create Liquorice order signature - let liquorice_order_signature = liquorice_order.sign( - &api::liquorice::onchain::DomainSeparator::new( - 1, - liquorice_settlement.address().into_legacy(), - ), - liquorice_order.hash(), - &liquorice_maker, - ); + let signer = PrivateKeySigner::from_slice(liquorice_maker.private_key()).unwrap(); + let liquorice_order_signature = signer.sign_hash_sync(&liquorice_order_hash).unwrap(); // Create Liquorice settlement calldata liquorice_settlement .settleSingle( liquorice_maker.address().into_alloy(), - ILiquoriceSettlement::ILiquoriceSettlement::Single { - rfqId: liquorice_order.rfq_id.clone(), - nonce: liquorice_order.nonce.into_alloy(), - trader: liquorice_order.trader.into_alloy(), - effectiveTrader: liquorice_order.effective_trader.into_alloy(), - baseToken: liquorice_order.base_token.into_alloy(), - quoteToken: liquorice_order.quote_token.into_alloy(), - baseTokenAmount: liquorice_order.base_token_amount.into_alloy(), - quoteTokenAmount: liquorice_order.quote_token_amount.into_alloy(), - minFillAmount: liquorice_order.min_fill_amount.into_alloy(), - quoteExpiry: liquorice_order.quote_expiry.into_alloy(), - recipient: liquorice_order.recipient.into_alloy(), - }, - ILiquoriceSettlement::Signature::TypedSignature { - signatureType: liquorice_order_signature.signature_type, - transferCommand: liquorice_order_signature.transfer_command, - signatureBytes: Bytes::from(liquorice_order_signature.signature_bytes.0), + liquorice_order.clone(), + LiquoriceSettlement::Signature::TypedSignature { + signatureType: 3, // EIP712 + transferCommand: 1, // SIMPLE_TRANSFER + signatureBytes: liquorice_order_signature.as_bytes().into(), }, - liquorice_order.quote_token_amount.into_alloy(), + liquorice_order.quoteTokenAmount, // Taker signature is not used in this use case - ILiquoriceSettlement::Signature::TypedSignature { + LiquoriceSettlement::Signature::TypedSignature { signatureType: 0, transferCommand: 0, signatureBytes: Bytes::from(vec![0u8; 65]), @@ -351,5 +347,5 @@ http-timeout = "10s" assert!(matches!(notification.content, Content::Settle(Settle { rfq_ids, .. - }) if rfq_ids.contains(&liquorice_order.rfq_id))); + }) if rfq_ids.contains(&liquorice_order.rfqId))); } From 91299bdeb3f47164db55fd22c8b7807e57263a4e Mon Sep 17 00:00:00 2001 From: Kaze Date: Fri, 31 Oct 2025 17:03:37 +0900 Subject: [PATCH 071/117] feat: generalized wrappers (#3700) ## Description this introduces the ability for a `wrapper` contract to be included in the appdata and solutions. A `wrapper` is a contract which is called with the same parameters as settlement contract `settle`, but executes a series of operations either/both before or after executing the actual GPv2Settlement contract's `settle` function. This simplifies integration. see the full info here https://www.notion.so/cownation/Generalized-Wrapper-2798da5f04ca8095a2d4c56b9d17134e Only approved `wrapper` contracts will be allowed to call the `GPv2Settlement` contract (via the current GPv2AllowlistAuthenticator), and it is expected that wrapper contracts will do the necessary validation of solvers on behalf of the settlement contract. Its expected that generalized wrappers can simplify the implementation of many initiatives, including: * "flashloans" integrations (ex. aave, euler) * enforcable pre- and post-hooks (users can ensure that post actions must at least be attempted, such as deposit to a vault) * ex: with our current CowShed implementation, if cross chain send were to fail due to ex. insufficient fee, funds can be sent back to the user rather than needing to be recovered from the CowShed contract * TWAP * currently we are implementing this for EOAs, but its very difficult to ensure funds are only pulled from the users wallet when needed because there is no auth. Since the CowShed could effectively become a wrapper contract, it can pull funds from user and immediately call the necessary `settle` function afterwards to ensure funds are traded. ## Implementation Notes * `wrappers` is added to the `appData` so that the frontend can "hint" the necessary flashloan or other required functionality if needed (similar to current `flashloans` functionality). More than one wrapper can be specified in a single order. A wrapper is combination of `address`, the address of the wrapper contract to execute, and `data`, which is any additional data required for the wrapper to execute * `wrappers` is added to solution so its easy for the driver to encode into a final solution. It is an array in order to accomodate different orders that require different wrappers. * additionally a solver can add their own wrapper if they determine its necessary/useful to get the best result from a trade (some already technically do this) Potentially further changes required/limitations: * when quoting, how can the use of a wrapper be effectively included in the calculation? * this implements handling in the autopilot and driver, but what will need to happen from the solver side? ## How to Test the Wrapper I have deployed a testing `EmptyWrapper` to `0x54112E2F481AC239661914691082039d7B05A264`. By using this contract as a simple wrapper, created a script to serve as a minimal E2E POC: This PR can be verified to be working E2E by taking the following steps: 1. Boot up the playground environment. I used the command: `docker compose -f playground/docker-compose.fork.yml up --build` 2. With all the services stabilized and running, open a new terminal and run the provided wrapper test script: `./playground/test_wrapper.sh` 3. In the docker compose logs, observe the order being placed, an auction held, and finally a transaction submitted to chain 4. The transaction result can be digested with `cast`: * To get the submitted transaction and all its data fields: `cast tx ` * To get the result of executing the transaction on-chain (the receipt): `cast receipt ` 5. It is also possible to see the order information and the active fields for `wrapper` and `wrapperData` by opening up https://localhost:8001 (the CoW Explorer) and putting in the printed order ID at the end of script execution. ## Related PRs and Documentation * general wiki https://www.notion.so/cownation/Generalized-Wrapper-2798da5f04ca8095a2d4c56b9d17134e * PR on the contract side https://github.com/cowprotocol/euler-integration-contracts/pull/6 --------- Co-authored-by: Martin Magnus --- Cargo.lock | 30 ++ configs/local/driver.toml | 2 + crates/app-data/src/app_data.rs | 22 ++ crates/contracts/artifacts/ICowWrapper.json | 41 +++ crates/contracts/src/alloy.rs | 2 + .../src/domain/competition/order/app_data.rs | 7 + .../domain/competition/solution/encoding.rs | 128 +++++-- .../src/domain/competition/solution/mod.rs | 10 + .../driver/src/infra/blockchain/contracts.rs | 6 + crates/driver/src/infra/solver/dto/auction.rs | 10 + .../driver/src/infra/solver/dto/solution.rs | 10 +- crates/driver/src/infra/solver/mod.rs | 26 ++ crates/e2e/Cargo.toml | 2 +- crates/e2e/tests/e2e/cow_amm.rs | 2 + crates/e2e/tests/e2e/jit_orders.rs | 1 + .../e2e/liquidity_source_notification.rs | 1 + crates/e2e/tests/e2e/main.rs | 1 + crates/e2e/tests/e2e/solver_competition.rs | 2 + crates/e2e/tests/e2e/wrapper.rs | 344 ++++++++++++++++++ crates/solvers-dto/src/auction.rs | 14 + crates/solvers-dto/src/solution.rs | 12 + .../src/api/routes/solve/dto/auction.rs | 9 + .../src/api/routes/solve/dto/solution.rs | 8 + crates/solvers/src/domain/order.rs | 8 + crates/solvers/src/domain/solution.rs | 17 + crates/solvers/src/domain/solver.rs | 13 +- 26 files changed, 700 insertions(+), 28 deletions(-) create mode 100644 crates/contracts/artifacts/ICowWrapper.json create mode 100644 crates/e2e/tests/e2e/wrapper.rs diff --git a/Cargo.lock b/Cargo.lock index 1c1d499189..ca700095d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,7 +380,9 @@ dependencies = [ "alloy-primitives", "alloy-rpc-client", "alloy-rpc-types-anvil", + "alloy-rpc-types-debug", "alloy-rpc-types-eth", + "alloy-rpc-types-trace", "alloy-signer", "alloy-sol-types", "alloy-transport", @@ -458,7 +460,9 @@ checksum = "339af7336571dd39ae3a15bde08ae6a647e62f75350bd415832640268af92c06" dependencies = [ "alloy-primitives", "alloy-rpc-types-anvil", + "alloy-rpc-types-debug", "alloy-rpc-types-eth", + "alloy-rpc-types-trace", "alloy-serde", "serde", ] @@ -486,6 +490,18 @@ dependencies = [ "alloy-serde", ] +[[package]] +name = "alloy-rpc-types-debug" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388cf910e66bd4f309a81ef746dcf8f9bca2226e3577890a8d56c5839225cf46" +dependencies = [ + "alloy-primitives", + "derive_more 2.0.1", + "serde", + "serde_with", +] + [[package]] name = "alloy-rpc-types-eth" version = "1.0.41" @@ -507,6 +523,20 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "alloy-rpc-types-trace" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de4e95fb0572b97b17751d0fdf5cdc42b0050f9dd9459eddd1bf2e2fbfed0a33" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", + "serde_json", + "thiserror 2.0.12", +] + [[package]] name = "alloy-serde" version = "1.0.41" diff --git a/configs/local/driver.toml b/configs/local/driver.toml index dea62fd2c5..89c9cd8621 100644 --- a/configs/local/driver.toml +++ b/configs/local/driver.toml @@ -1,3 +1,5 @@ +app-data-fetching-enabled = true +orderbook-url = "http://orderbook" tx-gas-limit = "45000000" [[solver]] diff --git a/crates/app-data/src/app_data.rs b/crates/app-data/src/app_data.rs index ddd00cb5d8..915b7916c4 100644 --- a/crates/app-data/src/app_data.rs +++ b/crates/app-data/src/app_data.rs @@ -1,6 +1,7 @@ use { crate::{AppDataHash, Hooks, app_data_hash::hash_full_app_data}, anyhow::{Context, Result, anyhow}, + bytes_hex::BytesHex, number::serialization::HexOrDecimalU256, primitive_types::{H160, U256}, serde::{Deserialize, Deserializer, Serialize, Serializer, de}, @@ -21,6 +22,7 @@ pub struct ValidatedAppData { pub protocol: ProtocolAppData, } +#[serde_as] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)] #[cfg_attr(any(test, feature = "test_helpers"), derive(Serialize))] #[serde(rename_all = "camelCase")] @@ -32,6 +34,8 @@ pub struct ProtocolAppData { #[serde(default)] pub partner_fee: PartnerFees, pub flashloan: Option, + #[serde(default)] + pub wrappers: Vec, } /// Contains information to hint at how a solver could make @@ -57,6 +61,23 @@ pub struct Flashloan { pub amount: U256, } +/// Contains information about wrapper contracts +#[serde_as] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq)] +#[cfg_attr(any(test, feature = "test_helpers"), derive(Serialize))] +#[serde(rename_all = "camelCase")] +pub struct WrapperCall { + /// The address of the wrapper contract. + pub address: H160, + /// Additional calldata to be passed to the wrapper contract. + #[serde_as(as = "BytesHex")] + pub data: Vec, + /// Declares whether this wrapper (and its data) needs to be included + /// unmodified in a solution containing this order. + #[serde(default)] + pub is_omittable: bool, +} + #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)] #[cfg_attr(any(test, feature = "test_helpers"), derive(Serialize))] pub struct ReplacedOrder { @@ -440,6 +461,7 @@ impl From for ProtocolAppData { fn from(value: BackendAppData) -> Self { Self { hooks: value.hooks, + wrappers: Vec::new(), signer: None, replaced_order: None, partner_fee: PartnerFees::default(), diff --git a/crates/contracts/artifacts/ICowWrapper.json b/crates/contracts/artifacts/ICowWrapper.json new file mode 100644 index 0000000000..4a5d36a0a5 --- /dev/null +++ b/crates/contracts/artifacts/ICowWrapper.json @@ -0,0 +1,41 @@ +{ + "abi": [ + { + "type": "function", + "name": "parseWrapperData", + "inputs": [ + { + "name": "wrapperData", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [ + { + "name": "remainingWrapperData", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "wrappedSettle", + "inputs": [ + { + "name": "settleData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "wrapperData", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + } + ] +} diff --git a/crates/contracts/src/alloy.rs b/crates/contracts/src/alloy.rs index 55938c0675..b575da1112 100644 --- a/crates/contracts/src/alloy.rs +++ b/crates/contracts/src/alloy.rs @@ -615,6 +615,8 @@ crate::bindings!( } ); +crate::bindings!(ICowWrapper); + // Only used in crate::bindings!( Permit2, diff --git a/crates/driver/src/domain/competition/order/app_data.rs b/crates/driver/src/domain/competition/order/app_data.rs index 73345760c8..937eda7bf9 100644 --- a/crates/driver/src/domain/competition/order/app_data.rs +++ b/crates/driver/src/domain/competition/order/app_data.rs @@ -126,6 +126,13 @@ impl AppData { Self::Full(data) => data.protocol.flashloan.as_ref(), } } + + pub fn wrappers(&self) -> &[app_data::WrapperCall] { + match self { + Self::Hash(_) => &[], + Self::Full(data) => &data.protocol.wrappers, + } + } } impl From<[u8; APP_DATA_LEN]> for AppData { diff --git a/crates/driver/src/domain/competition/solution/encoding.rs b/crates/driver/src/domain/competition/solution/encoding.rs index 6ef98656c9..f488d2c383 100644 --- a/crates/driver/src/domain/competition/solution/encoding.rs +++ b/crates/driver/src/domain/competition/solution/encoding.rs @@ -13,6 +13,7 @@ use { util::Bytes, }, allowance::Allowance, + alloy::sol_types::SolCall, contracts::alloy::{FlashLoanRouter::LoanRequest, WETH9}, ethcontract::H160, ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, @@ -32,6 +33,8 @@ pub enum Error { // TODO: remove when contracts are deployed everywhere #[error("flashloan support disabled")] FlashloanSupportDisabled, + #[error("both wrappers and flashloans cannot be encoded in the same auction")] + FlashloanWrappersIncompatible, } pub fn tx( @@ -206,6 +209,10 @@ pub fn tx( interactions.push(unwrap(native_unwrap, contracts.weth())); } + let has_flashloans = !solution.flashloans.is_empty(); + let has_wrappers = !solution.wrappers.is_empty(); + + // Encode the base settlement calldata let mut settle_calldata = contracts .settlement() .settle( @@ -221,36 +228,20 @@ pub fn tx( .calldata() .to_vec(); - // Encode the auction id into the calldata + // Append auction ID to settlement calldata settle_calldata.extend(auction.id().ok_or(Error::MissingAuctionId)?.to_be_bytes()); - // Target and calldata depend on whether a flashloan is used - let (to, calldata) = if solution.flashloans.is_empty() { + let (to, calldata) = if has_flashloans && has_wrappers { + return Err(Error::FlashloanWrappersIncompatible); + } else if has_flashloans { + encode_flashloan_settlement(solution, contracts, settle_calldata)? + } else if has_wrappers { + encode_wrapper_settlement(solution, settle_calldata) + } else { ( contracts.settlement().address().into_legacy().into(), settle_calldata, ) - } else { - let router = contracts - .flashloan_router() - .ok_or(Error::FlashloanSupportDisabled)?; - - let flashloans = solution - .flashloans - .values() - .map(|flashloan| LoanRequest::Data { - amount: flashloan.amount.0.into_alloy(), - borrower: flashloan.protocol_adapter.0.into_alloy(), - lender: flashloan.liquidity_provider.0.into_alloy(), - token: flashloan.token.0.0.into_alloy(), - }) - .collect(); - - let calldata = router - .flashLoanAndSettle(flashloans, settle_calldata.into()) - .calldata() - .to_vec(); - (router.address().into_legacy().into(), calldata) }; Ok(eth::Tx { @@ -262,6 +253,95 @@ pub fn tx( }) } +/// Encodes a settlement transaction that uses flashloans. +/// +/// Takes the base settlement calldata and wraps it in a flashLoanAndSettle call +/// to the flashloan router contract. +/// +/// Returns (router_address, flashloan_calldata) +fn encode_flashloan_settlement( + solution: &super::Solution, + contracts: &infra::blockchain::Contracts, + settle_calldata: Vec, +) -> Result<(eth::Address, Vec), Error> { + // Get flashloan router contract + let router = contracts + .flashloan_router() + .ok_or(Error::FlashloanSupportDisabled)?; + + // Convert flashloans to LoanRequest format + let flashloans = solution + .flashloans + .values() + .map(|flashloan| LoanRequest::Data { + amount: flashloan.amount.0.into_alloy(), + borrower: flashloan.protocol_adapter.0.into_alloy(), + lender: flashloan.liquidity_provider.0.into_alloy(), + token: flashloan.token.0.0.into_alloy(), + }) + .collect(); + + // Wrap settlement in flashLoanAndSettle call + let calldata = router + .flashLoanAndSettle(flashloans, settle_calldata.into()) + .calldata() + .to_vec(); + + Ok((router.address().into_legacy().into(), calldata)) +} + +/// Encodes a settlement transaction that uses wrapper contracts. +/// +/// Takes the base settlement calldata and wraps it in a wrappedSettleCall +/// with encoded wrapper metadata. Since wrappers are a chain, the wrapper +/// address to call is also processed by this function. +/// +/// Returns (first_wrapper_address, wrapped_calldata) +fn encode_wrapper_settlement( + solution: &super::Solution, + settle_calldata: Vec, +) -> (eth::Address, Vec) { + // Encode wrapper metadata + let wrapper_data = encode_wrapper_data(&solution.wrappers); + + // Create wrappedSettleCall + let calldata = contracts::alloy::ICowWrapper::ICowWrapper::wrappedSettleCall { + settleData: settle_calldata.into(), + wrapperData: wrapper_data.into(), + } + .abi_encode(); + + (solution.wrappers[0].address, calldata) +} + +/// Encodes wrapper metadata for wrapper settlement calls. +/// +/// The format is: +/// - For wrappers after the first: 20 bytes (address) +/// - For each wrapper: 2 bytes (data length as u16 in native endian) + data +/// +/// More information about wrapper encoding: +/// https://www.notion.so/cownation/Generalized-Wrapper-2798da5f04ca8095a2d4c56b9d17134e?source=copy_link#2858da5f04ca807980bbf7f845354120 +/// +/// Note: The first wrapper address is omitted from the encoded data since it's +/// already used as the transaction target. +fn encode_wrapper_data(wrappers: &[super::WrapperCall]) -> Vec { + let mut wrapper_data = Vec::new(); + + for (index, w) in wrappers.iter().enumerate() { + // Skip first wrapper's address (it's the transaction target) + if index != 0 { + wrapper_data.extend(w.address.0.as_bytes()); + } + + // Encode data length as u16 in native endian, then the data itself + wrapper_data.extend((w.data.len() as u16).to_be_bytes().to_vec()); + wrapper_data.extend(w.data.clone()); + } + + wrapper_data +} + pub fn liquidity_interaction( liquidity: &Liquidity, slippage: &slippage::Parameters, diff --git a/crates/driver/src/domain/competition/solution/mod.rs b/crates/driver/src/domain/competition/solution/mod.rs index 4c9b6f161b..71c16fb9f2 100644 --- a/crates/driver/src/domain/competition/solution/mod.rs +++ b/crates/driver/src/domain/competition/solution/mod.rs @@ -39,6 +39,12 @@ pub use {error::Error, interaction::Interaction, settlement::Settlement, trade:: type Prices = HashMap; +#[derive(Clone)] +pub struct WrapperCall { + pub address: eth::Address, + pub data: Vec, +} + // TODO Add a constructor and ensure that the clearing prices are included for // each trade /// A solution represents a set of orders which the solver has found an optimal @@ -56,6 +62,7 @@ pub struct Solution { weth: eth::WethAddress, gas: Option, flashloans: HashMap, + wrappers: Vec, } impl Solution { @@ -73,6 +80,7 @@ impl Solution { fee_handler: FeeHandler, surplus_capturing_jit_order_owners: &HashSet, flashloans: HashMap, + wrappers: Vec, ) -> Result { // Surplus capturing JIT orders behave like Fulfillment orders. They capture // surplus, pay network fees and contribute to score of a solution. @@ -129,6 +137,7 @@ impl Solution { weth, gas, flashloans, + wrappers, }; // Check that the solution includes clearing prices for all user trades. @@ -383,6 +392,7 @@ impl Solution { (None, None) => None, }, flashloans, + wrappers: self.wrappers.clone(), }) } diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index ec03aa7627..6b9d35a5be 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -36,6 +36,7 @@ pub struct Contracts { /// Mapping from CoW AMM factory address to the corresponding CoW AMM /// helper. cow_amm_helper_by_factory: HashMap, + web3: Web3, } #[derive(Debug, Default, Clone)] @@ -122,6 +123,7 @@ impl Contracts { flashloan_router, balance_helper, cow_amm_helper_by_factory: addresses.cow_amm_helper_by_factory, + web3: web3.clone(), }) } @@ -161,6 +163,10 @@ impl Contracts { &self.balance_helper } + pub fn web3(&self) -> &Web3 { + &self.web3 + } + pub fn cow_amm_helper_by_factory( &self, ) -> &HashMap { diff --git a/crates/driver/src/infra/solver/dto/auction.rs b/crates/driver/src/infra/solver/dto/auction.rs index 3e6887f336..1af418428a 100644 --- a/crates/driver/src/infra/solver/dto/auction.rs +++ b/crates/driver/src/infra/solver/dto/auction.rs @@ -17,6 +17,9 @@ use { std::collections::HashMap, }; +pub type WrapperCalls = HashMap>; + +#[expect(clippy::too_many_arguments)] pub fn new( auction: &competition::Auction, liquidity: &[liquidity::Liquidity], @@ -24,6 +27,7 @@ pub fn new( fee_handler: FeeHandler, solver_native_token: ManageNativeToken, flashloan_hints: &HashMap, + wrappers: &WrapperCalls, deadline: chrono::DateTime, ) -> solvers_dto::auction::Auction { let mut tokens: HashMap = auction @@ -154,6 +158,12 @@ pub fn new( ), app_data: AppDataHash(order.app_data.hash().0.into()), flashloan_hint: flashloan_hints.get(&order.uid).map(Into::into), + wrappers: wrappers + .get(&order.uid) + .into_iter() + .flatten() + .cloned() + .collect(), signature: order.signature.data.clone().into(), signing_scheme: match order.signature.scheme { Scheme::Eip712 => solvers_dto::auction::SigningScheme::Eip712, diff --git a/crates/driver/src/infra/solver/dto/solution.rs b/crates/driver/src/infra/solver/dto/solution.rs index 3b00f54155..e6e3a5927f 100644 --- a/crates/driver/src/infra/solver/dto/solution.rs +++ b/crates/driver/src/infra/solver/dto/solution.rs @@ -1,6 +1,10 @@ use { crate::{ - domain::{competition, eth, liquidity}, + domain::{ + competition::{self, solution::WrapperCall}, + eth, + liquidity, + }, infra::Solver, util::Bytes, }, @@ -224,6 +228,10 @@ impl Solutions { flashloan_hints.get(&uid).cloned()?, )) }).collect()), + solution.wrappers.iter().cloned().map(|w| WrapperCall { + address: eth::Address(w.address), + data: w.data, + }).collect() ) .map_err(|err| match err { competition::solution::error::Solution::InvalidClearingPrices => { diff --git a/crates/driver/src/infra/solver/mod.rs b/crates/driver/src/infra/solver/mod.rs index fa0de7aff4..0099418ec4 100644 --- a/crates/driver/src/infra/solver/mod.rs +++ b/crates/driver/src/infra/solver/mod.rs @@ -238,6 +238,9 @@ impl Solver { let start = Instant::now(); let flashloan_hints = self.assemble_flashloan_hints(auction); + let wrappers = self.assemble_wrappers(auction); + + // Fetch the solutions from the solver. let weth = self.eth.contracts().weth_address(); let auction_dto = dto::auction::new( auction, @@ -246,6 +249,7 @@ impl Solver { self.config.fee_handler, self.config.solver_native_token, &flashloan_hints, + &wrappers, auction.deadline(self.timeouts()).solvers(), ); @@ -340,6 +344,28 @@ impl Solver { .collect() } + fn assemble_wrappers(&self, auction: &Auction) -> dto::auction::WrapperCalls { + auction + .orders() + .iter() + .filter_map(|order| { + let wrappers = order.app_data.wrappers(); + if wrappers.is_empty() { + return None; + } + let wrapper_calls = wrappers + .iter() + .map(|w| solvers_dto::auction::WrapperCall { + address: w.address, + data: w.data.clone(), + is_omittable: w.is_omittable, + }) + .collect(); + Some((order.uid, wrapper_calls)) + }) + .collect() + } + /// Make a fire and forget POST request to notify the solver about an event. pub fn notify( &self, diff --git a/crates/e2e/Cargo.toml b/crates/e2e/Cargo.toml index d0161b5a75..a616862d68 100644 --- a/crates/e2e/Cargo.toml +++ b/crates/e2e/Cargo.toml @@ -9,7 +9,7 @@ edition = "2024" license = "MIT OR Apache-2.0" [dependencies] -alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic", "provider-anvil-api", "sol-types"] } +alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-local", "signer-mnemonic", "provider-anvil-api", "provider-debug-api", "sol-types"] } app-data = { workspace = true } anyhow = { workspace = true } autopilot = { workspace = true } diff --git a/crates/e2e/tests/e2e/cow_amm.rs b/crates/e2e/tests/e2e/cow_amm.rs index 6e389aafec..030d14066c 100644 --- a/crates/e2e/tests/e2e/cow_amm.rs +++ b/crates/e2e/tests/e2e/cow_amm.rs @@ -356,6 +356,7 @@ async fn cow_amm_jit(web3: Web3) { post_interactions: vec![], gas: None, flashloans: None, + wrappers: vec![], })); // Drive solution @@ -998,6 +999,7 @@ async fn cow_amm_opposite_direction(web3: Web3) { post_interactions: vec![], gas: None, flashloans: None, + wrappers: vec![], } }; diff --git a/crates/e2e/tests/e2e/jit_orders.rs b/crates/e2e/tests/e2e/jit_orders.rs index f6e01f473e..89e5f1ae04 100644 --- a/crates/e2e/tests/e2e/jit_orders.rs +++ b/crates/e2e/tests/e2e/jit_orders.rs @@ -187,6 +187,7 @@ async fn single_limit_order_test(web3: Web3) { post_interactions: vec![], gas: None, flashloans: None, + wrappers: vec![], })); // Drive solution diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index f60442b5fc..6b3b665fde 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -308,6 +308,7 @@ http-timeout = "10s" post_interactions: vec![], gas: None, flashloans: None, + wrappers: vec![], })); // Wait for trade diff --git a/crates/e2e/tests/e2e/main.rs b/crates/e2e/tests/e2e/main.rs index 0d60c18b7a..02a8bd9d7f 100644 --- a/crates/e2e/tests/e2e/main.rs +++ b/crates/e2e/tests/e2e/main.rs @@ -37,3 +37,4 @@ mod tracking_insufficient_funds; mod uncovered_order; mod univ2; mod vault_balances; +mod wrapper; diff --git a/crates/e2e/tests/e2e/solver_competition.rs b/crates/e2e/tests/e2e/solver_competition.rs index 608f371f56..4c1c902cf7 100644 --- a/crates/e2e/tests/e2e/solver_competition.rs +++ b/crates/e2e/tests/e2e/solver_competition.rs @@ -461,6 +461,7 @@ async fn store_filtered_solutions(web3: Web3) { post_interactions: vec![], gas: None, flashloans: None, + wrappers: vec![], })); // bad solver settles both orders at 2:1. Because it can't beat the @@ -490,6 +491,7 @@ async fn store_filtered_solutions(web3: Web3) { post_interactions: vec![], gas: None, flashloans: None, + wrappers: vec![], })); // Drive solution diff --git a/crates/e2e/tests/e2e/wrapper.rs b/crates/e2e/tests/e2e/wrapper.rs new file mode 100644 index 0000000000..322510f6c3 --- /dev/null +++ b/crates/e2e/tests/e2e/wrapper.rs @@ -0,0 +1,344 @@ +use { + ::alloy::{ + primitives::{Address, address}, + providers::{ + Provider, + ext::{AnvilApi, DebugApi, ImpersonateConfig}, + }, + rpc::types::trace::geth::{CallConfig, GethDebugTracingOptions}, + }, + app_data::{AppDataHash, hash_full_app_data}, + contracts::alloy::ERC20, + e2e::setup::*, + ethrpc::alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, + model::{ + order::{OrderCreation, OrderCreationAppData, OrderKind}, + quote::{OrderQuoteRequest, OrderQuoteSide, SellAmount}, + signature::EcdsaSigningScheme, + }, + secp256k1::SecretKey, + serde_json::json, + shared::ethrpc::Web3, + web3::signing::SecretKeyRef, +}; + +/// The block number from which we will fetch state for the forked test. +const FORK_BLOCK_MAINNET: u64 = 23688436; + +/// EmptyWrapper contract address deployed on mainnet. +const EMPTY_WRAPPER_MAINNET: Address = address!("751871E9cA28B441Bb6d3b7C4255cf2B5873d56a"); + +#[tokio::test] +#[ignore] +async fn forked_node_mainnet_wrapper() { + run_forked_test_with_block_number( + forked_mainnet_wrapper_test, + std::env::var("FORK_URL_MAINNET") + .expect("FORK_URL_MAINNET must be set to run forked tests"), + FORK_BLOCK_MAINNET, + ) + .await; +} + +/// Test that orders can be placed with wrapper contracts specified in the app +/// data. +async fn forked_mainnet_wrapper_test(web3: Web3) { + let mut onchain = OnchainComponents::deployed(web3.clone()).await; + + let [solver] = onchain.make_solvers_forked(to_wei(1)).await; + let [trader] = onchain.make_accounts(to_wei(2)).await; + + let token_weth = onchain.contracts().weth.clone(); + let token_usdc = ERC20::Instance::new( + address!("a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"), + web3.alloy.clone(), + ); + + // Authorize the empty wrapper as a solver + web3.alloy + .anvil_send_impersonated_transaction_with_config( + onchain + .contracts() + .gp_authenticator + .addSolver(EMPTY_WRAPPER_MAINNET) + .from( + onchain + .contracts() + .gp_authenticator + .manager() + .call() + .await + .unwrap(), + ) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: Some(to_wei(1).into_alloy()), + stop_impersonate: true, + }, + ) + .await + .unwrap() + .get_receipt() + .await + .unwrap(); + + // Trader deposits ETH to get WETH + token_weth + .deposit() + .value(to_wei(1).into_alloy()) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + + // Approve GPv2 for trading + token_weth + .approve( + onchain.contracts().allowance.into_alloy(), + to_wei(1).into_alloy(), + ) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + + // Start services + let services = Services::new(&onchain).await; + services.start_protocol(solver).await; + + onchain.mint_block().await; + + // Create app data with the deployed EmptyWrapper contract + let app_data = json!({ + "version": "0.9.0", + "metadata": { + "wrappers": [ + { + "address": format!("{:?}", EMPTY_WRAPPER_MAINNET), + "data": "0xbeef", + "isOmittable": false, + }, + { + "address": format!("{:?}", EMPTY_WRAPPER_MAINNET), + "data": "0xfeed", + "isOmittable": false, + }, + ] + } + }) + .to_string(); + + let app_data_hash = AppDataHash(hash_full_app_data(app_data.as_bytes())); + + // Warm up co-located driver by quoting the order + let _ = services + .submit_quote(&OrderQuoteRequest { + sell_token: token_weth.address().into_legacy(), + buy_token: token_usdc.address().into_legacy(), + side: OrderQuoteSide::Sell { + sell_amount: SellAmount::BeforeFee { + value: to_wei(1).try_into().unwrap(), + }, + }, + app_data: OrderCreationAppData::Both { + full: app_data.clone(), + expected: app_data_hash, + }, + ..Default::default() + }) + .await; + + tracing::info!("Creating order with wrapper in app data"); + let order = OrderCreation { + app_data: OrderCreationAppData::Both { + full: app_data.clone(), + expected: app_data_hash, + }, + sell_token: token_weth.address().into_legacy(), + sell_amount: to_wei(1), + buy_token: token_usdc.address().into_legacy(), + buy_amount: 1.into(), + valid_to: model::time::now_in_epoch_seconds() + 300, + kind: OrderKind::Sell, + ..Default::default() + } + .sign( + EcdsaSigningScheme::Eip712, + &onchain.contracts().domain_separator, + SecretKeyRef::from(&SecretKey::from_slice(trader.private_key()).unwrap()), + ); + + let sell_token_balance_before = token_weth + .balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap(); + let buy_token_balance_before = token_usdc + .balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap(); + + // Create the order + let order_uid = services.create_order(&order).await.unwrap(); + tracing::info!("Order created with UID: {:?}", order_uid); + + // Verify the order was created with correct app data + let created_order = services.get_order(&order_uid).await.unwrap(); + assert_eq!(created_order.data.app_data, app_data_hash); + assert_eq!( + created_order.metadata.full_app_data.as_deref(), + Some(app_data.as_str()) + ); + + // Verify app data can be retrieved + let retrieved_app_data = services.get_app_data(app_data_hash).await.unwrap(); + assert_eq!(retrieved_app_data, app_data); + + // Drive solution + tracing::info!("Waiting for trade."); + + wait_for_condition(TIMEOUT, || async { + onchain.mint_block().await; + let sell_token_balance_after = token_weth + .balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap(); + let buy_token_balance_after = token_usdc + .balanceOf(trader.address().into_alloy()) + .call() + .await + .unwrap(); + + (sell_token_balance_before > sell_token_balance_after) + && (buy_token_balance_after > buy_token_balance_before) + }) + .await + .unwrap(); + + tracing::info!("Transaction completion observed."); + + wait_for_condition(TIMEOUT, || async { + // It takes a bit of extra time for the API to receive the actual txn + let trades_result = services.get_trades(&order_uid).await.unwrap(); + !trades_result.is_empty() + }) + .await + .unwrap(); + + // slight repeating of code here because accessing the data from within the + // `wait_for_condition` turns out to be difficult + let trades_result = services.get_trades(&order_uid).await.unwrap(); + let solve_tx_hash = trades_result[0].tx_hash.unwrap(); + tracing::info!("Settlement transaction hash: {:?}", solve_tx_hash); + + let solve_tx = web3 + .alloy + .get_transaction_by_hash(solve_tx_hash.into_alloy()) + .await + .unwrap() + .unwrap() + .into_request(); + + // the call itself should have gone to the wrapper + assert_eq!( + solve_tx.to.unwrap().into_to().unwrap(), + EMPTY_WRAPPER_MAINNET + ); + + // Trace the transaction to verify both wrapper calls happened + tracing::info!("Tracing transaction to verify wrapper calls"); + + // Create GethDebugTracingOptions with callTracer explicitly set + let tracing_options = GethDebugTracingOptions { + tracer: Some( + ::alloy::rpc::types::trace::geth::GethDebugTracerType::BuiltInTracer( + ::alloy::rpc::types::trace::geth::GethDebugBuiltInTracerType::CallTracer, + ), + ), + tracer_config: serde_json::to_value(CallConfig::default()) + .ok() + .and_then(|v| serde_json::from_value(v).ok()) + .unwrap(), + ..Default::default() + }; + + let trace = web3 + .alloy + .debug_trace_transaction(solve_tx_hash.into_alloy(), tracing_options) + .await + .unwrap(); + + // Extract call frame from the trace + let call_frame = match trace { + ::alloy::rpc::types::trace::geth::GethTrace::CallTracer(frame) => frame, + other => panic!("Expected CallTracer trace but got: {:?}", other), + }; + + // Verify that we have calls to the wrapper with the expected data + let mut wrapper_calls = Vec::new(); + fn collect_wrapper_calls( + frame: &::alloy::rpc::types::trace::geth::CallFrame, + wrapper_addr: Address, + calls: &mut Vec<::alloy::primitives::Bytes>, + ) { + if frame.to == Some(wrapper_addr) { + calls.push(frame.input.clone()); + } + for call in &frame.calls { + collect_wrapper_calls(call, wrapper_addr, calls); + } + } + collect_wrapper_calls(&call_frame, EMPTY_WRAPPER_MAINNET, &mut wrapper_calls); + + tracing::info!( + "Found {} wrapper calls in transaction trace", + wrapper_calls.len() + ); + assert_eq!( + wrapper_calls.len(), + 2, + "Expected 2 wrapper calls but found {}", + wrapper_calls.len() + ); + + // Verify the wrapper calls contain the expected data (0xbeef and 0xfeed) + let call_data_strings: Vec = wrapper_calls + .iter() + .map(|data| format!("{:?}", data)) + .collect(); + + assert!( + call_data_strings[0].contains("0002beef"), + "Initial call data does not contain first wrapper data" + ); + assert!( + call_data_strings[1].contains("0002feed"), + "Initial call data does not contain second wrapper data" + ); + tracing::info!("Wrapper call data: {:?}", call_data_strings); + + // Check that the auction ID propogated through the wrappers ok + // Sometimes the API isnt ready to respond to the request immediately so we wait + // a bit for success + wait_for_condition(TIMEOUT, || async { + let auction_info = services.get_solver_competition(solve_tx_hash).await; + + if let Ok(a) = auction_info { + tracing::info!("Pulled auction id {:?}", a.auction_id); + true + } else { + false + } + }) + .await + .unwrap(); + + tracing::info!( + "Order with wrapper successfully traded on forked mainnet with verified wrapper calls" + ); +} diff --git a/crates/solvers-dto/src/auction.rs b/crates/solvers-dto/src/auction.rs index 736e212abe..0f2ab355ec 100644 --- a/crates/solvers-dto/src/auction.rs +++ b/crates/solvers-dto/src/auction.rs @@ -56,6 +56,8 @@ pub struct Order { pub app_data: AppDataHash, #[serde(skip_serializing_if = "Option::is_none")] pub flashloan_hint: Option, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub wrappers: Vec, pub signing_scheme: SigningScheme, #[serde(with = "bytes_hex")] pub signature: Vec, @@ -294,3 +296,15 @@ pub struct FlashloanHint { #[serde_as(as = "HexOrDecimalU256")] pub amount: U256, } + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WrapperCall { + pub address: H160, + #[serde(with = "bytes_hex")] + pub data: Vec, + /// Declares whether this wrapper (and its data) needs to be included + /// unmodified in a solution containing this order. + #[serde(default)] + pub is_omittable: bool, +} diff --git a/crates/solvers-dto/src/solution.rs b/crates/solvers-dto/src/solution.rs index 8230d9f0ef..2037117c3f 100644 --- a/crates/solvers-dto/src/solution.rs +++ b/crates/solvers-dto/src/solution.rs @@ -30,6 +30,8 @@ pub struct Solution { pub gas: Option, #[serde(skip_serializing_if = "Option::is_none", default)] pub flashloans: Option>, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub wrappers: Vec, } #[serde_as] @@ -216,3 +218,13 @@ pub struct Flashloan { #[serde_as(as = "HexOrDecimalU256")] pub amount: U256, } + +#[serde_as] +#[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct WrapperCall { + pub address: H160, + #[serde_as(as = "serialize::Hex")] + #[serde(default)] + pub data: Vec, +} diff --git a/crates/solvers/src/api/routes/solve/dto/auction.rs b/crates/solvers/src/api/routes/solve/dto/auction.rs index e1a4bea323..3bbc635716 100644 --- a/crates/solvers/src/api/routes/solve/dto/auction.rs +++ b/crates/solvers/src/api/routes/solve/dto/auction.rs @@ -69,6 +69,15 @@ pub fn into_domain(auction: Auction) -> Result { token: eth::TokenAddress(hint.token), amount: hint.amount, }), + wrappers: order + .wrappers + .clone() + .iter() + .map(|w| order::WrapperCall { + address: w.address, + data: w.data.clone(), + }) + .collect(), }) .collect(), liquidity: auction diff --git a/crates/solvers/src/api/routes/solve/dto/solution.rs b/crates/solvers/src/api/routes/solve/dto/solution.rs index 66a7e28ff4..206a9428c2 100644 --- a/crates/solvers/src/api/routes/solve/dto/solution.rs +++ b/crates/solvers/src/api/routes/solve/dto/solution.rs @@ -118,6 +118,14 @@ pub fn from_domain(solutions: &[solution::Solution]) -> super::Solutions { gas: solution.gas.map(|gas| gas.0.as_u64()), // rely on driver to fill in the blanks flashloans: None, + wrappers: solution + .wrappers + .iter() + .map(|w| solvers_dto::solution::WrapperCall { + address: w.target.0, + data: w.data.clone(), + }) + .collect(), }) .collect(), } diff --git a/crates/solvers/src/domain/order.rs b/crates/solvers/src/domain/order.rs index 705964786f..026cd07679 100644 --- a/crates/solvers/src/domain/order.rs +++ b/crates/solvers/src/domain/order.rs @@ -2,6 +2,7 @@ use { crate::{domain::eth, util}, + ethcontract::H160, ethereum_types::{Address, H256}, std::fmt::{self, Debug, Display, Formatter}, }; @@ -16,6 +17,7 @@ pub struct Order { pub class: Class, pub partially_fillable: bool, pub flashloan_hint: Option, + pub wrappers: Vec, } impl Order { @@ -144,3 +146,9 @@ pub struct FlashloanHint { pub token: eth::TokenAddress, pub amount: eth::U256, } + +#[derive(Debug, Clone)] +pub struct WrapperCall { + pub address: H160, + pub data: Vec, +} diff --git a/crates/solvers/src/domain/solution.rs b/crates/solvers/src/domain/solution.rs index 497a23303f..ae81bb227b 100644 --- a/crates/solvers/src/domain/solution.rs +++ b/crates/solvers/src/domain/solution.rs @@ -7,6 +7,12 @@ use { #[derive(Debug, Default, Copy, Clone)] pub struct Id(pub u64); +#[derive(Debug, Default)] +pub struct WrapperCall { + pub target: eth::Address, + pub data: Vec, +} + /// A solution to an auction. #[derive(Debug, Default)] pub struct Solution { @@ -17,6 +23,7 @@ pub struct Solution { pub interactions: Vec, pub post_interactions: Vec, pub gas: Option, + pub wrappers: Vec, } impl Solution { @@ -110,6 +117,8 @@ pub struct Single { pub interactions: Vec, /// The estimated gas needed for the solution settling this single order. pub gas: eth::Gas, + /// The wrapper calls to use + pub wrappers: Vec, } impl Single { @@ -122,6 +131,7 @@ impl Single { output, interactions, gas, + wrappers, } = self; if (order.sell.token, order.buy.token) != (input.token, output.token) { @@ -180,6 +190,13 @@ impl Single { post_interactions: Default::default(), gas: Some(gas), trades: vec![Trade::Fulfillment(Fulfillment::new(order, executed, fee)?)], + wrappers: wrappers + .iter() + .map(|w| WrapperCall { + target: eth::Address(w.address), + data: w.data.clone(), + }) + .collect(), }) } } diff --git a/crates/solvers/src/domain/solver.rs b/crates/solvers/src/domain/solver.rs index e777a1bca3..1c612b3cec 100644 --- a/crates/solvers/src/domain/solver.rs +++ b/crates/solvers/src/domain/solver.rs @@ -191,7 +191,8 @@ impl Inner { } }; - let compute_solution = async |request| -> Option { + let compute_solution = async |request: Request| -> Option { + let wrappers = request.wrappers.clone(); let route = boundary_solver.route(request, self.max_hops).await?; let interactions = route .segments @@ -230,6 +231,7 @@ impl Inner { output, interactions, gas, + wrappers, } .into_solution(fee)? .with_id(solution::Id(i as u64)) @@ -251,7 +253,11 @@ impl Inner { fn requests_for_order(&self, order: &Order) -> impl Iterator + use<> { let order::Order { - sell, buy, side, .. + sell, + buy, + side, + wrappers, + .. } = order.clone(); let n = if order.partially_fillable { @@ -273,6 +279,7 @@ impl Inner { amount: buy.amount / divisor, }, side, + wrappers: wrappers.clone(), } }) .filter(|r| !r.sell.amount.is_zero() && !r.buy.amount.is_zero()) @@ -302,6 +309,7 @@ impl Inner { sell, buy, side: order::Side::Buy, + wrappers: order.wrappers.clone(), } } } @@ -323,6 +331,7 @@ pub struct Request { pub sell: eth::Asset, pub buy: eth::Asset, pub side: order::Side, + pub wrappers: Vec, } /// A trading route. From bdf844078d264b19287f7b4af068cd42c0b8d181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Fri, 31 Oct 2025 09:52:53 +0000 Subject: [PATCH 072/117] Migrate alerter to alloy (#3851) --- Cargo.lock | 2 +- crates/alerter/Cargo.toml | 2 +- crates/alerter/src/lib.rs | 16 ++++----- crates/number/src/serialization.rs | 53 ++++++++++++++++++++++++++++-- 4 files changed, 59 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca700095d7..e9e26b60a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,6 +64,7 @@ dependencies = [ name = "alerter" version = "0.1.0" dependencies = [ + "alloy", "anyhow", "clap", "humantime", @@ -71,7 +72,6 @@ dependencies = [ "model", "number", "observe", - "primitive-types", "prometheus", "reqwest 0.11.27", "serde", diff --git a/crates/alerter/Cargo.toml b/crates/alerter/Cargo.toml index 6cb577ef91..b7b1f89a69 100644 --- a/crates/alerter/Cargo.toml +++ b/crates/alerter/Cargo.toml @@ -6,6 +6,7 @@ edition = "2024" license = "MIT OR Apache-2.0" [dependencies] +alloy = { workspace = true } anyhow = { workspace = true } clap = { workspace = true } humantime = { workspace = true } @@ -13,7 +14,6 @@ observe = { workspace = true } mimalloc = { workspace = true } model = { workspace = true } number = { workspace = true } -primitive-types = { workspace = true } prometheus = { workspace = true } reqwest = { workspace = true, features = ["json"] } serde_with = { workspace = true } diff --git a/crates/alerter/src/lib.rs b/crates/alerter/src/lib.rs index 46c4398476..6d8016b3f4 100644 --- a/crates/alerter/src/lib.rs +++ b/crates/alerter/src/lib.rs @@ -4,11 +4,11 @@ // price api (0x). If this is the case it alerts. use { + alloy::primitives::{Address, U256, address}, anyhow::{Context, Result}, clap::Parser, model::order::{BUY_ETH_ADDRESS, OrderClass, OrderKind, OrderStatus, OrderUid}, number::serialization::HexOrDecimalU256, - primitive_types::{H160, U256}, prometheus::IntGauge, reqwest::Client, serde_with::serde_as, @@ -24,10 +24,10 @@ use { #[serde(rename_all = "camelCase")] struct Order { kind: OrderKind, - buy_token: H160, + buy_token: Address, #[serde_as(as = "HexOrDecimalU256")] buy_amount: U256, - sell_token: H160, + sell_token: Address, #[serde_as(as = "HexOrDecimalU256")] sell_amount: U256, uid: OrderUid, @@ -90,12 +90,10 @@ impl OrderBookApi { // Converts the eth placeholder address to weth. Leaves other addresses // untouched. -fn convert_eth_to_weth(token: H160) -> H160 { - let weth: H160 = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" - .parse() - .unwrap(); - if token == BUY_ETH_ADDRESS { - weth +fn convert_eth_to_weth(token: Address) -> Address { + const WETH: Address = address!("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"); + if token == Address::from_slice(&BUY_ETH_ADDRESS.0) { + WETH } else { token } diff --git a/crates/number/src/serialization.rs b/crates/number/src/serialization.rs index a6fa7949dd..b30a9107e1 100644 --- a/crates/number/src/serialization.rs +++ b/crates/number/src/serialization.rs @@ -5,14 +5,43 @@ use { std::fmt, }; +/// (De)serialization structure able to deserialize decimal and hexadecimal +/// numbers, serializes as decimal. pub struct HexOrDecimalU256; -impl<'de> DeserializeAs<'de, U256> for HexOrDecimalU256 { - fn deserialize_as(deserializer: D) -> Result +impl<'de> DeserializeAs<'de, alloy::primitives::U256> for HexOrDecimalU256 { + fn deserialize_as(deserializer: D) -> Result where D: Deserializer<'de>, { - deserialize(deserializer) + struct Visitor {} + impl de::Visitor<'_> for Visitor { + type Value = alloy::primitives::U256; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!( + formatter, + "a u256 encoded either as 0x hex prefixed or decimal encoded string" + ) + } + + fn visit_str(self, s: &str) -> Result + where + E: de::Error, + { + if s.trim().starts_with("0x") { + alloy::primitives::U256::from_str_radix(s, 16).map_err(|err| { + de::Error::custom(format!("failed to decode {s:?} as hex u256: {err}")) + }) + } else { + alloy::primitives::U256::from_str_radix(s, 10).map_err(|err| { + de::Error::custom(format!("failed to decode {s:?} as decimal u256: {err}")) + }) + } + } + } + + deserializer.deserialize_str(Visitor {}) } } @@ -25,6 +54,24 @@ impl SerializeAs for HexOrDecimalU256 { } } +impl<'de> DeserializeAs<'de, U256> for HexOrDecimalU256 { + fn deserialize_as(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserialize(deserializer) + } +} + +impl SerializeAs for HexOrDecimalU256 { + fn serialize_as(source: &alloy::primitives::U256, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&source.to_string()) + } +} + pub fn serialize(value: &U256, serializer: S) -> Result where S: Serializer, From ba5ac8e39d592cea43ec50caed70f237814e8711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Duarte?= Date: Fri, 31 Oct 2025 13:59:29 +0000 Subject: [PATCH 073/117] Migrate the remaining ERC20 (#3844) --- crates/contracts/build.rs | 46 ----- crates/contracts/src/errors.rs | 10 -- crates/contracts/src/lib.rs | 10 -- crates/cow-amm/src/maintainers.rs | 8 +- .../driver/src/infra/blockchain/contracts.rs | 13 +- crates/driver/src/infra/blockchain/mod.rs | 6 - crates/driver/src/infra/blockchain/token.rs | 45 ++--- crates/e2e/src/setup/mod.rs | 10 +- crates/e2e/tests/e2e/buffers.rs | 2 +- crates/e2e/tests/e2e/liquidity.rs | 168 +++++++++++------- .../e2e/liquidity_source_notification.rs | 151 +++++++++------- crates/e2e/tests/e2e/protocol_fee.rs | 14 +- crates/ethrpc/Cargo.toml | 2 +- crates/ethrpc/src/alloy/errors.rs | 90 ++++++++++ crates/ethrpc/src/alloy/mod.rs | 2 +- crates/shared/Cargo.toml | 1 + .../shared/src/account_balances/simulation.rs | 72 ++++---- .../src/bad_token/token_owner_finder/mod.rs | 26 +-- .../balance_overrides/detector.rs | 16 +- crates/shared/src/sources/swapr.rs | 13 +- .../src/sources/uniswap_v2/pool_fetching.rs | 72 +++----- crates/shared/src/token_info.rs | 34 ++-- crates/solver/src/interactions/allowances.rs | 37 ++-- 23 files changed, 456 insertions(+), 392 deletions(-) delete mode 100644 crates/contracts/build.rs create mode 100644 crates/ethrpc/src/alloy/errors.rs diff --git a/crates/contracts/build.rs b/crates/contracts/build.rs deleted file mode 100644 index 805b62a231..0000000000 --- a/crates/contracts/build.rs +++ /dev/null @@ -1,46 +0,0 @@ -use { - ethcontract_generate::{ContractBuilder, loaders::TruffleLoader}, - std::{env, path::Path}, -}; - -#[path = "src/paths.rs"] -mod paths; - -fn main() { - // NOTE: This is a workaround for `rerun-if-changed` directives for - // non-existent files cause the crate's build unit to get flagged for a - // rebuild if any files in the workspace change. - // - // See: - // - https://github.com/rust-lang/cargo/issues/6003 - // - https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorerun-if-changedpath - println!("cargo:rerun-if-changed=build.rs"); - - generate_contract("ERC20"); -} - -fn generate_contract(name: &str) { - generate_contract_with_config(name, |builder| builder) -} - -fn generate_contract_with_config( - name: &str, - config: impl FnOnce(ContractBuilder) -> ContractBuilder, -) { - let path = paths::contract_artifacts_dir() - .join(name) - .with_extension("json"); - let contract = TruffleLoader::new() - .name(name) - .load_contract_from_file(&path) - .unwrap(); - let dest = env::var("OUT_DIR").unwrap(); - - println!("cargo:rerun-if-changed={}", path.display()); - - config(ContractBuilder::new().visibility_modifier("pub")) - .generate(&contract) - .unwrap() - .write_to_file(Path::new(&dest).join(format!("{name}.rs"))) - .unwrap(); -} diff --git a/crates/contracts/src/errors.rs b/crates/contracts/src/errors.rs index d7ca2fa8dd..6eb7c907e6 100644 --- a/crates/contracts/src/errors.rs +++ b/crates/contracts/src/errors.rs @@ -57,16 +57,6 @@ pub fn testing_contract_error() -> MethodError { } } -/// Create an arbitrary alloy error that will convert into a "contract" error. Useful for testing. -pub fn testing_alloy_contract_error() -> alloy::contract::Error { - alloy::contract::Error::NotADeploymentTransaction -} - -/// Create an arbitrary alloy error that will convert into a "node" error. Useful for testing. -pub fn testing_alloy_node_error() -> alloy::contract::Error { - alloy::contract::Error::TransportError(alloy::transports::TransportError::NullResp) -} - #[cfg(test)] mod tests { use super::*; diff --git a/crates/contracts/src/lib.rs b/crates/contracts/src/lib.rs index 91fc45b6ef..b39baad16f 100644 --- a/crates/contracts/src/lib.rs +++ b/crates/contracts/src/lib.rs @@ -42,16 +42,6 @@ pub mod paths; pub mod vault; pub mod web3; -macro_rules! include_contracts { - ($($name:ident;)*) => {$( - include!(concat!(env!("OUT_DIR"), "/", stringify!($name), ".rs")); - )*}; -} - -include_contracts! { - ERC20; -} - #[cfg(test)] mod tests { use { diff --git a/crates/cow-amm/src/maintainers.rs b/crates/cow-amm/src/maintainers.rs index 3522c71eb9..bb93ea3438 100644 --- a/crates/cow-amm/src/maintainers.rs +++ b/crates/cow-amm/src/maintainers.rs @@ -1,8 +1,8 @@ use { crate::{Amm, cache::Storage}, - contracts::ERC20, + contracts::alloy::ERC20, ethcontract::futures::future::{join_all, select_ok}, - ethrpc::{Web3, alloy::conversions::IntoLegacy}, + ethrpc::Web3, shared::maintenance::Maintaining, std::sync::Arc, tokio::sync::RwLock, @@ -25,8 +25,8 @@ impl EmptyPoolRemoval { .traded_tokens() .iter() .map(move |token| async move { - ERC20::at(&self.web3, token.into_legacy()) - .balance_of(amm_address.into_legacy()) + ERC20::Instance::new(*token, self.web3.alloy.clone()) + .balanceOf(*amm_address) .call() .await .map_err(|err| { diff --git a/crates/driver/src/infra/blockchain/contracts.rs b/crates/driver/src/infra/blockchain/contracts.rs index 6b9d35a5be..d89a39b294 100644 --- a/crates/driver/src/infra/blockchain/contracts.rs +++ b/crates/driver/src/infra/blockchain/contracts.rs @@ -1,5 +1,5 @@ use { - crate::{domain::eth, infra::blockchain::Ethereum}, + crate::domain::eth, chain::Chain, contracts::alloy::{ BalancerV2Vault, @@ -189,17 +189,6 @@ pub fn deployment_address( ) } -/// A trait for initializing contract instances with dynamic addresses. -pub trait ContractAt { - fn at(eth: &Ethereum, address: eth::ContractAddress) -> Self; -} - -impl ContractAt for contracts::ERC20 { - fn at(eth: &Ethereum, address: eth::ContractAddress) -> Self { - Self::at(ð.web3, address.into()) - } -} - #[derive(Debug, Error)] pub enum Error { #[error("method error: {0:?}")] diff --git a/crates/driver/src/infra/blockchain/mod.rs b/crates/driver/src/infra/blockchain/mod.rs index de79a07084..d286d5f5d8 100644 --- a/crates/driver/src/infra/blockchain/mod.rs +++ b/crates/driver/src/infra/blockchain/mod.rs @@ -1,5 +1,4 @@ use { - self::contracts::ContractAt, crate::{boundary, domain::eth}, chain::Chain, ethcontract::{U256, errors::ExecutionError}, @@ -159,11 +158,6 @@ impl Ethereum { &self.inner.contracts } - /// Create a contract instance at the specified address. - pub fn contract_at(&self, address: eth::ContractAddress) -> T { - T::at(self, address) - } - /// Check if a smart contract is deployed to the given address. pub async fn is_contract(&self, address: eth::Address) -> Result { let code = self.web3.eth().code(address.into(), None).await?; diff --git a/crates/driver/src/infra/blockchain/token.rs b/crates/driver/src/infra/blockchain/token.rs index 6e930c5840..b9758000cc 100644 --- a/crates/driver/src/infra/blockchain/token.rs +++ b/crates/driver/src/infra/blockchain/token.rs @@ -1,25 +1,32 @@ use { super::{Error, Ethereum}, crate::domain::eth, + ethrpc::alloy::{ + conversions::{IntoAlloy, IntoLegacy}, + errors::ContractErrorExt, + }, }; /// An ERC-20 token. /// /// https://eips.ethereum.org/EIPS/eip-20 pub struct Erc20 { - token: contracts::ERC20, + token: contracts::alloy::ERC20::Instance, } impl Erc20 { pub(super) fn new(eth: &Ethereum, address: eth::TokenAddress) -> Self { Self { - token: eth.contract_at(address.into()), + token: contracts::alloy::ERC20::Instance::new( + address.0.0.into_alloy(), + eth.web3.alloy.clone(), + ), } } /// Returns the [`eth::TokenAddress`] of the ERC20. pub fn address(&self) -> eth::TokenAddress { - self.token.address().into() + self.token.address().into_legacy().into() } /// Fetch the ERC20 allowance for the spender. See the allowance method in @@ -31,11 +38,15 @@ impl Erc20 { owner: eth::Address, spender: eth::Address, ) -> Result { - let amount = self.token.allowance(owner.0, spender.0).call().await?; + let amount = self + .token + .allowance(owner.0.into_alloy(), spender.0.into_alloy()) + .call() + .await?; Ok(eth::Allowance { - token: self.token.address().into(), + token: self.token.address().into_legacy().into(), spender, - amount, + amount: amount.into_legacy(), } .into()) } @@ -47,8 +58,8 @@ impl Erc20 { pub async fn decimals(&self) -> Result, Error> { match self.token.decimals().call().await { Ok(decimals) => Ok(Some(decimals)), - Err(err) if is_contract_error(&err) => Ok(None), - Err(err) => Err(err.into()), + Err(err) if err.is_node_error() => Err(err.into()), + Err(_) => Ok(None), } } @@ -59,8 +70,8 @@ impl Erc20 { pub async fn symbol(&self) -> Result, Error> { match self.token.symbol().call().await { Ok(symbol) => Ok(Some(symbol)), - Err(err) if is_contract_error(&err) => Ok(None), - Err(err) => Err(err.into()), + Err(err) if err.is_node_error() => Err(err.into()), + Err(_) => Ok(None), } } @@ -70,21 +81,11 @@ impl Erc20 { /// https://eips.ethereum.org/EIPS/eip-20#balanceof pub async fn balance(&self, holder: eth::Address) -> Result { self.token - .balance_of(holder.0) + .balanceOf(holder.0.into_alloy()) .call() .await + .map(IntoLegacy::into_legacy) .map(Into::into) .map_err(Into::into) } } - -/// Returns `true` if a [`ethcontract::errors::MethodError`] is the result of -/// some on-chain computation error. -fn is_contract_error(err: ðcontract::errors::MethodError) -> bool { - // Assume that any error that isn't a `Web3` error is a "contract error", - // this can mean things like: - // - The contract call reverted - // - The returndata cannot be decoded - // - etc. - !matches!(&err.inner, ethcontract::errors::ExecutionError::Web3(_)) -} diff --git a/crates/e2e/src/setup/mod.rs b/crates/e2e/src/setup/mod.rs index 40423f647b..454d3b149a 100644 --- a/crates/e2e/src/setup/mod.rs +++ b/crates/e2e/src/setup/mod.rs @@ -250,12 +250,14 @@ async fn run( #[macro_export] macro_rules! assert_approximately_eq { ($executed_value:expr_2021, $expected_value:expr_2021) => {{ - let lower = $expected_value * U256::from(99999999999u128) / U256::from(100000000000u128); - let upper = - ($expected_value * U256::from(100000000001u128) / U256::from(100000000000u128)) + 1; + let lower = $expected_value * ::alloy::primitives::U256::from(99999999999u128) + / ::alloy::primitives::U256::from(100000000000u128); + let upper = ($expected_value * ::alloy::primitives::U256::from(100000000001u128) + / ::alloy::primitives::U256::from(100000000000u128)) + + ::alloy::primitives::U256::ONE; assert!( $executed_value >= lower && $executed_value <= upper, - "Expected: ~{}, got: {}", + "Expected: ~{}, got: {}, ({lower}, {upper})", $expected_value, $executed_value ); diff --git a/crates/e2e/tests/e2e/buffers.rs b/crates/e2e/tests/e2e/buffers.rs index 56237ac9bd..cd4ce06679 100644 --- a/crates/e2e/tests/e2e/buffers.rs +++ b/crates/e2e/tests/e2e/buffers.rs @@ -128,7 +128,7 @@ async fn onchain_settlement_without_liquidity(web3: Web3) { .await .unwrap(); // Check that internal buffers were used - assert!(settlement_contract_balance == U256::ZERO); + assert_eq!(settlement_contract_balance, U256::ZERO); // Same order can trade again with external liquidity let order = OrderCreation { diff --git a/crates/e2e/tests/e2e/liquidity.rs b/crates/e2e/tests/e2e/liquidity.rs index 0a5e547850..1598e095f4 100644 --- a/crates/e2e/tests/e2e/liquidity.rs +++ b/crates/e2e/tests/e2e/liquidity.rs @@ -1,14 +1,14 @@ use { - chrono::{NaiveDateTime, Utc}, - contracts::{ - ERC20, - alloy::{IZeroex, InstanceExt}, + alloy::{ + primitives::{Address, address}, + providers::ext::{AnvilApi, ImpersonateConfig}, }, + chrono::{NaiveDateTime, Utc}, + contracts::alloy::{ERC20, IZeroex, InstanceExt}, driver::domain::eth::H160, e2e::{ api::zeroex::{Eip712TypedZeroExOrder, ZeroExApi}, assert_approximately_eq, - nodes::forked_node::ForkedNodeApi, setup::{ OnchainComponents, Services, @@ -20,17 +20,16 @@ use { to_wei_with_exp, wait_for_condition, }, - tx, }, ethcontract::{Account, H256, prelude::U256}, ethrpc::{ Web3, alloy::{ + CallBuilderExt, ProviderSignerExt, conversions::{IntoAlloy, IntoLegacy, TryIntoAlloyAsync}, }, }, - hex_literal::hex, model::{ order::{OrderCreation, OrderKind}, signature::EcdsaSigningScheme, @@ -41,8 +40,8 @@ use { /// The block number from which we will fetch state for the forked tests. pub const FORK_BLOCK: u64 = 23112197; -pub const USDT_WHALE: H160 = H160(hex!("F977814e90dA44bFA03b6295A0616a897441aceC")); -pub const USDC_WHALE: H160 = H160(hex!("28c6c06298d514db089934071355e5743bf21d60")); +pub const USDT_WHALE: Address = address!("F977814e90dA44bFA03b6295A0616a897441aceC"); +pub const USDC_WHALE: Address = address!("28c6c06298d514db089934071355e5743bf21d60"); #[tokio::test] #[ignore] @@ -58,23 +57,18 @@ async fn forked_node_zero_ex_liquidity_mainnet() { async fn zero_ex_liquidity(web3: Web3) { let mut onchain = OnchainComponents::deployed(web3.clone()).await; - let forked_node_api = web3.api::>(); let [solver] = onchain.make_solvers_forked(to_wei(1)).await; let [trader, zeroex_maker] = onchain.make_accounts(to_wei(1)).await; - let token_usdc = ERC20::at( - &web3, - "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" - .parse() - .unwrap(), + let token_usdc = ERC20::Instance::new( + address!("a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"), + web3.alloy.clone(), ); - let token_usdt = ERC20::at( - &web3, - "0xdac17f958d2ee523a2206206994597c13d831ec7" - .parse() - .unwrap(), + let token_usdt = ERC20::Instance::new( + address!("dac17f958d2ee523a2206206994597c13d831ec7"), + web3.alloy.clone(), ); let zeroex_provider = { @@ -83,41 +77,90 @@ async fn zero_ex_liquidity(web3: Web3) { }; let zeroex = IZeroex::Instance::deployed(&zeroex_provider).await.unwrap(); - let amount = to_wei_with_exp(5, 8); + let amount = to_wei_with_exp(5, 8).into_alloy(); // Give trader some USDC - let usdc_whale = forked_node_api.impersonate(&USDC_WHALE).await.unwrap(); - tx!(usdc_whale, token_usdc.transfer(trader.address(), amount)); + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdc + .transfer(trader.address().into_alloy(), amount) + .from(USDC_WHALE) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .watch() + .await + .unwrap(); // Give 0x maker a bit more USDT - let usdt_whale = forked_node_api.impersonate(&USDT_WHALE).await.unwrap(); - tx!( - usdt_whale, - // With a lower amount 0x contract shows much lower fillable amount - token_usdt.transfer(zeroex_maker.address(), amount * 4) - ); + // With a lower amount 0x contract shows much lower fillable amount + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdt + .transfer( + zeroex_maker.address().into_alloy(), + amount * alloy::primitives::U256::from(4), + ) + .from(USDT_WHALE) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .watch() + .await + .unwrap(); // Required for the remaining fillable taker amount - tx!(usdc_whale, token_usdc.transfer(solver.address(), amount)); + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdc + .transfer(solver.address().into_alloy(), amount) + .from(USDC_WHALE) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .watch() + .await + .unwrap(); - tx!( - trader.account(), - token_usdc.approve(onchain.contracts().allowance, amount) - ); - tx!( - zeroex_maker.account(), - // With a lower amount 0x contract shows much lower fillable amount - token_usdt.approve(zeroex.address().into_legacy(), amount * 4) - ); - tx!( - solver.account(), - token_usdc.approve(zeroex.address().into_legacy(), amount) - ); + token_usdc + .approve(onchain.contracts().allowance.into_alloy(), amount) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + // With a lower amount 0x contract shows much lower fillable amount + token_usdt + .approve(*zeroex.address(), amount * alloy::primitives::U256::from(4)) + .from(zeroex_maker.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); + token_usdc + .approve(*zeroex.address(), amount) + .from(solver.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); let order = OrderCreation { - sell_token: token_usdc.address(), - sell_amount: amount, - buy_token: token_usdt.address(), - buy_amount: amount, + sell_token: token_usdc.address().into_legacy(), + sell_amount: amount.into_legacy(), + buy_token: token_usdt.address().into_legacy(), + buy_amount: amount.into_legacy(), valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, ..Default::default() @@ -179,12 +222,12 @@ async fn zero_ex_liquidity(web3: Web3) { // Drive solution let sell_token_balance_before = token_usdc - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); let buy_token_balance_before = token_usdt - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .unwrap(); @@ -195,7 +238,7 @@ async fn zero_ex_liquidity(web3: Web3) { tracing::info!("Waiting for trade."); wait_for_condition(TIMEOUT, || async { token_usdc - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .is_ok_and(|balance| balance < sell_token_balance_before) @@ -204,7 +247,7 @@ async fn zero_ex_liquidity(web3: Web3) { .unwrap(); wait_for_condition(TIMEOUT, || async { token_usdt - .balance_of(trader.address()) + .balanceOf(trader.address().into_alloy()) .call() .await .is_ok_and(|balance| balance >= buy_token_balance_before + amount) @@ -218,21 +261,21 @@ async fn zero_ex_liquidity(web3: Web3) { // [`relative-slippage`] config value is set to 0.1 // crates/e2e/src/setup/colocation.rs:110 which is then applied to the // original filled amount crates/solver/src/liquidity/slippage.rs:110 - let expected_filled_amount = amount.as_u128() + amount.as_u128() / 10u128; + let expected_filled_amount = amount + amount / alloy::primitives::U256::from(10); assert_approximately_eq!( - U256::from(zeroex_order_amounts.filled), - U256::from(expected_filled_amount) + alloy::primitives::U256::from(zeroex_order_amounts.filled), + expected_filled_amount ); assert!(zeroex_order_amounts.fillable > 0u128); assert_approximately_eq!( - U256::from(zeroex_order_amounts.fillable), - U256::from(amount.as_u128() * 2 - expected_filled_amount) + alloy::primitives::U256::from(zeroex_order_amounts.fillable), + (amount * alloy::primitives::U256::from(2)) - expected_filled_amount ); // Fill the remaining part of the 0x order let zeroex_order = Eip712TypedZeroExOrder { - maker_token: token_usdt.address(), - taker_token: token_usdc.address(), + maker_token: token_usdt.address().into_legacy(), + taker_token: token_usdc.address().into_legacy(), maker_amount: zeroex_order_amounts.fillable, taker_amount: zeroex_order_amounts.fillable, // doesn't participate in the hash calculation @@ -254,10 +297,13 @@ async fn zero_ex_liquidity(web3: Web3) { .await .unwrap(); assert_approximately_eq!( - U256::from(zeroex_order_amounts.filled), - U256::from(amount.as_u128() * 2 - expected_filled_amount) + alloy::primitives::U256::from(zeroex_order_amounts.filled), + (amount * alloy::primitives::U256::from(2)) - expected_filled_amount + ); + assert_approximately_eq!( + alloy::primitives::U256::from(zeroex_order_amounts.fillable), + alloy::primitives::U256::ZERO ); - assert_approximately_eq!(U256::from(zeroex_order_amounts.fillable), U256::zero()); } fn create_zeroex_liquidity_orders( diff --git a/crates/e2e/tests/e2e/liquidity_source_notification.rs b/crates/e2e/tests/e2e/liquidity_source_notification.rs index 6b3b665fde..415b8d6b61 100644 --- a/crates/e2e/tests/e2e/liquidity_source_notification.rs +++ b/crates/e2e/tests/e2e/liquidity_source_notification.rs @@ -1,17 +1,14 @@ use { alloy::{ primitives::{Address, Bytes, U256, address}, + providers::ext::{AnvilApi, ImpersonateConfig}, signers::{SignerSync, local::PrivateKeySigner}, }, chrono::Utc, - contracts::{ - ERC20, - alloy::{InstanceExt, LiquoriceSettlement}, - }, + contracts::alloy::{ERC20, InstanceExt, LiquoriceSettlement}, driver::infra, e2e::{ api, - nodes::forked_node::ForkedNodeApi, setup::{ OnchainComponents, Services, @@ -23,11 +20,13 @@ use { to_wei_with_exp, wait_for_condition, }, - tx, }, ethrpc::{ Web3, - alloy::conversions::{IntoAlloy, IntoLegacy}, + alloy::{ + CallBuilderExt, + conversions::{IntoAlloy, IntoLegacy}, + }, }, model::{ order::{OrderCreation, OrderKind}, @@ -59,7 +58,6 @@ async fn forked_node_liquidity_source_notification_mainnet() { async fn liquidity_source_notification(web3: Web3) { // Start onchain components let mut onchain = OnchainComponents::deployed(web3.clone()).await; - let forked_node_api = web3.api::>(); // Define trade params let trade_amount = to_wei_with_exp(5, 8); @@ -74,44 +72,63 @@ async fn liquidity_source_notification(web3: Web3) { let [trader, liquorice_maker] = onchain.make_accounts(to_wei(1)).await; // Access trade tokens contracts - let token_usdc = ERC20::at( - &web3, - "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" - .parse() - .unwrap(), + let token_usdc = ERC20::Instance::new( + address!("a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"), + web3.alloy.clone(), ); - let token_usdt = ERC20::at( - &web3, - "0xdac17f958d2ee523a2206206994597c13d831ec7" - .parse() - .unwrap(), + let token_usdt = ERC20::Instance::new( + address!("dac17f958d2ee523a2206206994597c13d831ec7"), + web3.alloy.clone(), ); // CoW onchain setup - { - // Fund trader - let usdc_whale = forked_node_api - .impersonate(&USDC_WHALE.into_legacy()) - .await - .unwrap(); - tx!( - usdc_whale, - token_usdc.transfer(trader.address(), trade_amount) - ); + // Fund trader + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdc + .transfer(trader.address().into_alloy(), trade_amount.into_alloy()) + .from(USDC_WHALE) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .watch() + .await + .unwrap(); - // Fund solver - tx!( - usdc_whale, - token_usdc.transfer(solver.address(), trade_amount) - ); + // Fund solver + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdc + .transfer(solver.address().into_alloy(), trade_amount.into_alloy()) + .from(USDC_WHALE) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .watch() + .await + .unwrap(); - // Trader gives approval to the CoW allowance contract - tx!( - trader.account(), - token_usdc.approve(onchain.contracts().allowance, ethcontract::U256::MAX) - ); - } + // Trader gives approval to the CoW allowance contract + token_usdc + .approve( + onchain.contracts().allowance.into_alloy(), + alloy::primitives::U256::MAX, + ) + .from(trader.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); // Liquorice onchain setup @@ -129,22 +146,36 @@ async fn liquidity_source_notification(web3: Web3) { .into_legacy(); // Fund `liquorice_maker` - { - let usdt_whale = forked_node_api - .impersonate(&USDT_WHALE.into_legacy()) - .await - .unwrap(); - tx!( - usdt_whale, - token_usdt.transfer(liquorice_maker.address(), trade_amount) - ); - } + web3.alloy + .anvil_send_impersonated_transaction_with_config( + token_usdt + .transfer( + liquorice_maker.address().into_alloy(), + trade_amount.into_alloy(), + ) + .from(USDT_WHALE) + .into_transaction_request(), + ImpersonateConfig { + fund_amount: None, + stop_impersonate: true, + }, + ) + .await + .unwrap() + .watch() + .await + .unwrap(); // Maker gives approval to the Liquorice balance manager contract - tx!( - liquorice_maker.account(), - token_usdt.approve(liquorice_balance_manager_address, ethcontract::U256::MAX) - ); + token_usdt + .approve( + liquorice_balance_manager_address.into_alloy(), + alloy::primitives::U256::MAX, + ) + .from(liquorice_maker.address().into_alloy()) + .send_and_watch() + .await + .unwrap(); // Liquorice API setup let liquorice_api = api::liquorice::server::LiquoriceApi::start().await; @@ -208,9 +239,9 @@ http-timeout = "10s" // Create CoW order let order_id = { let order = OrderCreation { - sell_token: token_usdc.address(), + sell_token: token_usdc.address().into_legacy(), sell_amount: trade_amount, - buy_token: token_usdt.address(), + buy_token: token_usdt.address().into_legacy(), buy_amount: trade_amount, valid_to: model::time::now_in_epoch_seconds() + 300, kind: OrderKind::Sell, @@ -232,8 +263,8 @@ http-timeout = "10s" nonce: U256::from(0), trader: *onchain.contracts().gp_settlement.address(), effectiveTrader: *onchain.contracts().gp_settlement.address(), - baseToken: token_usdc.address().into_alloy(), - quoteToken: token_usdt.address().into_alloy(), + baseToken: *token_usdc.address(), + quoteToken: *token_usdt.address(), baseTokenAmount: trade_amount.into_alloy(), quoteTokenAmount: trade_amount.into_alloy(), minFillAmount: U256::from(1), @@ -279,8 +310,8 @@ http-timeout = "10s" liquorice_solver_api_mock.configure_solution(Some(Solution { id: 1, prices: HashMap::from([ - (token_usdc.address(), to_wei(11)), - (token_usdt.address(), to_wei(10)), + (token_usdc.address().into_legacy(), to_wei(11)), + (token_usdt.address().into_legacy(), to_wei(10)), ]), trades: vec![solvers_dto::solution::Trade::Fulfillment( solvers_dto::solution::Fulfillment { @@ -296,7 +327,7 @@ http-timeout = "10s" calldata: liquorice_solution_calldata, value: 0.into(), allowances: vec![solvers_dto::solution::Allowance { - token: token_usdc.address(), + token: token_usdc.address().into_legacy(), spender: liquorice_balance_manager_address, amount: trade_amount, }], diff --git a/crates/e2e/tests/e2e/protocol_fee.rs b/crates/e2e/tests/e2e/protocol_fee.rs index 133f94dd6b..f0e657f562 100644 --- a/crates/e2e/tests/e2e/protocol_fee.rs +++ b/crates/e2e/tests/e2e/protocol_fee.rs @@ -372,11 +372,17 @@ async fn combined_protocol_fees(web3: Web3) { .unwrap() .try_into() .expect("Expected exactly four elements"); - assert_approximately_eq!(market_executed_fee_in_buy_token, market_order_token_balance); - assert_approximately_eq!(limit_executed_fee_in_buy_token, limit_order_token_balance); assert_approximately_eq!( - partner_fee_executed_fee_in_buy_token, - partner_fee_order_token_balance + market_executed_fee_in_buy_token.into_alloy(), + market_order_token_balance.into_alloy() + ); + assert_approximately_eq!( + limit_executed_fee_in_buy_token.into_alloy(), + limit_order_token_balance.into_alloy() + ); + assert_approximately_eq!( + partner_fee_executed_fee_in_buy_token.into_alloy(), + partner_fee_order_token_balance.into_alloy() ); } diff --git a/crates/ethrpc/Cargo.toml b/crates/ethrpc/Cargo.toml index 36d43c02c5..b85f18c342 100644 --- a/crates/ethrpc/Cargo.toml +++ b/crates/ethrpc/Cargo.toml @@ -11,7 +11,7 @@ name = "ethrpc" path = "src/lib.rs" [dependencies] -alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-aws", "signer-local", "eips", "reqwest-default-tls"] } +alloy = { workspace = true, default-features = false, features = ["json-rpc", "providers", "rpc-client", "rpc-types", "transports", "reqwest", "signers", "signer-aws", "signer-local", "eips", "reqwest-default-tls", "contract"] } anyhow = { workspace = true } async-trait = { workspace = true } ethcontract = { workspace = true } diff --git a/crates/ethrpc/src/alloy/errors.rs b/crates/ethrpc/src/alloy/errors.rs new file mode 100644 index 0000000000..e3f917196f --- /dev/null +++ b/crates/ethrpc/src/alloy/errors.rs @@ -0,0 +1,90 @@ +use alloy::{contract::Error as ContractError, transports::RpcError}; + +/// Bubbles up node errors, ignoring all other errors. +pub fn ignore_non_node_error(result: Result) -> anyhow::Result> { + match result { + Ok(result) => Ok(Some(result)), + Err(err) if err.is_node_error() => Err(err.into()), + Err(_) => Ok(None), + } +} + +pub trait ContractErrorExt { + /// Returns whether a given error is a contract error, this is considered to + /// be all errors except the transport error where there is no revert data. + fn is_contract_error(&self) -> bool; + + /// Returns whether a given error is a node error. + fn is_node_error(&self) -> bool; +} + +impl ContractErrorExt for ContractError { + fn is_contract_error(&self) -> bool { + !self.is_node_error() + } + + fn is_node_error(&self) -> bool { + // This mapping is "ported" from ethcontract's error hierarchy, although in it + // contract errors are better defined. Essentially, everything that isn't web3 + // related in ethcontract gets classified as a contract error, however, in alloy + // some contract errors are "hidden" inside transport errors, as such we need to + // check if transport errors have revert data to rule out contract errors. + // + // NOTE: using alloy's decoding functions doesn't work here because it requires + // the revert data to *not* be empty, otherwise it will return `None` as if a + // revert wasn't present or wasn't able to be decoded, though the usage of + // `Option` erases the existing nuances of the failure + match self { + // When the revert data is empty (e.g. you perform a call to a missing function) + // alloy's decode breaks, because even though there is revert data, it is empty + // so alloy's decode method fails leading your (the caller) to think there wasn't one + // Thus, to properly check for any kind of revert, just look at the revert data + ContractError::TransportError(RpcError::ErrorResp(err)) => { + // Due to the mismatch between error APIs and best-effort approximation this log + // line is left here as a debugging tool in case we start having RPC issues + let no_revert_data = err.as_revert_data().is_none(); + tracing::debug!(?err, %no_revert_data, "transport rpc error"); + no_revert_data + } + ContractError::TransportError(_) => true, + _ => false, + } + } +} + +/// Create an arbitrary alloy error that will convert into a "contract" error. +/// Useful for testing. +#[cfg(any(test, feature = "test-util"))] +pub fn testing_alloy_contract_error() -> alloy::contract::Error { + alloy::contract::Error::NotADeploymentTransaction +} + +/// Create an arbitrary alloy error that will convert into a "node" error. +/// Useful for testing. +#[cfg(any(test, feature = "test-util"))] +pub fn testing_alloy_node_error() -> alloy::contract::Error { + alloy::contract::Error::TransportError(alloy::transports::TransportError::ErrorResp( + alloy::rpc::json_rpc::ErrorPayload::internal_error(), + )) +} + +#[cfg(test)] +mod tests { + use crate::alloy::errors::{ + ContractErrorExt, + testing_alloy_contract_error, + testing_alloy_node_error, + }; + + #[test] + fn test_contract_error() { + assert!(testing_alloy_contract_error().is_contract_error()); + assert!(!testing_alloy_node_error().is_contract_error()); + } + + #[test] + fn test_node_error() { + assert!(!testing_alloy_contract_error().is_node_error()); + assert!(testing_alloy_node_error().is_node_error()); + } +} diff --git a/crates/ethrpc/src/alloy/mod.rs b/crates/ethrpc/src/alloy/mod.rs index 33f1dbcea7..914e7e3251 100644 --- a/crates/ethrpc/src/alloy/mod.rs +++ b/crates/ethrpc/src/alloy/mod.rs @@ -1,7 +1,7 @@ mod buffering; pub mod conversions; +pub mod errors; mod instrumentation; - mod wallet; use { diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index a01d9254cf..cb5cee77c4 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -68,6 +68,7 @@ testlib = { workspace = true } app-data = { workspace = true, features = ["test_helpers"] } tokio = { workspace = true, features = ["rt-multi-thread"] } mockall = { workspace = true } +ethrpc = {workspace = true, features = ["test-util"]} [features] test-util = ["dep:mockall"] diff --git a/crates/shared/src/account_balances/simulation.rs b/crates/shared/src/account_balances/simulation.rs index cdeb96230b..e0319989cc 100644 --- a/crates/shared/src/account_balances/simulation.rs +++ b/crates/shared/src/account_balances/simulation.rs @@ -6,13 +6,13 @@ use { super::{BalanceFetching, Query, TransferSimulationError}, crate::account_balances::BalanceSimulator, anyhow::Result, - contracts::{alloy::BalancerV2Vault::BalancerV2Vault, erc20::Contract}, + contracts::alloy::{BalancerV2Vault::BalancerV2Vault, ERC20}, ethcontract::{H160, U256}, ethrpc::{ Web3, alloy::conversions::{IntoAlloy, IntoLegacy}, }, - futures::{TryFutureExt, future}, + futures::future, model::order::SellTokenSource, tracing::instrument, }; @@ -66,58 +66,59 @@ impl Balances { }) } - async fn tradable_balance_simple(&self, query: &Query, token: &Contract) -> Result { + async fn tradable_balance_simple( + &self, + query: &Query, + token: &ERC20::Instance, + ) -> Result { let usable_balance = match query.source { SellTokenSource::Erc20 => { - let balance = token.balance_of(query.owner).call(); - let allowance = token.allowance(query.owner, self.vault_relayer()).call(); - let (balance, allowance) = futures::try_join!(balance, allowance)?; - std::cmp::min(balance, allowance) + let balance = token.balanceOf(query.owner.into_alloy()); + let allowance = + token.allowance(query.owner.into_alloy(), self.vault_relayer().into_alloy()); + let (balance, allowance) = futures::try_join!( + balance.call().into_future(), + allowance.call().into_future() + )?; + std::cmp::min(balance, allowance).into_legacy() } SellTokenSource::External => { let vault = BalancerV2Vault::new(self.vault().into_alloy(), &self.web3.alloy); - // NOTE: the anyhow error conversion can be removed after migrating the token to - // alloy - let balance = token - .balance_of(query.owner) - .call() - .map_err(anyhow::Error::from); - let has_approved_relayer = vault.hasApprovedRelayer( + let balance = token.balanceOf(query.owner.into_alloy()); + let approved = vault.hasApprovedRelayer( query.owner.into_alloy(), self.vault_relayer().into_alloy(), ); - let approved = has_approved_relayer - .call() - .into_future() - .map_err(anyhow::Error::from); - let allowance = token - .allowance(query.owner, self.vault()) - .call() - .map_err(anyhow::Error::from); - let (balance, approved, allowance) = - futures::try_join!(balance, approved, allowance)?; + let allowance = + token.allowance(query.owner.into_alloy(), self.vault().into_alloy()); + let (balance, approved, allowance) = futures::try_join!( + balance.call().into_future(), + approved.call().into_future(), + allowance.call().into_future() + )?; match approved { true => std::cmp::min(balance, allowance), - false => 0.into(), + false => alloy::primitives::U256::ZERO, } + .into_legacy() } SellTokenSource::Internal => { let vault = BalancerV2Vault::new(self.vault().into_alloy(), &self.web3.alloy); - - let get_internal_balance = vault + let balance = vault .getInternalBalance(query.owner.into_alloy(), vec![query.token.into_alloy()]); - let balance = get_internal_balance.call().into_future(); - - let has_approved_relayer = vault.hasApprovedRelayer( + let approved = vault.hasApprovedRelayer( query.owner.into_alloy(), self.vault_relayer().into_alloy(), ); - let approved = has_approved_relayer.call().into_future(); - let (balance, approved) = futures::try_join!(balance, approved)?; + let (balance, approved) = futures::try_join!( + balance.call().into_future(), + approved.call().into_future() + )?; match approved { - true => balance[0].into_legacy(), // internal approvals are always U256::MAX - false => 0.into(), + true => balance[0], // internal approvals are always U256::MAX + false => alloy::primitives::U256::ZERO, } + .into_legacy() } }; Ok(usable_balance) @@ -133,7 +134,8 @@ impl BalanceFetching for Balances { .iter() .map(|query| async { if query.interactions.is_empty() { - let token = contracts::ERC20::at(&self.web3, query.token); + let token = + ERC20::Instance::new(query.token.into_alloy(), self.web3.alloy.clone()); self.tradable_balance_simple(query, &token).await } else { self.tradable_balance_simulated(query).await diff --git a/crates/shared/src/bad_token/token_owner_finder/mod.rs b/crates/shared/src/bad_token/token_owner_finder/mod.rs index 550ab09b4d..9282789fb3 100644 --- a/crates/shared/src/bad_token/token_owner_finder/mod.rs +++ b/crates/shared/src/bad_token/token_owner_finder/mod.rs @@ -31,12 +31,12 @@ use { }, anyhow::{Context, Result}, chain::Chain, - contracts::{ - ERC20, - alloy::{BalancerV2Vault, IUniswapV3Factory}, - errors::EthcontractErrorType, - }, + contracts::alloy::{BalancerV2Vault, ERC20, IUniswapV3Factory}, ethcontract::U256, + ethrpc::alloy::{ + conversions::{IntoAlloy, IntoLegacy}, + errors::ContractErrorExt, + }, futures::{Stream, StreamExt as _}, primitive_types::H160, rate_limit::Strategy, @@ -420,7 +420,7 @@ impl TokenOwnerFinder { #[async_trait::async_trait] impl TokenOwnerFinding for TokenOwnerFinder { async fn find_owner(&self, token: H160, min_balance: U256) -> Result> { - let instance = ERC20::at(&self.web3, token); + let instance = ERC20::Instance::new(token.into_alloy(), self.web3.alloy.clone()); // We use a stream with ready_chunks so that we can start with the addresses of // fast TokenOwnerFinding implementations first without having to wait @@ -435,12 +435,12 @@ impl TokenOwnerFinding for TokenOwnerFinder { // owner is not the settlement contract. .filter(|owner| *owner != self.settlement_contract) .map(|owner| { - let call = instance.balance_of(owner).call(); + let balance = instance.balanceOf(owner.into_alloy()); async move { - match call.await { + match balance.call().await { Ok(balance) => Ok((owner, balance)), - Err(err) if EthcontractErrorType::is_contract_err(&err) => { - Ok((owner, 0.into())) + Err(err) if err.is_contract_error() => { + Ok((owner, alloy::primitives::U256::ZERO)) } Err(err) => Err(err), } @@ -448,11 +448,11 @@ impl TokenOwnerFinding for TokenOwnerFinder { }); let balances = futures::future::try_join_all(futures).await?; - if let Some(holder) = balances + if let Some((addr, balance)) = balances .into_iter() - .find(|(_, balance)| *balance >= min_balance) + .find(|(_, balance)| *balance >= min_balance.into_alloy()) { - return Ok(Some(holder)); + return Ok(Some((addr, balance.into_legacy()))); } } diff --git a/crates/shared/src/price_estimation/trade_verifier/balance_overrides/detector.rs b/crates/shared/src/price_estimation/trade_verifier/balance_overrides/detector.rs index acbbc392a0..94ad5a0712 100644 --- a/crates/shared/src/price_estimation/trade_verifier/balance_overrides/detector.rs +++ b/crates/shared/src/price_estimation/trade_verifier/balance_overrides/detector.rs @@ -2,8 +2,9 @@ use { super::Strategy, crate::tenderly_api::SimulationError, anyhow::Context, - contracts::ERC20, + contracts::alloy::ERC20, ethcontract::{Address, H256, U256, state_overrides::StateOverride}, + ethrpc::alloy::conversions::{IntoAlloy, IntoLegacy}, maplit::hashmap, std::{ collections::HashMap, @@ -100,23 +101,26 @@ impl Detector { /// Returns an `Err` if it cannot detect the strategy or an internal /// simulation fails. pub async fn detect(&self, token: Address) -> Result { - let token = ERC20::at(&self.web3, token); + let token = ERC20::Instance::new(token.into_alloy(), self.web3.alloy.clone()); let overrides = hashmap! { - token.address() => StateOverride { + token.address().into_legacy() => StateOverride { state_diff: Some(self.state_overrides.clone()), ..Default::default() }, }; let balance = token - .balance_of(self.holder) - .call_with_state_overrides(&overrides) + .balanceOf(self.holder.into_alloy()) + .state(overrides.into_alloy()) + .call() .await .context("eth_call with state overrides failed") .map_err(|e| DetectionError::Simulation(SimulationError::Other(e)))?; self.strategies .iter() - .find_map(|helper| (helper.balance == balance).then_some(helper.strategy.clone())) + .find_map(|helper| { + (helper.balance.into_alloy() == balance).then_some(helper.strategy.clone()) + }) .ok_or(DetectionError::NotFound) } } diff --git a/crates/shared/src/sources/swapr.rs b/crates/shared/src/sources/swapr.rs index 2896817333..28a81b3180 100644 --- a/crates/shared/src/sources/swapr.rs +++ b/crates/shared/src/sources/swapr.rs @@ -1,16 +1,11 @@ //! A pool state reading implementation specific to Swapr. use { - crate::sources::uniswap_v2::pool_fetching::{ - DefaultPoolReader, - Pool, - PoolReading, - handle_alloy_contract_error, - }, + crate::sources::uniswap_v2::pool_fetching::{DefaultPoolReader, Pool, PoolReading}, anyhow::Result, contracts::alloy::ISwaprPair, ethcontract::BlockId, - ethrpc::alloy::conversions::IntoAlloy, + ethrpc::alloy::{conversions::IntoAlloy, errors::ignore_non_node_error}, futures::{FutureExt as _, future::BoxFuture}, model::TokenPair, num::rational::Ratio, @@ -46,7 +41,7 @@ fn handle_results( pool: Result>, fee: Result, ) -> Result> { - let fee = handle_alloy_contract_error(fee)?; + let fee = ignore_non_node_error(fee)?; Ok(pool?.and_then(|pool| { Some(Pool { fee: Ratio::new(fee?, FEE_BASE), @@ -64,8 +59,8 @@ mod tests { recent_block_cache::Block, sources::{BaselineSource, uniswap_v2}, }, - contracts::errors::testing_alloy_contract_error, ethcontract::H160, + ethrpc::alloy::errors::testing_alloy_contract_error, maplit::hashset, }; diff --git a/crates/shared/src/sources/uniswap_v2/pool_fetching.rs b/crates/shared/src/sources/uniswap_v2/pool_fetching.rs index e2801e2ea9..5a1f77a388 100644 --- a/crates/shared/src/sources/uniswap_v2/pool_fetching.rs +++ b/crates/shared/src/sources/uniswap_v2/pool_fetching.rs @@ -1,16 +1,17 @@ use { super::pair_provider::PairProvider, crate::{baseline_solver::BaselineSolvable, ethrpc::Web3, recent_block_cache::Block}, - alloy::sol_types::GenericContractError, anyhow::Result, cached::{Cached, TimedCache}, contracts::{ - ERC20, - alloy::IUniswapLikePair::{self, IUniswapLikePair::getReservesReturn}, + alloy::{ + ERC20, + IUniswapLikePair::{self, IUniswapLikePair::getReservesReturn}, + }, errors::EthcontractErrorType, }, ethcontract::{BlockId, H160, U256, errors::MethodError}, - ethrpc::alloy::conversions::IntoAlloy, + ethrpc::alloy::{conversions::IntoAlloy, errors::ignore_non_node_error}, futures::{ FutureExt as _, future::{self, BoxFuture}, @@ -274,21 +275,25 @@ impl PoolReading for DefaultPoolReader { let pair_address = self.pair_provider.pair_address(&pair); // Fetch ERC20 token balances of the pools to sanity check with reserves - let token0 = ERC20::at(&self.web3, pair.get().0); - let token1 = ERC20::at(&self.web3, pair.get().1); - - let fetch_token0_balance = token0.balance_of(pair_address).block(block).call(); - let fetch_token1_balance = token1.balance_of(pair_address).block(block).call(); + let token0 = ERC20::Instance::new(pair.get().0.into_alloy(), self.web3.alloy.clone()); + let token1 = ERC20::Instance::new(pair.get().1.into_alloy(), self.web3.alloy.clone()); async move { + let fetch_token0_balance = token0 + .balanceOf(pair_address.into_alloy()) + .block(block.into_alloy()); + let fetch_token1_balance = token1 + .balanceOf(pair_address.into_alloy()) + .block(block.into_alloy()); + let pair_contract = IUniswapLikePair::Instance::new(pair_address.into_alloy(), self.web3.alloy.clone()); let fetch_reserves = pair_contract.getReserves().block(block.into_alloy()); let (reserves, token0_balance, token1_balance) = futures::join!( fetch_reserves.call().into_future(), - fetch_token0_balance, - fetch_token1_balance + fetch_token0_balance.call().into_future(), + fetch_token1_balance.call().into_future() ); handle_results( @@ -308,8 +313,8 @@ impl PoolReading for DefaultPoolReader { struct FetchedPool { pair: TokenPair, reserves: Result, - token0_balance: Result, - token1_balance: Result, + token0_balance: Result, + token1_balance: Result, } // Node errors should be bubbled up but contract errors should lead to the pool @@ -324,31 +329,10 @@ pub fn handle_contract_error(result: Result) -> Result