diff --git a/README.md b/README.md index ff7d0f36..540c5d87 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ cargo doc --open | Curve Pools | ❌|| | Balancer Pools | ❌|| | Bancor Pools | ❌|| -| Izumi Pools | ❌|| +| Izumi Pools | ✅|| | ERC4626 Vaults | ✅|| diff --git a/contracts/izumi/GetiZiPoolDataBatchRequest.sol b/contracts/izumi/GetiZiPoolDataBatchRequest.sol new file mode 100644 index 00000000..c622d42a --- /dev/null +++ b/contracts/izumi/GetiZiPoolDataBatchRequest.sol @@ -0,0 +1,154 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IiZiSwapPool { + function liquidity(bytes32 key) + external + view + returns ( + uint128 liquidity, + uint256 lastFeeScaleX_128, + uint256 lastFeeScaleY_128, + uint256 tokenOwedX, + uint256 tokenOwedY + ); + + function tokenX() external view returns (address); + function tokenY() external view returns (address); + + function sqrtRate_96() external view returns(uint160); + function fee() external view returns (uint24); + function pointDelta() external view returns (int24); + function state() + external view + returns( + uint160 sqrtPrice_96, + int24 currentPoint, + uint16 observationCurrentIndex, + uint16 observationQueueLen, + uint16 observationNextQueueLen, + bool locked, + uint128 liquidity, + uint128 liquidityX + ); +} +/** + @dev This contract is not meant to be deployed. Instead, use a static call with the + deployment bytecode as payload. + */ +contract GetiZiPoolDataBatchRequest { + struct PoolData { + address tokenA; + uint8 tokenADecimals; + address tokenB; + uint8 tokenBDecimals; + uint128 liquidity; + uint160 sqrtPrice; + uint128 liquidityA; + uint128 liquidityB; + int24 currentPoint; + int24 pointDelta; + uint24 fee; + } + + constructor(address[] memory pools) { + PoolData[] memory allPoolData = new PoolData[](pools.length); + + for (uint256 i = 0; i < pools.length; ++i) { + address poolAddress = pools[i]; + + if (codeSizeIsZero(poolAddress)) continue; + + PoolData memory poolData; + + poolData.tokenA = IiZiSwapPool(poolAddress).tokenX(); + poolData.tokenB = IiZiSwapPool(poolAddress).tokenY(); + + //Check that tokenA and tokenB do not have codesize of 0 + if (codeSizeIsZero(poolData.tokenA)) continue; + if (codeSizeIsZero(poolData.tokenB)) continue; + + //Get tokenA decimals + ( + bool tokenADecimalsSuccess, + bytes memory tokenADecimalsData + ) = poolData.tokenA.call(abi.encodeWithSignature("decimals()")); + + if (tokenADecimalsSuccess) { + uint256 tokenADecimals; + + if (tokenADecimalsData.length == 32) { + (tokenADecimals) = abi.decode( + tokenADecimalsData, + (uint256) + ); + + if (tokenADecimals == 0 || tokenADecimals > 255) { + continue; + } else { + poolData.tokenADecimals = uint8(tokenADecimals); + } + } else { + continue; + } + } else { + continue; + } + + ( + bool tokenBDecimalsSuccess, + bytes memory tokenBDecimalsData + ) = poolData.tokenB.call(abi.encodeWithSignature("decimals()")); + + if (tokenBDecimalsSuccess) { + uint256 tokenBDecimals; + if (tokenBDecimalsData.length == 32) { + (tokenBDecimals) = abi.decode( + tokenBDecimalsData, + (uint256) + ); + + if (tokenBDecimals == 0 || tokenBDecimals > 255) { + continue; + } else { + poolData.tokenBDecimals = uint8(tokenBDecimals); + } + } else { + continue; + } + } else { + continue; + } + + (uint160 sqrtPriceX96, int24 currentPoint, , , , , uint128 liquidity, uint128 liquidityX) = IiZiSwapPool( + poolAddress + ).state(); + + + poolData.fee = IiZiSwapPool(poolAddress).fee(); + poolData.pointDelta = IiZiSwapPool(poolAddress).pointDelta(); + poolData.sqrtPrice = sqrtPriceX96; + poolData.currentPoint = currentPoint; + poolData.liquidity = liquidity; + poolData.liquidityA = liquidityX; + poolData.liquidityB = liquidity - liquidityX; + allPoolData[i] = poolData; + } + + bytes memory _abiEncodedData = abi.encode(allPoolData); + assembly { + // Return from the start of the data (discarding the original data address) + // up to the end of the memory used + let dataStart := add(_abiEncodedData, 0x20) + return(dataStart, sub(msize(), dataStart)) + } + } + + function codeSizeIsZero(address target) internal view returns (bool) { + if (target.code.length == 0) { + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/contracts/izumi/SynciZiPoolDataBatchRequest.sol b/contracts/izumi/SynciZiPoolDataBatchRequest.sol new file mode 100644 index 00000000..d3c51f84 --- /dev/null +++ b/contracts/izumi/SynciZiPoolDataBatchRequest.sol @@ -0,0 +1,101 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IiZiSwapPool { + function liquidity( + bytes32 key + ) + external + view + returns ( + uint128 liquidity, + uint256 lastFeeScaleX_128, + uint256 lastFeeScaleY_128, + uint256 tokenOwedX, + uint256 tokenOwedY + ); + + function tokenX() external view returns (address); + + function tokenY() external view returns (address); + + function sqrtRate_96() external view returns (uint160); + + function fee() external view returns (uint24); + + function pointDelta() external view returns (int24); + + function state() + external + view + returns ( + uint160 sqrtPrice_96, + int24 currentPoint, + uint16 observationCurrentIndex, + uint16 observationQueueLen, + uint16 observationNextQueueLen, + bool locked, + uint128 liquidity, + uint128 liquidityX + ); +} + +/** + @dev This contract is not meant to be deployed. Instead, use a static call with the + deployment bytecode as payload. + */ +contract SynciZiPoolDataBatchRequest { + struct PoolData { + uint128 liquidity; + uint160 sqrtPrice; + uint128 liquidityA; + uint128 liquidityB; + int24 currentPoint; + } + + constructor(address[] memory pools) { + PoolData[] memory allPoolData = new PoolData[](pools.length); + + for (uint256 i = 0; i < pools.length; ++i) { + address poolAddress = pools[i]; + + if (codeSizeIsZero(poolAddress)) continue; + + PoolData memory poolData; + + ( + uint160 sqrtPriceX96, + int24 currentPoint, + , + , + , + , + uint128 liquidity, + uint128 liquidityX + ) = IiZiSwapPool(poolAddress).state(); + + poolData.sqrtPrice = sqrtPriceX96; + poolData.currentPoint = currentPoint; + poolData.liquidity = liquidity; + poolData.liquidityA = liquidityX; + poolData.liquidityB = liquidity - liquidityX; + allPoolData[i] = poolData; + } + + bytes memory _abiEncodedData = abi.encode(allPoolData); + assembly { + // Return from the start of the data (discarding the original data address) + // up to the end of the memory used + let dataStart := add(_abiEncodedData, 0x20) + return(dataStart, sub(msize(), dataStart)) + } + } + + function codeSizeIsZero(address target) internal view returns (bool) { + if (target.code.length == 0) { + return true; + } else { + return false; + } + } +} diff --git a/examples/discover-erc-4626-vaults.rs b/examples/discover-erc-4626-vaults.rs index 682b1f0a..7c2a8c1d 100644 --- a/examples/discover-erc-4626-vaults.rs +++ b/examples/discover-erc-4626-vaults.rs @@ -12,7 +12,7 @@ async fn main() -> Result<(), Box> { let provider = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); //discover vaults - let _vaults = discovery::erc_4626::discover_erc_4626_vaults(provider).await?; + let _vaults = discovery::erc_4626::discover_erc_4626_vaults(provider, 30000).await?; Ok(()) } diff --git a/examples/discover-factories.rs b/examples/discover-factories.rs index 4b2c3f27..b7b96e21 100644 --- a/examples/discover-factories.rs +++ b/examples/discover-factories.rs @@ -6,11 +6,12 @@ use damms::discovery::factory::{discover_factories, DiscoverableFactory}; #[tokio::main] async fn main() -> Result<(), Box> { - let factories_filename = "gnosis_factories.json"; - let number_of_amms_threshold = 50; + let factories_filename = "fantom_factories.json"; + let number_of_amms_threshold = 10; //Add rpc endpoint here: - let rpc_endpoint = "https://rpc.gnosis.gateway.fm"; + let rpc_endpoint = + std::env::var("ARBITRUM_MAINNET_ENDPOINT").expect("Could not get ETHEREUM_RPC_ENDPOINT"); let provider = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); @@ -18,6 +19,7 @@ async fn main() -> Result<(), Box> { vec![ DiscoverableFactory::UniswapV2Factory, DiscoverableFactory::UniswapV3Factory, + DiscoverableFactory::IziSwapFactory, ], number_of_amms_threshold, provider, diff --git a/examples/sync-amms.rs b/examples/sync-amms.rs index 41a3ce72..6710620b 100644 --- a/examples/sync-amms.rs +++ b/examples/sync-amms.rs @@ -6,10 +6,7 @@ use ethers::{ }; use damms::{ - amm::{ - factory::Factory, uniswap_v2::factory::UniswapV2Factory, - uniswap_v3::factory::UniswapV3Factory, - }, + amm::{factory::Factory, izumi::factory::IziSwapFactory}, sync, }; @@ -17,31 +14,35 @@ use damms::{ async fn main() -> Result<(), Box> { //Add rpc endpoint here: let rpc_endpoint = - std::env::var("ETHEREUM_RPC_ENDPOINT").expect("Could not get ETHEREUM_RPC_ENDPOINT"); + std::env::var("ARBITRUM_MAINNET_ENDPOINT").expect("Could not get ETHEREUM_RPC_ENDPOINT"); let provider = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); let factories = vec![ //UniswapV2 - Factory::UniswapV2Factory(UniswapV2Factory::new( - H160::from_str("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f").unwrap(), - 2638438, - 300, - )), - //Add Sushiswap - Factory::UniswapV2Factory(UniswapV2Factory::new( - H160::from_str("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac").unwrap(), - 10794229, - 300, - )), + // Factory::UniswapV2Factory(UniswapV2Factory::new( + // H160::from_str("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f").unwrap(), + // 2638438, + // 300, + // )), + // //Add Sushiswap + // Factory::UniswapV2Factory(UniswapV2Factory::new( + // H160::from_str("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac").unwrap(), + // 10794229, + // 300, + // )), //Add UniswapV3 - Factory::UniswapV3Factory(UniswapV3Factory::new( - H160::from_str("0x1F98431c8aD98523631AE4a59f267346ea31F984").unwrap(), - 12369621, + // Factory::UniswapV3Factory(UniswapV3Factory::new( + // H160::from_str("0x1F98431c8aD98523631AE4a59f267346ea31F984").unwrap(), + // 185, + // )), + Factory::IziSwapFactory(IziSwapFactory::new( + H160::from_str("0x45e5f26451cdb01b0fa1f8582e0aad9a6f27c218").unwrap(), + 26815159, )), ]; //Sync pairs - sync::sync_amms(factories, provider, None).await?; + sync::sync_amms(factories, provider, None, 30000).await?; Ok(()) } diff --git a/src/amm/factory.rs b/src/amm/factory.rs index 0a4660b8..b40cf58e 100644 --- a/src/amm/factory.rs +++ b/src/amm/factory.rs @@ -11,6 +11,7 @@ use tokio::task::JoinHandle; use crate::errors::DAMMError; use super::{ + izumi::factory::{IziSwapFactory, IZI_POOL_CREATED_EVENT_SIGNATURE}, uniswap_v2::factory::{UniswapV2Factory, PAIR_CREATED_EVENT_SIGNATURE}, uniswap_v3::factory::{UniswapV3Factory, POOL_CREATED_EVENT_SIGNATURE}, AMM, @@ -53,6 +54,7 @@ pub trait AutomatedMarketMakerFactory { pub enum Factory { UniswapV2Factory(UniswapV2Factory), UniswapV3Factory(UniswapV3Factory), + IziSwapFactory(IziSwapFactory), } #[async_trait] @@ -61,6 +63,7 @@ impl AutomatedMarketMakerFactory for Factory { match self { Factory::UniswapV2Factory(factory) => factory.address(), Factory::UniswapV3Factory(factory) => factory.address(), + Factory::IziSwapFactory(factory) => factory.address(), } } @@ -68,6 +71,7 @@ impl AutomatedMarketMakerFactory for Factory { match self { Factory::UniswapV2Factory(factory) => factory.amm_created_event_signature(), Factory::UniswapV3Factory(factory) => factory.amm_created_event_signature(), + Factory::IziSwapFactory(factory) => factory.amm_created_event_signature(), } } @@ -79,6 +83,7 @@ impl AutomatedMarketMakerFactory for Factory { match self { Factory::UniswapV2Factory(factory) => factory.new_amm_from_log(log, middleware).await, Factory::UniswapV3Factory(factory) => factory.new_amm_from_log(log, middleware).await, + Factory::IziSwapFactory(factory) => factory.new_amm_from_log(log, middleware).await, } } @@ -86,6 +91,7 @@ impl AutomatedMarketMakerFactory for Factory { match self { Factory::UniswapV2Factory(factory) => factory.new_empty_amm_from_log(log), Factory::UniswapV3Factory(factory) => factory.new_empty_amm_from_log(log), + Factory::IziSwapFactory(factory) => factory.new_empty_amm_from_log(log), } } @@ -102,6 +108,9 @@ impl AutomatedMarketMakerFactory for Factory { Factory::UniswapV3Factory(factory) => { factory.get_all_amms(to_block, middleware, step).await } + Factory::IziSwapFactory(factory) => { + factory.get_all_amms(to_block, middleware, step).await + } } } @@ -120,6 +129,11 @@ impl AutomatedMarketMakerFactory for Factory { .populate_amm_data(amms, block_number, middleware) .await } + Factory::IziSwapFactory(factory) => { + factory + .populate_amm_data(amms, block_number, middleware) + .await + } } } @@ -127,6 +141,7 @@ impl AutomatedMarketMakerFactory for Factory { match self { Factory::UniswapV2Factory(uniswap_v2_factory) => uniswap_v2_factory.creation_block, Factory::UniswapV3Factory(uniswap_v3_factory) => uniswap_v3_factory.creation_block, + Factory::IziSwapFactory(izi_swap_factory) => izi_swap_factory.creation_block, } } } @@ -208,6 +223,8 @@ impl Factory { Factory::UniswapV2Factory(UniswapV2Factory::default()) } else if event_signature == POOL_CREATED_EVENT_SIGNATURE { Factory::UniswapV3Factory(UniswapV3Factory::default()) + } else if event_signature == IZI_POOL_CREATED_EVENT_SIGNATURE { + Factory::IziSwapFactory(IziSwapFactory::default()) } else { //TODO: handle this error panic!("Unrecognized event signature") diff --git a/src/amm/izumi/batch_request/GetiZiPoolDataBatchRequest.json b/src/amm/izumi/batch_request/GetiZiPoolDataBatchRequest.json new file mode 100644 index 00000000..283e25bb --- /dev/null +++ b/src/amm/izumi/batch_request/GetiZiPoolDataBatchRequest.json @@ -0,0 +1,4961 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address[]", + "name": "pools", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "bytecode": { + "object": "0x608060405234801561001057600080fd5b506040516111c53803806111c583398181016040528101906100329190610af5565b6000815167ffffffffffffffff81111561004f5761004e610954565b5b60405190808252806020026020018201604052801561008857816020015b610075610847565b81526020019060019003908161006d5790505b50905060005b82518110156107e55760008382815181106100ac576100ab610b3e565b5b602002602001015190506100c58161081460201b60201c565b156100d057506107d4565b6100d8610847565b8173ffffffffffffffffffffffffffffffffffffffff166316dc165b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610123573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101479190610b6d565b816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1663b7d19fc46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ed9190610b6d565b816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610237816000015161081460201b60201c565b156102435750506107d4565b610256816040015161081460201b60201c565b156102625750506107d4565b600080826000015173ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f313ce567000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516103109190610c0b565b6000604051808303816000865af19150503d806000811461034d576040519150601f19603f3d011682016040523d82523d6000602084013e610352565b606091505b509150915081156103c357600060208251036103b3578180602001905181019061037c9190610c58565b9050600081148061038d575060ff81115b1561039c5750505050506107d4565b80846020019060ff16908160ff16815250506103bd565b50505050506107d4565b506103cc565b505050506107d4565b600080846040015173ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f313ce567000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161047a9190610c0b565b6000604051808303816000865af19150503d80600081146104b7576040519150601f19603f3d011682016040523d82523d6000602084013e6104bc565b606091505b50915091508115610531576000602082510361051f57818060200190518101906104e69190610c58565b905060008114806104f7575060ff81115b1561050857505050505050506107d4565b80866060019060ff16908160ff168152505061052b565b505050505050506107d4565b5061053c565b5050505050506107d4565b6000806000808973ffffffffffffffffffffffffffffffffffffffff1663c19d93fb6040518163ffffffff1660e01b815260040161010060405180830381865afa15801561058e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b29190610da4565b9750975050505050935093508973ffffffffffffffffffffffffffffffffffffffff1663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015610609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062d9190610e95565b89610140019062ffffff16908162ffffff16815250508973ffffffffffffffffffffffffffffffffffffffff166358c51ce66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561068e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b29190610ec2565b89610120019060020b908160020b81525050838960a0019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508289610100019060020b908160020b815250508189608001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff1681525050808960c001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff1681525050808261077b9190610f1e565b8960e001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff1681525050888c8c815181106107be576107bd610b3e565b5b6020026020010181905250505050505050505050505b806107de90610f62565b905061008e565b506000816040516020016107f991906111a2565b60405160208183030381529060405290506020810180590381f35b6000808273ffffffffffffffffffffffffffffffffffffffff163b0361083d5760019050610842565b600090505b919050565b604051806101600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600060ff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600060ff16815260200160006fffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff168152602001600060020b8152602001600060020b8152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61098c82610943565b810181811067ffffffffffffffff821117156109ab576109aa610954565b5b80604052505050565b60006109be61092a565b90506109ca8282610983565b919050565b600067ffffffffffffffff8211156109ea576109e9610954565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610a2b82610a00565b9050919050565b610a3b81610a20565b8114610a4657600080fd5b50565b600081519050610a5881610a32565b92915050565b6000610a71610a6c846109cf565b6109b4565b90508083825260208201905060208402830185811115610a9457610a936109fb565b5b835b81811015610abd5780610aa98882610a49565b845260208401935050602081019050610a96565b5050509392505050565b600082601f830112610adc57610adb61093e565b5b8151610aec848260208601610a5e565b91505092915050565b600060208284031215610b0b57610b0a610934565b5b600082015167ffffffffffffffff811115610b2957610b28610939565b5b610b3584828501610ac7565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215610b8357610b82610934565b5b6000610b9184828501610a49565b91505092915050565b600081519050919050565b600081905092915050565b60005b83811015610bce578082015181840152602081019050610bb3565b60008484015250505050565b6000610be582610b9a565b610bef8185610ba5565b9350610bff818560208601610bb0565b80840191505092915050565b6000610c178284610bda565b915081905092915050565b6000819050919050565b610c3581610c22565b8114610c4057600080fd5b50565b600081519050610c5281610c2c565b92915050565b600060208284031215610c6e57610c6d610934565b5b6000610c7c84828501610c43565b91505092915050565b610c8e81610a00565b8114610c9957600080fd5b50565b600081519050610cab81610c85565b92915050565b60008160020b9050919050565b610cc781610cb1565b8114610cd257600080fd5b50565b600081519050610ce481610cbe565b92915050565b600061ffff82169050919050565b610d0181610cea565b8114610d0c57600080fd5b50565b600081519050610d1e81610cf8565b92915050565b60008115159050919050565b610d3981610d24565b8114610d4457600080fd5b50565b600081519050610d5681610d30565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b610d8181610d5c565b8114610d8c57600080fd5b50565b600081519050610d9e81610d78565b92915050565b600080600080600080600080610100898b031215610dc557610dc4610934565b5b6000610dd38b828c01610c9c565b9850506020610de48b828c01610cd5565b9750506040610df58b828c01610d0f565b9650506060610e068b828c01610d0f565b9550506080610e178b828c01610d0f565b94505060a0610e288b828c01610d47565b93505060c0610e398b828c01610d8f565b92505060e0610e4a8b828c01610d8f565b9150509295985092959890939650565b600062ffffff82169050919050565b610e7281610e5a565b8114610e7d57600080fd5b50565b600081519050610e8f81610e69565b92915050565b600060208284031215610eab57610eaa610934565b5b6000610eb984828501610e80565b91505092915050565b600060208284031215610ed857610ed7610934565b5b6000610ee684828501610cd5565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610f2982610d5c565b9150610f3483610d5c565b925082820390506fffffffffffffffffffffffffffffffff811115610f5c57610f5b610eef565b5b92915050565b6000610f6d82610c22565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610f9f57610f9e610eef565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b610fdf81610a20565b82525050565b600060ff82169050919050565b610ffb81610fe5565b82525050565b61100a81610d5c565b82525050565b61101981610a00565b82525050565b61102881610cb1565b82525050565b61103781610e5a565b82525050565b610160820160008201516110546000850182610fd6565b5060208201516110676020850182610ff2565b50604082015161107a6040850182610fd6565b50606082015161108d6060850182610ff2565b5060808201516110a06080850182611001565b5060a08201516110b360a0850182611010565b5060c08201516110c660c0850182611001565b5060e08201516110d960e0850182611001565b506101008201516110ee61010085018261101f565b5061012082015161110361012085018261101f565b5061014082015161111861014085018261102e565b50505050565b600061112a838361103d565b6101608301905092915050565b6000602082019050919050565b600061114f82610faa565b6111598185610fb5565b935061116483610fc6565b8060005b8381101561119557815161117c888261111e565b975061118783611137565b925050600181019050611168565b5085935050505092915050565b600060208201905081810360008301526111bc8184611144565b90509291505056fe", + "sourceMap": "1116:3852:20:-:0;;;1479:3288;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1525:29;1572:5;:12;1557:28;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;1525:60;;1601:9;1596:2824;1620:5;:12;1616:1;:16;1596:2824;;;1653:19;1675:5;1681:1;1675:8;;;;;;;;:::i;:::-;;;;;;;;1653:30;;1702:27;1717:11;1702:14;;;:27;;:::i;:::-;1698:41;;;1731:8;;;1698:41;1754:24;;:::i;:::-;1824:11;1811:32;;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1793:8;:15;;:52;;;;;;;;;;;1890:11;1877:32;;;:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1859:8;:15;;:52;;;;;;;;;;;1999:31;2014:8;:15;;;1999:14;;;:31;;:::i;:::-;1995:45;;;2032:8;;;;1995:45;2058:31;2073:8;:15;;;2058:14;;;:31;;:::i;:::-;2054:45;;;2091:8;;;;2054:45;2166:26;2210:31;2258:8;:15;;;:20;;2279:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2258:59;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2148:169;;;;2336:21;2332:640;;;2377:22;2451:2;2422:18;:25;:31;2418:493;;2532:18;2496:111;;;;;;;;;;;;:::i;:::-;2477:130;;2652:1;2634:14;:19;:43;;;;2674:3;2657:14;:20;2634:43;2630:208;;;2705:8;;;;;;;2630:208;2800:14;2768:8;:23;;:47;;;;;;;;;;;2418:493;;;2884:8;;;;;;;2418:493;2359:566;2332:640;;;2949:8;;;;;;2332:640;3004:26;3048:31;3096:8;:15;;;:20;;3117:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3096:59;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2986:169;;;;3174:21;3170:639;;;3215:22;3288:2;3259:18;:25;:31;3255:493;;3369:18;3333:111;;;;;;;;;;;;:::i;:::-;3314:130;;3489:1;3471:14;:19;:43;;;;3511:3;3494:14;:20;3471:43;3467:208;;;3542:8;;;;;;;;;3467:208;3637:14;3605:8;:23;;:47;;;;;;;;;;;3255:493;;;3721:8;;;;;;;;;3255:493;3197:565;3170:639;;;3786:8;;;;;;;;3170:639;3824:20;3846:18;3874:17;3893:18;3945:11;3915:61;;;:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3823:155;;;;;;;;;;;;4033:11;4020:29;;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4005:8;:12;;:46;;;;;;;;;;;4100:11;4087:36;;;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4065:8;:19;;:60;;;;;;;;;;;4160:12;4139:8;:18;;:33;;;;;;;;;;;4210:12;4186:8;:21;;:36;;;;;;;;;;;4257:9;4236:8;:18;;:30;;;;;;;;;;;4302:10;4280:8;:19;;:32;;;;;;;;;;;4360:10;4348:9;:22;;;;:::i;:::-;4326:8;:19;;:44;;;;;;;;;;;4401:8;4384:11;4396:1;4384:14;;;;;;;;:::i;:::-;;;;;;;:25;;;;1639:2781;;;;;;;;;;1596:2824;1634:3;;;;:::i;:::-;;;1596:2824;;;;4430:28;4472:11;4461:23;;;;;;;;:::i;:::-;;;;;;;;;;;;;4430:54;;4691:4;4674:15;4670:26;4740:9;4731:7;4727:23;4716:9;4709:42;4773:193;4836:4;4878:1;4856:6;:18;;;:23;4852:108;;4902:4;4895:11;;;;4852:108;4944:5;4937:12;;4773:193;;;;:::o;1116:3852::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7:75:23:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:117;443:1;440;433:12;457:102;498:6;549:2;545:7;540:2;533:5;529:14;525:28;515:38;;457:102;;;:::o;565:180::-;613:77;610:1;603:88;710:4;707:1;700:15;734:4;731:1;724:15;751:281;834:27;856:4;834:27;:::i;:::-;826:6;822:40;964:6;952:10;949:22;928:18;916:10;913:34;910:62;907:88;;;975:18;;:::i;:::-;907:88;1015:10;1011:2;1004:22;794:238;751:281;;:::o;1038:129::-;1072:6;1099:20;;:::i;:::-;1089:30;;1128:33;1156:4;1148:6;1128:33;:::i;:::-;1038:129;;;:::o;1173:311::-;1250:4;1340:18;1332:6;1329:30;1326:56;;;1362:18;;:::i;:::-;1326:56;1412:4;1404:6;1400:17;1392:25;;1472:4;1466;1462:15;1454:23;;1173:311;;;:::o;1490:117::-;1599:1;1596;1589:12;1613:126;1650:7;1690:42;1683:5;1679:54;1668:65;;1613:126;;;:::o;1745:96::-;1782:7;1811:24;1829:5;1811:24;:::i;:::-;1800:35;;1745:96;;;:::o;1847:122::-;1920:24;1938:5;1920:24;:::i;:::-;1913:5;1910:35;1900:63;;1959:1;1956;1949:12;1900:63;1847:122;:::o;1975:143::-;2032:5;2063:6;2057:13;2048:22;;2079:33;2106:5;2079:33;:::i;:::-;1975:143;;;;:::o;2141:732::-;2248:5;2273:81;2289:64;2346:6;2289:64;:::i;:::-;2273:81;:::i;:::-;2264:90;;2374:5;2403:6;2396:5;2389:21;2437:4;2430:5;2426:16;2419:23;;2490:4;2482:6;2478:17;2470:6;2466:30;2519:3;2511:6;2508:15;2505:122;;;2538:79;;:::i;:::-;2505:122;2653:6;2636:231;2670:6;2665:3;2662:15;2636:231;;;2745:3;2774:48;2818:3;2806:10;2774:48;:::i;:::-;2769:3;2762:61;2852:4;2847:3;2843:14;2836:21;;2712:155;2696:4;2691:3;2687:14;2680:21;;2636:231;;;2640:21;2254:619;;2141:732;;;;;:::o;2896:385::-;2978:5;3027:3;3020:4;3012:6;3008:17;3004:27;2994:122;;3035:79;;:::i;:::-;2994:122;3145:6;3139:13;3170:105;3271:3;3263:6;3256:4;3248:6;3244:17;3170:105;:::i;:::-;3161:114;;2984:297;2896:385;;;;:::o;3287:554::-;3382:6;3431:2;3419:9;3410:7;3406:23;3402:32;3399:119;;;3437:79;;:::i;:::-;3399:119;3578:1;3567:9;3563:17;3557:24;3608:18;3600:6;3597:30;3594:117;;;3630:79;;:::i;:::-;3594:117;3735:89;3816:7;3807:6;3796:9;3792:22;3735:89;:::i;:::-;3725:99;;3528:306;3287:554;;;;:::o;3847:180::-;3895:77;3892:1;3885:88;3992:4;3989:1;3982:15;4016:4;4013:1;4006:15;4033:351;4103:6;4152:2;4140:9;4131:7;4127:23;4123:32;4120:119;;;4158:79;;:::i;:::-;4120:119;4278:1;4303:64;4359:7;4350:6;4339:9;4335:22;4303:64;:::i;:::-;4293:74;;4249:128;4033:351;;;;:::o;4390:98::-;4441:6;4475:5;4469:12;4459:22;;4390:98;;;:::o;4494:147::-;4595:11;4632:3;4617:18;;4494:147;;;;:::o;4647:246::-;4728:1;4738:113;4752:6;4749:1;4746:13;4738:113;;;4837:1;4832:3;4828:11;4822:18;4818:1;4813:3;4809:11;4802:39;4774:2;4771:1;4767:10;4762:15;;4738:113;;;4885:1;4876:6;4871:3;4867:16;4860:27;4709:184;4647:246;;;:::o;4899:386::-;5003:3;5031:38;5063:5;5031:38;:::i;:::-;5085:88;5166:6;5161:3;5085:88;:::i;:::-;5078:95;;5182:65;5240:6;5235:3;5228:4;5221:5;5217:16;5182:65;:::i;:::-;5272:6;5267:3;5263:16;5256:23;;5007:278;4899:386;;;;:::o;5291:271::-;5421:3;5443:93;5532:3;5523:6;5443:93;:::i;:::-;5436:100;;5553:3;5546:10;;5291:271;;;;:::o;5568:77::-;5605:7;5634:5;5623:16;;5568:77;;;:::o;5651:122::-;5724:24;5742:5;5724:24;:::i;:::-;5717:5;5714:35;5704:63;;5763:1;5760;5753:12;5704:63;5651:122;:::o;5779:143::-;5836:5;5867:6;5861:13;5852:22;;5883:33;5910:5;5883:33;:::i;:::-;5779:143;;;;:::o;5928:351::-;5998:6;6047:2;6035:9;6026:7;6022:23;6018:32;6015:119;;;6053:79;;:::i;:::-;6015:119;6173:1;6198:64;6254:7;6245:6;6234:9;6230:22;6198:64;:::i;:::-;6188:74;;6144:128;5928:351;;;;:::o;6285:122::-;6358:24;6376:5;6358:24;:::i;:::-;6351:5;6348:35;6338:63;;6397:1;6394;6387:12;6338:63;6285:122;:::o;6413:143::-;6470:5;6501:6;6495:13;6486:22;;6517:33;6544:5;6517:33;:::i;:::-;6413:143;;;;:::o;6562:90::-;6597:7;6640:5;6637:1;6626:20;6615:31;;6562:90;;;:::o;6658:118::-;6729:22;6745:5;6729:22;:::i;:::-;6722:5;6719:33;6709:61;;6766:1;6763;6756:12;6709:61;6658:118;:::o;6782:139::-;6837:5;6868:6;6862:13;6853:22;;6884:31;6909:5;6884:31;:::i;:::-;6782:139;;;;:::o;6927:89::-;6963:7;7003:6;6996:5;6992:18;6981:29;;6927:89;;;:::o;7022:120::-;7094:23;7111:5;7094:23;:::i;:::-;7087:5;7084:34;7074:62;;7132:1;7129;7122:12;7074:62;7022:120;:::o;7148:141::-;7204:5;7235:6;7229:13;7220:22;;7251:32;7277:5;7251:32;:::i;:::-;7148:141;;;;:::o;7295:90::-;7329:7;7372:5;7365:13;7358:21;7347:32;;7295:90;;;:::o;7391:116::-;7461:21;7476:5;7461:21;:::i;:::-;7454:5;7451:32;7441:60;;7497:1;7494;7487:12;7441:60;7391:116;:::o;7513:137::-;7567:5;7598:6;7592:13;7583:22;;7614:30;7638:5;7614:30;:::i;:::-;7513:137;;;;:::o;7656:118::-;7693:7;7733:34;7726:5;7722:46;7711:57;;7656:118;;;:::o;7780:122::-;7853:24;7871:5;7853:24;:::i;:::-;7846:5;7843:35;7833:63;;7892:1;7889;7882:12;7833:63;7780:122;:::o;7908:143::-;7965:5;7996:6;7990:13;7981:22;;8012:33;8039:5;8012:33;:::i;:::-;7908:143;;;;:::o;8057:1432::-;8182:6;8190;8198;8206;8214;8222;8230;8238;8287:3;8275:9;8266:7;8262:23;8258:33;8255:120;;;8294:79;;:::i;:::-;8255:120;8414:1;8439:64;8495:7;8486:6;8475:9;8471:22;8439:64;:::i;:::-;8429:74;;8385:128;8552:2;8578:62;8632:7;8623:6;8612:9;8608:22;8578:62;:::i;:::-;8568:72;;8523:127;8689:2;8715:63;8770:7;8761:6;8750:9;8746:22;8715:63;:::i;:::-;8705:73;;8660:128;8827:2;8853:63;8908:7;8899:6;8888:9;8884:22;8853:63;:::i;:::-;8843:73;;8798:128;8965:3;8992:63;9047:7;9038:6;9027:9;9023:22;8992:63;:::i;:::-;8982:73;;8936:129;9104:3;9131:61;9184:7;9175:6;9164:9;9160:22;9131:61;:::i;:::-;9121:71;;9075:127;9241:3;9268:64;9324:7;9315:6;9304:9;9300:22;9268:64;:::i;:::-;9258:74;;9212:130;9381:3;9408:64;9464:7;9455:6;9444:9;9440:22;9408:64;:::i;:::-;9398:74;;9352:130;8057:1432;;;;;;;;;;;:::o;9495:91::-;9531:7;9571:8;9564:5;9560:20;9549:31;;9495:91;;;:::o;9592:120::-;9664:23;9681:5;9664:23;:::i;:::-;9657:5;9654:34;9644:62;;9702:1;9699;9692:12;9644:62;9592:120;:::o;9718:141::-;9774:5;9805:6;9799:13;9790:22;;9821:32;9847:5;9821:32;:::i;:::-;9718:141;;;;:::o;9865:349::-;9934:6;9983:2;9971:9;9962:7;9958:23;9954:32;9951:119;;;9989:79;;:::i;:::-;9951:119;10109:1;10134:63;10189:7;10180:6;10169:9;10165:22;10134:63;:::i;:::-;10124:73;;10080:127;9865:349;;;;:::o;10220:347::-;10288:6;10337:2;10325:9;10316:7;10312:23;10308:32;10305:119;;;10343:79;;:::i;:::-;10305:119;10463:1;10488:62;10542:7;10533:6;10522:9;10518:22;10488:62;:::i;:::-;10478:72;;10434:126;10220:347;;;;:::o;10573:180::-;10621:77;10618:1;10611:88;10718:4;10715:1;10708:15;10742:4;10739:1;10732:15;10759:227;10799:4;10819:20;10837:1;10819:20;:::i;:::-;10814:25;;10853:20;10871:1;10853:20;:::i;:::-;10848:25;;10897:1;10894;10890:9;10882:17;;10921:34;10915:4;10912:44;10909:70;;;10959:18;;:::i;:::-;10909:70;10759:227;;;;:::o;10992:233::-;11031:3;11054:24;11072:5;11054:24;:::i;:::-;11045:33;;11100:66;11093:5;11090:77;11087:103;;11170:18;;:::i;:::-;11087:103;11217:1;11210:5;11206:13;11199:20;;10992:233;;;:::o;11231:141::-;11325:6;11359:5;11353:12;11343:22;;11231:141;;;:::o;11378:211::-;11504:11;11538:6;11533:3;11526:19;11578:4;11573:3;11569:14;11554:29;;11378:211;;;;:::o;11595:159::-;11689:4;11712:3;11704:11;;11742:4;11737:3;11733:14;11725:22;;11595:159;;;:::o;11760:108::-;11837:24;11855:5;11837:24;:::i;:::-;11832:3;11825:37;11760:108;;:::o;11874:86::-;11909:7;11949:4;11942:5;11938:16;11927:27;;11874:86;;;:::o;11966:102::-;12039:22;12055:5;12039:22;:::i;:::-;12034:3;12027:35;11966:102;;:::o;12074:108::-;12151:24;12169:5;12151:24;:::i;:::-;12146:3;12139:37;12074:108;;:::o;12188:::-;12265:24;12283:5;12265:24;:::i;:::-;12260:3;12253:37;12188:108;;:::o;12302:102::-;12375:22;12391:5;12375:22;:::i;:::-;12370:3;12363:35;12302:102;;:::o;12410:105::-;12485:23;12502:5;12485:23;:::i;:::-;12480:3;12473:36;12410:105;;:::o;12617:2122::-;12758:6;12753:3;12749:16;12849:4;12842:5;12838:16;12832:23;12868:63;12925:4;12920:3;12916:14;12902:12;12868:63;:::i;:::-;12775:166;13033:4;13026:5;13022:16;13016:23;13052:59;13105:4;13100:3;13096:14;13082:12;13052:59;:::i;:::-;12951:170;13205:4;13198:5;13194:16;13188:23;13224:63;13281:4;13276:3;13272:14;13258:12;13224:63;:::i;:::-;13131:166;13389:4;13382:5;13378:16;13372:23;13408:59;13461:4;13456:3;13452:14;13438:12;13408:59;:::i;:::-;13307:170;13564:4;13557:5;13553:16;13547:23;13583:63;13640:4;13635:3;13631:14;13617:12;13583:63;:::i;:::-;13487:169;13743:4;13736:5;13732:16;13726:23;13762:63;13819:4;13814:3;13810:14;13796:12;13762:63;:::i;:::-;13666:169;13923:4;13916:5;13912:16;13906:23;13942:63;13999:4;13994:3;13990:14;13976:12;13942:63;:::i;:::-;13845:170;14103:4;14096:5;14092:16;14086:23;14122:63;14179:4;14174:3;14170:14;14156:12;14122:63;:::i;:::-;14025:170;14285:6;14278:5;14274:18;14268:25;14306:61;14359:6;14354:3;14350:16;14336:12;14306:61;:::i;:::-;14205:172;14465:6;14458:5;14454:18;14448:25;14486:61;14539:6;14534:3;14530:16;14516:12;14486:61;:::i;:::-;14387:170;14638:6;14631:5;14627:18;14621:25;14659:63;14714:6;14709:3;14705:16;14691:12;14659:63;:::i;:::-;14567:165;12727:2012;12617:2122;;:::o;14745:289::-;14868:10;14889:100;14985:3;14977:6;14889:100;:::i;:::-;15021:6;15016:3;15012:16;14998:30;;14745:289;;;;:::o;15040:140::-;15137:4;15169;15164:3;15160:14;15152:22;;15040:140;;;:::o;15286:948::-;15459:3;15488:81;15563:5;15488:81;:::i;:::-;15585:113;15691:6;15686:3;15585:113;:::i;:::-;15578:120;;15722:83;15799:5;15722:83;:::i;:::-;15828:7;15859:1;15844:365;15869:6;15866:1;15863:13;15844:365;;;15945:6;15939:13;15972:117;16085:3;16070:13;15972:117;:::i;:::-;15965:124;;16112:87;16192:6;16112:87;:::i;:::-;16102:97;;15904:305;15891:1;15888;15884:9;15879:14;;15844:365;;;15848:14;16225:3;16218:10;;15464:770;;;15286:948;;;;:::o;16240:481::-;16437:4;16475:2;16464:9;16460:18;16452:26;;16524:9;16518:4;16514:20;16510:1;16499:9;16495:17;16488:47;16552:162;16709:4;16700:6;16552:162;:::i;:::-;16544:170;;16240:481;;;;:::o", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x6080604052600080fdfea2646970667358221220bddcabe35289f37dd2bf13722fafcfa7b8aa793d7c4e4e7c06b9b6b090b6413d64736f6c63430008100033", + "sourceMap": "1116:3852:20:-:0;;;;;", + "linkReferences": {} + }, + "methodIdentifiers": {}, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.16+commit.07a7930e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"details\":\"This contract is not meant to be deployed. Instead, use a static call with the deployment bytecode as payload.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/GetiZiPoolDataBatchRequest.sol\":\"GetiZiPoolDataBatchRequest\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/GetiZiPoolDataBatchRequest.sol\":{\"keccak256\":\"0x4bbe97685c5e9a6da0fc223adcef9f5faa11935d9db50fb39f987143bf2254f6\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5bcc426cb0c2ac75e3d689fe57ac4034c72802105ee066186f9e795115e08a69\",\"dweb:/ipfs/QmTqGaj2WX4txeDxv4BzUBCCvN1k4NuTb42HFLPxV8bVYo\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.16+commit.07a7930e" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "address[]", + "name": "pools", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } + }, + "settings": { + "remappings": [ + ":ds-test/=lib/forge-std/lib/ds-test/src/", + ":forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": false, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/GetiZiPoolDataBatchRequest.sol": "GetiZiPoolDataBatchRequest" + }, + "libraries": {} + }, + "sources": { + "src/GetiZiPoolDataBatchRequest.sol": { + "keccak256": "0x4bbe97685c5e9a6da0fc223adcef9f5faa11935d9db50fb39f987143bf2254f6", + "urls": [ + "bzz-raw://5bcc426cb0c2ac75e3d689fe57ac4034c72802105ee066186f9e795115e08a69", + "dweb:/ipfs/QmTqGaj2WX4txeDxv4BzUBCCvN1k4NuTb42HFLPxV8bVYo" + ], + "license": "MIT" + } + }, + "version": 1 + }, + "ast": { + "absolutePath": "src/GetiZiPoolDataBatchRequest.sol", + "id": 29582, + "exportedSymbols": { + "GetiZiPoolDataBatchRequest": [ + 29581 + ], + "IiZiSwapPool": [ + 29256 + ] + }, + "nodeType": "SourceUnit", + "src": "31:4937:20", + "nodes": [ + { + "id": 29196, + "nodeType": "PragmaDirective", + "src": "31:23:20", + "nodes": [], + "literals": [ + "solidity", + "^", + "0.8", + ".0" + ] + }, + { + "id": 29256, + "nodeType": "ContractDefinition", + "src": "56:928:20", + "nodes": [ + { + "id": 29211, + "nodeType": "FunctionDefinition", + "src": "85:262:20", + "nodes": [], + "functionSelector": "b0f59257", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "liquidity", + "nameLocation": "94:9:20", + "parameters": { + "id": 29199, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29198, + "mutability": "mutable", + "name": "key", + "nameLocation": "112:3:20", + "nodeType": "VariableDeclaration", + "scope": 29211, + "src": "104:11:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 29197, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "104:7:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "103:13:20" + }, + "returnParameters": { + "id": 29210, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29201, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "185:9:20", + "nodeType": "VariableDeclaration", + "scope": 29211, + "src": "177:17:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29200, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "177:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29203, + "mutability": "mutable", + "name": "lastFeeScaleX_128", + "nameLocation": "216:17:20", + "nodeType": "VariableDeclaration", + "scope": 29211, + "src": "208:25:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29202, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "208:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29205, + "mutability": "mutable", + "name": "lastFeeScaleY_128", + "nameLocation": "255:17:20", + "nodeType": "VariableDeclaration", + "scope": 29211, + "src": "247:25:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29204, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "247:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29207, + "mutability": "mutable", + "name": "tokenOwedX", + "nameLocation": "294:10:20", + "nodeType": "VariableDeclaration", + "scope": 29211, + "src": "286:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29206, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "286:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29209, + "mutability": "mutable", + "name": "tokenOwedY", + "nameLocation": "326:10:20", + "nodeType": "VariableDeclaration", + "scope": 29211, + "src": "318:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29208, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "318:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "163:183:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 29216, + "nodeType": "FunctionDefinition", + "src": "357:50:20", + "nodes": [], + "functionSelector": "16dc165b", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokenX", + "nameLocation": "366:6:20", + "parameters": { + "id": 29212, + "nodeType": "ParameterList", + "parameters": [], + "src": "372:2:20" + }, + "returnParameters": { + "id": 29215, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29214, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 29216, + "src": "398:7:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 29213, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "398:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "397:9:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 29221, + "nodeType": "FunctionDefinition", + "src": "412:50:20", + "nodes": [], + "functionSelector": "b7d19fc4", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokenY", + "nameLocation": "421:6:20", + "parameters": { + "id": 29217, + "nodeType": "ParameterList", + "parameters": [], + "src": "427:2:20" + }, + "returnParameters": { + "id": 29220, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29219, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 29221, + "src": "453:7:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 29218, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "453:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "452:9:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 29226, + "nodeType": "FunctionDefinition", + "src": "468:54:20", + "nodes": [], + "functionSelector": "09beabc1", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "sqrtRate_96", + "nameLocation": "477:11:20", + "parameters": { + "id": 29222, + "nodeType": "ParameterList", + "parameters": [], + "src": "488:2:20" + }, + "returnParameters": { + "id": 29225, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29224, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 29226, + "src": "513:7:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 29223, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "513:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + } + ], + "src": "512:9:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 29231, + "nodeType": "FunctionDefinition", + "src": "527:46:20", + "nodes": [], + "functionSelector": "ddca3f43", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "fee", + "nameLocation": "536:3:20", + "parameters": { + "id": 29227, + "nodeType": "ParameterList", + "parameters": [], + "src": "539:2:20" + }, + "returnParameters": { + "id": 29230, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29229, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 29231, + "src": "565:6:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + }, + "typeName": { + "id": 29228, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "565:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "visibility": "internal" + } + ], + "src": "564:8:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 29236, + "nodeType": "FunctionDefinition", + "src": "578:52:20", + "nodes": [], + "functionSelector": "58c51ce6", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "pointDelta", + "nameLocation": "587:10:20", + "parameters": { + "id": 29232, + "nodeType": "ParameterList", + "parameters": [], + "src": "597:2:20" + }, + "returnParameters": { + "id": 29235, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29234, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 29236, + "src": "623:5:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 29233, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "623:5:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + } + ], + "src": "622:7:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 29255, + "nodeType": "FunctionDefinition", + "src": "635:347:20", + "nodes": [], + "functionSelector": "c19d93fb", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "state", + "nameLocation": "644:5:20", + "parameters": { + "id": 29237, + "nodeType": "ParameterList", + "parameters": [], + "src": "649:2:20" + }, + "returnParameters": { + "id": 29254, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29239, + "mutability": "mutable", + "name": "sqrtPrice_96", + "nameLocation": "711:12:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "703:20:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 29238, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "703:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29241, + "mutability": "mutable", + "name": "currentPoint", + "nameLocation": "743:12:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "737:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 29240, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "737:5:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29243, + "mutability": "mutable", + "name": "observationCurrentIndex", + "nameLocation": "776:23:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "769:30:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 29242, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "769:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29245, + "mutability": "mutable", + "name": "observationQueueLen", + "nameLocation": "820:19:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "813:26:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 29244, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "813:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29247, + "mutability": "mutable", + "name": "observationNextQueueLen", + "nameLocation": "860:23:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "853:30:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 29246, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "853:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29249, + "mutability": "mutable", + "name": "locked", + "nameLocation": "902:6:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "897:11:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 29248, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "897:4:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29251, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "930:9:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "922:17:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29250, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "922:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29253, + "mutability": "mutable", + "name": "liquidityX", + "nameLocation": "961:10:20", + "nodeType": "VariableDeclaration", + "scope": 29255, + "src": "953:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29252, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "953:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + } + ], + "src": "689:292:20" + }, + "scope": 29256, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "IiZiSwapPool", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "linearizedBaseContracts": [ + 29256 + ], + "name": "IiZiSwapPool", + "nameLocation": "66:12:20", + "scope": 29582, + "usedErrors": [] + }, + { + "id": 29581, + "nodeType": "ContractDefinition", + "src": "1116:3852:20", + "nodes": [ + { + "id": 29280, + "nodeType": "StructDefinition", + "src": "1158:315:20", + "nodes": [], + "canonicalName": "GetiZiPoolDataBatchRequest.PoolData", + "members": [ + { + "constant": false, + "id": 29259, + "mutability": "mutable", + "name": "tokenA", + "nameLocation": "1192:6:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1184:14:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 29258, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1184:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29261, + "mutability": "mutable", + "name": "tokenADecimals", + "nameLocation": "1214:14:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1208:20:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 29260, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1208:5:20", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29263, + "mutability": "mutable", + "name": "tokenB", + "nameLocation": "1246:6:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1238:14:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 29262, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1238:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29265, + "mutability": "mutable", + "name": "tokenBDecimals", + "nameLocation": "1268:14:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1262:20:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 29264, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1262:5:20", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29267, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "1300:9:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1292:17:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29266, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1292:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29269, + "mutability": "mutable", + "name": "sqrtPrice", + "nameLocation": "1327:9:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1319:17:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 29268, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "1319:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29271, + "mutability": "mutable", + "name": "liquidityA", + "nameLocation": "1354:10:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1346:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29270, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1346:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29273, + "mutability": "mutable", + "name": "liquidityB", + "nameLocation": "1382:10:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1374:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29272, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1374:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29275, + "mutability": "mutable", + "name": "currentPoint", + "nameLocation": "1408:12:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1402:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 29274, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "1402:5:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29277, + "mutability": "mutable", + "name": "pointDelta", + "nameLocation": "1436:10:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1430:16:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 29276, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "1430:5:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29279, + "mutability": "mutable", + "name": "fee", + "nameLocation": "1463:3:20", + "nodeType": "VariableDeclaration", + "scope": 29280, + "src": "1456:10:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + }, + "typeName": { + "id": 29278, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "1456:6:20", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "visibility": "internal" + } + ], + "name": "PoolData", + "nameLocation": "1165:8:20", + "scope": 29581, + "visibility": "public" + }, + { + "id": 29560, + "nodeType": "FunctionDefinition", + "src": "1479:3288:20", + "nodes": [], + "body": { + "id": 29559, + "nodeType": "Block", + "src": "1515:3252:20", + "nodes": [], + "statements": [ + { + "assignments": [ + 29290 + ], + "declarations": [ + { + "constant": false, + "id": 29290, + "mutability": "mutable", + "name": "allPoolData", + "nameLocation": "1543:11:20", + "nodeType": "VariableDeclaration", + "scope": 29559, + "src": "1525:29:20", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_memory_ptr_$dyn_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData[]" + }, + "typeName": { + "baseType": { + "id": 29288, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 29287, + "name": "PoolData", + "nameLocations": [ + "1525:8:20" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 29280, + "src": "1525:8:20" + }, + "referencedDeclaration": 29280, + "src": "1525:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_storage_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData" + } + }, + "id": 29289, + "nodeType": "ArrayTypeName", + "src": "1525:10:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_storage_$dyn_storage_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData[]" + } + }, + "visibility": "internal" + } + ], + "id": 29298, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 29295, + "name": "pools", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29283, + "src": "1572:5:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 29296, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1578:6:20", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1572:12:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 29294, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1557:14:20", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_struct$_PoolData_$29280_memory_ptr_$dyn_memory_ptr_$", + "typeString": "function (uint256) pure returns (struct GetiZiPoolDataBatchRequest.PoolData memory[] memory)" + }, + "typeName": { + "baseType": { + "id": 29292, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 29291, + "name": "PoolData", + "nameLocations": [ + "1561:8:20" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 29280, + "src": "1561:8:20" + }, + "referencedDeclaration": 29280, + "src": "1561:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_storage_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData" + } + }, + "id": 29293, + "nodeType": "ArrayTypeName", + "src": "1561:10:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_storage_$dyn_storage_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData[]" + } + } + }, + "id": 29297, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1557:28:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_memory_ptr_$dyn_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1525:60:20" + }, + { + "body": { + "id": 29549, + "nodeType": "Block", + "src": "1639:2781:20", + "statements": [ + { + "assignments": [ + 29311 + ], + "declarations": [ + { + "constant": false, + "id": 29311, + "mutability": "mutable", + "name": "poolAddress", + "nameLocation": "1661:11:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "1653:19:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 29310, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1653:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 29315, + "initialValue": { + "baseExpression": { + "id": 29312, + "name": "pools", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29283, + "src": "1675:5:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 29314, + "indexExpression": { + "id": 29313, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29300, + "src": "1681:1:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1675:8:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1653:30:20" + }, + { + "condition": { + "arguments": [ + { + "id": 29317, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29311, + "src": "1717:11:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29316, + "name": "codeSizeIsZero", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29580, + "src": "1702:14:20", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", + "typeString": "function (address) view returns (bool)" + } + }, + "id": 29318, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1702:27:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 29320, + "nodeType": "IfStatement", + "src": "1698:41:20", + "trueBody": { + "id": 29319, + "nodeType": "Continue", + "src": "1731:8:20" + } + }, + { + "assignments": [ + 29323 + ], + "declarations": [ + { + "constant": false, + "id": 29323, + "mutability": "mutable", + "name": "poolData", + "nameLocation": "1770:8:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "1754:24:20", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData" + }, + "typeName": { + "id": 29322, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 29321, + "name": "PoolData", + "nameLocations": [ + "1754:8:20" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 29280, + "src": "1754:8:20" + }, + "referencedDeclaration": 29280, + "src": "1754:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_storage_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData" + } + }, + "visibility": "internal" + } + ], + "id": 29324, + "nodeType": "VariableDeclarationStatement", + "src": "1754:24:20" + }, + { + "expression": { + "id": 29333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29325, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "1793:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29327, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "1802:6:20", + "memberName": "tokenA", + "nodeType": "MemberAccess", + "referencedDeclaration": 29259, + "src": "1793:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [ + { + "id": 29329, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29311, + "src": "1824:11:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29328, + "name": "IiZiSwapPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29256, + "src": "1811:12:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IiZiSwapPool_$29256_$", + "typeString": "type(contract IiZiSwapPool)" + } + }, + "id": 29330, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1811:25:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IiZiSwapPool_$29256", + "typeString": "contract IiZiSwapPool" + } + }, + "id": 29331, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1837:6:20", + "memberName": "tokenX", + "nodeType": "MemberAccess", + "referencedDeclaration": 29216, + "src": "1811:32:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_address_$", + "typeString": "function () view external returns (address)" + } + }, + "id": 29332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1811:34:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1793:52:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 29334, + "nodeType": "ExpressionStatement", + "src": "1793:52:20" + }, + { + "expression": { + "id": 29343, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29335, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "1859:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29337, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "1868:6:20", + "memberName": "tokenB", + "nodeType": "MemberAccess", + "referencedDeclaration": 29263, + "src": "1859:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [ + { + "id": 29339, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29311, + "src": "1890:11:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29338, + "name": "IiZiSwapPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29256, + "src": "1877:12:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IiZiSwapPool_$29256_$", + "typeString": "type(contract IiZiSwapPool)" + } + }, + "id": 29340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1877:25:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IiZiSwapPool_$29256", + "typeString": "contract IiZiSwapPool" + } + }, + "id": 29341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1903:6:20", + "memberName": "tokenY", + "nodeType": "MemberAccess", + "referencedDeclaration": 29221, + "src": "1877:32:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_address_$", + "typeString": "function () view external returns (address)" + } + }, + "id": 29342, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1877:34:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "1859:52:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 29344, + "nodeType": "ExpressionStatement", + "src": "1859:52:20" + }, + { + "condition": { + "arguments": [ + { + "expression": { + "id": 29346, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "2014:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29347, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2023:6:20", + "memberName": "tokenA", + "nodeType": "MemberAccess", + "referencedDeclaration": 29259, + "src": "2014:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29345, + "name": "codeSizeIsZero", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29580, + "src": "1999:14:20", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", + "typeString": "function (address) view returns (bool)" + } + }, + "id": 29348, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1999:31:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 29350, + "nodeType": "IfStatement", + "src": "1995:45:20", + "trueBody": { + "id": 29349, + "nodeType": "Continue", + "src": "2032:8:20" + } + }, + { + "condition": { + "arguments": [ + { + "expression": { + "id": 29352, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "2073:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29353, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2082:6:20", + "memberName": "tokenB", + "nodeType": "MemberAccess", + "referencedDeclaration": 29263, + "src": "2073:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29351, + "name": "codeSizeIsZero", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29580, + "src": "2058:14:20", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", + "typeString": "function (address) view returns (bool)" + } + }, + "id": 29354, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2058:31:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 29356, + "nodeType": "IfStatement", + "src": "2054:45:20", + "trueBody": { + "id": 29355, + "nodeType": "Continue", + "src": "2091:8:20" + } + }, + { + "assignments": [ + 29358, + 29360 + ], + "declarations": [ + { + "constant": false, + "id": 29358, + "mutability": "mutable", + "name": "tokenADecimalsSuccess", + "nameLocation": "2171:21:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "2166:26:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 29357, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2166:4:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29360, + "mutability": "mutable", + "name": "tokenADecimalsData", + "nameLocation": "2223:18:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "2210:31:20", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 29359, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2210:5:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 29369, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "646563696d616c732829", + "id": 29366, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2303:12:20", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_313ce567add4d438edf58b94ff345d7d38c45b17dfc0f947988d7819dca364f9", + "typeString": "literal_string \"decimals()\"" + }, + "value": "decimals()" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_313ce567add4d438edf58b94ff345d7d38c45b17dfc0f947988d7819dca364f9", + "typeString": "literal_string \"decimals()\"" + } + ], + "expression": { + "id": 29364, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "2279:3:20", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 29365, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2283:19:20", + "memberName": "encodeWithSignature", + "nodeType": "MemberAccess", + "src": "2279:23:20", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (string memory) pure returns (bytes memory)" + } + }, + "id": 29367, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2279:37:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "expression": { + "id": 29361, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "2258:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29362, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2267:6:20", + "memberName": "tokenA", + "nodeType": "MemberAccess", + "referencedDeclaration": 29259, + "src": "2258:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 29363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2274:4:20", + "memberName": "call", + "nodeType": "MemberAccess", + "src": "2258:20:20", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory) payable returns (bool,bytes memory)" + } + }, + "id": 29368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2258:59:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2148:169:20" + }, + { + "condition": { + "id": 29370, + "name": "tokenADecimalsSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29358, + "src": "2336:21:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29415, + "nodeType": "Block", + "src": "2931:41:20", + "statements": [ + { + "id": 29414, + "nodeType": "Continue", + "src": "2949:8:20" + } + ] + }, + "id": 29416, + "nodeType": "IfStatement", + "src": "2332:640:20", + "trueBody": { + "id": 29413, + "nodeType": "Block", + "src": "2359:566:20", + "statements": [ + { + "assignments": [ + 29372 + ], + "declarations": [ + { + "constant": false, + "id": 29372, + "mutability": "mutable", + "name": "tokenADecimals", + "nameLocation": "2385:14:20", + "nodeType": "VariableDeclaration", + "scope": 29413, + "src": "2377:22:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29371, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2377:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 29373, + "nodeType": "VariableDeclarationStatement", + "src": "2377:22:20" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29377, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 29374, + "name": "tokenADecimalsData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29360, + "src": "2422:18:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 29375, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2441:6:20", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "2422:25:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3332", + "id": 29376, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2451:2:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "2422:31:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29411, + "nodeType": "Block", + "src": "2862:49:20", + "statements": [ + { + "id": 29410, + "nodeType": "Continue", + "src": "2884:8:20" + } + ] + }, + "id": 29412, + "nodeType": "IfStatement", + "src": "2418:493:20", + "trueBody": { + "id": 29409, + "nodeType": "Block", + "src": "2455:401:20", + "statements": [ + { + "expression": { + "id": 29387, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "components": [ + { + "id": 29378, + "name": "tokenADecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29372, + "src": "2478:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 29379, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "2477:16:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 29382, + "name": "tokenADecimalsData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29360, + "src": "2532:18:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "components": [ + { + "id": 29384, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2577:7:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 29383, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2577:7:20", + "typeDescriptions": {} + } + } + ], + "id": 29385, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "2576:9:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "expression": { + "id": 29380, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "2496:3:20", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 29381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2500:6:20", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "2496:10:20", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 29386, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2496:111:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2477:130:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 29388, + "nodeType": "ExpressionStatement", + "src": "2477:130:20" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 29395, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29391, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 29389, + "name": "tokenADecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29372, + "src": "2634:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 29390, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2652:1:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2634:19:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29394, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 29392, + "name": "tokenADecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29372, + "src": "2657:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "323535", + "id": 29393, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2674:3:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "2657:20:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "2634:43:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29407, + "nodeType": "Block", + "src": "2742:96:20", + "statements": [ + { + "expression": { + "id": 29405, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29398, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "2768:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29400, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2777:14:20", + "memberName": "tokenADecimals", + "nodeType": "MemberAccess", + "referencedDeclaration": 29261, + "src": "2768:23:20", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 29403, + "name": "tokenADecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29372, + "src": "2800:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 29402, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "2794:5:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 29401, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "2794:5:20", + "typeDescriptions": {} + } + }, + "id": 29404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2794:21:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "2768:47:20", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 29406, + "nodeType": "ExpressionStatement", + "src": "2768:47:20" + } + ] + }, + "id": 29408, + "nodeType": "IfStatement", + "src": "2630:208:20", + "trueBody": { + "id": 29397, + "nodeType": "Block", + "src": "2679:57:20", + "statements": [ + { + "id": 29396, + "nodeType": "Continue", + "src": "2705:8:20" + } + ] + } + } + ] + } + } + ] + } + }, + { + "assignments": [ + 29418, + 29420 + ], + "declarations": [ + { + "constant": false, + "id": 29418, + "mutability": "mutable", + "name": "tokenBDecimalsSuccess", + "nameLocation": "3009:21:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "3004:26:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 29417, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "3004:4:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29420, + "mutability": "mutable", + "name": "tokenBDecimalsData", + "nameLocation": "3061:18:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "3048:31:20", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 29419, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "3048:5:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 29429, + "initialValue": { + "arguments": [ + { + "arguments": [ + { + "hexValue": "646563696d616c732829", + "id": 29426, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3141:12:20", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_313ce567add4d438edf58b94ff345d7d38c45b17dfc0f947988d7819dca364f9", + "typeString": "literal_string \"decimals()\"" + }, + "value": "decimals()" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_313ce567add4d438edf58b94ff345d7d38c45b17dfc0f947988d7819dca364f9", + "typeString": "literal_string \"decimals()\"" + } + ], + "expression": { + "id": 29424, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3117:3:20", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 29425, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3121:19:20", + "memberName": "encodeWithSignature", + "nodeType": "MemberAccess", + "src": "3117:23:20", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodewithsignature_pure$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (string memory) pure returns (bytes memory)" + } + }, + "id": 29427, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3117:37:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "expression": { + "expression": { + "id": 29421, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "3096:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29422, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3105:6:20", + "memberName": "tokenB", + "nodeType": "MemberAccess", + "referencedDeclaration": 29263, + "src": "3096:15:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 29423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3112:4:20", + "memberName": "call", + "nodeType": "MemberAccess", + "src": "3096:20:20", + "typeDescriptions": { + "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "function (bytes memory) payable returns (bool,bytes memory)" + } + }, + "id": 29428, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3096:59:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", + "typeString": "tuple(bool,bytes memory)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2986:169:20" + }, + { + "condition": { + "id": 29430, + "name": "tokenBDecimalsSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29418, + "src": "3174:21:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29475, + "nodeType": "Block", + "src": "3768:41:20", + "statements": [ + { + "id": 29474, + "nodeType": "Continue", + "src": "3786:8:20" + } + ] + }, + "id": 29476, + "nodeType": "IfStatement", + "src": "3170:639:20", + "trueBody": { + "id": 29473, + "nodeType": "Block", + "src": "3197:565:20", + "statements": [ + { + "assignments": [ + 29432 + ], + "declarations": [ + { + "constant": false, + "id": 29432, + "mutability": "mutable", + "name": "tokenBDecimals", + "nameLocation": "3223:14:20", + "nodeType": "VariableDeclaration", + "scope": 29473, + "src": "3215:22:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29431, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3215:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 29433, + "nodeType": "VariableDeclarationStatement", + "src": "3215:22:20" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 29434, + "name": "tokenBDecimalsData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29420, + "src": "3259:18:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 29435, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3278:6:20", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "3259:25:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3332", + "id": 29436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3288:2:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_32_by_1", + "typeString": "int_const 32" + }, + "value": "32" + }, + "src": "3259:31:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29471, + "nodeType": "Block", + "src": "3699:49:20", + "statements": [ + { + "id": 29470, + "nodeType": "Continue", + "src": "3721:8:20" + } + ] + }, + "id": 29472, + "nodeType": "IfStatement", + "src": "3255:493:20", + "trueBody": { + "id": 29469, + "nodeType": "Block", + "src": "3292:401:20", + "statements": [ + { + "expression": { + "id": 29447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "components": [ + { + "id": 29438, + "name": "tokenBDecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29432, + "src": "3315:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 29439, + "isConstant": false, + "isInlineArray": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "TupleExpression", + "src": "3314:16:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 29442, + "name": "tokenBDecimalsData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29420, + "src": "3369:18:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + { + "components": [ + { + "id": 29444, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3414:7:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": { + "id": 29443, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3414:7:20", + "typeDescriptions": {} + } + } + ], + "id": 29445, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "3413:9:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + }, + { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + } + ], + "expression": { + "id": 29440, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "3333:3:20", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 29441, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "3337:6:20", + "memberName": "decode", + "nodeType": "MemberAccess", + "src": "3333:10:20", + "typeDescriptions": { + "typeIdentifier": "t_function_abidecode_pure$__$returns$__$", + "typeString": "function () pure" + } + }, + "id": 29446, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3333:111:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3314:130:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 29448, + "nodeType": "ExpressionStatement", + "src": "3314:130:20" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 29455, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29451, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 29449, + "name": "tokenBDecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29432, + "src": "3471:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 29450, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3489:1:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "3471:19:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "||", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29454, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 29452, + "name": "tokenBDecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29432, + "src": "3494:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "323535", + "id": 29453, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3511:3:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_255_by_1", + "typeString": "int_const 255" + }, + "value": "255" + }, + "src": "3494:20:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "3471:43:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29467, + "nodeType": "Block", + "src": "3579:96:20", + "statements": [ + { + "expression": { + "id": 29465, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29458, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "3605:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29460, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "3614:14:20", + "memberName": "tokenBDecimals", + "nodeType": "MemberAccess", + "referencedDeclaration": 29265, + "src": "3605:23:20", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 29463, + "name": "tokenBDecimals", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29432, + "src": "3637:14:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 29462, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3631:5:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint8_$", + "typeString": "type(uint8)" + }, + "typeName": { + "id": 29461, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "3631:5:20", + "typeDescriptions": {} + } + }, + "id": 29464, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3631:21:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "3605:47:20", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 29466, + "nodeType": "ExpressionStatement", + "src": "3605:47:20" + } + ] + }, + "id": 29468, + "nodeType": "IfStatement", + "src": "3467:208:20", + "trueBody": { + "id": 29457, + "nodeType": "Block", + "src": "3516:57:20", + "statements": [ + { + "id": 29456, + "nodeType": "Continue", + "src": "3542:8:20" + } + ] + } + } + ] + } + } + ] + } + }, + { + "assignments": [ + 29478, + 29480, + null, + null, + null, + null, + 29482, + 29484 + ], + "declarations": [ + { + "constant": false, + "id": 29478, + "mutability": "mutable", + "name": "sqrtPriceX96", + "nameLocation": "3832:12:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "3824:20:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 29477, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "3824:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29480, + "mutability": "mutable", + "name": "currentPoint", + "nameLocation": "3852:12:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "3846:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 29479, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "3846:5:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + }, + null, + null, + null, + null, + { + "constant": false, + "id": 29482, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "3882:9:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "3874:17:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29481, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "3874:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 29484, + "mutability": "mutable", + "name": "liquidityX", + "nameLocation": "3901:10:20", + "nodeType": "VariableDeclaration", + "scope": 29549, + "src": "3893:18:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 29483, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "3893:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + } + ], + "id": 29490, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [ + { + "id": 29486, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29311, + "src": "3945:11:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29485, + "name": "IiZiSwapPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29256, + "src": "3915:12:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IiZiSwapPool_$29256_$", + "typeString": "type(contract IiZiSwapPool)" + } + }, + "id": 29487, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3915:55:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IiZiSwapPool_$29256", + "typeString": "contract IiZiSwapPool" + } + }, + "id": 29488, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "3971:5:20", + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 29255, + "src": "3915:61:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint160_$_t_int24_$_t_uint16_$_t_uint16_$_t_uint16_$_t_bool_$_t_uint128_$_t_uint128_$", + "typeString": "function () view external returns (uint160,int24,uint16,uint16,uint16,bool,uint128,uint128)" + } + }, + "id": 29489, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "3915:63:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint160_$_t_int24_$_t_uint16_$_t_uint16_$_t_uint16_$_t_bool_$_t_uint128_$_t_uint128_$", + "typeString": "tuple(uint160,int24,uint16,uint16,uint16,bool,uint128,uint128)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3823:155:20" + }, + { + "expression": { + "id": 29499, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29491, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4005:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29493, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4014:3:20", + "memberName": "fee", + "nodeType": "MemberAccess", + "referencedDeclaration": 29279, + "src": "4005:12:20", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [ + { + "id": 29495, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29311, + "src": "4033:11:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29494, + "name": "IiZiSwapPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29256, + "src": "4020:12:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IiZiSwapPool_$29256_$", + "typeString": "type(contract IiZiSwapPool)" + } + }, + "id": 29496, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4020:25:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IiZiSwapPool_$29256", + "typeString": "contract IiZiSwapPool" + } + }, + "id": 29497, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4046:3:20", + "memberName": "fee", + "nodeType": "MemberAccess", + "referencedDeclaration": 29231, + "src": "4020:29:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint24_$", + "typeString": "function () view external returns (uint24)" + } + }, + "id": 29498, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4020:31:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "src": "4005:46:20", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "id": 29500, + "nodeType": "ExpressionStatement", + "src": "4005:46:20" + }, + { + "expression": { + "id": 29509, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29501, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4065:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29503, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4074:10:20", + "memberName": "pointDelta", + "nodeType": "MemberAccess", + "referencedDeclaration": 29277, + "src": "4065:19:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [ + { + "id": 29505, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29311, + "src": "4100:11:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 29504, + "name": "IiZiSwapPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29256, + "src": "4087:12:20", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IiZiSwapPool_$29256_$", + "typeString": "type(contract IiZiSwapPool)" + } + }, + "id": 29506, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4087:25:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IiZiSwapPool_$29256", + "typeString": "contract IiZiSwapPool" + } + }, + "id": 29507, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4113:10:20", + "memberName": "pointDelta", + "nodeType": "MemberAccess", + "referencedDeclaration": 29236, + "src": "4087:36:20", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_int24_$", + "typeString": "function () view external returns (int24)" + } + }, + "id": 29508, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4087:38:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "src": "4065:60:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "id": 29510, + "nodeType": "ExpressionStatement", + "src": "4065:60:20" + }, + { + "expression": { + "id": 29515, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29511, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4139:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29513, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4148:9:20", + "memberName": "sqrtPrice", + "nodeType": "MemberAccess", + "referencedDeclaration": 29269, + "src": "4139:18:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 29514, + "name": "sqrtPriceX96", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29478, + "src": "4160:12:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "src": "4139:33:20", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "id": 29516, + "nodeType": "ExpressionStatement", + "src": "4139:33:20" + }, + { + "expression": { + "id": 29521, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29517, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4186:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29519, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4195:12:20", + "memberName": "currentPoint", + "nodeType": "MemberAccess", + "referencedDeclaration": 29275, + "src": "4186:21:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 29520, + "name": "currentPoint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29480, + "src": "4210:12:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "src": "4186:36:20", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "id": 29522, + "nodeType": "ExpressionStatement", + "src": "4186:36:20" + }, + { + "expression": { + "id": 29527, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29523, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4236:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29525, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4245:9:20", + "memberName": "liquidity", + "nodeType": "MemberAccess", + "referencedDeclaration": 29267, + "src": "4236:18:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 29526, + "name": "liquidity", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29482, + "src": "4257:9:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "4236:30:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "id": 29528, + "nodeType": "ExpressionStatement", + "src": "4236:30:20" + }, + { + "expression": { + "id": 29533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29529, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4280:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29531, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4289:10:20", + "memberName": "liquidityA", + "nodeType": "MemberAccess", + "referencedDeclaration": 29271, + "src": "4280:19:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 29532, + "name": "liquidityX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29484, + "src": "4302:10:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "4280:32:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "id": 29534, + "nodeType": "ExpressionStatement", + "src": "4280:32:20" + }, + { + "expression": { + "id": 29541, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 29535, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4326:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29537, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "4335:10:20", + "memberName": "liquidityB", + "nodeType": "MemberAccess", + "referencedDeclaration": 29273, + "src": "4326:19:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "id": 29540, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 29538, + "name": "liquidity", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29482, + "src": "4348:9:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 29539, + "name": "liquidityX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29484, + "src": "4360:10:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "4348:22:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "4326:44:20", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "id": 29542, + "nodeType": "ExpressionStatement", + "src": "4326:44:20" + }, + { + "expression": { + "id": 29547, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 29543, + "name": "allPoolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29290, + "src": "4384:11:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_memory_ptr_$dyn_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory[] memory" + } + }, + "id": 29545, + "indexExpression": { + "id": 29544, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29300, + "src": "4396:1:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "4384:14:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 29546, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29323, + "src": "4401:8:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "src": "4384:25:20", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$29280_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 29548, + "nodeType": "ExpressionStatement", + "src": "4384:25:20" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 29303, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29300, + "src": "1616:1:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 29304, + "name": "pools", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29283, + "src": "1620:5:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 29305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1626:6:20", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1620:12:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1616:16:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 29550, + "initializationExpression": { + "assignments": [ + 29300 + ], + "declarations": [ + { + "constant": false, + "id": 29300, + "mutability": "mutable", + "name": "i", + "nameLocation": "1609:1:20", + "nodeType": "VariableDeclaration", + "scope": 29550, + "src": "1601:9:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 29299, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1601:7:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 29302, + "initialValue": { + "hexValue": "30", + "id": 29301, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1613:1:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1601:13:20" + }, + "loopExpression": { + "expression": { + "id": 29308, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "1634:3:20", + "subExpression": { + "id": 29307, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29300, + "src": "1636:1:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 29309, + "nodeType": "ExpressionStatement", + "src": "1634:3:20" + }, + "nodeType": "ForStatement", + "src": "1596:2824:20" + }, + { + "assignments": [ + 29552 + ], + "declarations": [ + { + "constant": false, + "id": 29552, + "mutability": "mutable", + "name": "_abiEncodedData", + "nameLocation": "4443:15:20", + "nodeType": "VariableDeclaration", + "scope": 29559, + "src": "4430:28:20", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 29551, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4430:5:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 29557, + "initialValue": { + "arguments": [ + { + "id": 29555, + "name": "allPoolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29290, + "src": "4472:11:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_memory_ptr_$dyn_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory[] memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_struct$_PoolData_$29280_memory_ptr_$dyn_memory_ptr", + "typeString": "struct GetiZiPoolDataBatchRequest.PoolData memory[] memory" + } + ], + "expression": { + "id": 29553, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "4461:3:20", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 29554, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "4465:6:20", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "4461:10:20", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 29556, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "4461:23:20", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "4430:54:20" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "4503:258:20", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "4653:43:20", + "value": { + "arguments": [ + { + "name": "_abiEncodedData", + "nodeType": "YulIdentifier", + "src": "4674:15:20" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4691:4:20", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4670:3:20" + }, + "nodeType": "YulFunctionCall", + "src": "4670:26:20" + }, + "variables": [ + { + "name": "dataStart", + "nodeType": "YulTypedName", + "src": "4657:9:20", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "dataStart", + "nodeType": "YulIdentifier", + "src": "4716:9:20" + }, + { + "arguments": [ + { + "arguments": [], + "functionName": { + "name": "msize", + "nodeType": "YulIdentifier", + "src": "4731:5:20" + }, + "nodeType": "YulFunctionCall", + "src": "4731:7:20" + }, + { + "name": "dataStart", + "nodeType": "YulIdentifier", + "src": "4740:9:20" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "4727:3:20" + }, + "nodeType": "YulFunctionCall", + "src": "4727:23:20" + } + ], + "functionName": { + "name": "return", + "nodeType": "YulIdentifier", + "src": "4709:6:20" + }, + "nodeType": "YulFunctionCall", + "src": "4709:42:20" + }, + "nodeType": "YulExpressionStatement", + "src": "4709:42:20" + } + ] + }, + "evmVersion": "london", + "externalReferences": [ + { + "declaration": 29552, + "isOffset": false, + "isSlot": false, + "src": "4674:15:20", + "valueSize": 1 + } + ], + "id": 29558, + "nodeType": "InlineAssembly", + "src": "4494:267:20" + } + ] + }, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "parameters": { + "id": 29284, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29283, + "mutability": "mutable", + "name": "pools", + "nameLocation": "1508:5:20", + "nodeType": "VariableDeclaration", + "scope": 29560, + "src": "1491:22:20", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 29281, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1491:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 29282, + "nodeType": "ArrayTypeName", + "src": "1491:9:20", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + } + ], + "src": "1490:24:20" + }, + "returnParameters": { + "id": 29285, + "nodeType": "ParameterList", + "parameters": [], + "src": "1515:0:20" + }, + "scope": 29581, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "id": 29580, + "nodeType": "FunctionDefinition", + "src": "4773:193:20", + "nodes": [], + "body": { + "id": 29579, + "nodeType": "Block", + "src": "4842:124:20", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 29571, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "expression": { + "id": 29567, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29562, + "src": "4856:6:20", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 29568, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4863:4:20", + "memberName": "code", + "nodeType": "MemberAccess", + "src": "4856:11:20", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 29569, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "4868:6:20", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "4856:18:20", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 29570, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4878:1:20", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4856:23:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 29577, + "nodeType": "Block", + "src": "4923:37:20", + "statements": [ + { + "expression": { + "hexValue": "66616c7365", + "id": 29575, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4944:5:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 29566, + "id": 29576, + "nodeType": "Return", + "src": "4937:12:20" + } + ] + }, + "id": 29578, + "nodeType": "IfStatement", + "src": "4852:108:20", + "trueBody": { + "id": 29574, + "nodeType": "Block", + "src": "4881:36:20", + "statements": [ + { + "expression": { + "hexValue": "74727565", + "id": 29572, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4902:4:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 29566, + "id": 29573, + "nodeType": "Return", + "src": "4895:11:20" + } + ] + } + } + ] + }, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "codeSizeIsZero", + "nameLocation": "4782:14:20", + "parameters": { + "id": 29563, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29562, + "mutability": "mutable", + "name": "target", + "nameLocation": "4805:6:20", + "nodeType": "VariableDeclaration", + "scope": 29580, + "src": "4797:14:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 29561, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4797:7:20", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "4796:16:20" + }, + "returnParameters": { + "id": 29566, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29565, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 29580, + "src": "4836:4:20", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 29564, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "4836:4:20", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "4835:6:20" + }, + "scope": 29581, + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "GetiZiPoolDataBatchRequest", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 29257, + "nodeType": "StructuredDocumentation", + "src": "985:130:20", + "text": "@dev This contract is not meant to be deployed. Instead, use a static call with the\ndeployment bytecode as payload." + }, + "fullyImplemented": true, + "linearizedBaseContracts": [ + 29581 + ], + "name": "GetiZiPoolDataBatchRequest", + "nameLocation": "1125:26:20", + "scope": 29582, + "usedErrors": [] + } + ], + "license": "MIT" + }, + "id": 20 +} \ No newline at end of file diff --git a/src/amm/izumi/batch_request/SynciZiPoolDataBatchRequest.json b/src/amm/izumi/batch_request/SynciZiPoolDataBatchRequest.json new file mode 100644 index 00000000..508588d4 --- /dev/null +++ b/src/amm/izumi/batch_request/SynciZiPoolDataBatchRequest.json @@ -0,0 +1,2627 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address[]", + "name": "pools", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "bytecode": { + "object": "0x608060405234801561001057600080fd5b5060405161099a38038061099a83398181016040528101906100329190610521565b6000815167ffffffffffffffff81111561004f5761004e610380565b5b60405190808252806020026020018201604052801561008857816020015b6100756102d8565b81526020019060019003908161006d5790505b50905060005b82518110156102765760008382815181106100ac576100ab61056a565b5b602002602001015190506100c5816102a560201b60201c565b156100d05750610265565b6100d86102d8565b6000806000808573ffffffffffffffffffffffffffffffffffffffff1663c19d93fb6040518163ffffffff1660e01b815260040161010060405180830381865afa15801561012a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014e91906106b8565b97509750505050509350935083856020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082856080019060020b908160020b815250508185600001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff16815250508085604001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff16815250508082610210919061079d565b85606001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff1681525050848888815181106102535761025261056a565b5b60200260200101819052505050505050505b8061026f906107eb565b905061008e565b5060008160405160200161028a9190610977565b60405160208183030381529060405290506020810180590381f35b6000808273ffffffffffffffffffffffffffffffffffffffff163b036102ce57600190506102d3565b600090505b919050565b6040518060a0016040528060006fffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff168152602001600060020b81525090565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6103b88261036f565b810181811067ffffffffffffffff821117156103d7576103d6610380565b5b80604052505050565b60006103ea610356565b90506103f682826103af565b919050565b600067ffffffffffffffff82111561041657610415610380565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104578261042c565b9050919050565b6104678161044c565b811461047257600080fd5b50565b6000815190506104848161045e565b92915050565b600061049d610498846103fb565b6103e0565b905080838252602082019050602084028301858111156104c0576104bf610427565b5b835b818110156104e957806104d58882610475565b8452602084019350506020810190506104c2565b5050509392505050565b600082601f8301126105085761050761036a565b5b815161051884826020860161048a565b91505092915050565b60006020828403121561053757610536610360565b5b600082015167ffffffffffffffff81111561055557610554610365565b5b610561848285016104f3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6105a28161042c565b81146105ad57600080fd5b50565b6000815190506105bf81610599565b92915050565b60008160020b9050919050565b6105db816105c5565b81146105e657600080fd5b50565b6000815190506105f8816105d2565b92915050565b600061ffff82169050919050565b610615816105fe565b811461062057600080fd5b50565b6000815190506106328161060c565b92915050565b60008115159050919050565b61064d81610638565b811461065857600080fd5b50565b60008151905061066a81610644565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b61069581610670565b81146106a057600080fd5b50565b6000815190506106b28161068c565b92915050565b600080600080600080600080610100898b0312156106d9576106d8610360565b5b60006106e78b828c016105b0565b98505060206106f88b828c016105e9565b97505060406107098b828c01610623565b965050606061071a8b828c01610623565b955050608061072b8b828c01610623565b94505060a061073c8b828c0161065b565b93505060c061074d8b828c016106a3565b92505060e061075e8b828c016106a3565b9150509295985092959890939650565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006107a882610670565b91506107b383610670565b925082820390506fffffffffffffffffffffffffffffffff8111156107db576107da61076e565b5b92915050565b6000819050919050565b60006107f6826107e1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108285761082761076e565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61086881610670565b82525050565b6108778161042c565b82525050565b610886816105c5565b82525050565b60a0820160008201516108a2600085018261085f565b5060208201516108b5602085018261086e565b5060408201516108c8604085018261085f565b5060608201516108db606085018261085f565b5060808201516108ee608085018261087d565b50505050565b6000610900838361088c565b60a08301905092915050565b6000602082019050919050565b600061092482610833565b61092e818561083e565b93506109398361084f565b8060005b8381101561096a57815161095188826108f4565b975061095c8361090c565b92505060018101905061093d565b5085935050505092915050565b600060208201905081810360008301526109918184610919565b90509291505056fe", + "sourceMap": "1141:1635:0:-:0;;;1351:1224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1397:29;1444:5;:12;1429:28;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;1397:60;;1473:9;1468:760;1492:5;:12;1488:1;:16;1468:760;;;1525:19;1547:5;1553:1;1547:8;;;;;;;;:::i;:::-;;;;;;;;1525:30;;1574:27;1589:11;1574:14;;;:27;;:::i;:::-;1570:41;;;1603:8;;;1570:41;1626:24;;:::i;:::-;1683:20;1721:18;1829:17;1864:18;1912:11;1899:31;;;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1665:267;;;;;;;;;;;;1968:12;1947:8;:18;;:33;;;;;;;;;;;2018:12;1994:8;:21;;:36;;;;;;;;;;;2065:9;2044:8;:18;;:30;;;;;;;;;;;2110:10;2088:8;:19;;:32;;;;;;;;;;;2168:10;2156:9;:22;;;;:::i;:::-;2134:8;:19;;:44;;;;;;;;;;;2209:8;2192:11;2204:1;2192:14;;;;;;;;:::i;:::-;;;;;;;:25;;;;1511:717;;;;;;1468:760;1506:3;;;;:::i;:::-;;;1468:760;;;;2238:28;2280:11;2269:23;;;;;;;;:::i;:::-;;;;;;;;;;;;;2238:54;;2499:4;2482:15;2478:26;2548:9;2539:7;2535:23;2524:9;2517:42;2581:193;2644:4;2686:1;2664:6;:18;;;:23;2660:108;;2710:4;2703:11;;;;2660:108;2752:5;2745:12;;2581:193;;;;:::o;1141:1635::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7:75:1:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:117;443:1;440;433:12;457:102;498:6;549:2;545:7;540:2;533:5;529:14;525:28;515:38;;457:102;;;:::o;565:180::-;613:77;610:1;603:88;710:4;707:1;700:15;734:4;731:1;724:15;751:281;834:27;856:4;834:27;:::i;:::-;826:6;822:40;964:6;952:10;949:22;928:18;916:10;913:34;910:62;907:88;;;975:18;;:::i;:::-;907:88;1015:10;1011:2;1004:22;794:238;751:281;;:::o;1038:129::-;1072:6;1099:20;;:::i;:::-;1089:30;;1128:33;1156:4;1148:6;1128:33;:::i;:::-;1038:129;;;:::o;1173:311::-;1250:4;1340:18;1332:6;1329:30;1326:56;;;1362:18;;:::i;:::-;1326:56;1412:4;1404:6;1400:17;1392:25;;1472:4;1466;1462:15;1454:23;;1173:311;;;:::o;1490:117::-;1599:1;1596;1589:12;1613:126;1650:7;1690:42;1683:5;1679:54;1668:65;;1613:126;;;:::o;1745:96::-;1782:7;1811:24;1829:5;1811:24;:::i;:::-;1800:35;;1745:96;;;:::o;1847:122::-;1920:24;1938:5;1920:24;:::i;:::-;1913:5;1910:35;1900:63;;1959:1;1956;1949:12;1900:63;1847:122;:::o;1975:143::-;2032:5;2063:6;2057:13;2048:22;;2079:33;2106:5;2079:33;:::i;:::-;1975:143;;;;:::o;2141:732::-;2248:5;2273:81;2289:64;2346:6;2289:64;:::i;:::-;2273:81;:::i;:::-;2264:90;;2374:5;2403:6;2396:5;2389:21;2437:4;2430:5;2426:16;2419:23;;2490:4;2482:6;2478:17;2470:6;2466:30;2519:3;2511:6;2508:15;2505:122;;;2538:79;;:::i;:::-;2505:122;2653:6;2636:231;2670:6;2665:3;2662:15;2636:231;;;2745:3;2774:48;2818:3;2806:10;2774:48;:::i;:::-;2769:3;2762:61;2852:4;2847:3;2843:14;2836:21;;2712:155;2696:4;2691:3;2687:14;2680:21;;2636:231;;;2640:21;2254:619;;2141:732;;;;;:::o;2896:385::-;2978:5;3027:3;3020:4;3012:6;3008:17;3004:27;2994:122;;3035:79;;:::i;:::-;2994:122;3145:6;3139:13;3170:105;3271:3;3263:6;3256:4;3248:6;3244:17;3170:105;:::i;:::-;3161:114;;2984:297;2896:385;;;;:::o;3287:554::-;3382:6;3431:2;3419:9;3410:7;3406:23;3402:32;3399:119;;;3437:79;;:::i;:::-;3399:119;3578:1;3567:9;3563:17;3557:24;3608:18;3600:6;3597:30;3594:117;;;3630:79;;:::i;:::-;3594:117;3735:89;3816:7;3807:6;3796:9;3792:22;3735:89;:::i;:::-;3725:99;;3528:306;3287:554;;;;:::o;3847:180::-;3895:77;3892:1;3885:88;3992:4;3989:1;3982:15;4016:4;4013:1;4006:15;4033:122;4106:24;4124:5;4106:24;:::i;:::-;4099:5;4096:35;4086:63;;4145:1;4142;4135:12;4086:63;4033:122;:::o;4161:143::-;4218:5;4249:6;4243:13;4234:22;;4265:33;4292:5;4265:33;:::i;:::-;4161:143;;;;:::o;4310:90::-;4345:7;4388:5;4385:1;4374:20;4363:31;;4310:90;;;:::o;4406:118::-;4477:22;4493:5;4477:22;:::i;:::-;4470:5;4467:33;4457:61;;4514:1;4511;4504:12;4457:61;4406:118;:::o;4530:139::-;4585:5;4616:6;4610:13;4601:22;;4632:31;4657:5;4632:31;:::i;:::-;4530:139;;;;:::o;4675:89::-;4711:7;4751:6;4744:5;4740:18;4729:29;;4675:89;;;:::o;4770:120::-;4842:23;4859:5;4842:23;:::i;:::-;4835:5;4832:34;4822:62;;4880:1;4877;4870:12;4822:62;4770:120;:::o;4896:141::-;4952:5;4983:6;4977:13;4968:22;;4999:32;5025:5;4999:32;:::i;:::-;4896:141;;;;:::o;5043:90::-;5077:7;5120:5;5113:13;5106:21;5095:32;;5043:90;;;:::o;5139:116::-;5209:21;5224:5;5209:21;:::i;:::-;5202:5;5199:32;5189:60;;5245:1;5242;5235:12;5189:60;5139:116;:::o;5261:137::-;5315:5;5346:6;5340:13;5331:22;;5362:30;5386:5;5362:30;:::i;:::-;5261:137;;;;:::o;5404:118::-;5441:7;5481:34;5474:5;5470:46;5459:57;;5404:118;;;:::o;5528:122::-;5601:24;5619:5;5601:24;:::i;:::-;5594:5;5591:35;5581:63;;5640:1;5637;5630:12;5581:63;5528:122;:::o;5656:143::-;5713:5;5744:6;5738:13;5729:22;;5760:33;5787:5;5760:33;:::i;:::-;5656:143;;;;:::o;5805:1432::-;5930:6;5938;5946;5954;5962;5970;5978;5986;6035:3;6023:9;6014:7;6010:23;6006:33;6003:120;;;6042:79;;:::i;:::-;6003:120;6162:1;6187:64;6243:7;6234:6;6223:9;6219:22;6187:64;:::i;:::-;6177:74;;6133:128;6300:2;6326:62;6380:7;6371:6;6360:9;6356:22;6326:62;:::i;:::-;6316:72;;6271:127;6437:2;6463:63;6518:7;6509:6;6498:9;6494:22;6463:63;:::i;:::-;6453:73;;6408:128;6575:2;6601:63;6656:7;6647:6;6636:9;6632:22;6601:63;:::i;:::-;6591:73;;6546:128;6713:3;6740:63;6795:7;6786:6;6775:9;6771:22;6740:63;:::i;:::-;6730:73;;6684:129;6852:3;6879:61;6932:7;6923:6;6912:9;6908:22;6879:61;:::i;:::-;6869:71;;6823:127;6989:3;7016:64;7072:7;7063:6;7052:9;7048:22;7016:64;:::i;:::-;7006:74;;6960:130;7129:3;7156:64;7212:7;7203:6;7192:9;7188:22;7156:64;:::i;:::-;7146:74;;7100:130;5805:1432;;;;;;;;;;;:::o;7243:180::-;7291:77;7288:1;7281:88;7388:4;7385:1;7378:15;7412:4;7409:1;7402:15;7429:227;7469:4;7489:20;7507:1;7489:20;:::i;:::-;7484:25;;7523:20;7541:1;7523:20;:::i;:::-;7518:25;;7567:1;7564;7560:9;7552:17;;7591:34;7585:4;7582:44;7579:70;;;7629:18;;:::i;:::-;7579:70;7429:227;;;;:::o;7662:77::-;7699:7;7728:5;7717:16;;7662:77;;;:::o;7745:233::-;7784:3;7807:24;7825:5;7807:24;:::i;:::-;7798:33;;7853:66;7846:5;7843:77;7840:103;;7923:18;;:::i;:::-;7840:103;7970:1;7963:5;7959:13;7952:20;;7745:233;;;:::o;7984:138::-;8075:6;8109:5;8103:12;8093:22;;7984:138;;;:::o;8128:208::-;8251:11;8285:6;8280:3;8273:19;8325:4;8320:3;8316:14;8301:29;;8128:208;;;;:::o;8342:156::-;8433:4;8456:3;8448:11;;8486:4;8481:3;8477:14;8469:22;;8342:156;;;:::o;8504:108::-;8581:24;8599:5;8581:24;:::i;:::-;8576:3;8569:37;8504:108;;:::o;8618:::-;8695:24;8713:5;8695:24;:::i;:::-;8690:3;8683:37;8618:108;;:::o;8732:102::-;8805:22;8821:5;8805:22;:::i;:::-;8800:3;8793:35;8732:102;;:::o;8938:1043::-;9073:4;9068:3;9064:14;9165:4;9158:5;9154:16;9148:23;9184:63;9241:4;9236:3;9232:14;9218:12;9184:63;:::i;:::-;9088:169;9344:4;9337:5;9333:16;9327:23;9363:63;9420:4;9415:3;9411:14;9397:12;9363:63;:::i;:::-;9267:169;9524:4;9517:5;9513:16;9507:23;9543:63;9600:4;9595:3;9591:14;9577:12;9543:63;:::i;:::-;9446:170;9704:4;9697:5;9693:16;9687:23;9723:63;9780:4;9775:3;9771:14;9757:12;9723:63;:::i;:::-;9626:170;9886:4;9879:5;9875:16;9869:23;9905:59;9958:4;9953:3;9949:14;9935:12;9905:59;:::i;:::-;9806:168;9042:939;8938:1043;;:::o;9987:275::-;10104:10;10125:94;10215:3;10207:6;10125:94;:::i;:::-;10251:4;10246:3;10242:14;10228:28;;9987:275;;;;:::o;10268:137::-;10362:4;10394;10389:3;10385:14;10377:22;;10268:137;;;:::o;10513:924::-;10680:3;10709:78;10781:5;10709:78;:::i;:::-;10803:110;10906:6;10901:3;10803:110;:::i;:::-;10796:117;;10937:80;11011:5;10937:80;:::i;:::-;11040:7;11071:1;11056:356;11081:6;11078:1;11075:13;11056:356;;;11157:6;11151:13;11184:111;11291:3;11276:13;11184:111;:::i;:::-;11177:118;;11318:84;11395:6;11318:84;:::i;:::-;11308:94;;11116:296;11103:1;11100;11096:9;11091:14;;11056:356;;;11060:14;11428:3;11421:10;;10685:752;;;10513:924;;;;:::o;11443:469::-;11634:4;11672:2;11661:9;11657:18;11649:26;;11721:9;11715:4;11711:20;11707:1;11696:9;11692:17;11685:47;11749:156;11900:4;11891:6;11749:156;:::i;:::-;11741:164;;11443:469;;;;:::o", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x6080604052600080fdfea26469706673582212201385265405bed449009eec8163e8d1dc0b06b28471181cbf3bb19707c174a1f064736f6c63430008100033", + "sourceMap": "1141:1635:0:-:0;;;;;", + "linkReferences": {} + }, + "methodIdentifiers": {}, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.16+commit.07a7930e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"pools\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"details\":\"This contract is not meant to be deployed. Instead, use a static call with the deployment bytecode as payload.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/SynciZiPoolDataBatchRequest.sol\":\"SynciZiPoolDataBatchRequest\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/SynciZiPoolDataBatchRequest.sol\":{\"keccak256\":\"0x2347c91dcabf9b556ee9719bec5b6e402509a57670ec496a49aec4f5615c9958\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://38e00744526eaf20b59ed14ee7c8fb4672f94d4b8dd6d7e60b4e95b4c6c03c00\",\"dweb:/ipfs/QmNg3jAxc9j8mC5Eb9reiLFRuh7PGNGUKqTLxmDwGe27zr\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.16+commit.07a7930e" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [ + { + "internalType": "address[]", + "name": "pools", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } + }, + "settings": { + "remappings": [ + ":ds-test/=lib/forge-std/lib/ds-test/src/", + ":forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": false, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/SynciZiPoolDataBatchRequest.sol": "SynciZiPoolDataBatchRequest" + }, + "libraries": {} + }, + "sources": { + "src/SynciZiPoolDataBatchRequest.sol": { + "keccak256": "0x2347c91dcabf9b556ee9719bec5b6e402509a57670ec496a49aec4f5615c9958", + "urls": [ + "bzz-raw://38e00744526eaf20b59ed14ee7c8fb4672f94d4b8dd6d7e60b4e95b4c6c03c00", + "dweb:/ipfs/QmNg3jAxc9j8mC5Eb9reiLFRuh7PGNGUKqTLxmDwGe27zr" + ], + "license": "MIT" + } + }, + "version": 1 + }, + "ast": { + "absolutePath": "src/SynciZiPoolDataBatchRequest.sol", + "id": 203, + "exportedSymbols": { + "IiZiSwapPool": [ + 61 + ], + "SynciZiPoolDataBatchRequest": [ + 202 + ] + }, + "nodeType": "SourceUnit", + "src": "31:2746:0", + "nodes": [ + { + "id": 1, + "nodeType": "PragmaDirective", + "src": "31:23:0", + "nodes": [], + "literals": [ + "solidity", + "^", + "0.8", + ".0" + ] + }, + { + "id": 61, + "nodeType": "ContractDefinition", + "src": "56:952:0", + "nodes": [ + { + "id": 16, + "nodeType": "FunctionDefinition", + "src": "85:276:0", + "nodes": [], + "functionSelector": "b0f59257", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "liquidity", + "nameLocation": "94:9:0", + "parameters": { + "id": 4, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 3, + "mutability": "mutable", + "name": "key", + "nameLocation": "121:3:0", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "113:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 2, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "113:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "src": "103:27:0" + }, + "returnParameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 6, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "199:9:0", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "191:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 5, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "191:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "mutability": "mutable", + "name": "lastFeeScaleX_128", + "nameLocation": "230:17:0", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "222:25:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "222:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 10, + "mutability": "mutable", + "name": "lastFeeScaleY_128", + "nameLocation": "269:17:0", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "261:25:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 9, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "261:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 12, + "mutability": "mutable", + "name": "tokenOwedX", + "nameLocation": "308:10:0", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "300:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 11, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "300:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14, + "mutability": "mutable", + "name": "tokenOwedY", + "nameLocation": "340:10:0", + "nodeType": "VariableDeclaration", + "scope": 16, + "src": "332:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "332:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "177:183:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 21, + "nodeType": "FunctionDefinition", + "src": "367:50:0", + "nodes": [], + "functionSelector": "16dc165b", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokenX", + "nameLocation": "376:6:0", + "parameters": { + "id": 17, + "nodeType": "ParameterList", + "parameters": [], + "src": "382:2:0" + }, + "returnParameters": { + "id": 20, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 19, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 21, + "src": "408:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 18, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "408:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "407:9:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 26, + "nodeType": "FunctionDefinition", + "src": "423:50:0", + "nodes": [], + "functionSelector": "b7d19fc4", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "tokenY", + "nameLocation": "432:6:0", + "parameters": { + "id": 22, + "nodeType": "ParameterList", + "parameters": [], + "src": "438:2:0" + }, + "returnParameters": { + "id": 25, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 24, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 26, + "src": "464:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 23, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "464:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "463:9:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 31, + "nodeType": "FunctionDefinition", + "src": "479:55:0", + "nodes": [], + "functionSelector": "09beabc1", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "sqrtRate_96", + "nameLocation": "488:11:0", + "parameters": { + "id": 27, + "nodeType": "ParameterList", + "parameters": [], + "src": "499:2:0" + }, + "returnParameters": { + "id": 30, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 31, + "src": "525:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 28, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "525:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + } + ], + "src": "524:9:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 36, + "nodeType": "FunctionDefinition", + "src": "540:46:0", + "nodes": [], + "functionSelector": "ddca3f43", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "fee", + "nameLocation": "549:3:0", + "parameters": { + "id": 32, + "nodeType": "ParameterList", + "parameters": [], + "src": "552:2:0" + }, + "returnParameters": { + "id": 35, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 34, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 36, + "src": "578:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + }, + "typeName": { + "id": 33, + "name": "uint24", + "nodeType": "ElementaryTypeName", + "src": "578:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint24", + "typeString": "uint24" + } + }, + "visibility": "internal" + } + ], + "src": "577:8:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 41, + "nodeType": "FunctionDefinition", + "src": "592:52:0", + "nodes": [], + "functionSelector": "58c51ce6", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "pointDelta", + "nameLocation": "601:10:0", + "parameters": { + "id": 37, + "nodeType": "ParameterList", + "parameters": [], + "src": "611:2:0" + }, + "returnParameters": { + "id": 40, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 39, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 41, + "src": "637:5:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 38, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "637:5:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + } + ], + "src": "636:7:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + }, + { + "id": 60, + "nodeType": "FunctionDefinition", + "src": "650:356:0", + "nodes": [], + "functionSelector": "c19d93fb", + "implemented": false, + "kind": "function", + "modifiers": [], + "name": "state", + "nameLocation": "659:5:0", + "parameters": { + "id": 42, + "nodeType": "ParameterList", + "parameters": [], + "src": "664:2:0" + }, + "returnParameters": { + "id": 59, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 44, + "mutability": "mutable", + "name": "sqrtPrice_96", + "nameLocation": "735:12:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "727:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 43, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "727:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 46, + "mutability": "mutable", + "name": "currentPoint", + "nameLocation": "767:12:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "761:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 45, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "761:5:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 48, + "mutability": "mutable", + "name": "observationCurrentIndex", + "nameLocation": "800:23:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "793:30:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 47, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "793:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 50, + "mutability": "mutable", + "name": "observationQueueLen", + "nameLocation": "844:19:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "837:26:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 49, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "837:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 52, + "mutability": "mutable", + "name": "observationNextQueueLen", + "nameLocation": "884:23:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "877:30:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + }, + "typeName": { + "id": 51, + "name": "uint16", + "nodeType": "ElementaryTypeName", + "src": "877:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint16", + "typeString": "uint16" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 54, + "mutability": "mutable", + "name": "locked", + "nameLocation": "926:6:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "921:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 53, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "921:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 56, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "954:9:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "946:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 55, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "946:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 58, + "mutability": "mutable", + "name": "liquidityX", + "nameLocation": "985:10:0", + "nodeType": "VariableDeclaration", + "scope": 60, + "src": "977:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 57, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "977:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + } + ], + "src": "713:292:0" + }, + "scope": 61, + "stateMutability": "view", + "virtual": false, + "visibility": "external" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "IiZiSwapPool", + "contractDependencies": [], + "contractKind": "interface", + "fullyImplemented": false, + "linearizedBaseContracts": [ + 61 + ], + "name": "IiZiSwapPool", + "nameLocation": "66:12:0", + "scope": 203, + "usedErrors": [] + }, + { + "id": 202, + "nodeType": "ContractDefinition", + "src": "1141:1635:0", + "nodes": [ + { + "id": 73, + "nodeType": "StructDefinition", + "src": "1184:161:0", + "nodes": [], + "canonicalName": "SynciZiPoolDataBatchRequest.PoolData", + "members": [ + { + "constant": false, + "id": 64, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "1218:9:0", + "nodeType": "VariableDeclaration", + "scope": 73, + "src": "1210:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 63, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1210:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 66, + "mutability": "mutable", + "name": "sqrtPrice", + "nameLocation": "1245:9:0", + "nodeType": "VariableDeclaration", + "scope": 73, + "src": "1237:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 65, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "1237:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 68, + "mutability": "mutable", + "name": "liquidityA", + "nameLocation": "1272:10:0", + "nodeType": "VariableDeclaration", + "scope": 73, + "src": "1264:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 67, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1264:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 70, + "mutability": "mutable", + "name": "liquidityB", + "nameLocation": "1300:10:0", + "nodeType": "VariableDeclaration", + "scope": 73, + "src": "1292:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 69, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1292:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 72, + "mutability": "mutable", + "name": "currentPoint", + "nameLocation": "1326:12:0", + "nodeType": "VariableDeclaration", + "scope": 73, + "src": "1320:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 71, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "1320:5:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + } + ], + "name": "PoolData", + "nameLocation": "1191:8:0", + "scope": 202, + "visibility": "public" + }, + { + "id": 181, + "nodeType": "FunctionDefinition", + "src": "1351:1224:0", + "nodes": [], + "body": { + "id": 180, + "nodeType": "Block", + "src": "1387:1188:0", + "nodes": [], + "statements": [ + { + "assignments": [ + 83 + ], + "declarations": [ + { + "constant": false, + "id": 83, + "mutability": "mutable", + "name": "allPoolData", + "nameLocation": "1415:11:0", + "nodeType": "VariableDeclaration", + "scope": 180, + "src": "1397:29:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_memory_ptr_$dyn_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData[]" + }, + "typeName": { + "baseType": { + "id": 81, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 80, + "name": "PoolData", + "nameLocations": [ + "1397:8:0" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 73, + "src": "1397:8:0" + }, + "referencedDeclaration": 73, + "src": "1397:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_storage_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData" + } + }, + "id": 82, + "nodeType": "ArrayTypeName", + "src": "1397:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_storage_$dyn_storage_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData[]" + } + }, + "visibility": "internal" + } + ], + "id": 91, + "initialValue": { + "arguments": [ + { + "expression": { + "id": 88, + "name": "pools", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "1444:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 89, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1450:6:0", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1444:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 87, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "1429:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_struct$_PoolData_$73_memory_ptr_$dyn_memory_ptr_$", + "typeString": "function (uint256) pure returns (struct SynciZiPoolDataBatchRequest.PoolData memory[] memory)" + }, + "typeName": { + "baseType": { + "id": 85, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 84, + "name": "PoolData", + "nameLocations": [ + "1433:8:0" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 73, + "src": "1433:8:0" + }, + "referencedDeclaration": 73, + "src": "1433:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_storage_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData" + } + }, + "id": 86, + "nodeType": "ArrayTypeName", + "src": "1433:10:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_storage_$dyn_storage_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData[]" + } + } + }, + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1429:28:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_memory_ptr_$dyn_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1397:60:0" + }, + { + "body": { + "id": 170, + "nodeType": "Block", + "src": "1511:717:0", + "statements": [ + { + "assignments": [ + 104 + ], + "declarations": [ + { + "constant": false, + "id": 104, + "mutability": "mutable", + "name": "poolAddress", + "nameLocation": "1533:11:0", + "nodeType": "VariableDeclaration", + "scope": 170, + "src": "1525:19:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 103, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1525:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "id": 108, + "initialValue": { + "baseExpression": { + "id": 105, + "name": "pools", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "1547:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 107, + "indexExpression": { + "id": 106, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "1553:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1547:8:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1525:30:0" + }, + { + "condition": { + "arguments": [ + { + "id": 110, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 104, + "src": "1589:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 109, + "name": "codeSizeIsZero", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1574:14:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", + "typeString": "function (address) view returns (bool)" + } + }, + "id": 111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1574:27:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 113, + "nodeType": "IfStatement", + "src": "1570:41:0", + "trueBody": { + "id": 112, + "nodeType": "Continue", + "src": "1603:8:0" + } + }, + { + "assignments": [ + 116 + ], + "declarations": [ + { + "constant": false, + "id": 116, + "mutability": "mutable", + "name": "poolData", + "nameLocation": "1642:8:0", + "nodeType": "VariableDeclaration", + "scope": 170, + "src": "1626:24:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData" + }, + "typeName": { + "id": 115, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 114, + "name": "PoolData", + "nameLocations": [ + "1626:8:0" + ], + "nodeType": "IdentifierPath", + "referencedDeclaration": 73, + "src": "1626:8:0" + }, + "referencedDeclaration": 73, + "src": "1626:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_storage_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData" + } + }, + "visibility": "internal" + } + ], + "id": 117, + "nodeType": "VariableDeclarationStatement", + "src": "1626:24:0" + }, + { + "assignments": [ + 119, + 121, + null, + null, + null, + null, + 123, + 125 + ], + "declarations": [ + { + "constant": false, + "id": 119, + "mutability": "mutable", + "name": "sqrtPriceX96", + "nameLocation": "1691:12:0", + "nodeType": "VariableDeclaration", + "scope": 170, + "src": "1683:20:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + }, + "typeName": { + "id": 118, + "name": "uint160", + "nodeType": "ElementaryTypeName", + "src": "1683:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 121, + "mutability": "mutable", + "name": "currentPoint", + "nameLocation": "1727:12:0", + "nodeType": "VariableDeclaration", + "scope": 170, + "src": "1721:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + }, + "typeName": { + "id": 120, + "name": "int24", + "nodeType": "ElementaryTypeName", + "src": "1721:5:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "visibility": "internal" + }, + null, + null, + null, + null, + { + "constant": false, + "id": 123, + "mutability": "mutable", + "name": "liquidity", + "nameLocation": "1837:9:0", + "nodeType": "VariableDeclaration", + "scope": 170, + "src": "1829:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 122, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1829:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 125, + "mutability": "mutable", + "name": "liquidityX", + "nameLocation": "1872:10:0", + "nodeType": "VariableDeclaration", + "scope": 170, + "src": "1864:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "typeName": { + "id": 124, + "name": "uint128", + "nodeType": "ElementaryTypeName", + "src": "1864:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "visibility": "internal" + } + ], + "id": 131, + "initialValue": { + "arguments": [], + "expression": { + "argumentTypes": [], + "expression": { + "arguments": [ + { + "id": 127, + "name": "poolAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 104, + "src": "1912:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 126, + "name": "IiZiSwapPool", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "1899:12:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IiZiSwapPool_$61_$", + "typeString": "type(contract IiZiSwapPool)" + } + }, + "id": 128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1899:25:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_contract$_IiZiSwapPool_$61", + "typeString": "contract IiZiSwapPool" + } + }, + "id": 129, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1925:5:0", + "memberName": "state", + "nodeType": "MemberAccess", + "referencedDeclaration": 60, + "src": "1899:31:0", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$__$returns$_t_uint160_$_t_int24_$_t_uint16_$_t_uint16_$_t_uint16_$_t_bool_$_t_uint128_$_t_uint128_$", + "typeString": "function () view external returns (uint160,int24,uint16,uint16,uint16,bool,uint128,uint128)" + } + }, + "id": 130, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "1899:33:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_uint160_$_t_int24_$_t_uint16_$_t_uint16_$_t_uint16_$_t_bool_$_t_uint128_$_t_uint128_$", + "typeString": "tuple(uint160,int24,uint16,uint16,uint16,bool,uint128,uint128)" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1665:267:0" + }, + { + "expression": { + "id": 136, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 132, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "1947:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 134, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "1956:9:0", + "memberName": "sqrtPrice", + "nodeType": "MemberAccess", + "referencedDeclaration": 66, + "src": "1947:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 135, + "name": "sqrtPriceX96", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 119, + "src": "1968:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "src": "1947:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + }, + "id": 137, + "nodeType": "ExpressionStatement", + "src": "1947:33:0" + }, + { + "expression": { + "id": 142, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 138, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "1994:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 140, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2003:12:0", + "memberName": "currentPoint", + "nodeType": "MemberAccess", + "referencedDeclaration": 72, + "src": "1994:21:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 141, + "name": "currentPoint", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 121, + "src": "2018:12:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "src": "1994:36:0", + "typeDescriptions": { + "typeIdentifier": "t_int24", + "typeString": "int24" + } + }, + "id": 143, + "nodeType": "ExpressionStatement", + "src": "1994:36:0" + }, + { + "expression": { + "id": 148, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 144, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "2044:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 146, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2053:9:0", + "memberName": "liquidity", + "nodeType": "MemberAccess", + "referencedDeclaration": 64, + "src": "2044:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 147, + "name": "liquidity", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 123, + "src": "2065:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "2044:30:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "id": 149, + "nodeType": "ExpressionStatement", + "src": "2044:30:0" + }, + { + "expression": { + "id": 154, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 150, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "2088:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 152, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2097:10:0", + "memberName": "liquidityA", + "nodeType": "MemberAccess", + "referencedDeclaration": 68, + "src": "2088:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 153, + "name": "liquidityX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 125, + "src": "2110:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "2088:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "id": 155, + "nodeType": "ExpressionStatement", + "src": "2088:32:0" + }, + { + "expression": { + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "expression": { + "id": 156, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "2134:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 158, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberLocation": "2143:10:0", + "memberName": "liquidityB", + "nodeType": "MemberAccess", + "referencedDeclaration": 70, + "src": "2134:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + }, + "id": 161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 159, + "name": "liquidity", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 123, + "src": "2156:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 160, + "name": "liquidityX", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 125, + "src": "2168:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "2156:22:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "src": "2134:44:0", + "typeDescriptions": { + "typeIdentifier": "t_uint128", + "typeString": "uint128" + } + }, + "id": 163, + "nodeType": "ExpressionStatement", + "src": "2134:44:0" + }, + { + "expression": { + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 164, + "name": "allPoolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 83, + "src": "2192:11:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_memory_ptr_$dyn_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory[] memory" + } + }, + "id": 166, + "indexExpression": { + "id": 165, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "2204:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2192:14:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 167, + "name": "poolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "2209:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "src": "2192:25:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_PoolData_$73_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "2192:25:0" + } + ] + }, + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 99, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 96, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "1488:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "expression": { + "id": 97, + "name": "pools", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 76, + "src": "1492:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[] memory" + } + }, + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "1498:6:0", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "1492:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1488:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 171, + "initializationExpression": { + "assignments": [ + 93 + ], + "declarations": [ + { + "constant": false, + "id": 93, + "mutability": "mutable", + "name": "i", + "nameLocation": "1481:1:0", + "nodeType": "VariableDeclaration", + "scope": 171, + "src": "1473:9:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 92, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1473:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "id": 95, + "initialValue": { + "hexValue": "30", + "id": 94, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1485:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "1473:13:0" + }, + "loopExpression": { + "expression": { + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": true, + "src": "1506:3:0", + "subExpression": { + "id": 100, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "1508:1:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 102, + "nodeType": "ExpressionStatement", + "src": "1506:3:0" + }, + "nodeType": "ForStatement", + "src": "1468:760:0" + }, + { + "assignments": [ + 173 + ], + "declarations": [ + { + "constant": false, + "id": 173, + "mutability": "mutable", + "name": "_abiEncodedData", + "nameLocation": "2251:15:0", + "nodeType": "VariableDeclaration", + "scope": 180, + "src": "2238:28:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 172, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "2238:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + } + ], + "id": 178, + "initialValue": { + "arguments": [ + { + "id": 176, + "name": "allPoolData", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 83, + "src": "2280:11:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_memory_ptr_$dyn_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory[] memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_struct$_PoolData_$73_memory_ptr_$dyn_memory_ptr", + "typeString": "struct SynciZiPoolDataBatchRequest.PoolData memory[] memory" + } + ], + "expression": { + "id": 174, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -1, + "src": "2269:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 175, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberLocation": "2273:6:0", + "memberName": "encode", + "nodeType": "MemberAccess", + "src": "2269:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 177, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "nameLocations": [], + "names": [], + "nodeType": "FunctionCall", + "src": "2269:23:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2238:54:0" + }, + { + "AST": { + "nodeType": "YulBlock", + "src": "2311:258:0", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "2461:43:0", + "value": { + "arguments": [ + { + "name": "_abiEncodedData", + "nodeType": "YulIdentifier", + "src": "2482:15:0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2499:4:0", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2478:3:0" + }, + "nodeType": "YulFunctionCall", + "src": "2478:26:0" + }, + "variables": [ + { + "name": "dataStart", + "nodeType": "YulTypedName", + "src": "2465:9:0", + "type": "" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "dataStart", + "nodeType": "YulIdentifier", + "src": "2524:9:0" + }, + { + "arguments": [ + { + "arguments": [], + "functionName": { + "name": "msize", + "nodeType": "YulIdentifier", + "src": "2539:5:0" + }, + "nodeType": "YulFunctionCall", + "src": "2539:7:0" + }, + { + "name": "dataStart", + "nodeType": "YulIdentifier", + "src": "2548:9:0" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "2535:3:0" + }, + "nodeType": "YulFunctionCall", + "src": "2535:23:0" + } + ], + "functionName": { + "name": "return", + "nodeType": "YulIdentifier", + "src": "2517:6:0" + }, + "nodeType": "YulFunctionCall", + "src": "2517:42:0" + }, + "nodeType": "YulExpressionStatement", + "src": "2517:42:0" + } + ] + }, + "evmVersion": "london", + "externalReferences": [ + { + "declaration": 173, + "isOffset": false, + "isSlot": false, + "src": "2482:15:0", + "valueSize": 1 + } + ], + "id": 179, + "nodeType": "InlineAssembly", + "src": "2302:267:0" + } + ] + }, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "parameters": { + "id": 77, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 76, + "mutability": "mutable", + "name": "pools", + "nameLocation": "1380:5:0", + "nodeType": "VariableDeclaration", + "scope": 181, + "src": "1363:22:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 74, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1363:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 75, + "nodeType": "ArrayTypeName", + "src": "1363:9:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "visibility": "internal" + } + ], + "src": "1362:24:0" + }, + "returnParameters": { + "id": 78, + "nodeType": "ParameterList", + "parameters": [], + "src": "1387:0:0" + }, + "scope": 202, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "id": 201, + "nodeType": "FunctionDefinition", + "src": "2581:193:0", + "nodes": [], + "body": { + "id": 200, + "nodeType": "Block", + "src": "2650:124:0", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 192, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "expression": { + "id": 188, + "name": "target", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 183, + "src": "2664:6:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 189, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2671:4:0", + "memberName": "code", + "nodeType": "MemberAccess", + "src": "2664:11:0", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + }, + "id": 190, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberLocation": "2676:6:0", + "memberName": "length", + "nodeType": "MemberAccess", + "src": "2664:18:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "30", + "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2686:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2664:23:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 198, + "nodeType": "Block", + "src": "2731:37:0", + "statements": [ + { + "expression": { + "hexValue": "66616c7365", + "id": 196, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2752:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "functionReturnParameters": 187, + "id": 197, + "nodeType": "Return", + "src": "2745:12:0" + } + ] + }, + "id": 199, + "nodeType": "IfStatement", + "src": "2660:108:0", + "trueBody": { + "id": 195, + "nodeType": "Block", + "src": "2689:36:0", + "statements": [ + { + "expression": { + "hexValue": "74727565", + "id": 193, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2710:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "functionReturnParameters": 187, + "id": 194, + "nodeType": "Return", + "src": "2703:11:0" + } + ] + } + } + ] + }, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "codeSizeIsZero", + "nameLocation": "2590:14:0", + "parameters": { + "id": 184, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 183, + "mutability": "mutable", + "name": "target", + "nameLocation": "2613:6:0", + "nodeType": "VariableDeclaration", + "scope": 201, + "src": "2605:14:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 182, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2605:7:0", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "visibility": "internal" + } + ], + "src": "2604:16:0" + }, + "returnParameters": { + "id": 187, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 186, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 201, + "src": "2644:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 185, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2644:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "2643:6:0" + }, + "scope": 202, + "stateMutability": "view", + "virtual": false, + "visibility": "internal" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "SynciZiPoolDataBatchRequest", + "contractDependencies": [], + "contractKind": "contract", + "documentation": { + "id": 62, + "nodeType": "StructuredDocumentation", + "src": "1010:130:0", + "text": "@dev This contract is not meant to be deployed. Instead, use a static call with the\ndeployment bytecode as payload." + }, + "fullyImplemented": true, + "linearizedBaseContracts": [ + 202 + ], + "name": "SynciZiPoolDataBatchRequest", + "nameLocation": "1150:27:0", + "scope": 203, + "usedErrors": [] + } + ], + "license": "MIT" + }, + "id": 0 +} \ No newline at end of file diff --git a/src/amm/izumi/batch_request/mod.rs b/src/amm/izumi/batch_request/mod.rs new file mode 100644 index 00000000..06beb929 --- /dev/null +++ b/src/amm/izumi/batch_request/mod.rs @@ -0,0 +1,228 @@ +use std::{sync::Arc, vec}; + +use ethers::{ + abi::{ParamType, Token}, + providers::Middleware, + types::{Bytes, I256}, +}; + +use crate::{ + amm::{AutomatedMarketMaker, AMM}, + errors::DAMMError, +}; + +use super::IziSwapPool; + +use ethers::prelude::abigen; + +abigen!( + IGetiZiPoolDataBatchRequest, + "src/amm/izumi/batch_request/GetiZiPoolDataBatchRequest.json"; + ISynciZiPoolDataBatchRequest, + "src/amm/izumi/batch_request/SynciZiPoolDataBatchRequest.json"; + +); + +pub async fn get_izi_pool_data_batch_request( + pool: &mut IziSwapPool, + block_number: Option, + middleware: Arc, +) -> Result<(), DAMMError> { + let constructor_args = Token::Tuple(vec![Token::Array(vec![Token::Address(pool.address)])]); + + let deployer = + IGetiZiPoolDataBatchRequest::deploy(middleware.clone(), constructor_args).unwrap(); + + let return_data: Bytes = if let Some(block_number) = block_number { + deployer.block(block_number).call_raw().await? + } else { + deployer.call_raw().await? + }; + + let return_data_tokens = ethers::abi::decode( + &[ParamType::Array(Box::new(ParamType::Tuple(vec![ + ParamType::Address, // token a + ParamType::Uint(8), // token a decimals + ParamType::Address, // token b + ParamType::Uint(8), // token b decimals + ParamType::Uint(128), // liquidity + ParamType::Uint(160), // sqrtPrice + ParamType::Uint(128), // liquidityA + ParamType::Uint(128), // liquidityB + ParamType::Int(24), // currentPoint + ParamType::Int(24), // pointDelta + ParamType::Uint(24), //fee + ])))], + &return_data, + )?; + + //Update pool data + for tokens in return_data_tokens { + if let Some(tokens_arr) = tokens.into_array() { + for tup in tokens_arr { + if let Some(pool_data) = tup.into_tuple() { + //If the pool token A is not zero, signaling that the pool data was populated + if !pool_data[0].to_owned().into_address().unwrap().is_zero() { + //Update the pool data + pool.token_a = pool_data[0].to_owned().into_address().unwrap(); + + pool.token_a_decimals = + pool_data[1].to_owned().into_uint().unwrap().as_u32() as u8; + + pool.token_b = pool_data[2].to_owned().into_address().unwrap(); + + pool.token_b_decimals = + pool_data[3].to_owned().into_uint().unwrap().as_u32() as u8; + + pool.liquidity = pool_data[4].to_owned().into_uint().unwrap().as_u128(); + + pool.sqrt_price = pool_data[5].to_owned().into_uint().unwrap(); + + pool.liquidity_x = + I256::from_raw(pool_data[6].to_owned().into_uint().unwrap()).as_u128(); + + pool.liquidity_y = + I256::from_raw(pool_data[7].to_owned().into_uint().unwrap()).as_u128(); + + pool.current_point = + I256::from_raw(pool_data[8].to_owned().into_int().unwrap()).as_i32(); + pool.point_delta = + I256::from_raw(pool_data[9].to_owned().into_int().unwrap()).as_i32(); + pool.fee = pool_data[10].to_owned().into_uint().unwrap().as_u64() as u32; + } + } + } + } + } + Ok(()) +} + +pub async fn sync_izi_pool_batch_request( + pool: &mut IziSwapPool, + middleware: Arc, +) -> Result<(), DAMMError> { + let constructor_args = Token::Tuple(vec![Token::Array(vec![Token::Address(pool.address)])]); + + let deployer = ISynciZiPoolDataBatchRequest::deploy(middleware.clone(), constructor_args) + .expect("Could not deploy"); + + let return_data: Bytes = deployer.call_raw().await?; + let return_data_tokens = ethers::abi::decode( + &[ParamType::Tuple(vec![ + ParamType::Uint(128), // liquidity + ParamType::Uint(160), // sqrtPrice + ParamType::Uint(128), // liquidityA + ParamType::Uint(128), // liquidityB + ParamType::Int(24), // currentPoint + ])], + &return_data, + )?; + + for tokens in return_data_tokens { + if let Some(tokens_arr) = tokens.into_array() { + for tup in tokens_arr { + if let Some(pool_data) = tup.into_tuple() { + //If the sqrt_price is not zero, signaling that the pool data was populated + if !pool_data[1].to_owned().into_uint().unwrap().is_zero() { + //Update the pool data + pool.liquidity = pool_data[0].to_owned().into_uint().unwrap().as_u128(); + pool.sqrt_price = pool_data[1].to_owned().into_uint().unwrap(); + pool.liquidity_x = pool_data[2].to_owned().into_uint().unwrap().as_u128(); + pool.liquidity_y = pool_data[3].to_owned().into_uint().unwrap().as_u128(); + pool.current_point = + I256::from_raw(pool_data[4].to_owned().into_int().unwrap()).as_i32(); + } else { + return Err(DAMMError::SyncError(pool.address)); + } + } + } + } + } + + Ok(()) +} + +pub async fn get_amm_data_batch_request( + amms: &mut [AMM], + block_number: u64, + middleware: Arc, +) -> Result<(), DAMMError> { + let mut target_addresses = vec![]; + + for amm in amms.iter() { + target_addresses.push(Token::Address(amm.address())); + } + + let constructor_args = Token::Tuple(vec![Token::Array(target_addresses)]); + let deployer = IGetiZiPoolDataBatchRequest::deploy(middleware.clone(), constructor_args) + .expect("Could not initialize batch request deployer"); + + let return_data: Bytes = deployer.block(block_number).call_raw().await?; + + let return_data_tokens = ethers::abi::decode( + &[ParamType::Array(Box::new(ParamType::Tuple(vec![ + ParamType::Address, // token a + ParamType::Uint(8), // token a decimals + ParamType::Address, // token b + ParamType::Uint(8), // token b decimals + ParamType::Uint(128), // liquidity + ParamType::Uint(160), // sqrtPrice + ParamType::Uint(128), // liquidityA + ParamType::Uint(128), // liquidityB + ParamType::Int(24), // currentPoint + ParamType::Int(24), // pointDelta + ParamType::Uint(24), //fee + ])))], + &return_data, + )?; + + let mut pool_idx = 0; + + dbg!("Getting here"); + //Update pool data + for tokens in return_data_tokens { + if let Some(tokens_arr) = tokens.into_array() { + for tup in tokens_arr { + if let Some(pool_data) = tup.into_tuple() { + //If the pool token A is not zero, signaling that the pool data was populated + if !pool_data[0].to_owned().into_address().unwrap().is_zero() { + //Update the pool data + if let AMM::IziSwapPool(izi_pool) = amms.get_mut(pool_idx).unwrap() { + izi_pool.token_a = pool_data[0].to_owned().into_address().unwrap(); + + izi_pool.token_a_decimals = + pool_data[1].to_owned().into_uint().unwrap().as_u32() as u8; + + izi_pool.token_b = pool_data[2].to_owned().into_address().unwrap(); + + izi_pool.token_b_decimals = + pool_data[3].to_owned().into_uint().unwrap().as_u32() as u8; + + izi_pool.liquidity = + pool_data[4].to_owned().into_uint().unwrap().as_u128(); + + izi_pool.sqrt_price = pool_data[5].to_owned().into_uint().unwrap(); + + izi_pool.liquidity_x = + pool_data[6].to_owned().into_uint().unwrap().as_u128(); + + izi_pool.liquidity_y = + pool_data[7].to_owned().into_uint().unwrap().as_u128(); + izi_pool.current_point = + I256::from_raw(pool_data[8].to_owned().into_int().unwrap()) + .as_i32(); + izi_pool.point_delta = + I256::from_raw(pool_data[9].to_owned().into_int().unwrap()) + .as_i32(); + + izi_pool.fee = + pool_data[10].to_owned().into_uint().unwrap().as_u64() as u32; + } + } + pool_idx += 1; + } + } + } + } + Ok(()) +} diff --git a/src/amm/izumi/factory.rs b/src/amm/izumi/factory.rs new file mode 100644 index 00000000..d3c5403d --- /dev/null +++ b/src/amm/izumi/factory.rs @@ -0,0 +1,236 @@ +use std::{ + collections::{BTreeMap, HashMap}, + sync::Arc, +}; + +use crate::{ + amm::{ + factory::{AutomatedMarketMakerFactory, TASK_LIMIT}, + AutomatedMarketMaker, AMM, + }, + errors::{DAMMError, EventLogError}, +}; +use async_trait::async_trait; +use ethers::{ + abi::RawLog, + prelude::{abigen, EthEvent}, + providers::Middleware, + types::{BlockNumber, Filter, Log, H160, H256, U256, U64}, +}; +use serde::{Deserialize, Serialize}; +use tokio::task::JoinHandle; + +use super::{batch_request, IziSwapPool}; + +abigen!( + IiZiSwapFactory, + r#"[ + event NewPool(address indexed tokenX,address indexed tokenY,uint24 indexed fee,uint24 pointDelta,address pool) + ]"#; +); + +pub const IZI_POOL_CREATED_EVENT_SIGNATURE: H256 = H256([ + 240, 77, 166, 119, 85, 173, 245, 135, 57, 100, 158, 47, 185, 148, 154, 99, 40, 81, 129, 65, + 183, 172, 158, 68, 170, 16, 50, 6, 136, 176, 73, 0, +]); + +#[derive(Default, Debug, Clone, Copy, Serialize, Deserialize)] +pub struct IziSwapFactory { + pub address: H160, + pub creation_block: u64, +} + +#[async_trait] +impl AutomatedMarketMakerFactory for IziSwapFactory { + fn address(&self) -> H160 { + self.address + } + + fn creation_block(&self) -> u64 { + self.creation_block + } + + fn amm_created_event_signature(&self) -> H256 { + IZI_POOL_CREATED_EVENT_SIGNATURE + } + + async fn new_amm_from_log( + &self, + log: Log, + middleware: Arc, + ) -> Result> { + if let Some(block_number) = log.block_number { + let pool_created_filter = NewPoolFilter::decode_log(&RawLog::from(log))?; + Ok(AMM::IziSwapPool( + IziSwapPool::new_from_address( + pool_created_filter.pool, + block_number.as_u64(), + middleware, + ) + .await?, + )) + } else { + return Err(DAMMError::BlockNumberNotFound); + } + } + + async fn get_all_amms( + &self, + to_block: Option, + middleware: Arc, + step: u64, + ) -> Result, DAMMError> { + if let Some(block) = to_block { + self.get_all_pools_from_logs(block, step, middleware).await + } else { + return Err(DAMMError::BlockNumberNotFound); + } + } + + async fn populate_amm_data( + &self, + amms: &mut [AMM], + block_number: Option, + middleware: Arc, + ) -> Result<(), DAMMError> { + if let Some(block_number) = block_number { + let step = 127; //Max batch size for call + for amm_chunk in amms.chunks_mut(step) { + batch_request::get_amm_data_batch_request( + amm_chunk, + block_number, + middleware.clone(), + ) + .await?; + } + } else { + return Err(DAMMError::BlockNumberNotFound); + } + + Ok(()) + } + + fn new_empty_amm_from_log(&self, log: Log) -> Result { + let pool_created_event = NewPoolFilter::decode_log(&RawLog::from(log))?; + + Ok(AMM::IziSwapPool(IziSwapPool { + address: pool_created_event.pool, + token_a: pool_created_event.token_x, + token_b: pool_created_event.token_y, + token_a_decimals: 0, + token_b_decimals: 0, + fee: pool_created_event.fee, + liquidity: 0, + sqrt_price: U256::zero(), + liquidity_x: 0, + liquidity_y: 0, + current_point: 0, + point_delta: 0, + })) + } +} + +impl IziSwapFactory { + pub fn new(address: H160, creation_block: u64) -> IziSwapFactory { + IziSwapFactory { + address, + creation_block, + } + } + + //Function to get all pair created events for a given Dex factory address and sync pool data + pub async fn get_all_pools_from_logs( + self, + to_block: u64, + step: u64, + middleware: Arc, + ) -> Result, DAMMError> { + //Unwrap can be used here because the creation block was verified within `Dex::new()` + let mut from_block = self.creation_block; + let mut aggregated_amms: HashMap = HashMap::new(); + + //TODO: NOTE: we do not currently need to use a btreemap but if we are to do local simulation we will need burn and mint logs. For this reason, we are leaving the sync arch to be the same as uniswapV3 + let mut ordered_logs: BTreeMap> = BTreeMap::new(); + + let mut handles = vec![]; + + let mut tasks = 0; + while from_block < to_block { + let middleware = middleware.clone(); + + let mut target_block = from_block + step - 1; + if target_block > to_block { + target_block = to_block; + } + + handles.push(tokio::spawn(async move { + let logs = middleware + .get_logs( + &Filter::new() + .topic0(vec![IZI_POOL_CREATED_EVENT_SIGNATURE]) + .from_block(BlockNumber::Number(U64([from_block]))) + .to_block(BlockNumber::Number(U64([target_block]))), + ) + .await + .map_err(DAMMError::MiddlewareError)?; + + Ok::, DAMMError>(logs) + })); + + from_block += step; + + tasks += 1; + //Here we are limiting the number of green threads that can be spun up to not have the node time out + if tasks == TASK_LIMIT { + self.process_logs_from_handles(handles, &mut ordered_logs) + .await?; + handles = vec![]; + tasks = 0; + } + } + + self.process_logs_from_handles(handles, &mut ordered_logs) + .await?; + + for (_, log_group) in ordered_logs { + for log in log_group { + let event_signature = log.topics[0]; + + //If the event sig is the pool created event sig, then the log is coming from the factory + if event_signature == IZI_POOL_CREATED_EVENT_SIGNATURE + && log.address == self.address + { + let new_pool = self.new_empty_amm_from_log(log)?; + + aggregated_amms.insert(new_pool.address(), new_pool); + } + } + } + + Ok(aggregated_amms.into_values().collect::>()) + } + + async fn process_logs_from_handles( + &self, + handles: Vec, DAMMError>>>, + ordered_logs: &mut BTreeMap>, + ) -> Result<(), DAMMError> { + // group the logs from each thread by block number and then sync the logs in chronological order + for handle in handles { + let logs = handle.await??; + + for log in logs { + if let Some(log_block_number) = log.block_number { + if let Some(log_group) = ordered_logs.get_mut(&log_block_number) { + log_group.push(log); + } else { + ordered_logs.insert(log_block_number, vec![log]); + } + } else { + return Err(EventLogError::LogBlockNumberNotFound)?; + } + } + } + Ok(()) + } +} diff --git a/src/amm/izumi/mod.rs b/src/amm/izumi/mod.rs new file mode 100644 index 00000000..6e6b4702 --- /dev/null +++ b/src/amm/izumi/mod.rs @@ -0,0 +1,465 @@ +use std::{cmp::Ordering, str::FromStr, sync::Arc}; + +use async_trait::async_trait; +use ethers::{ + abi::{ethabi::Bytes, RawLog, Token}, + prelude::{abigen, EthEvent}, + providers::Middleware, + types::{Log, H160, H256, I256, U256}, +}; +use serde::{Deserialize, Serialize}; + +use crate::errors::{ArithmeticError, DAMMError, EventLogError, SwapSimulationError}; + +use self::factory::{NewPoolFilter, IZI_POOL_CREATED_EVENT_SIGNATURE}; + +use super::AutomatedMarketMaker; +pub mod batch_request; +pub mod factory; + +abigen!( + + IiZiSwapPool, + r#"[ + function token0() external view returns (address) + function token1() external view returns (address) + function liquidity() external view returns (uint128) + function fee() external view returns (uint24) + function swapY2X(address recipient,uint128 amount,int24 highPt,bytes calldata data) returns (uint256 amountX, uint256 amountY) + function swapX2Y(address recipient,uint128 amount,int24 lowPt,bytes calldata data) returns (uint256 amountX, uint256 amountY) + event Swap(address indexed tokenX,address indexed tokenY,uint24 indexed fee,bool sellXEarnY,uint256 amountX,uint256 amountY) + ]"#; + + IErc20, + r#"[ + function balanceOf(address account) external view returns (uint256) + function decimals() external view returns (uint8) + ]"#; + + IQuoter, + r#"[ + function swapY2X(address tokenX,address tokenY,uint24 fee,uint128 amount,int24 highPt) public returns (uint256 amountX, int24 finalPoint) + function swapX2Y(address tokenX,address tokenY,uint24 fee,uint128 amount,int24 lowPt) public returns (uint256 amountY, int24 finalPoint) + ]"# +); + +pub const SWAP_EVENT_SIGNATURE: H256 = H256([ + 231, 119, 154, 54, 162, 138, 224, 228, 155, 203, 217, 252, 245, 114, 134, 251, 96, 118, 153, + 192, 195, 57, 194, 2, 233, 36, 149, 100, 5, 5, 97, 62, +]); + +pub const MIN_PT: i32 = -800000; +pub const MAX_PT: i32 = 800000; + +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +pub struct IziSwapPool { + pub address: H160, + pub token_a: H160, + pub token_a_decimals: u8, + pub token_b: H160, + pub token_b_decimals: u8, + pub liquidity: u128, + pub liquidity_x: u128, + pub liquidity_y: u128, + pub sqrt_price: U256, + pub fee: u32, + pub current_point: i32, + pub point_delta: i32, +} +#[async_trait] +impl AutomatedMarketMaker for IziSwapPool { + fn address(&self) -> H160 { + self.address + } + async fn sync(&mut self, middleware: Arc) -> Result<(), DAMMError> { + batch_request::sync_izi_pool_batch_request(self, middleware.clone()).await?; + Ok(()) + } + fn sync_on_event_signatures(&self) -> Vec { + vec![SWAP_EVENT_SIGNATURE] + } + fn tokens(&self) -> Vec { + vec![self.token_a, self.token_b] + } + fn calculate_price(&self, base_token: H160) -> Result { + let shift = self.token_a_decimals as i8 - self.token_b_decimals as i8; + let price = match shift.cmp(&0) { + Ordering::Less => 1.0001_f64.powi(self.current_point) / 10_f64.powi(-shift as i32), + Ordering::Greater => 1.0001_f64.powi(self.current_point) * 10_f64.powi(shift as i32), + Ordering::Equal => 1.0001_f64.powi(self.current_point), + }; + if base_token == self.token_a { + Ok(price) + } else { + Ok(1.0 / price) + } + } + fn sync_from_log(&mut self, _log: ethers::types::Log) -> Result<(), EventLogError> { + todo!("Not yet implemented"); + } + async fn populate_data( + &mut self, + block_number: Option, + middleware: Arc, + ) -> Result<(), DAMMError> { + batch_request::get_izi_pool_data_batch_request(self, block_number, middleware.clone()) + .await?; + Ok(()) + } + fn simulate_swap( + &self, + _token_in: H160, + _amount_in: U256, + ) -> Result { + todo!("Not yet implemented"); + } + fn simulate_swap_mut( + &mut self, + _token_in: H160, + _amount_in: U256, + ) -> Result { + todo!("Not yet implemented"); + } + + fn get_token_out(&self, token_in: H160) -> H160 { + if self.token_a == token_in { + self.token_b + } else { + self.token_a + } + } +} + +impl IziSwapPool { + #[allow(clippy::too_many_arguments)] + pub fn new( + address: H160, + token_a: H160, + token_a_decimals: u8, + token_b: H160, + token_b_decimals: u8, + fee: u32, + liquidity: u128, + sqrt_price: U256, + liquidity_x: u128, + liquidity_y: u128, + current_point: i32, + point_delta: i32, + ) -> IziSwapPool { + IziSwapPool { + address, + token_a, + token_a_decimals, + token_b, + token_b_decimals, + fee, + liquidity, + sqrt_price, + liquidity_x, + liquidity_y, + current_point, + point_delta, + } + } + + //TODO: document that this function will not populate the tick_bitmap and ticks, if you want to populate those, you must call populate_tick_data on an initialized pool.1.0001_f64 + + //Creates a new instance of the pool from the pair address + pub async fn new_from_address( + pair_address: H160, + _creation_block: u64, + middleware: Arc, + ) -> Result> { + let mut pool = IziSwapPool { + address: pair_address, + token_a: H160::zero(), + token_a_decimals: 0, + token_b: H160::zero(), + token_b_decimals: 0, + liquidity: 0, + sqrt_price: U256::zero(), + liquidity_x: 0, + liquidity_y: 0, + current_point: 0, + point_delta: 0, + fee: 0, + }; + + //TODO: break this into two threads so it can happen concurrently? + pool.populate_data(None, middleware).await?; + + if !pool.data_is_populated() { + return Err(DAMMError::PoolDataError); + } + + Ok(pool) + } + + pub async fn new_from_log( + log: Log, + middleware: Arc, + ) -> Result> { + let event_signature = log.topics[0]; + + if event_signature == IZI_POOL_CREATED_EVENT_SIGNATURE { + if let Some(block_number) = log.block_number { + let pool_created_event = NewPoolFilter::decode_log(&RawLog::from(log))?; + + IziSwapPool::new_from_address( + pool_created_event.pool, + block_number.as_u64(), + middleware, + ) + .await + } else { + Err(EventLogError::LogBlockNumberNotFound)? + } + } else { + Err(EventLogError::InvalidEventSignature)? + } + } + + pub fn new_empty_pool_from_log(log: Log) -> Result { + let event_signature = log.topics[0]; + + if event_signature == IZI_POOL_CREATED_EVENT_SIGNATURE { + let pool_created_event = NewPoolFilter::decode_log(&RawLog::from(log))?; + + Ok(IziSwapPool { + address: pool_created_event.pool, + token_a: pool_created_event.token_x, + token_b: pool_created_event.token_y, + token_a_decimals: 0, + token_b_decimals: 0, + fee: pool_created_event.fee, + liquidity: 0, + sqrt_price: U256::zero(), + liquidity_x: 0, + liquidity_y: 0, + current_point: 0, + point_delta: 0, + }) + } else { + Err(EventLogError::InvalidEventSignature) + } + } + + pub fn fee(&self) -> u32 { + self.fee + } + + pub fn data_is_populated(&self) -> bool { + !(self.token_a.is_zero() || self.token_b.is_zero()) + } + + pub async fn sync_from_swap_log( + &mut self, + _log: Log, + middleware: Arc, + ) -> Result<(), DAMMError> { + batch_request::sync_izi_pool_batch_request(self, middleware).await?; + Ok(()) + } + + pub async fn get_token_decimals( + &mut self, + middleware: Arc, + ) -> Result<(u8, u8), DAMMError> { + let token_a_decimals = IErc20::new(self.token_a, middleware.clone()) + .decimals() + .call() + .await?; + + let token_b_decimals = IErc20::new(self.token_b, middleware) + .decimals() + .call() + .await?; + + Ok((token_a_decimals, token_b_decimals)) + } + + pub async fn simulate_swap_async( + &self, + token_in: H160, + amount_in: u128, + quoter: &str, + middleware: Arc, + ) -> Result> { + let quoter = IQuoter::new(H160::from_str(quoter).unwrap(), middleware.clone()); + + if token_in == self.token_a { + let (amount_out, _) = quoter + .swap_x2y(token_in, self.token_b, self.fee, amount_in, MIN_PT) + .call() + .await?; + Ok(amount_out) + } else { + let (amount_out, _) = quoter + .swap_y2x(token_in, self.token_a, self.fee, amount_in, MAX_PT) + .call() + .await?; + Ok(amount_out) + } + } + + pub fn swap_calldata( + &self, + recipient: H160, + zero_for_one: bool, + amount: U256, + limit_pt: I256, + calldata: Vec, + ) -> Bytes { + let input_tokens = vec![ + Token::Address(recipient), + Token::Uint(amount), + Token::Int(limit_pt.into_raw()), + Token::Bytes(calldata), + ]; + if zero_for_one { + IIZISWAPPOOL_ABI + .function("swapX2Y") + .unwrap() + .encode_input(&input_tokens) + .expect("Could not encode swap calldata") + } else { + IIZISWAPPOOL_ABI + .function("swapY2X") + .unwrap() + .encode_input(&input_tokens) + .expect("Could not encode swap calldata") + } + } +} + +#[cfg(test)] +mod test { + use crate::amm::{izumi::IziSwapPool, AutomatedMarketMaker}; + + #[allow(unused)] + use ethers::providers::Middleware; + + #[allow(unused)] + use ethers::{ + prelude::abigen, + providers::{Http, Provider}, + types::{H160, U256}, + }; + #[allow(unused)] + use std::error::Error; + #[allow(unused)] + use std::{str::FromStr, sync::Arc}; + abigen!( + IQuoter, + r#"[ + function quoteExactInputSingle(address tokenIn, address tokenOut,uint24 fee, uint256 amountIn, uint160 sqrtPriceLimitX96) external returns (uint256 amountOut) + ]"#;); + + #[tokio::test] + async fn test_get_new_from_address() { + let rpc_endpoint = std::env::var("ARBITRUM_MAINNET_ENDPOINT") + .expect("Could not get ETHEREUM_RPC_ENDPOINT"); + let middleware = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); + + let pool = IziSwapPool::new_from_address( + H160::from_str("0x6336e3F52d196b4f63eE512455237c934B3355eB").unwrap(), + 29420590, + middleware.clone(), + ) + .await + .unwrap(); + + assert_eq!( + pool.address, + H160::from_str("0x6336e3F52d196b4f63eE512455237c934B3355eB").unwrap() + ); + assert_eq!( + pool.token_a, + H160::from_str("0x82af49447d8a07e3bd95bd0d56f35241523fbab1").unwrap() + ); + assert_eq!(pool.token_a_decimals, 18); + assert_eq!( + pool.token_b, + H160::from_str("0xff970a61a04b1ca14834a43f5de4533ebddb5cc8").unwrap() + ); + assert_eq!(pool.token_b_decimals, 6); + assert_eq!(pool.fee, 2000); + assert_eq!(pool.point_delta, 40); + } + + #[tokio::test] + async fn test_get_pool_data() { + let rpc_endpoint = std::env::var("ARBITRUM_MAINNET_ENDPOINT") + .expect("Could not get ETHEREUM_RPC_ENDPOINT"); + let middleware = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); + + let mut pool = IziSwapPool::new_from_address( + H160::from_str("0x6336e3F52d196b4f63eE512455237c934B3355eB").unwrap(), + 29420590, + middleware.clone(), + ) + .await + .expect("Could not initialize pool"); + + let current_block = middleware.get_block_number().await.unwrap().as_u64(); + pool.populate_data(Some(current_block), middleware) + .await + .expect("Failed"); + + assert_eq!( + pool.address, + H160::from_str("0x6336e3F52d196b4f63eE512455237c934B3355eB").unwrap() + ); + assert_eq!( + pool.token_a, + H160::from_str("0x82af49447d8a07e3bd95bd0d56f35241523fbab1").unwrap() + ); + assert_eq!(pool.token_a_decimals, 18); + assert_eq!( + pool.token_b, + H160::from_str("0xff970a61a04b1ca14834a43f5de4533ebddb5cc8").unwrap() + ); + assert_eq!(pool.token_b_decimals, 6); + assert_eq!(pool.fee, 2000); + assert_eq!(pool.point_delta, 40); + assert!(pool.sqrt_price != U256::zero()); + } + + #[tokio::test] + async fn test_sync_pool() { + let rpc_endpoint = std::env::var("ARBITRUM_MAINNET_ENDPOINT") + .expect("Could not get ARBITRUM_MAINNET_ENDPOINT"); + let middleware = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); + + let mut pool = IziSwapPool::new_from_address( + H160::from_str("0x6336e3F52d196b4f63eE512455237c934B3355eB").unwrap(), + 29420590, + middleware.clone(), + ) + .await + .expect("Could not initialize pool"); + + dbg!(pool.address); + + pool.sync(middleware).await.expect("Could not sync pool"); + + //TODO: need to assert values + } + + // #[tokio::test] + // async fn test_calculate_price() { + // let rpc_endpoint = std::env::var("ARBITRUM_MAINNET_ENDPOINT") + // .expect("Could not get ETHEREUM_RPC_ENDPOINT"); + // let middleware = Arc::new(Provider::::try_from(rpc_endpoint).unwrap()); + + // let mut pool = IziSwapPool { + // address: H160::from_str("0x6336e3F52d196b4f63eE512455237c934B3355eB").unwrap(), + // ..Default::default() + // }; + + // pool.populate_data(None, middleware.clone()).await.unwrap(); + + // let sqrt_price = block_pool.slot_0().block(16515398).call().await.unwrap().0; + // pool.sqrt_price = sqrt_price; + // } +} diff --git a/src/amm/mod.rs b/src/amm/mod.rs index a49a6fd5..47fbba60 100644 --- a/src/amm/mod.rs +++ b/src/amm/mod.rs @@ -1,5 +1,6 @@ pub mod erc_4626; pub mod factory; +pub mod izumi; pub mod uniswap_v2; pub mod uniswap_v3; @@ -14,7 +15,10 @@ use serde::{Deserialize, Serialize}; use crate::errors::{ArithmeticError, DAMMError, EventLogError, SwapSimulationError}; -use self::{erc_4626::ERC4626Vault, uniswap_v2::UniswapV2Pool, uniswap_v3::UniswapV3Pool}; +use self::{ + erc_4626::ERC4626Vault, izumi::IziSwapPool, uniswap_v2::UniswapV2Pool, + uniswap_v3::UniswapV3Pool, +}; #[async_trait] pub trait AutomatedMarketMaker { @@ -44,6 +48,7 @@ pub enum AMM { UniswapV2Pool(UniswapV2Pool), UniswapV3Pool(UniswapV3Pool), ERC4626Vault(ERC4626Vault), + IziSwapPool(IziSwapPool), } #[async_trait] @@ -53,6 +58,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.address, AMM::UniswapV3Pool(pool) => pool.address, AMM::ERC4626Vault(vault) => vault.vault_token, + AMM::IziSwapPool(pool) => pool.address, } } @@ -61,6 +67,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.sync(middleware).await, AMM::UniswapV3Pool(pool) => pool.sync(middleware).await, AMM::ERC4626Vault(vault) => vault.sync(middleware).await, + AMM::IziSwapPool(pool) => pool.sync(middleware).await, } } @@ -69,6 +76,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.sync_on_event_signatures(), AMM::UniswapV3Pool(pool) => pool.sync_on_event_signatures(), AMM::ERC4626Vault(vault) => vault.sync_on_event_signatures(), + AMM::IziSwapPool(pool) => pool.sync_on_event_signatures(), } } @@ -77,6 +85,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.sync_from_log(log), AMM::UniswapV3Pool(pool) => pool.sync_from_log(log), AMM::ERC4626Vault(vault) => vault.sync_from_log(log), + AMM::IziSwapPool(pool) => pool.sync_from_log(log), } } @@ -85,6 +94,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.simulate_swap(token_in, amount_in), AMM::UniswapV3Pool(pool) => pool.simulate_swap(token_in, amount_in), AMM::ERC4626Vault(vault) => vault.simulate_swap(token_in, amount_in), + AMM::IziSwapPool(pool) => pool.simulate_swap(token_in, amount_in), } } @@ -97,6 +107,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.simulate_swap_mut(token_in, amount_in), AMM::UniswapV3Pool(pool) => pool.simulate_swap_mut(token_in, amount_in), AMM::ERC4626Vault(vault) => vault.simulate_swap_mut(token_in, amount_in), + AMM::IziSwapPool(pool) => pool.simulate_swap_mut(token_in, amount_in), } } @@ -105,6 +116,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.get_token_out(token_in), AMM::UniswapV3Pool(pool) => pool.get_token_out(token_in), AMM::ERC4626Vault(vault) => vault.get_token_out(token_in), + AMM::IziSwapPool(pool) => pool.get_token_out(token_in), } } @@ -117,6 +129,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.populate_data(None, middleware).await, AMM::UniswapV3Pool(pool) => pool.populate_data(block_number, middleware).await, AMM::ERC4626Vault(vault) => vault.populate_data(None, middleware).await, + AMM::IziSwapPool(pool) => pool.populate_data(block_number, middleware).await, } } @@ -125,6 +138,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.tokens(), AMM::UniswapV3Pool(pool) => pool.tokens(), AMM::ERC4626Vault(vault) => vault.tokens(), + AMM::IziSwapPool(pool) => pool.tokens(), } } @@ -133,6 +147,7 @@ impl AutomatedMarketMaker for AMM { AMM::UniswapV2Pool(pool) => pool.calculate_price(base_token), AMM::UniswapV3Pool(pool) => pool.calculate_price(base_token), AMM::ERC4626Vault(vault) => vault.calculate_price(base_token), + AMM::IziSwapPool(pool) => pool.calculate_price(base_token), } } } diff --git a/src/amm/uniswap_v3/mod.rs b/src/amm/uniswap_v3/mod.rs index 96efa9ee..95e27d0e 100644 --- a/src/amm/uniswap_v3/mod.rs +++ b/src/amm/uniswap_v3/mod.rs @@ -1108,7 +1108,7 @@ mod test { middleware: Arc, ) -> Result<(UniswapV3Pool, u64), DAMMError> { let mut pool = UniswapV3Pool { - address: H160::from_str("0x11950d141EcB863F01007AdD7D1A342041227b58").unwrap(), + address: H160::from_str("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640").unwrap(), ..Default::default() }; diff --git a/src/discovery/factory.rs b/src/discovery/factory.rs index 6bbce139..a9df9c3b 100644 --- a/src/discovery/factory.rs +++ b/src/discovery/factory.rs @@ -14,6 +14,7 @@ use crate::{ pub enum DiscoverableFactory { UniswapV2Factory, UniswapV3Factory, + IziSwapFactory, } impl DiscoverableFactory { @@ -26,6 +27,9 @@ impl DiscoverableFactory { DiscoverableFactory::UniswapV3Factory => { amm::uniswap_v3::factory::POOL_CREATED_EVENT_SIGNATURE } + DiscoverableFactory::IziSwapFactory => { + amm::izumi::factory::IZI_POOL_CREATED_EVENT_SIGNATURE + } } } } @@ -35,6 +39,7 @@ pub async fn discover_factories( factories: Vec, number_of_amms_threshold: u64, middleware: Arc, + step: u64, ) -> Result, DAMMError> { let spinner = Spinner::new(spinners::Dots, "Discovering new factories...", Color::Blue); @@ -54,7 +59,7 @@ pub async fn discover_factories( .as_u64(); //For each block within the range, get all pairs asynchronously - let step = 100000; + // let step = 100000; //Set up filter and events to filter each block you are searching by let mut identified_factories: HashMap = HashMap::new(); @@ -96,6 +101,13 @@ pub async fn discover_factories( .expect("Could not get block number from log") .as_u64(); } + Factory::IziSwapFactory(izi_swap_factory) => { + izi_swap_factory.address = log.address; + izi_swap_factory.creation_block = log + .block_number + .expect("Could not get block number from log") + .as_u64(); + } } identified_factories.insert(log.address, (factory, 0)); diff --git a/src/sync/checkpoint.rs b/src/sync/checkpoint.rs index c66a48ad..9f9647f5 100644 --- a/src/sync/checkpoint.rs +++ b/src/sync/checkpoint.rs @@ -14,6 +14,7 @@ use tokio::task::JoinHandle; use crate::{ amm::{ factory::{AutomatedMarketMakerFactory, Factory}, + izumi::factory::IziSwapFactory, uniswap_v2::factory::UniswapV2Factory, uniswap_v3::factory::UniswapV3Factory, AMM, @@ -188,6 +189,10 @@ pub async fn batch_sync_amms_from_checkpoint( ))), AMM::ERC4626Vault(_) => None, + AMM::IziSwapPool(_) => Some(Factory::IziSwapFactory(IziSwapFactory::new( + H160::zero(), + 0, + ))), }; //Spawn a new thread to get all pools and sync data for each dex @@ -216,12 +221,13 @@ pub fn sort_amms(amms: Vec) -> (Vec, Vec, Vec) { let mut uniswap_v2_pools = vec![]; let mut uniswap_v3_pools = vec![]; let mut erc_4626_vaults = vec![]; - + let mut izi_swap_pools = vec![]; for amm in amms { match amm { AMM::UniswapV2Pool(_) => uniswap_v2_pools.push(amm), AMM::UniswapV3Pool(_) => uniswap_v3_pools.push(amm), AMM::ERC4626Vault(_) => erc_4626_vaults.push(amm), + AMM::IziSwapPool(_) => izi_swap_pools.push(amm), } } diff --git a/src/sync/mod.rs b/src/sync/mod.rs index 330981c0..5236ae1c 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -1,7 +1,7 @@ use crate::{ amm::{ factory::{AutomatedMarketMakerFactory, Factory}, - uniswap_v2, uniswap_v3, AutomatedMarketMaker, AMM, + izumi, uniswap_v2, uniswap_v3, AutomatedMarketMaker, AMM, }, errors::DAMMError, }; @@ -129,6 +129,18 @@ pub async fn populate_amms( amm.populate_data(None, middleware.clone()).await?; } } + + AMM::IziSwapPool(_) => { + let step = 120; //Max batch size for call + for amm_chunk in amms.chunks_mut(step) { + izumi::batch_request::get_amm_data_batch_request( + amm_chunk, + block_number, + middleware.clone(), + ) + .await?; + } + } } } else { return Err(DAMMError::IncongruentAMMs); @@ -158,6 +170,11 @@ pub fn remove_empty_amms(amms: Vec) -> Vec { cleaned_amms.push(amm) } } + AMM::IziSwapPool(ref izi_swap_pool) => { + if !izi_swap_pool.token_a.is_zero() && !izi_swap_pool.token_b.is_zero() { + cleaned_amms.push(amm) + } + } } }