Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
493123 | 13 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
FluidDexResolver
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { AddressCalcs } from "../../../libraries/addressCalcs.sol"; import { DexSlotsLink } from "../../../libraries/dexSlotsLink.sol"; import { DexCalcs } from "../../../libraries/dexCalcs.sol"; import { BigMathMinified } from "../../../libraries/bigMathMinified.sol"; import { BytesSliceAndConcat } from "../../../libraries/bytesSliceAndConcat.sol"; import { IFluidDexT1 } from "../../../protocols/dex/interfaces/iDexT1.sol"; import { Structs as FluidLiquidityResolverStructs } from "../liquidity/structs.sol"; import { Structs } from "./structs.sol"; import { Variables } from "./variables.sol"; /// @title DexFactoryViews /// @notice Abstract contract providing view functions for DEX factory-related operations abstract contract DexFactoryViews is Variables { /// @notice Get the address of a DEX given its ID /// @param dexId_ The ID of the DEX /// @return dex_ The address of the DEX function getDexAddress(uint256 dexId_) public view returns (address dex_) { return AddressCalcs.addressCalc(address(FACTORY), dexId_); } /// @notice Get the ID of a DEX given its address /// @param dex_ The address of the DEX /// @return id_ The ID of the DEX function getDexId(address dex_) public view returns (uint id_) { id_ = IFluidDexT1(dex_).DEX_ID(); } /// @notice Get the total number of DEXes /// @return The total number of DEXes function getTotalDexes() public view returns (uint) { return FACTORY.totalDexes(); } /// @notice Get an array of all DEX addresses /// @return dexes_ An array containing all DEX addresses function getAllDexAddresses() public view returns (address[] memory dexes_) { uint totalDexes_ = getTotalDexes(); dexes_ = new address[](totalDexes_); for (uint i = 0; i < totalDexes_; i++) { dexes_[i] = getDexAddress((i + 1)); } } } /// @title DexStorageVars /// @notice Abstract contract providing view functions for DEX storage variables abstract contract DexStorageVars is Variables { /// @notice Get the raw DEX variables /// @param dex_ The address of the DEX /// @return The raw DEX variables function getDexVariablesRaw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_VARIABLES_SLOT)); } /// @notice Get the raw DEX variables2 /// @param dex_ The address of the DEX /// @return The raw DEX variables2 function getDexVariables2Raw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_VARIABLES2_SLOT)); } /// @notice Get the total supply shares slot data of a DEX /// @param dex_ The address of the DEX /// @return The total supply shares function getTotalSupplySharesRaw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_TOTAL_SUPPLY_SHARES_SLOT)); } /// @notice Get the raw user supply data for a specific user and DEX /// @param dex_ The address of the DEX /// @param user_ The address of the user /// @return The raw user supply data function getUserSupplyDataRaw(address dex_, address user_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage( DexSlotsLink.calculateMappingStorageSlot(DexSlotsLink.DEX_USER_SUPPLY_MAPPING_SLOT, user_) ); } /// @notice Get the total borrow shares slot data of a DEX /// @param dex_ The address of the DEX /// @return The total borrow shares function getTotalBorrowSharesRaw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_TOTAL_BORROW_SHARES_SLOT)); } /// @notice Get the raw user borrow data for a specific user and DEX /// @param dex_ The address of the DEX /// @param user_ The address of the user /// @return The raw user borrow data function getUserBorrowDataRaw(address dex_, address user_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage( DexSlotsLink.calculateMappingStorageSlot(DexSlotsLink.DEX_USER_BORROW_MAPPING_SLOT, user_) ); } /// @notice Get the raw oracle data for a specific DEX and index /// @param dex_ The address of the DEX /// @param index_ The index of the oracle data /// @return The raw oracle data function getOracleRaw(address dex_, uint index_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage( _calculateStorageSlotUintMapping(DexSlotsLink.DEX_ORACLE_MAPPING_SLOT, index_) ); } /// @notice Get the raw range shift for a DEX /// @param dex_ The address of the DEX /// @return The raw range shift function getRangeShiftRaw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_RANGE_THRESHOLD_SHIFTS_SLOT)) & type(uint128).max; } /// @notice Get the raw threshold shift for a DEX /// @param dex_ The address of the DEX /// @return The raw threshold shift function getThresholdShiftRaw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_RANGE_THRESHOLD_SHIFTS_SLOT)) >> 128; } /// @notice Get the raw center price shift for a DEX /// @param dex_ The address of the DEX /// @return The raw center price shift function getCenterPriceShiftRaw(address dex_) public view returns (uint) { return IFluidDexT1(dex_).readFromStorage(bytes32(DexSlotsLink.DEX_CENTER_PRICE_SHIFT_SLOT)); } /// @dev Calculate the storage slot for a uint mapping /// @param slot_ The base slot of the mapping /// @param key_ The key of the mapping /// @return The calculated storage slot function _calculateStorageSlotUintMapping(uint256 slot_, uint key_) internal pure returns (bytes32) { return keccak256(abi.encode(key_, slot_)); } } abstract contract DexActionEstimates { address private constant ADDRESS_DEAD = 0x000000000000000000000000000000000000dEaD; /// @notice estimates swap IN tokens execution /// @param dex_ Dex pool /// @param swap0to1_ Direction of swap. If true, swaps token0 for token1; if false, swaps token1 for token0 /// @param amountIn_ The exact amount of input tokens to swap /// @param amountOutMin_ The minimum amount of output tokens the user is willing to accept /// @return amountOut_ The amount of output tokens received from the swap function estimateSwapIn( address dex_, bool swap0to1_, uint256 amountIn_, uint256 amountOutMin_ ) public payable returns (uint256 amountOut_) { try IFluidDexT1(dex_).swapIn{ value: msg.value }(swap0to1_, amountIn_, amountOutMin_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (amountOut_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexSwapResult.selector); } } /// @notice estimates swap OUT tokens execution /// @param dex_ Dex pool /// @param swap0to1_ Direction of swap. If true, swaps token0 for token1; if false, swaps token1 for token0 /// @param amountOut_ The exact amount of tokens to receive after swap /// @param amountInMax_ Maximum amount of tokens to swap in /// @return amountIn_ The amount of input tokens used for the swap function estimateSwapOut( address dex_, bool swap0to1_, uint256 amountOut_, uint256 amountInMax_ ) public payable returns (uint256 amountIn_) { try IFluidDexT1(dex_).swapOut{ value: msg.value }(swap0to1_, amountOut_, amountInMax_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (amountIn_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexSwapResult.selector); } } /// @dev Estimate deposit tokens in equal proportion to the current pool ratio /// @param dex_ The address of the DEX contract /// @param shares_ The number of shares to mint /// @param maxToken0Deposit_ Maximum amount of token0 to deposit /// @param maxToken1Deposit_ Maximum amount of token1 to deposit /// @return token0Amt_ Estimated amount of token0 to deposit /// @return token1Amt_ Estimated amount of token1 to deposit function estimateDepositPerfect( address dex_, uint shares_, uint maxToken0Deposit_, uint maxToken1Deposit_ ) public payable returns (uint token0Amt_, uint token1Amt_) { try IFluidDexT1(dex_).depositPerfect{ value: msg.value }(shares_, maxToken0Deposit_, maxToken1Deposit_, true) {} catch (bytes memory lowLevelData_) { (token0Amt_, token1Amt_) = _decodeLowLevelUint2x( lowLevelData_, IFluidDexT1.FluidDexPerfectLiquidityOutput.selector ); } } /// @dev Estimate withdrawal of a perfect amount of collateral liquidity /// @param dex_ The address of the DEX contract /// @param shares_ The number of shares to withdraw /// @param minToken0Withdraw_ The minimum amount of token0 the user is willing to accept /// @param minToken1Withdraw_ The minimum amount of token1 the user is willing to accept /// @return token0Amt_ Estimated amount of token0 to be withdrawn /// @return token1Amt_ Estimated amount of token1 to be withdrawn function estimateWithdrawPerfect( address dex_, uint shares_, uint minToken0Withdraw_, uint minToken1Withdraw_ ) public returns (uint token0Amt_, uint token1Amt_) { try IFluidDexT1(dex_).withdrawPerfect(shares_, minToken0Withdraw_, minToken1Withdraw_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (token0Amt_, token1Amt_) = _decodeLowLevelUint2x( lowLevelData_, IFluidDexT1.FluidDexPerfectLiquidityOutput.selector ); } } /// @dev Estimate borrowing tokens in equal proportion to the current debt pool ratio /// @param dex_ The address of the DEX contract /// @param shares_ The number of shares to borrow /// @param minToken0Borrow_ Minimum amount of token0 to borrow /// @param minToken1Borrow_ Minimum amount of token1 to borrow /// @return token0Amt_ Estimated amount of token0 to be borrowed /// @return token1Amt_ Estimated amount of token1 to be borrowed function estimateBorrowPerfect( address dex_, uint shares_, uint minToken0Borrow_, uint minToken1Borrow_ ) public returns (uint token0Amt_, uint token1Amt_) { try IFluidDexT1(dex_).borrowPerfect(shares_, minToken0Borrow_, minToken1Borrow_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (token0Amt_, token1Amt_) = _decodeLowLevelUint2x( lowLevelData_, IFluidDexT1.FluidDexPerfectLiquidityOutput.selector ); } } /// @dev Estimate paying back borrowed tokens in equal proportion to the current debt pool ratio /// @param dex_ The address of the DEX contract /// @param shares_ The number of shares to pay back /// @param maxToken0Payback_ Maximum amount of token0 to pay back /// @param maxToken1Payback_ Maximum amount of token1 to pay back /// @return token0Amt_ Estimated amount of token0 to be paid back /// @return token1Amt_ Estimated amount of token1 to be paid back function estimatePaybackPerfect( address dex_, uint shares_, uint maxToken0Payback_, uint maxToken1Payback_ ) public payable returns (uint token0Amt_, uint token1Amt_) { try IFluidDexT1(dex_).paybackPerfect{ value: msg.value }(shares_, maxToken0Payback_, maxToken1Payback_, true) {} catch (bytes memory lowLevelData_) { (token0Amt_, token1Amt_) = _decodeLowLevelUint2x( lowLevelData_, IFluidDexT1.FluidDexPerfectLiquidityOutput.selector ); } } /// @dev Estimate deposit of tokens /// @param dex_ The address of the DEX contract /// @param token0Amt_ Amount of token0 to deposit /// @param token1Amt_ Amount of token1 to deposit /// @param minSharesAmt_ Minimum amount of shares to receive /// @return shares_ Estimated amount of shares to be minted function estimateDeposit( address dex_, uint token0Amt_, uint token1Amt_, uint minSharesAmt_ ) public payable returns (uint shares_) { try IFluidDexT1(dex_).deposit{ value: msg.value }(token0Amt_, token1Amt_, minSharesAmt_, true) {} catch ( bytes memory lowLevelData_ ) { (shares_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexLiquidityOutput.selector); } } /// @dev Estimate withdrawal of tokens /// @param dex_ The address of the DEX contract /// @param token0Amt_ Amount of token0 to withdraw /// @param token1Amt_ Amount of token1 to withdraw /// @param maxSharesAmt_ Maximum amount of shares to burn /// @return shares_ Estimated amount of shares to be burned function estimateWithdraw( address dex_, uint token0Amt_, uint token1Amt_, uint maxSharesAmt_ ) public returns (uint shares_) { try IFluidDexT1(dex_).withdraw(token0Amt_, token1Amt_, maxSharesAmt_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (shares_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexLiquidityOutput.selector); } } /// @dev Estimate borrowing of tokens /// @param dex_ The address of the DEX contract /// @param token0Amt_ Amount of token0 to borrow /// @param token1Amt_ Amount of token1 to borrow /// @param maxSharesAmt_ Maximum amount of shares to mint /// @return shares_ Estimated amount of shares to be minted function estimateBorrow( address dex_, uint token0Amt_, uint token1Amt_, uint maxSharesAmt_ ) public returns (uint shares_) { try IFluidDexT1(dex_).borrow(token0Amt_, token1Amt_, maxSharesAmt_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (shares_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexLiquidityOutput.selector); } } /// @dev Estimate paying back of borrowed tokens /// @param dex_ The address of the DEX contract /// @param token0Amt_ Amount of token0 to pay back /// @param token1Amt_ Amount of token1 to pay back /// @param minSharesAmt_ Minimum amount of shares to burn /// @return shares_ Estimated amount of shares to be burned function estimatePayback( address dex_, uint token0Amt_, uint token1Amt_, uint minSharesAmt_ ) public payable returns (uint shares_) { try IFluidDexT1(dex_).payback{ value: msg.value }(token0Amt_, token1Amt_, minSharesAmt_, true) {} catch ( bytes memory lowLevelData_ ) { (shares_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexLiquidityOutput.selector); } } /// @dev Estimate withdrawal of a perfect amount of collateral liquidity in one token /// @param dex_ The address of the DEX contract /// @param shares_ The number of shares to withdraw /// @param minToken0_ The minimum amount of token0 the user is willing to accept /// @param minToken1_ The minimum amount of token1 the user is willing to accept /// @return withdrawAmt_ Estimated amount of tokens to be withdrawn function estimateWithdrawPerfectInOneToken( address dex_, uint shares_, uint minToken0_, uint minToken1_ ) public returns (uint withdrawAmt_) { try IFluidDexT1(dex_).withdrawPerfectInOneToken(shares_, minToken0_, minToken1_, ADDRESS_DEAD) {} catch ( bytes memory lowLevelData_ ) { (withdrawAmt_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexSingleTokenOutput.selector); } } /// @dev Estimate paying back of a perfect amount of borrowed tokens in one token /// @param dex_ The address of the DEX contract /// @param shares_ The number of shares to pay back /// @param maxToken0_ Maximum amount of token0 to pay back /// @param maxToken1_ Maximum amount of token1 to pay back /// @return paybackAmt_ Estimated amount of tokens to be paid back function estimatePaybackPerfectInOneToken( address dex_, uint shares_, uint maxToken0_, uint maxToken1_ ) public payable returns (uint paybackAmt_) { try IFluidDexT1(dex_).paybackPerfectInOneToken{ value: msg.value }(shares_, maxToken0_, maxToken1_, true) {} catch (bytes memory lowLevelData_) { (paybackAmt_) = _decodeLowLevelUint1x(lowLevelData_, IFluidDexT1.FluidDexSingleTokenOutput.selector); } } function _decodeLowLevelUint2x( bytes memory lowLevelData_, bytes4 targetErrorSelector_ ) internal pure returns (uint value1_, uint value2_) { if (lowLevelData_.length < 68) { return (0, 0); } bytes4 errorSelector_; assembly { // Extract the selector from the error data errorSelector_ := mload(add(lowLevelData_, 0x20)) } if (errorSelector_ == targetErrorSelector_) { assembly { value1_ := mload(add(lowLevelData_, 36)) value2_ := mload(add(lowLevelData_, 68)) } } // else => values remain 0 } function _decodeLowLevelUint1x( bytes memory lowLevelData_, bytes4 targetErrorSelector_ ) internal pure returns (uint value1_) { if (lowLevelData_.length < 36) { return 0; } bytes4 errorSelector_; assembly { // Extract the selector from the error data errorSelector_ := mload(add(lowLevelData_, 0x20)) } if (errorSelector_ == targetErrorSelector_) { assembly { value1_ := mload(add(lowLevelData_, 36)) } } // else => values remain 0 } } abstract contract DexConstantsViews { /// @notice returns all Dex constants function getDexConstantsView(address dex_) public view returns (IFluidDexT1.ConstantViews memory constantsView_) { return IFluidDexT1(dex_).constantsView(); } /// @notice returns all Dex constants 2 function getDexConstantsView2( address dex_ ) public view returns (IFluidDexT1.ConstantViews2 memory constantsView2_) { return IFluidDexT1(dex_).constantsView2(); } /// @notice Get the addresses of the tokens in a DEX /// @param dex_ The address of the DEX /// @return token0_ The address of token0 in the DEX /// @return token1_ The address of token1 in the DEX function getDexTokens(address dex_) public view returns (address token0_, address token1_) { IFluidDexT1.ConstantViews memory constantsView_ = IFluidDexT1(dex_).constantsView(); return (constantsView_.token0, constantsView_.token1); } } abstract contract DexPublicViews is DexStorageVars, DexConstantsViews { /// @notice Get the prices and exchange prices for a DEX /// @param dex_ The address of the DEX /// @return pex_ A struct containing prices and exchange prices /// @dev expected to be called via callStatic function getDexPricesAndExchangePrices( address dex_ ) public returns (IFluidDexT1.PricesAndExchangePrice memory pex_) { try IFluidDexT1(dex_).getPricesAndExchangePrices() {} catch (bytes memory lowLevelData_) { bytes4 errorSelector_; assembly { // Extract the selector from the error data errorSelector_ := mload(add(lowLevelData_, 0x20)) } if (errorSelector_ == IFluidDexT1.FluidDexPricesAndExchangeRates.selector) { pex_ = abi.decode( BytesSliceAndConcat.bytesSlice(lowLevelData_, 4, lowLevelData_.length - 4), (IFluidDexT1.PricesAndExchangePrice) ); } } } /// @notice Get the collateral reserves for a DEX /// @param dex_ The address of the DEX /// @return reserves_ A struct containing collateral reserve information /// @dev expected to be called via callStatic function getDexCollateralReserves(address dex_) public returns (IFluidDexT1.CollateralReserves memory reserves_) { return _getDexCollateralReserves(dex_, getDexConstantsView2(dex_)); } /// @notice Get the debt reserves for a DEX /// @param dex_ The address of the DEX /// @return reserves_ A struct containing debt reserve information /// @dev expected to be called via callStatic function getDexDebtReserves(address dex_) public returns (IFluidDexT1.DebtReserves memory reserves_) { return _getDexDebtReserves(dex_, getDexConstantsView2(dex_)); } /// @notice get Dex oracle price TWAP data /// @param secondsAgos_ array of seconds ago for which TWAP is needed. If user sends [10, 30, 60] then twaps_ will return [10-0, 30-10, 60-30] /// @return twaps_ twap price, lowest price (aka minima) & highest price (aka maxima) between secondsAgo checkpoints /// @return currentPrice_ price of pool after the most recent swap function getDexOraclePrice( address dex_, uint[] memory secondsAgos_ ) external view returns (IFluidDexT1.Oracle[] memory twaps_, uint currentPrice_) { return IFluidDexT1(dex_).oraclePrice(secondsAgos_); } /// @dev Get the collateral reserves for a DEX scaled to token decimals function _getDexCollateralReserves( address dex_, IFluidDexT1.ConstantViews2 memory constantsView2_ ) internal returns (IFluidDexT1.CollateralReserves memory reserves_) { uint256 dexVariables2_ = getDexVariables2Raw(dex_); if ((dexVariables2_ & 1) != 1) { // smart col not enabled return IFluidDexT1.CollateralReserves(0, 0, 0, 0); } try this.getDexPricesAndExchangePrices(dex_) returns (IFluidDexT1.PricesAndExchangePrice memory pex_) { try IFluidDexT1(dex_).getCollateralReserves( pex_.geometricMean, pex_.upperRange, pex_.lowerRange, pex_.supplyToken0ExchangePrice, pex_.supplyToken1ExchangePrice ) returns (IFluidDexT1.CollateralReserves memory colReserves_) { // returned reserves are in 1e12 decimals -> normalize to token decimals reserves_.token0RealReserves = (colReserves_.token0RealReserves * constantsView2_.token0DenominatorPrecision) / constantsView2_.token0NumeratorPrecision; reserves_.token0ImaginaryReserves = (colReserves_.token0ImaginaryReserves * constantsView2_.token0DenominatorPrecision) / constantsView2_.token0NumeratorPrecision; reserves_.token1RealReserves = (colReserves_.token1RealReserves * constantsView2_.token1DenominatorPrecision) / constantsView2_.token1NumeratorPrecision; reserves_.token1ImaginaryReserves = (colReserves_.token1ImaginaryReserves * constantsView2_.token1DenominatorPrecision) / constantsView2_.token1NumeratorPrecision; } catch { reserves_ = IFluidDexT1.CollateralReserves(0, 0, 0, 0); } } catch { reserves_ = IFluidDexT1.CollateralReserves(0, 0, 0, 0); } } /// @dev Get the debt reserves for a DEX scaled to token decimals function _getDexDebtReserves( address dex_, IFluidDexT1.ConstantViews2 memory constantsView2_ ) internal returns (IFluidDexT1.DebtReserves memory reserves_) { uint256 dexVariables2_ = getDexVariables2Raw(dex_); if ((dexVariables2_ & 2) != 2) { // smart debt not enabled return IFluidDexT1.DebtReserves(0, 0, 0, 0, 0, 0); } try this.getDexPricesAndExchangePrices(dex_) returns (IFluidDexT1.PricesAndExchangePrice memory pex_) { try IFluidDexT1(dex_).getDebtReserves( pex_.geometricMean, pex_.upperRange, pex_.lowerRange, pex_.borrowToken0ExchangePrice, pex_.borrowToken1ExchangePrice ) returns (IFluidDexT1.DebtReserves memory debtReserves_) { // returned reserves are in 1e12 decimals -> normalize to token decimals reserves_.token0Debt = (debtReserves_.token0Debt * constantsView2_.token0DenominatorPrecision) / constantsView2_.token0NumeratorPrecision; reserves_.token0RealReserves = (debtReserves_.token0RealReserves * constantsView2_.token0DenominatorPrecision) / constantsView2_.token0NumeratorPrecision; reserves_.token0ImaginaryReserves = (debtReserves_.token0ImaginaryReserves * constantsView2_.token0DenominatorPrecision) / constantsView2_.token0NumeratorPrecision; reserves_.token1Debt = (debtReserves_.token1Debt * constantsView2_.token1DenominatorPrecision) / constantsView2_.token1NumeratorPrecision; reserves_.token1RealReserves = (debtReserves_.token1RealReserves * constantsView2_.token1DenominatorPrecision) / constantsView2_.token1NumeratorPrecision; reserves_.token1ImaginaryReserves = (debtReserves_.token1ImaginaryReserves * constantsView2_.token1DenominatorPrecision) / constantsView2_.token1NumeratorPrecision; } catch { reserves_ = IFluidDexT1.DebtReserves(0, 0, 0, 0, 0, 0); } } catch { reserves_ = IFluidDexT1.DebtReserves(0, 0, 0, 0, 0, 0); } } } abstract contract DexUserViews is Variables, Structs, DexConstantsViews, DexPublicViews { /// @notice Get user supply data for a specific DEX and user /// @param dex_ The address of the DEX /// @param user_ The address of the user /// @return userSupplyData_ Struct containing user supply data function getUserSupplyData( address dex_, address user_ ) public view returns (UserSupplyData memory userSupplyData_) { uint256 userSupply_ = getUserSupplyDataRaw(dex_, user_); if (userSupply_ > 0) { // if userSupply_ == 0 -> user not configured yet userSupplyData_.isAllowed = userSupply_ & 1 == 1; userSupplyData_.supply = BigMathMinified.fromBigNumber( (userSupply_ >> DexSlotsLink.BITS_USER_SUPPLY_AMOUNT) & DexCalcs.X64, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); // get updated expanded withdrawal limit userSupplyData_.withdrawalLimit = DexCalcs.calcWithdrawalLimitBeforeOperate( userSupply_, userSupplyData_.supply ); userSupplyData_.lastUpdateTimestamp = (userSupply_ >> DexSlotsLink.BITS_USER_SUPPLY_LAST_UPDATE_TIMESTAMP) & DexCalcs.X33; userSupplyData_.expandPercent = (userSupply_ >> DexSlotsLink.BITS_USER_SUPPLY_EXPAND_PERCENT) & DexCalcs.X14; userSupplyData_.expandDuration = (userSupply_ >> DexSlotsLink.BITS_USER_SUPPLY_EXPAND_DURATION) & DexCalcs.X24; userSupplyData_.baseWithdrawalLimit = BigMathMinified.fromBigNumber( (userSupply_ >> DexSlotsLink.BITS_USER_SUPPLY_BASE_WITHDRAWAL_LIMIT) & DexCalcs.X18, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); userSupplyData_.withdrawableUntilLimit = userSupplyData_.supply > userSupplyData_.withdrawalLimit ? userSupplyData_.supply - userSupplyData_.withdrawalLimit : 0; userSupplyData_.withdrawable = userSupplyData_.withdrawableUntilLimit; (address token0_, address token1_) = getDexTokens(dex_); (userSupplyData_.liquidityUserSupplyDataToken0, userSupplyData_.liquidityTokenData0) = LIQUIDITY_RESOLVER .getUserSupplyData(dex_, token0_); (userSupplyData_.liquidityUserSupplyDataToken1, userSupplyData_.liquidityTokenData1) = LIQUIDITY_RESOLVER .getUserSupplyData(dex_, token1_); } } /// @notice Get user supply data for multiple users in a specific DEX /// @param dex_ The address of the DEX /// @param users_ Array of user addresses /// @return userSuppliesData_ Array of UserSupplyData structs for each user function getUserSupplyDatas( address dex_, address[] calldata users_ ) public view returns (UserSupplyData[] memory userSuppliesData_) { uint256 length_ = users_.length; userSuppliesData_ = new UserSupplyData[](length_); for (uint256 i; i < length_; i++) { (userSuppliesData_[i]) = getUserSupplyData(dex_, users_[i]); } } /// @notice Get user borrow data for a specific DEX and user /// @param dex_ The address of the DEX /// @param user_ The address of the user /// @return userBorrowData_ Struct containing user borrow data function getUserBorrowData( address dex_, address user_ ) public view returns (UserBorrowData memory userBorrowData_) { uint256 userBorrow_ = getUserBorrowDataRaw(dex_, user_); if (userBorrow_ > 0) { // if userBorrow_ == 0 -> user not configured yet userBorrowData_.isAllowed = userBorrow_ & 1 == 1; userBorrowData_.borrow = BigMathMinified.fromBigNumber( (userBorrow_ >> DexSlotsLink.BITS_USER_BORROW_AMOUNT) & DexCalcs.X64, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); // get updated expanded borrow limit userBorrowData_.borrowLimit = DexCalcs.calcBorrowLimitBeforeOperate(userBorrow_, userBorrowData_.borrow); userBorrowData_.lastUpdateTimestamp = (userBorrow_ >> DexSlotsLink.BITS_USER_BORROW_LAST_UPDATE_TIMESTAMP) & DexCalcs.X33; userBorrowData_.expandPercent = (userBorrow_ >> DexSlotsLink.BITS_USER_BORROW_EXPAND_PERCENT) & DexCalcs.X14; userBorrowData_.expandDuration = (userBorrow_ >> DexSlotsLink.BITS_USER_BORROW_EXPAND_DURATION) & DexCalcs.X24; userBorrowData_.baseBorrowLimit = BigMathMinified.fromBigNumber( (userBorrow_ >> DexSlotsLink.BITS_USER_BORROW_BASE_BORROW_LIMIT) & DexCalcs.X18, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); userBorrowData_.maxBorrowLimit = BigMathMinified.fromBigNumber( (userBorrow_ >> DexSlotsLink.BITS_USER_BORROW_MAX_BORROW_LIMIT) & DexCalcs.X18, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); userBorrowData_.borrowableUntilLimit = userBorrowData_.borrowLimit > userBorrowData_.borrow ? userBorrowData_.borrowLimit - userBorrowData_.borrow : 0; userBorrowData_.borrowable = userBorrowData_.borrowableUntilLimit; (address token0_, address token1_) = getDexTokens(dex_); (userBorrowData_.liquidityUserBorrowDataToken0, userBorrowData_.liquidityTokenData0) = LIQUIDITY_RESOLVER .getUserBorrowData(dex_, token0_); (userBorrowData_.liquidityUserBorrowDataToken1, userBorrowData_.liquidityTokenData1) = LIQUIDITY_RESOLVER .getUserBorrowData(dex_, token1_); } } /// @notice Get user borrow data for multiple users in a specific DEX /// @param dex_ The address of the DEX /// @param users_ Array of user addresses /// @return userBorrowingsData_ Array of UserBorrowData structs for each user function getUserBorrowDatas( address dex_, address[] calldata users_ ) public view returns (UserBorrowData[] memory userBorrowingsData_) { uint256 length_ = users_.length; userBorrowingsData_ = new UserBorrowData[](length_); for (uint256 i; i < length_; i++) { (userBorrowingsData_[i]) = getUserBorrowData(dex_, users_[i]); } } /// @notice Get both user supply and borrow data for multiple users in a specific DEX /// @param dex_ The address of the DEX /// @param users_ Array of user addresses /// @return userSuppliesData_ Array of UserSupplyData structs for each user /// @return userBorrowingsData_ Array of UserBorrowData structs for each user function getUserBorrowSupplyDatas( address dex_, address[] calldata users_ ) public view returns (UserSupplyData[] memory userSuppliesData_, UserBorrowData[] memory userBorrowingsData_) { uint256 length_ = users_.length; userSuppliesData_ = new UserSupplyData[](length_); userBorrowingsData_ = new UserBorrowData[](length_); for (uint256 i; i < length_; i++) { (userSuppliesData_[i]) = getUserSupplyData(dex_, users_[i]); (userBorrowingsData_[i]) = getUserBorrowData(dex_, users_[i]); } } } /// @notice Fluid Dex protocol resolver /// Implements various view-only methods to give easy access to Dex protocol data. contract FluidDexResolver is Variables, DexFactoryViews, DexActionEstimates, DexUserViews { constructor( address factory_, address liquidity_, address liquidityResolver_, address deployer_ ) Variables(factory_, liquidity_, liquidityResolver_, deployer_) {} /// @notice Get the current state of a DEX /// @param dex_ The address of the DEX /// @return state_ A struct containing the current state of the DEX /// @dev expected to be called via callStatic function getDexState(address dex_) public returns (DexState memory state_) { return _getDexState(dex_, getDexCollateralReserves(dex_), getDexDebtReserves(dex_)); } /// @notice Get the current configurations of a DEX /// @param dex_ The address of the DEX /// @return configs_ A struct containing the current configurations of the DEX function getDexConfigs(address dex_) public view returns (Configs memory configs_) { uint256 dexVariables2_ = getDexVariables2Raw(dex_); configs_.isSmartCollateralEnabled = (dexVariables2_ & 1) == 1; configs_.isSmartDebtEnabled = (dexVariables2_ & 2) == 2; configs_.fee = (dexVariables2_ >> 2) & X17; configs_.revenueCut = (dexVariables2_ >> 19) & X7; configs_.upperRange = (dexVariables2_ >> 27) & X20; configs_.lowerRange = (dexVariables2_ >> 47) & X20; configs_.upperShiftThreshold = (dexVariables2_ >> 68) & X10; configs_.lowerShiftThreshold = (dexVariables2_ >> 78) & X10; configs_.shiftingTime = (dexVariables2_ >> 88) & X24; configs_.maxSupplyShares = getTotalSupplySharesRaw(dex_) >> 128; configs_.maxBorrowShares = getTotalBorrowSharesRaw(dex_) >> 128; uint256 addressNonce_ = (dexVariables2_ >> 112) & X30; if (addressNonce_ > 0) { configs_.centerPriceAddress = AddressCalcs.addressCalc(DEPLOYER_CONTRACT, addressNonce_); } addressNonce_ = (dexVariables2_ >> 142) & X30; if (addressNonce_ > 0) { configs_.hookAddress = AddressCalcs.addressCalc(DEPLOYER_CONTRACT, addressNonce_); } configs_.maxCenterPrice = BigMathMinified.fromBigNumber( (dexVariables2_ >> 172) & X28, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); configs_.minCenterPrice = BigMathMinified.fromBigNumber( (dexVariables2_ >> 200) & X28, DexCalcs.DEFAULT_EXPONENT_SIZE, DexCalcs.DEFAULT_EXPONENT_MASK ); configs_.utilizationLimitToken0 = (dexVariables2_ >> 228) & X10; configs_.utilizationLimitToken1 = (dexVariables2_ >> 238) & X10; } /// @notice Get the swap limits and availability for a DEX /// @param dex_ The address of the DEX /// @return limitsAndAvailability_ A struct containing the swap limits and availability for the DEX function getDexSwapLimitsAndAvailability( address dex_ ) public view returns (SwapLimitsAndAvailability memory limitsAndAvailability_) { (address token0_, address token1_) = getDexTokens(dex_); uint256 dexVariables2_ = getDexVariables2Raw(dex_); uint256 utilizationLimitToken0_ = (dexVariables2_ >> 228) & X10; uint256 utilizationLimitToken1_ = (dexVariables2_ >> 238) & X10; return _getDexSwapLimitsAndAvailability(dex_, token0_, token1_, utilizationLimitToken0_, utilizationLimitToken1_); } /// @notice Get the entire data for a DEX /// @param dex_ The address of the DEX /// @return data_ A struct containing all the data for the DEX /// @dev expected to be called via callStatic function getDexEntireData(address dex_) public returns (DexEntireData memory data_) { data_.dex = dex_; data_.constantViews = getDexConstantsView(dex_); data_.constantViews2 = getDexConstantsView2(dex_); data_.configs = getDexConfigs(dex_); data_.pex = getDexPricesAndExchangePrices(dex_); data_.colReserves = _getDexCollateralReserves(dex_, data_.constantViews2); data_.debtReserves = _getDexDebtReserves(dex_, data_.constantViews2); data_.dexState = _getDexState(dex_, data_.colReserves, data_.debtReserves); data_.limitsAndAvailability = _getDexSwapLimitsAndAvailability( dex_, data_.constantViews.token0, data_.constantViews.token1, data_.configs.utilizationLimitToken0, data_.configs.utilizationLimitToken1 ); } /// @notice Get the entire data for multiple DEXes /// @param dexes_ An array of DEX addresses /// @return datas_ An array of structs containing all the data for each DEX /// @dev expected to be called via callStatic function getDexEntireDatas(address[] memory dexes_) public returns (DexEntireData[] memory datas_) { uint256 length_ = dexes_.length; datas_ = new DexEntireData[](length_); for (uint256 i; i < length_; i++) { datas_[i] = getDexEntireData(dexes_[i]); } } /// @notice Get the entire data for all DEXes /// @return datas_ An array of structs containing all the data for all DEXes /// @dev expected to be called via callStatic function getAllDexEntireDatas() external returns (DexEntireData[] memory datas_) { return getDexEntireDatas(getAllDexAddresses()); } /// @dev get the swap limits and availability for a DEX /// @param dex_ The address of the DEX /// @param token0_ The address of token0 /// @param token1_ The address of token1 /// @param utilizationLimitToken0Percent_ The utilization limit percentage for token0 /// @param utilizationLimitToken1Percent_ The utilization limit percentage for token1 /// @return limitsAndAvailability_ A struct containing the swap limits and availability for the DEX function _getDexSwapLimitsAndAvailability( address dex_, address token0_, address token1_, uint256 utilizationLimitToken0Percent_, uint256 utilizationLimitToken1Percent_ ) internal view returns (SwapLimitsAndAvailability memory limitsAndAvailability_) { ( limitsAndAvailability_.liquidityUserSupplyDataToken0, limitsAndAvailability_.liquidityTokenData0 ) = LIQUIDITY_RESOLVER.getUserSupplyData(dex_, token0_); ( limitsAndAvailability_.liquidityUserSupplyDataToken1, limitsAndAvailability_.liquidityTokenData1 ) = LIQUIDITY_RESOLVER.getUserSupplyData(dex_, token1_); (limitsAndAvailability_.liquidityUserBorrowDataToken0, ) = LIQUIDITY_RESOLVER.getUserBorrowData(dex_, token0_); (limitsAndAvailability_.liquidityUserBorrowDataToken1, ) = LIQUIDITY_RESOLVER.getUserBorrowData(dex_, token1_); limitsAndAvailability_.liquiditySupplyToken0 = limitsAndAvailability_.liquidityTokenData0.totalSupply; limitsAndAvailability_.liquiditySupplyToken1 = limitsAndAvailability_.liquidityTokenData1.totalSupply; limitsAndAvailability_.liquidityBorrowToken0 = limitsAndAvailability_.liquidityTokenData0.totalBorrow; limitsAndAvailability_.liquidityBorrowToken1 = limitsAndAvailability_.liquidityTokenData1.totalBorrow; limitsAndAvailability_.liquidityWithdrawableToken0 = limitsAndAvailability_ .liquidityUserSupplyDataToken0 .withdrawable; limitsAndAvailability_.liquidityWithdrawableToken1 = limitsAndAvailability_ .liquidityUserSupplyDataToken1 .withdrawable; limitsAndAvailability_.liquidityBorrowableToken0 = limitsAndAvailability_ .liquidityUserBorrowDataToken0 .borrowable; limitsAndAvailability_.liquidityBorrowableToken1 = limitsAndAvailability_ .liquidityUserBorrowDataToken1 .borrowable; limitsAndAvailability_.utilizationLimitToken0 = (limitsAndAvailability_.liquiditySupplyToken0 * utilizationLimitToken0Percent_) / 1e3; limitsAndAvailability_.utilizationLimitToken1 = (limitsAndAvailability_.liquiditySupplyToken1 * utilizationLimitToken1Percent_) / 1e3; if (limitsAndAvailability_.liquidityBorrowToken0 < limitsAndAvailability_.utilizationLimitToken0) { limitsAndAvailability_.withdrawableUntilUtilizationLimitToken0 = (1e3 * limitsAndAvailability_.liquidityBorrowToken0) / utilizationLimitToken0Percent_; limitsAndAvailability_.withdrawableUntilUtilizationLimitToken0 = limitsAndAvailability_ .liquiditySupplyToken0 > limitsAndAvailability_.withdrawableUntilUtilizationLimitToken0 ? limitsAndAvailability_.liquiditySupplyToken0 - limitsAndAvailability_.withdrawableUntilUtilizationLimitToken0 : 0; limitsAndAvailability_.borrowableUntilUtilizationLimitToken0 = limitsAndAvailability_.utilizationLimitToken0 - limitsAndAvailability_.liquidityBorrowToken0; } if (limitsAndAvailability_.liquidityBorrowToken1 < limitsAndAvailability_.utilizationLimitToken1) { limitsAndAvailability_.withdrawableUntilUtilizationLimitToken1 = (1e3 * limitsAndAvailability_.liquidityBorrowToken1) / utilizationLimitToken1Percent_; limitsAndAvailability_.withdrawableUntilUtilizationLimitToken1 = limitsAndAvailability_ .liquiditySupplyToken1 > limitsAndAvailability_.withdrawableUntilUtilizationLimitToken1 ? limitsAndAvailability_.liquiditySupplyToken1 - limitsAndAvailability_.withdrawableUntilUtilizationLimitToken1 : 0; limitsAndAvailability_.borrowableUntilUtilizationLimitToken1 = limitsAndAvailability_.utilizationLimitToken1 - limitsAndAvailability_.liquidityBorrowToken1; } } /// @dev Get the current state of a DEX function _getDexState( address dex_, IFluidDexT1.CollateralReserves memory colReserves_, IFluidDexT1.DebtReserves memory debtReserves_ ) internal view returns (DexState memory state_) { uint256 storageVar_ = getDexVariablesRaw(dex_); state_.lastToLastStoredPrice = (storageVar_ >> 1) & X40; state_.lastStoredPrice = (storageVar_ >> 41) & X40; state_.centerPrice = (storageVar_ >> 81) & X40; state_.lastUpdateTimestamp = (storageVar_ >> 121) & X33; state_.lastPricesTimeDiff = (storageVar_ >> 154) & X22; state_.oracleCheckPoint = (storageVar_ >> 176) & X3; state_.oracleMapping = (storageVar_ >> 179) & X16; state_.totalSupplyShares = getTotalSupplySharesRaw(dex_) & X128; state_.totalBorrowShares = getTotalBorrowSharesRaw(dex_) & X128; storageVar_ = getDexVariables2Raw(dex_); state_.isSwapAndArbitragePaused = storageVar_ >> 255 == 1; state_.shifts.isRangeChangeActive = (storageVar_ >> 26) & 1 == 1; state_.shifts.isThresholdChangeActive = (storageVar_ >> 67) & 1 == 1; state_.shifts.isCenterPriceShiftActive = (storageVar_ >> 248) & 1 == 1; storageVar_ = getRangeShiftRaw(dex_); state_.shifts.rangeShift.oldUpper = storageVar_ & X20; state_.shifts.rangeShift.oldLower = (storageVar_ >> 20) & X20; state_.shifts.rangeShift.duration = (storageVar_ >> 40) & X20; state_.shifts.rangeShift.startTimestamp = (storageVar_ >> 60) & X33; storageVar_ = getThresholdShiftRaw(dex_); state_.shifts.thresholdShift.oldUpper = storageVar_ & X10; state_.shifts.thresholdShift.oldLower = (storageVar_ >> 20) & X10; state_.shifts.thresholdShift.duration = (storageVar_ >> 40) & X20; state_.shifts.thresholdShift.startTimestamp = (storageVar_ >> 60) & X33; state_.shifts.thresholdShift.oldTime = (storageVar_ >> 93) & X24; storageVar_ = getCenterPriceShiftRaw(dex_); state_.shifts.centerPriceShift.startTimestamp = storageVar_ & X33; state_.shifts.centerPriceShift.shiftPercentage = (storageVar_ >> 33) & X20; state_.shifts.centerPriceShift.duration = (storageVar_ >> 53) & X20; if (state_.totalSupplyShares > 0) { state_.token0PerSupplyShare = (colReserves_.token0RealReserves * 1e18) / state_.totalSupplyShares; state_.token1PerSupplyShare = (colReserves_.token1RealReserves * 1e18) / state_.totalSupplyShares; } if (state_.totalBorrowShares > 0) { state_.token0PerBorrowShare = (debtReserves_.token0Debt * 1e18) / state_.totalBorrowShares; state_.token1PerBorrowShare = (debtReserves_.token1Debt * 1e18) / state_.totalBorrowShares; } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; /// @notice implements calculation of address for contracts deployed through CREATE. /// Accepts contract deployed from which address & nonce library AddressCalcs { /// @notice Computes the address of a contract based /// @param deployedFrom_ Address from which the contract was deployed /// @param nonce_ Nonce at which the contract was deployed /// @return contract_ Address of deployed contract function addressCalc(address deployedFrom_, uint nonce_) internal pure returns (address contract_) { // @dev based on https://ethereum.stackexchange.com/a/61413 // nonce of smart contract always starts with 1. so, with nonce 0 there won't be any deployment // hence, nonce of vault deployment starts with 1. bytes memory data; if (nonce_ == 0x00) { return address(0); } else if (nonce_ <= 0x7f) { data = abi.encodePacked(bytes1(0xd6), bytes1(0x94), deployedFrom_, uint8(nonce_)); } else if (nonce_ <= 0xff) { data = abi.encodePacked(bytes1(0xd7), bytes1(0x94), deployedFrom_, bytes1(0x81), uint8(nonce_)); } else if (nonce_ <= 0xffff) { data = abi.encodePacked(bytes1(0xd8), bytes1(0x94), deployedFrom_, bytes1(0x82), uint16(nonce_)); } else if (nonce_ <= 0xffffff) { data = abi.encodePacked(bytes1(0xd9), bytes1(0x94), deployedFrom_, bytes1(0x83), uint24(nonce_)); } else { data = abi.encodePacked(bytes1(0xda), bytes1(0x94), deployedFrom_, bytes1(0x84), uint32(nonce_)); } return address(uint160(uint256(keccak256(data)))); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; /// @title library that represents a number in BigNumber(coefficient and exponent) format to store in smaller bits. /// @notice the number is divided into two parts: a coefficient and an exponent. This comes at a cost of losing some precision /// at the end of the number because the exponent simply fills it with zeroes. This precision is oftentimes negligible and can /// result in significant gas cost reduction due to storage space reduction. /// Also note, a valid big number is as follows: if the exponent is > 0, then coefficient last bits should be occupied to have max precision. /// @dev roundUp is more like a increase 1, which happens everytime for the same number. /// roundDown simply sets trailing digits after coefficientSize to zero (floor), only once for the same number. library BigMathMinified { /// @dev constants to use for `roundUp` input param to increase readability bool internal constant ROUND_DOWN = false; bool internal constant ROUND_UP = true; /// @dev converts `normal` number to BigNumber with `exponent` and `coefficient` (or precision). /// e.g.: /// 5035703444687813576399599 (normal) = (coefficient[32bits], exponent[8bits])[40bits] /// 5035703444687813576399599 (decimal) => 10000101010010110100000011111011110010100110100000000011100101001101001101011101111 (binary) /// => 10000101010010110100000011111011000000000000000000000000000000000000000000000000000 /// ^-------------------- 51(exponent) -------------- ^ /// coefficient = 1000,0101,0100,1011,0100,0000,1111,1011 (2236301563) /// exponent = 0011,0011 (51) /// bigNumber = 1000,0101,0100,1011,0100,0000,1111,1011,0011,0011 (572493200179) /// /// @param normal number which needs to be converted into Big Number /// @param coefficientSize at max how many bits of precision there should be (64 = uint64 (64 bits precision)) /// @param exponentSize at max how many bits of exponent there should be (8 = uint8 (8 bits exponent)) /// @param roundUp signals if result should be rounded down or up /// @return bigNumber converted bigNumber (coefficient << exponent) function toBigNumber( uint256 normal, uint256 coefficientSize, uint256 exponentSize, bool roundUp ) internal pure returns (uint256 bigNumber) { assembly { let lastBit_ let number_ := normal if gt(number_, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { number_ := shr(0x80, number_) lastBit_ := 0x80 } if gt(number_, 0xFFFFFFFFFFFFFFFF) { number_ := shr(0x40, number_) lastBit_ := add(lastBit_, 0x40) } if gt(number_, 0xFFFFFFFF) { number_ := shr(0x20, number_) lastBit_ := add(lastBit_, 0x20) } if gt(number_, 0xFFFF) { number_ := shr(0x10, number_) lastBit_ := add(lastBit_, 0x10) } if gt(number_, 0xFF) { number_ := shr(0x8, number_) lastBit_ := add(lastBit_, 0x8) } if gt(number_, 0xF) { number_ := shr(0x4, number_) lastBit_ := add(lastBit_, 0x4) } if gt(number_, 0x3) { number_ := shr(0x2, number_) lastBit_ := add(lastBit_, 0x2) } if gt(number_, 0x1) { lastBit_ := add(lastBit_, 1) } if gt(number_, 0) { lastBit_ := add(lastBit_, 1) } if lt(lastBit_, coefficientSize) { // for throw exception lastBit_ := coefficientSize } let exponent := sub(lastBit_, coefficientSize) let coefficient := shr(exponent, normal) if and(roundUp, gt(exponent, 0)) { // rounding up is only needed if exponent is > 0, as otherwise the coefficient fully holds the original number coefficient := add(coefficient, 1) if eq(shl(coefficientSize, 1), coefficient) { // case were coefficient was e.g. 111, with adding 1 it became 1000 (in binary) and coefficientSize 3 bits // final coefficient would exceed it's size. -> reduce coefficent to 100 and increase exponent by 1. coefficient := shl(sub(coefficientSize, 1), 1) exponent := add(exponent, 1) } } if iszero(lt(exponent, shl(exponentSize, 1))) { // if exponent is >= exponentSize, the normal number is too big to fit within // BigNumber with too small sizes for coefficient and exponent revert(0, 0) } bigNumber := shl(exponentSize, coefficient) bigNumber := add(bigNumber, exponent) } } /// @dev get `normal` number from `bigNumber`, `exponentSize` and `exponentMask` function fromBigNumber( uint256 bigNumber, uint256 exponentSize, uint256 exponentMask ) internal pure returns (uint256 normal) { assembly { let coefficient := shr(exponentSize, bigNumber) let exponent := and(bigNumber, exponentMask) normal := shl(exponent, coefficient) } } /// @dev gets the most significant bit `lastBit` of a `normal` number (length of given number of binary format). /// e.g. /// 5035703444687813576399599 = 10000101010010110100000011111011110010100110100000000011100101001101001101011101111 /// lastBit = ^--------------------------------- 83 ----------------------------------------^ function mostSignificantBit(uint256 normal) internal pure returns (uint lastBit) { assembly { let number_ := normal if gt(normal, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { number_ := shr(0x80, number_) lastBit := 0x80 } if gt(number_, 0xFFFFFFFFFFFFFFFF) { number_ := shr(0x40, number_) lastBit := add(lastBit, 0x40) } if gt(number_, 0xFFFFFFFF) { number_ := shr(0x20, number_) lastBit := add(lastBit, 0x20) } if gt(number_, 0xFFFF) { number_ := shr(0x10, number_) lastBit := add(lastBit, 0x10) } if gt(number_, 0xFF) { number_ := shr(0x8, number_) lastBit := add(lastBit, 0x8) } if gt(number_, 0xF) { number_ := shr(0x4, number_) lastBit := add(lastBit, 0x4) } if gt(number_, 0x3) { number_ := shr(0x2, number_) lastBit := add(lastBit, 0x2) } if gt(number_, 0x1) { lastBit := add(lastBit, 1) } if gt(number_, 0) { lastBit := add(lastBit, 1) } } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; library BytesSliceAndConcat { // @dev taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol function bytesConcat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory tempBytes) { assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore( 0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. ) ) } return tempBytes; } // @dev taken from https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol function bytesSlice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory tempBytes) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { BigMathMinified } from "./bigMathMinified.sol"; import { DexSlotsLink } from "./dexSlotsLink.sol"; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // @DEV ATTENTION: ON ANY CHANGES HERE, MAKE SURE THAT LOGIC IN VAULTS WILL STILL BE VALID. // SOME CODE THERE ASSUMES DEXCALCS == LIQUIDITYCALCS. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /// @notice implements calculation methods used for Fluid Dex such as updated withdrawal / borrow limits. library DexCalcs { // constants used for BigMath conversion from and to storage uint256 internal constant DEFAULT_EXPONENT_SIZE = 8; uint256 internal constant DEFAULT_EXPONENT_MASK = 0xFF; uint256 internal constant FOUR_DECIMALS = 1e4; uint256 internal constant X14 = 0x3fff; uint256 internal constant X18 = 0x3ffff; uint256 internal constant X24 = 0xffffff; uint256 internal constant X33 = 0x1ffffffff; uint256 internal constant X64 = 0xffffffffffffffff; /////////////////////////////////////////////////////////////////////////// ////////// CALC LIMITS ///////// /////////////////////////////////////////////////////////////////////////// /// @dev calculates withdrawal limit before an operate execution: /// amount of user supply that must stay supplied (not amount that can be withdrawn). /// i.e. if user has supplied 100m and can withdraw 5M, this method returns the 95M, not the withdrawable amount 5M /// @param userSupplyData_ user supply data packed uint256 from storage /// @param userSupply_ current user supply amount already extracted from `userSupplyData_` and converted from BigMath /// @return currentWithdrawalLimit_ current withdrawal limit updated for expansion since last interaction. /// returned value is in raw for with interest mode, normal amount for interest free mode! function calcWithdrawalLimitBeforeOperate( uint256 userSupplyData_, uint256 userSupply_ ) internal view returns (uint256 currentWithdrawalLimit_) { // @dev must support handling the case where timestamp is 0 (config is set but no interactions yet). // first tx where timestamp is 0 will enter `if (lastWithdrawalLimit_ == 0)` because lastWithdrawalLimit_ is not set yet. // returning max withdrawal allowed, which is not exactly right but doesn't matter because the first interaction must be // a deposit anyway. Important is that it would not revert. // Note the first time a deposit brings the user supply amount to above the base withdrawal limit, the active limit // is the fully expanded limit immediately. // extract last set withdrawal limit uint256 lastWithdrawalLimit_ = (userSupplyData_ >> DexSlotsLink.BITS_USER_SUPPLY_PREVIOUS_WITHDRAWAL_LIMIT) & X64; lastWithdrawalLimit_ = (lastWithdrawalLimit_ >> DEFAULT_EXPONENT_SIZE) << (lastWithdrawalLimit_ & DEFAULT_EXPONENT_MASK); if (lastWithdrawalLimit_ == 0) { // withdrawal limit is not activated. Max withdrawal allowed return 0; } uint256 maxWithdrawableLimit_; uint256 temp_; unchecked { // extract max withdrawable percent of user supply and // calculate maximum withdrawable amount expandPercentage of user supply at full expansion duration elapsed // e.g.: if 10% expandPercentage, meaning 10% is withdrawable after full expandDuration has elapsed. // userSupply_ needs to be atleast 1e73 to overflow max limit of ~1e77 in uint256 (no token in existence where this is possible). maxWithdrawableLimit_ = (((userSupplyData_ >> DexSlotsLink.BITS_USER_SUPPLY_EXPAND_PERCENT) & X14) * userSupply_) / FOUR_DECIMALS; // time elapsed since last withdrawal limit was set (in seconds) // @dev last process timestamp is guaranteed to exist for withdrawal, as a supply must have happened before. // last timestamp can not be > current timestamp temp_ = block.timestamp - ((userSupplyData_ >> DexSlotsLink.BITS_USER_SUPPLY_LAST_UPDATE_TIMESTAMP) & X33); } // calculate withdrawable amount of expandPercent that is elapsed of expandDuration. // e.g. if 60% of expandDuration has elapsed, then user should be able to withdraw 6% of user supply, down to 94%. // Note: no explicit check for this needed, it is covered by setting minWithdrawalLimit_ if needed. temp_ = (maxWithdrawableLimit_ * temp_) / // extract expand duration: After this, decrement won't happen (user can withdraw 100% of withdraw limit) ((userSupplyData_ >> DexSlotsLink.BITS_USER_SUPPLY_EXPAND_DURATION) & X24); // expand duration can never be 0 // calculate expanded withdrawal limit: last withdrawal limit - withdrawable amount. // Note: withdrawable amount here can grow bigger than userSupply if timeElapsed is a lot bigger than expandDuration, // which would cause the subtraction `lastWithdrawalLimit_ - withdrawableAmount_` to revert. In that case, set 0 // which will cause minimum (fully expanded) withdrawal limit to be set in lines below. unchecked { // underflow explicitly checked & handled currentWithdrawalLimit_ = lastWithdrawalLimit_ > temp_ ? lastWithdrawalLimit_ - temp_ : 0; // calculate minimum withdrawal limit: minimum amount of user supply that must stay supplied at full expansion. // subtraction can not underflow as maxWithdrawableLimit_ is a percentage amount (<=100%) of userSupply_ temp_ = userSupply_ - maxWithdrawableLimit_; } // if withdrawal limit is decreased below minimum then set minimum // (e.g. when more than expandDuration time has elapsed) if (temp_ > currentWithdrawalLimit_) { currentWithdrawalLimit_ = temp_; } } /// @dev calculates withdrawal limit after an operate execution: /// amount of user supply that must stay supplied (not amount that can be withdrawn). /// i.e. if user has supplied 100m and can withdraw 5M, this method returns the 95M, not the withdrawable amount 5M /// @param userSupplyData_ user supply data packed uint256 from storage /// @param userSupply_ current user supply amount already extracted from `userSupplyData_` and added / subtracted with the executed operate amount /// @param newWithdrawalLimit_ current withdrawal limit updated for expansion since last interaction, result from `calcWithdrawalLimitBeforeOperate` /// @return withdrawalLimit_ updated withdrawal limit that should be written to storage. returned value is in /// raw for with interest mode, normal amount for interest free mode! function calcWithdrawalLimitAfterOperate( uint256 userSupplyData_, uint256 userSupply_, uint256 newWithdrawalLimit_ ) internal pure returns (uint256) { // temp_ => base withdrawal limit. below this, maximum withdrawals are allowed uint256 temp_ = (userSupplyData_ >> DexSlotsLink.BITS_USER_SUPPLY_BASE_WITHDRAWAL_LIMIT) & X18; temp_ = (temp_ >> DEFAULT_EXPONENT_SIZE) << (temp_ & DEFAULT_EXPONENT_MASK); // if user supply is below base limit then max withdrawals are allowed if (userSupply_ < temp_) { return 0; } // temp_ => withdrawal limit expandPercent (is in 1e2 decimals) temp_ = (userSupplyData_ >> DexSlotsLink.BITS_USER_SUPPLY_EXPAND_PERCENT) & X14; unchecked { // temp_ => minimum withdrawal limit: userSupply - max withdrawable limit (userSupply * expandPercent)) // userSupply_ needs to be atleast 1e73 to overflow max limit of ~1e77 in uint256 (no token in existence where this is possible). // subtraction can not underflow as maxWithdrawableLimit_ is a percentage amount (<=100%) of userSupply_ temp_ = userSupply_ - ((userSupply_ * temp_) / FOUR_DECIMALS); } // if new (before operation) withdrawal limit is less than minimum limit then set minimum limit. // e.g. can happen on new deposits. withdrawal limit is instantly fully expanded in a scenario where // increased deposit amount outpaces withrawals. if (temp_ > newWithdrawalLimit_) { return temp_; } return newWithdrawalLimit_; } /// @dev calculates borrow limit before an operate execution: /// total amount user borrow can reach (not borrowable amount in current operation). /// i.e. if user has borrowed 50M and can still borrow 5M, this method returns the total 55M, not the borrowable amount 5M /// @param userBorrowData_ user borrow data packed uint256 from storage /// @param userBorrow_ current user borrow amount already extracted from `userBorrowData_` /// @return currentBorrowLimit_ current borrow limit updated for expansion since last interaction. returned value is in /// raw for with interest mode, normal amount for interest free mode! function calcBorrowLimitBeforeOperate( uint256 userBorrowData_, uint256 userBorrow_ ) internal view returns (uint256 currentBorrowLimit_) { // @dev must support handling the case where timestamp is 0 (config is set but no interactions yet) -> base limit. // first tx where timestamp is 0 will enter `if (maxExpandedBorrowLimit_ < baseBorrowLimit_)` because `userBorrow_` and thus // `maxExpansionLimit_` and thus `maxExpandedBorrowLimit_` is 0 and `baseBorrowLimit_` can not be 0. // temp_ = extract borrow expand percent (is in 1e2 decimals) uint256 temp_ = (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_EXPAND_PERCENT) & X14; uint256 maxExpansionLimit_; uint256 maxExpandedBorrowLimit_; unchecked { // calculate max expansion limit: Max amount limit can expand to since last interaction // userBorrow_ needs to be atleast 1e73 to overflow max limit of ~1e77 in uint256 (no token in existence where this is possible). maxExpansionLimit_ = ((userBorrow_ * temp_) / FOUR_DECIMALS); // calculate max borrow limit: Max point limit can increase to since last interaction maxExpandedBorrowLimit_ = userBorrow_ + maxExpansionLimit_; } // currentBorrowLimit_ = extract base borrow limit currentBorrowLimit_ = (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_BASE_BORROW_LIMIT) & X18; currentBorrowLimit_ = (currentBorrowLimit_ >> DEFAULT_EXPONENT_SIZE) << (currentBorrowLimit_ & DEFAULT_EXPONENT_MASK); if (maxExpandedBorrowLimit_ < currentBorrowLimit_) { return currentBorrowLimit_; } // time elapsed since last borrow limit was set (in seconds) unchecked { // temp_ = timeElapsed_ (last timestamp can not be > current timestamp) temp_ = block.timestamp - ((userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_LAST_UPDATE_TIMESTAMP) & X33); // extract last update timestamp } // currentBorrowLimit_ = expandedBorrowableAmount + extract last set borrow limit currentBorrowLimit_ = // calculate borrow limit expansion since last interaction for `expandPercent` that is elapsed of `expandDuration`. // divisor is extract expand duration (after this, full expansion to expandPercentage happened). ((maxExpansionLimit_ * temp_) / ((userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_EXPAND_DURATION) & X24)) + // expand duration can never be 0 // extract last set borrow limit BigMathMinified.fromBigNumber( (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_PREVIOUS_BORROW_LIMIT) & X64, DEFAULT_EXPONENT_SIZE, DEFAULT_EXPONENT_MASK ); // if timeElapsed is bigger than expandDuration, new borrow limit would be > max expansion, // so set to `maxExpandedBorrowLimit_` in that case. // also covers the case where last process timestamp = 0 (timeElapsed would simply be very big) if (currentBorrowLimit_ > maxExpandedBorrowLimit_) { currentBorrowLimit_ = maxExpandedBorrowLimit_; } // temp_ = extract hard max borrow limit. Above this user can never borrow (not expandable above) temp_ = (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_MAX_BORROW_LIMIT) & X18; temp_ = (temp_ >> DEFAULT_EXPONENT_SIZE) << (temp_ & DEFAULT_EXPONENT_MASK); if (currentBorrowLimit_ > temp_) { currentBorrowLimit_ = temp_; } } /// @dev calculates borrow limit after an operate execution: /// total amount user borrow can reach (not borrowable amount in current operation). /// i.e. if user has borrowed 50M and can still borrow 5M, this method returns the total 55M, not the borrowable amount 5M /// @param userBorrowData_ user borrow data packed uint256 from storage /// @param userBorrow_ current user borrow amount already extracted from `userBorrowData_` and added / subtracted with the executed operate amount /// @param newBorrowLimit_ current borrow limit updated for expansion since last interaction, result from `calcBorrowLimitBeforeOperate` /// @return borrowLimit_ updated borrow limit that should be written to storage. /// returned value is in raw for with interest mode, normal amount for interest free mode! function calcBorrowLimitAfterOperate( uint256 userBorrowData_, uint256 userBorrow_, uint256 newBorrowLimit_ ) internal pure returns (uint256 borrowLimit_) { // temp_ = extract borrow expand percent uint256 temp_ = (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_EXPAND_PERCENT) & X14; // (is in 1e2 decimals) unchecked { // borrowLimit_ = calculate maximum borrow limit at full expansion. // userBorrow_ needs to be at least 1e73 to overflow max limit of ~1e77 in uint256 (no token in existence where this is possible). borrowLimit_ = userBorrow_ + ((userBorrow_ * temp_) / FOUR_DECIMALS); } // temp_ = extract base borrow limit temp_ = (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_BASE_BORROW_LIMIT) & X18; temp_ = (temp_ >> DEFAULT_EXPONENT_SIZE) << (temp_ & DEFAULT_EXPONENT_MASK); if (borrowLimit_ < temp_) { // below base limit, borrow limit is always base limit return temp_; } // temp_ = extract hard max borrow limit. Above this user can never borrow (not expandable above) temp_ = (userBorrowData_ >> DexSlotsLink.BITS_USER_BORROW_MAX_BORROW_LIMIT) & X18; temp_ = (temp_ >> DEFAULT_EXPONENT_SIZE) << (temp_ & DEFAULT_EXPONENT_MASK); // make sure fully expanded borrow limit is not above hard max borrow limit if (borrowLimit_ > temp_) { borrowLimit_ = temp_; } // if new borrow limit (from before operate) is > max borrow limit, set max borrow limit. // (e.g. on a repay shrinking instantly to fully expanded borrow limit from new borrow amount. shrinking is instant) if (newBorrowLimit_ > borrowLimit_) { return borrowLimit_; } return newBorrowLimit_; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; /// @notice library that helps in reading / working with storage slot data of Fluid Dex. /// @dev as all data for Fluid Dex is internal, any data must be fetched directly through manual /// slot reading through this library or, if gas usage is less important, through the FluidDexResolver. library DexSlotsLink { /// @dev storage slot for variables at Dex uint256 internal constant DEX_VARIABLES_SLOT = 0; /// @dev storage slot for variables2 at Dex uint256 internal constant DEX_VARIABLES2_SLOT = 1; /// @dev storage slot for total supply shares at Dex uint256 internal constant DEX_TOTAL_SUPPLY_SHARES_SLOT = 2; /// @dev storage slot for user supply mapping at Dex uint256 internal constant DEX_USER_SUPPLY_MAPPING_SLOT = 3; /// @dev storage slot for total borrow shares at Dex uint256 internal constant DEX_TOTAL_BORROW_SHARES_SLOT = 4; /// @dev storage slot for user borrow mapping at Dex uint256 internal constant DEX_USER_BORROW_MAPPING_SLOT = 5; /// @dev storage slot for oracle mapping at Dex uint256 internal constant DEX_ORACLE_MAPPING_SLOT = 6; /// @dev storage slot for range and threshold shifts at Dex uint256 internal constant DEX_RANGE_THRESHOLD_SHIFTS_SLOT = 7; /// @dev storage slot for center price shift at Dex uint256 internal constant DEX_CENTER_PRICE_SHIFT_SLOT = 8; // -------------------------------- // @dev stacked uint256 storage slots bits position data for each: // UserSupplyData uint256 internal constant BITS_USER_SUPPLY_ALLOWED = 0; uint256 internal constant BITS_USER_SUPPLY_AMOUNT = 1; uint256 internal constant BITS_USER_SUPPLY_PREVIOUS_WITHDRAWAL_LIMIT = 65; uint256 internal constant BITS_USER_SUPPLY_LAST_UPDATE_TIMESTAMP = 129; uint256 internal constant BITS_USER_SUPPLY_EXPAND_PERCENT = 162; uint256 internal constant BITS_USER_SUPPLY_EXPAND_DURATION = 176; uint256 internal constant BITS_USER_SUPPLY_BASE_WITHDRAWAL_LIMIT = 200; // UserBorrowData uint256 internal constant BITS_USER_BORROW_ALLOWED = 0; uint256 internal constant BITS_USER_BORROW_AMOUNT = 1; uint256 internal constant BITS_USER_BORROW_PREVIOUS_BORROW_LIMIT = 65; uint256 internal constant BITS_USER_BORROW_LAST_UPDATE_TIMESTAMP = 129; uint256 internal constant BITS_USER_BORROW_EXPAND_PERCENT = 162; uint256 internal constant BITS_USER_BORROW_EXPAND_DURATION = 176; uint256 internal constant BITS_USER_BORROW_BASE_BORROW_LIMIT = 200; uint256 internal constant BITS_USER_BORROW_MAX_BORROW_LIMIT = 218; // -------------------------------- /// @notice Calculating the slot ID for Dex contract for single mapping at `slot_` for `key_` function calculateMappingStorageSlot(uint256 slot_, address key_) internal pure returns (bytes32) { return keccak256(abi.encode(key_, slot_)); } /// @notice Calculating the slot ID for Dex contract for double mapping at `slot_` for `key1_` and `key2_` function calculateDoubleMappingStorageSlot( uint256 slot_, address key1_, address key2_ ) internal pure returns (bytes32) { bytes32 intermediateSlot_ = keccak256(abi.encode(key1_, slot_)); return keccak256(abi.encode(key2_, intermediateSlot_)); } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; abstract contract Structs { struct AddressBool { address addr; bool value; } struct AddressUint256 { address addr; uint256 value; } /// @notice struct to set borrow rate data for version 1 struct RateDataV1Params { /// /// @param token for rate data address token; /// /// @param kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 /// utilization below kink usually means slow increase in rate, once utilization is above kink borrow rate increases fast uint256 kink; /// /// @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100 /// i.e. constant minimum borrow rate /// e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then) uint256 rateAtUtilizationZero; /// /// @param rateAtUtilizationKink borrow rate when utilization is at kink. in 1e2: 100% = 10_000; 1% = 100 /// e.g. when rate should be 7% at kink then rateAtUtilizationKink would be 700 uint256 rateAtUtilizationKink; /// /// @param rateAtUtilizationMax borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100 /// e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500 uint256 rateAtUtilizationMax; } /// @notice struct to set borrow rate data for version 2 struct RateDataV2Params { /// /// @param token for rate data address token; /// /// @param kink1 first kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 /// utilization below kink 1 usually means slow increase in rate, once utilization is above kink 1 borrow rate increases faster uint256 kink1; /// /// @param kink2 second kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 /// utilization below kink 2 usually means slow / medium increase in rate, once utilization is above kink 2 borrow rate increases fast uint256 kink2; /// /// @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100 /// i.e. constant minimum borrow rate /// e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then) uint256 rateAtUtilizationZero; /// /// @param rateAtUtilizationKink1 desired borrow rate when utilization is at first kink. in 1e2: 100% = 10_000; 1% = 100 /// e.g. when rate should be 7% at first kink then rateAtUtilizationKink would be 700 uint256 rateAtUtilizationKink1; /// /// @param rateAtUtilizationKink2 desired borrow rate when utilization is at second kink. in 1e2: 100% = 10_000; 1% = 100 /// e.g. when rate should be 7% at second kink then rateAtUtilizationKink would be 1_200 uint256 rateAtUtilizationKink2; /// /// @param rateAtUtilizationMax desired borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100 /// e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500 uint256 rateAtUtilizationMax; } /// @notice struct to set token config struct TokenConfig { /// /// @param token address address token; /// /// @param fee charges on borrower's interest. in 1e2: 100% = 10_000; 1% = 100 uint256 fee; /// /// @param threshold on when to update the storage slot. in 1e2: 100% = 10_000; 1% = 100 uint256 threshold; /// /// @param maxUtilization maximum allowed utilization. in 1e2: 100% = 10_000; 1% = 100 /// set to 100% to disable and have default limit of 100% (avoiding SLOAD). uint256 maxUtilization; } /// @notice struct to set user supply & withdrawal config struct UserSupplyConfig { /// /// @param user address address user; /// /// @param token address address token; /// /// @param mode: 0 = without interest. 1 = with interest uint8 mode; /// /// @param expandPercent withdrawal limit expand percent. in 1e2: 100% = 10_000; 1% = 100 /// Also used to calculate rate at which withdrawal limit should decrease (instant). uint256 expandPercent; /// /// @param expandDuration withdrawal limit expand duration in seconds. /// used to calculate rate together with expandPercent uint256 expandDuration; /// /// @param baseWithdrawalLimit base limit, below this, user can withdraw the entire amount. /// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: /// with interest -> raw, without interest -> normal uint256 baseWithdrawalLimit; } /// @notice struct to set user borrow & payback config struct UserBorrowConfig { /// /// @param user address address user; /// /// @param token address address token; /// /// @param mode: 0 = without interest. 1 = with interest uint8 mode; /// /// @param expandPercent debt limit expand percent. in 1e2: 100% = 10_000; 1% = 100 /// Also used to calculate rate at which debt limit should decrease (instant). uint256 expandPercent; /// /// @param expandDuration debt limit expand duration in seconds. /// used to calculate rate together with expandPercent uint256 expandDuration; /// /// @param baseDebtCeiling base borrow limit. until here, borrow limit remains as baseDebtCeiling /// (user can borrow until this point at once without stepped expansion). Above this, automated limit comes in place. /// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: /// with interest -> raw, without interest -> normal uint256 baseDebtCeiling; /// /// @param maxDebtCeiling max borrow ceiling, maximum amount the user can borrow. /// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: /// with interest -> raw, without interest -> normal uint256 maxDebtCeiling; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { IFluidDexT1 } from "../../../protocols/dex/interfaces/iDexT1.sol"; import { Structs as FluidLiquidityResolverStructs } from "../liquidity/structs.sol"; abstract contract Structs { struct DexState { uint256 lastToLastStoredPrice; uint256 lastStoredPrice; // price of pool after the most recent swap uint256 centerPrice; uint256 lastUpdateTimestamp; uint256 lastPricesTimeDiff; uint256 oracleCheckPoint; uint256 oracleMapping; uint256 totalSupplyShares; uint256 totalBorrowShares; bool isSwapAndArbitragePaused; // if true, only perfect functions will be usable ShiftChanges shifts; // below values have to be combined with Oracle price data at the VaultResolver uint256 token0PerSupplyShare; // token0 amount per 1e18 supply shares uint256 token1PerSupplyShare; // token1 amount per 1e18 supply shares uint256 token0PerBorrowShare; // token0 amount per 1e18 borrow shares uint256 token1PerBorrowShare; // token1 amount per 1e18 borrow shares } struct ShiftData { uint256 oldUpper; uint256 oldLower; uint256 duration; uint256 startTimestamp; uint256 oldTime; // only for thresholdShift } struct CenterPriceShift { uint256 shiftPercentage; uint256 duration; uint256 startTimestamp; } struct ShiftChanges { bool isRangeChangeActive; bool isThresholdChangeActive; bool isCenterPriceShiftActive; ShiftData rangeShift; ShiftData thresholdShift; CenterPriceShift centerPriceShift; } struct Configs { bool isSmartCollateralEnabled; bool isSmartDebtEnabled; uint256 fee; uint256 revenueCut; uint256 upperRange; uint256 lowerRange; uint256 upperShiftThreshold; uint256 lowerShiftThreshold; uint256 shiftingTime; address centerPriceAddress; address hookAddress; uint256 maxCenterPrice; uint256 minCenterPrice; uint256 utilizationLimitToken0; uint256 utilizationLimitToken1; uint256 maxSupplyShares; uint256 maxBorrowShares; } // @dev note there might be other things that act as effective limits which are not fully considered here. // e.g. such as maximum 5% oracle shift in one swap, withdraws & borrowing together affecting each other, // shares being below max supply / borrow shares etc. struct SwapLimitsAndAvailability { // liquidity total amounts uint liquiditySupplyToken0; uint liquiditySupplyToken1; uint liquidityBorrowToken0; uint liquidityBorrowToken1; // liquidity limits uint liquidityWithdrawableToken0; uint liquidityWithdrawableToken1; uint liquidityBorrowableToken0; uint liquidityBorrowableToken1; // utilization limits based on config at Dex. (e.g. liquiditySupplyToken0 * Configs.utilizationLimitToken0 / 1e3) uint utilizationLimitToken0; uint utilizationLimitToken1; // swappable amounts until utilization limit. // In a swap that does both withdraw and borrow, the effective amounts might be less because withdraw / borrow affect each other // (both increase utilization). uint withdrawableUntilUtilizationLimitToken0; // x = totalSupply - totalBorrow / maxUtilizationPercentage uint withdrawableUntilUtilizationLimitToken1; uint borrowableUntilUtilizationLimitToken0; // x = maxUtilizationPercentage * totalSupply - totalBorrow. uint borrowableUntilUtilizationLimitToken1; // additional liquidity related data such as supply amount, limits, expansion etc. FluidLiquidityResolverStructs.UserSupplyData liquidityUserSupplyDataToken0; FluidLiquidityResolverStructs.UserSupplyData liquidityUserSupplyDataToken1; // additional liquidity related data such as borrow amount, limits, expansion etc. FluidLiquidityResolverStructs.UserBorrowData liquidityUserBorrowDataToken0; FluidLiquidityResolverStructs.UserBorrowData liquidityUserBorrowDataToken1; // liquidity token related data FluidLiquidityResolverStructs.OverallTokenData liquidityTokenData0; FluidLiquidityResolverStructs.OverallTokenData liquidityTokenData1; } struct DexEntireData { address dex; IFluidDexT1.ConstantViews constantViews; IFluidDexT1.ConstantViews2 constantViews2; Configs configs; IFluidDexT1.PricesAndExchangePrice pex; IFluidDexT1.CollateralReserves colReserves; IFluidDexT1.DebtReserves debtReserves; DexState dexState; SwapLimitsAndAvailability limitsAndAvailability; } // amounts are always in normal (for withInterest already multiplied with exchange price) struct UserSupplyData { bool isAllowed; uint256 supply; // user supply amount/shares // the withdrawal limit (e.g. if 10% is the limit, and 100M is supplied, it would be 90M) uint256 withdrawalLimit; uint256 lastUpdateTimestamp; uint256 expandPercent; // withdrawal limit expand percent in 1e2 uint256 expandDuration; // withdrawal limit expand duration in seconds uint256 baseWithdrawalLimit; // the current actual max withdrawable amount (e.g. if 10% is the limit, and 100M is supplied, it would be 10M) uint256 withdrawableUntilLimit; uint256 withdrawable; // actual currently withdrawable amount (supply - withdrawal Limit) & considering balance // liquidity related data such as supply amount, limits, expansion etc. FluidLiquidityResolverStructs.UserSupplyData liquidityUserSupplyDataToken0; FluidLiquidityResolverStructs.UserSupplyData liquidityUserSupplyDataToken1; // liquidity token related data FluidLiquidityResolverStructs.OverallTokenData liquidityTokenData0; FluidLiquidityResolverStructs.OverallTokenData liquidityTokenData1; } // amounts are always in normal (for withInterest already multiplied with exchange price) struct UserBorrowData { bool isAllowed; uint256 borrow; // user borrow amount/shares uint256 borrowLimit; uint256 lastUpdateTimestamp; uint256 expandPercent; uint256 expandDuration; uint256 baseBorrowLimit; uint256 maxBorrowLimit; uint256 borrowableUntilLimit; // borrowable amount until any borrow limit (incl. max utilization limit) uint256 borrowable; // actual currently borrowable amount (borrow limit - already borrowed) & considering balance, max utilization // liquidity related data such as borrow amount, limits, expansion etc. FluidLiquidityResolverStructs.UserBorrowData liquidityUserBorrowDataToken0; FluidLiquidityResolverStructs.UserBorrowData liquidityUserBorrowDataToken1; // liquidity token related data FluidLiquidityResolverStructs.OverallTokenData liquidityTokenData0; FluidLiquidityResolverStructs.OverallTokenData liquidityTokenData1; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { IFluidLiquidityResolver } from "../liquidity/iLiquidityResolver.sol"; import { IFluidDexFactory } from "../../../protocols/dex/interfaces/iDexFactory.sol"; interface IFluidLiquidity { function readFromStorage(bytes32 slot_) external view returns (uint256 result_); } abstract contract Variables { IFluidDexFactory public immutable FACTORY; IFluidLiquidity public immutable LIQUIDITY; IFluidLiquidityResolver public immutable LIQUIDITY_RESOLVER; /// @dev Address of contract used for deploying center price & hook related contract address public immutable DEPLOYER_CONTRACT; uint256 internal constant X2 = 0x3; uint256 internal constant X3 = 0x7; uint256 internal constant X5 = 0x1f; uint256 internal constant X7 = 0x7f; uint256 internal constant X8 = 0xff; uint256 internal constant X9 = 0x1ff; uint256 internal constant X10 = 0x3ff; uint256 internal constant X11 = 0x7ff; uint256 internal constant X14 = 0x3fff; uint256 internal constant X16 = 0xffff; uint256 internal constant X17 = 0x1ffff; uint256 internal constant X20 = 0xfffff; uint256 internal constant X22 = 0x3fffff; uint256 internal constant X23 = 0x7fffff; uint256 internal constant X24 = 0xffffff; uint256 internal constant X28 = 0xfffffff; uint256 internal constant X30 = 0x3fffffff; uint256 internal constant X32 = 0xffffffff; uint256 internal constant X33 = 0x1ffffffff; uint256 internal constant X40 = 0xffffffffff; uint256 internal constant X64 = 0xffffffffffffffff; uint256 internal constant X128 = 0xffffffffffffffffffffffffffffffff; /// @dev address that is mapped to the chain native token address internal constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; constructor(address factory_, address liquidity_, address liquidityResolver_, address deployer_) { FACTORY = IFluidDexFactory(factory_); LIQUIDITY = IFluidLiquidity(liquidity_); LIQUIDITY_RESOLVER = IFluidLiquidityResolver(liquidityResolver_); DEPLOYER_CONTRACT = deployer_; } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { Structs as LiquidityStructs } from "../../../periphery/resolvers/liquidity/structs.sol"; interface IFluidLiquidityResolver { /// @notice gets the `revenueAmount_` for a `token_`. function getRevenue(address token_) external view returns (uint256 revenueAmount_); /// @notice address of contract that gets sent the revenue. Configurable by governance function getRevenueCollector() external view returns (address); /// @notice Liquidity contract paused status: status = 1 -> normal. status = 2 -> paused. function getStatus() external view returns (uint256); /// @notice checks if `auth_` is an allowed auth on Liquidity. /// Auths can set most config values. E.g. contracts that automate certain flows like e.g. adding a new fToken. /// Governance can add/remove auths. Governance is auth by default. function isAuth(address auth_) external view returns (uint256); /// @notice checks if `guardian_` is an allowed Guardian on Liquidity. /// Guardians can pause lower class users. /// Governance can add/remove guardians. Governance is guardian by default. function isGuardian(address guardian_) external view returns (uint256); /// @notice gets user class for `user_`. Class defines which protocols can be paused by guardians. /// Currently there are 2 classes: 0 can be paused by guardians. 1 cannot be paused by guardians. /// New protocols are added as class 0 and will be upgraded to 1 over time. function getUserClass(address user_) external view returns (uint256); /// @notice gets exchangePricesAndConfig packed uint256 storage slot for `token_`. function getExchangePricesAndConfig(address token_) external view returns (uint256); /// @notice gets rateConfig packed uint256 storage slot for `token_`. function getRateConfig(address token_) external view returns (uint256); /// @notice gets totalAmounts packed uint256 storage slot for `token_`. function getTotalAmounts(address token_) external view returns (uint256); /// @notice gets configs2 packed uint256 storage slot for `token_`. function getConfigs2(address token_) external view returns (uint256); /// @notice gets userSupply data packed uint256 storage slot for `user_` and `token_`. function getUserSupply(address user_, address token_) external view returns (uint256); /// @notice gets userBorrow data packed uint256 storage slot for `user_` and `token_`. function getUserBorrow(address user_, address token_) external view returns (uint256); /// @notice returns all `listedTokens_` at the Liquidity contract. Once configured, a token can never be removed. function listedTokens() external view returns (address[] memory listedTokens_); /// @notice get the Rate config data `rateData_` for a `token_` compiled from the packed uint256 rateConfig storage slot function getTokenRateData(address token_) external view returns (LiquidityStructs.RateData memory rateData_); /// @notice get the Rate config datas `rateDatas_` for multiple `tokens_` compiled from the packed uint256 rateConfig storage slot function getTokensRateData( address[] calldata tokens_ ) external view returns (LiquidityStructs.RateData[] memory rateDatas_); /// @notice returns general data for `token_` such as rates, exchange prices, utilization, fee, total amounts etc. function getOverallTokenData( address token_ ) external view returns (LiquidityStructs.OverallTokenData memory overallTokenData_); /// @notice returns general data for multiple `tokens_` such as rates, exchange prices, utilization, fee, total amounts etc. function getOverallTokensData( address[] calldata tokens_ ) external view returns (LiquidityStructs.OverallTokenData[] memory overallTokensData_); /// @notice returns general data for all `listedTokens()` such as rates, exchange prices, utilization, fee, total amounts etc. function getAllOverallTokensData() external view returns (LiquidityStructs.OverallTokenData[] memory overallTokensData_); /// @notice returns `user_` supply data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for `token_` function getUserSupplyData( address user_, address token_ ) external view returns ( LiquidityStructs.UserSupplyData memory userSupplyData_, LiquidityStructs.OverallTokenData memory overallTokenData_ ); /// @notice returns `user_` supply data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple `tokens_` function getUserMultipleSupplyData( address user_, address[] calldata tokens_ ) external view returns ( LiquidityStructs.UserSupplyData[] memory userSuppliesData_, LiquidityStructs.OverallTokenData[] memory overallTokensData_ ); /// @notice returns `user_` borrow data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for `token_` function getUserBorrowData( address user_, address token_ ) external view returns ( LiquidityStructs.UserBorrowData memory userBorrowData_, LiquidityStructs.OverallTokenData memory overallTokenData_ ); /// @notice returns `user_` borrow data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple `tokens_` function getUserMultipleBorrowData( address user_, address[] calldata tokens_ ) external view returns ( LiquidityStructs.UserBorrowData[] memory userBorrowingsData_, LiquidityStructs.OverallTokenData[] memory overallTokensData_ ); /// @notice returns `user_` supply data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple `supplyTokens_` /// and returns `user_` borrow data and general data (such as rates, exchange prices, utilization, fee, total amounts etc.) for multiple `borrowTokens_` function getUserMultipleBorrowSupplyData( address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_ ) external view returns ( LiquidityStructs.UserSupplyData[] memory userSuppliesData_, LiquidityStructs.OverallTokenData[] memory overallSupplyTokensData_, LiquidityStructs.UserBorrowData[] memory userBorrowingsData_, LiquidityStructs.OverallTokenData[] memory overallBorrowTokensData_ ); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { Structs as AdminModuleStructs } from "../../../liquidity/adminModule/structs.sol"; abstract contract Structs { struct RateData { uint256 version; AdminModuleStructs.RateDataV1Params rateDataV1; AdminModuleStructs.RateDataV2Params rateDataV2; } struct OverallTokenData { uint256 borrowRate; uint256 supplyRate; uint256 fee; // revenue fee uint256 lastStoredUtilization; uint256 storageUpdateThreshold; uint256 lastUpdateTimestamp; uint256 supplyExchangePrice; uint256 borrowExchangePrice; uint256 supplyRawInterest; uint256 supplyInterestFree; uint256 borrowRawInterest; uint256 borrowInterestFree; uint256 totalSupply; uint256 totalBorrow; uint256 revenue; uint256 maxUtilization; // maximum allowed utilization RateData rateData; } // amounts are always in normal (for withInterest already multiplied with exchange price) struct UserSupplyData { bool modeWithInterest; // true if mode = with interest, false = without interest uint256 supply; // user supply amount // the withdrawal limit (e.g. if 10% is the limit, and 100M is supplied, it would be 90M) uint256 withdrawalLimit; uint256 lastUpdateTimestamp; uint256 expandPercent; // withdrawal limit expand percent in 1e2 uint256 expandDuration; // withdrawal limit expand duration in seconds uint256 baseWithdrawalLimit; // the current actual max withdrawable amount (e.g. if 10% is the limit, and 100M is supplied, it would be 10M) uint256 withdrawableUntilLimit; uint256 withdrawable; // actual currently withdrawable amount (supply - withdrawal Limit) & considering balance } // amounts are always in normal (for withInterest already multiplied with exchange price) struct UserBorrowData { bool modeWithInterest; // true if mode = with interest, false = without interest uint256 borrow; // user borrow amount uint256 borrowLimit; uint256 lastUpdateTimestamp; uint256 expandPercent; uint256 expandDuration; uint256 baseBorrowLimit; uint256 maxBorrowLimit; uint256 borrowableUntilLimit; // borrowable amount until any borrow limit (incl. max utilization limit) uint256 borrowable; // actual currently borrowable amount (borrow limit - already borrowed) & considering balance, max utilization uint256 borrowLimitUtilization; // borrow limit for `maxUtilization` } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; interface IFluidDexFactory { /// @notice Global auth is auth for all dexes function isGlobalAuth(address auth_) external view returns (bool); /// @notice Dex auth is auth for a specific dex function isDexAuth(address vault_, address auth_) external view returns (bool); /// @notice Total dexes deployed. function totalDexes() external view returns (uint256); /// @notice Compute dexAddress function getDexAddress(uint256 dexId_) external view returns (address); /// @notice read uint256 `result_` for a storage `slot_` key function readFromStorage(bytes32 slot_) external view returns (uint256 result_); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; interface IFluidDexT1 { error FluidDexError(uint256 errorId); /// @notice used to simulate swap to find the output amount error FluidDexSwapResult(uint256 amountOut); error FluidDexPerfectLiquidityOutput(uint256 token0Amt, uint token1Amt); error FluidDexSingleTokenOutput(uint256 tokenAmt); error FluidDexLiquidityOutput(uint256 shares); error FluidDexPricesAndExchangeRates(PricesAndExchangePrice pex_); /// @notice returns the dex id function DEX_ID() external view returns (uint256); /// @notice reads uint256 data `result_` from storage at a bytes32 storage `slot_` key. function readFromStorage(bytes32 slot_) external view returns (uint256 result_); struct Implementations { address shift; address admin; address colOperations; address debtOperations; address perfectOperationsAndOracle; } struct ConstantViews { uint256 dexId; address liquidity; address factory; Implementations implementations; address deployerContract; address token0; address token1; bytes32 supplyToken0Slot; bytes32 borrowToken0Slot; bytes32 supplyToken1Slot; bytes32 borrowToken1Slot; bytes32 exchangePriceToken0Slot; bytes32 exchangePriceToken1Slot; uint256 oracleMapping; } struct ConstantViews2 { uint token0NumeratorPrecision; uint token0DenominatorPrecision; uint token1NumeratorPrecision; uint token1DenominatorPrecision; } struct PricesAndExchangePrice { uint lastStoredPrice; // last stored price in 1e27 decimals uint centerPrice; // last stored price in 1e27 decimals uint upperRange; // price at upper range in 1e27 decimals uint lowerRange; // price at lower range in 1e27 decimals uint geometricMean; // geometric mean of upper range & lower range in 1e27 decimals uint supplyToken0ExchangePrice; uint borrowToken0ExchangePrice; uint supplyToken1ExchangePrice; uint borrowToken1ExchangePrice; } struct CollateralReserves { uint token0RealReserves; uint token1RealReserves; uint token0ImaginaryReserves; uint token1ImaginaryReserves; } struct DebtReserves { uint token0Debt; uint token1Debt; uint token0RealReserves; uint token1RealReserves; uint token0ImaginaryReserves; uint token1ImaginaryReserves; } function getCollateralReserves( uint geometricMean_, uint upperRange_, uint lowerRange_, uint token0SupplyExchangePrice_, uint token1SupplyExchangePrice_ ) external view returns (CollateralReserves memory c_); function getDebtReserves( uint geometricMean_, uint upperRange_, uint lowerRange_, uint token0BorrowExchangePrice_, uint token1BorrowExchangePrice_ ) external view returns (DebtReserves memory d_); // reverts with FluidDexPricesAndExchangeRates(pex_); function getPricesAndExchangePrices() external; function constantsView() external view returns (ConstantViews memory constantsView_); function constantsView2() external view returns (ConstantViews2 memory constantsView2_); struct Oracle { uint twap1by0; // TWAP price uint lowestPrice1by0; // lowest price point uint highestPrice1by0; // highest price point uint twap0by1; // TWAP price uint lowestPrice0by1; // lowest price point uint highestPrice0by1; // highest price point } /// @dev This function allows users to swap a specific amount of input tokens for output tokens /// @param swap0to1_ Direction of swap. If true, swaps token0 for token1; if false, swaps token1 for token0 /// @param amountIn_ The exact amount of input tokens to swap /// @param amountOutMin_ The minimum amount of output tokens the user is willing to accept /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with amountOut_ /// @return amountOut_ The amount of output tokens received from the swap function swapIn( bool swap0to1_, uint256 amountIn_, uint256 amountOutMin_, address to_ ) external payable returns (uint256 amountOut_); /// @dev Swap tokens with perfect amount out /// @param swap0to1_ Direction of swap. If true, swaps token0 for token1; if false, swaps token1 for token0 /// @param amountOut_ The exact amount of tokens to receive after swap /// @param amountInMax_ Maximum amount of tokens to swap in /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with amountIn_ /// @return amountIn_ The amount of input tokens used for the swap function swapOut( bool swap0to1_, uint256 amountOut_, uint256 amountInMax_, address to_ ) external payable returns (uint256 amountIn_); /// @dev Deposit tokens in equal proportion to the current pool ratio /// @param shares_ The number of shares to mint /// @param maxToken0Deposit_ Maximum amount of token0 to deposit /// @param maxToken1Deposit_ Maximum amount of token1 to deposit /// @param estimate_ If true, function will revert with estimated deposit amounts without executing the deposit /// @return token0Amt_ Amount of token0 deposited /// @return token1Amt_ Amount of token1 deposited function depositPerfect( uint shares_, uint maxToken0Deposit_, uint maxToken1Deposit_, bool estimate_ ) external payable returns (uint token0Amt_, uint token1Amt_); /// @dev This function allows users to withdraw a perfect amount of collateral liquidity /// @param shares_ The number of shares to withdraw /// @param minToken0Withdraw_ The minimum amount of token0 the user is willing to accept /// @param minToken1Withdraw_ The minimum amount of token1 the user is willing to accept /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with token0Amt_ & token1Amt_ /// @return token0Amt_ The amount of token0 withdrawn /// @return token1Amt_ The amount of token1 withdrawn function withdrawPerfect( uint shares_, uint minToken0Withdraw_, uint minToken1Withdraw_, address to_ ) external returns (uint token0Amt_, uint token1Amt_); /// @dev This function allows users to borrow tokens in equal proportion to the current debt pool ratio /// @param shares_ The number of shares to borrow /// @param minToken0Borrow_ Minimum amount of token0 to borrow /// @param minToken1Borrow_ Minimum amount of token1 to borrow /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with token0Amt_ & token1Amt_ /// @return token0Amt_ Amount of token0 borrowed /// @return token1Amt_ Amount of token1 borrowed function borrowPerfect( uint shares_, uint minToken0Borrow_, uint minToken1Borrow_, address to_ ) external returns (uint token0Amt_, uint token1Amt_); /// @dev This function allows users to pay back borrowed tokens in equal proportion to the current debt pool ratio /// @param shares_ The number of shares to pay back /// @param maxToken0Payback_ Maximum amount of token0 to pay back /// @param maxToken1Payback_ Maximum amount of token1 to pay back /// @param estimate_ If true, function will revert with estimated payback amounts without executing the payback /// @return token0Amt_ Amount of token0 paid back /// @return token1Amt_ Amount of token1 paid back function paybackPerfect( uint shares_, uint maxToken0Payback_, uint maxToken1Payback_, bool estimate_ ) external payable returns (uint token0Amt_, uint token1Amt_); /// @dev This function allows users to deposit tokens in any proportion into the col pool /// @param token0Amt_ The amount of token0 to deposit /// @param token1Amt_ The amount of token1 to deposit /// @param minSharesAmt_ The minimum amount of shares the user expects to receive /// @param estimate_ If true, function will revert with estimated shares without executing the deposit /// @return shares_ The amount of shares minted for the deposit function deposit( uint token0Amt_, uint token1Amt_, uint minSharesAmt_, bool estimate_ ) external payable returns (uint shares_); /// @dev This function allows users to withdraw tokens in any proportion from the col pool /// @param token0Amt_ The amount of token0 to withdraw /// @param token1Amt_ The amount of token1 to withdraw /// @param maxSharesAmt_ The maximum number of shares the user is willing to burn /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with shares_ /// @return shares_ The number of shares burned for the withdrawal function withdraw( uint token0Amt_, uint token1Amt_, uint maxSharesAmt_, address to_ ) external returns (uint shares_); /// @dev This function allows users to borrow tokens in any proportion from the debt pool /// @param token0Amt_ The amount of token0 to borrow /// @param token1Amt_ The amount of token1 to borrow /// @param maxSharesAmt_ The maximum amount of shares the user is willing to receive /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with shares_ /// @return shares_ The amount of borrow shares minted to represent the borrowed amount function borrow( uint token0Amt_, uint token1Amt_, uint maxSharesAmt_, address to_ ) external returns (uint shares_); /// @dev This function allows users to payback tokens in any proportion to the debt pool /// @param token0Amt_ The amount of token0 to payback /// @param token1Amt_ The amount of token1 to payback /// @param minSharesAmt_ The minimum amount of shares the user expects to burn /// @param estimate_ If true, function will revert with estimated shares without executing the payback /// @return shares_ The amount of borrow shares burned for the payback function payback( uint token0Amt_, uint token1Amt_, uint minSharesAmt_, bool estimate_ ) external payable returns (uint shares_); /// @dev This function allows users to withdraw their collateral with perfect shares in one token /// @param shares_ The number of shares to burn for withdrawal /// @param minToken0_ The minimum amount of token0 the user expects to receive (set to 0 if withdrawing in token1) /// @param minToken1_ The minimum amount of token1 the user expects to receive (set to 0 if withdrawing in token0) /// @param to_ Recipient of swapped tokens. If to_ == address(0) then out tokens will be sent to msg.sender. If to_ == ADDRESS_DEAD then function will revert with withdrawAmt_ /// @return withdrawAmt_ The amount of tokens withdrawn in the chosen token function withdrawPerfectInOneToken( uint shares_, uint minToken0_, uint minToken1_, address to_ ) external returns ( uint withdrawAmt_ ); /// @dev This function allows users to payback their debt with perfect shares in one token /// @param shares_ The number of shares to burn for payback /// @param maxToken0_ The maximum amount of token0 the user is willing to pay (set to 0 if paying back in token1) /// @param maxToken1_ The maximum amount of token1 the user is willing to pay (set to 0 if paying back in token0) /// @param estimate_ If true, the function will revert with the estimated payback amount without executing the payback /// @return paybackAmt_ The amount of tokens paid back in the chosen token function paybackPerfectInOneToken( uint shares_, uint maxToken0_, uint maxToken1_, bool estimate_ ) external payable returns ( uint paybackAmt_ ); /// @dev the oracle assumes last set price of pool till the next swap happens. /// There's a possibility that during that time some interest is generated hence the last stored price is not the 100% correct price for the whole duration /// but the difference due to interest will be super low so this difference is ignored /// For example 2 swaps happened 10min (600 seconds) apart and 1 token has 10% higher interest than other. /// then that token will accrue about 10% * 600 / secondsInAYear = ~0.0002% /// @param secondsAgos_ array of seconds ago for which TWAP is needed. If user sends [10, 30, 60] then twaps_ will return [10-0, 30-10, 60-30] /// @return twaps_ twap price, lowest price (aka minima) & highest price (aka maxima) between secondsAgo checkpoints /// @return currentPrice_ price of pool after the most recent swap function oraclePrice( uint[] memory secondsAgos_ ) external view returns ( Oracle[] memory twaps_, uint currentPrice_ ); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"factory_","type":"address"},{"internalType":"address","name":"liquidity_","type":"address"},{"internalType":"address","name":"liquidityResolver_","type":"address"},{"internalType":"address","name":"deployer_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DEPLOYER_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FACTORY","outputs":[{"internalType":"contract IFluidDexFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDITY","outputs":[{"internalType":"contract IFluidLiquidity","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDITY_RESOLVER","outputs":[{"internalType":"contract IFluidLiquidityResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"},{"internalType":"uint256","name":"maxSharesAmt_","type":"uint256"}],"name":"estimateBorrow","outputs":[{"internalType":"uint256","name":"shares_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"},{"internalType":"uint256","name":"minToken0Borrow_","type":"uint256"},{"internalType":"uint256","name":"minToken1Borrow_","type":"uint256"}],"name":"estimateBorrowPerfect","outputs":[{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"},{"internalType":"uint256","name":"minSharesAmt_","type":"uint256"}],"name":"estimateDeposit","outputs":[{"internalType":"uint256","name":"shares_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"},{"internalType":"uint256","name":"maxToken0Deposit_","type":"uint256"},{"internalType":"uint256","name":"maxToken1Deposit_","type":"uint256"}],"name":"estimateDepositPerfect","outputs":[{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"},{"internalType":"uint256","name":"minSharesAmt_","type":"uint256"}],"name":"estimatePayback","outputs":[{"internalType":"uint256","name":"shares_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"},{"internalType":"uint256","name":"maxToken0Payback_","type":"uint256"},{"internalType":"uint256","name":"maxToken1Payback_","type":"uint256"}],"name":"estimatePaybackPerfect","outputs":[{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"},{"internalType":"uint256","name":"maxToken0_","type":"uint256"},{"internalType":"uint256","name":"maxToken1_","type":"uint256"}],"name":"estimatePaybackPerfectInOneToken","outputs":[{"internalType":"uint256","name":"paybackAmt_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"bool","name":"swap0to1_","type":"bool"},{"internalType":"uint256","name":"amountIn_","type":"uint256"},{"internalType":"uint256","name":"amountOutMin_","type":"uint256"}],"name":"estimateSwapIn","outputs":[{"internalType":"uint256","name":"amountOut_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"bool","name":"swap0to1_","type":"bool"},{"internalType":"uint256","name":"amountOut_","type":"uint256"},{"internalType":"uint256","name":"amountInMax_","type":"uint256"}],"name":"estimateSwapOut","outputs":[{"internalType":"uint256","name":"amountIn_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"},{"internalType":"uint256","name":"maxSharesAmt_","type":"uint256"}],"name":"estimateWithdraw","outputs":[{"internalType":"uint256","name":"shares_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"},{"internalType":"uint256","name":"minToken0Withdraw_","type":"uint256"},{"internalType":"uint256","name":"minToken1Withdraw_","type":"uint256"}],"name":"estimateWithdrawPerfect","outputs":[{"internalType":"uint256","name":"token0Amt_","type":"uint256"},{"internalType":"uint256","name":"token1Amt_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"},{"internalType":"uint256","name":"minToken0_","type":"uint256"},{"internalType":"uint256","name":"minToken1_","type":"uint256"}],"name":"estimateWithdrawPerfectInOneToken","outputs":[{"internalType":"uint256","name":"withdrawAmt_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllDexAddresses","outputs":[{"internalType":"address[]","name":"dexes_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllDexEntireDatas","outputs":[{"components":[{"internalType":"address","name":"dex","type":"address"},{"components":[{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"address","name":"liquidity","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"address","name":"shift","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"colOperations","type":"address"},{"internalType":"address","name":"debtOperations","type":"address"},{"internalType":"address","name":"perfectOperationsAndOracle","type":"address"}],"internalType":"struct IFluidDexT1.Implementations","name":"implementations","type":"tuple"},{"internalType":"address","name":"deployerContract","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bytes32","name":"supplyToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"supplyToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken1Slot","type":"bytes32"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews","name":"constantViews","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token0DenominatorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1DenominatorPrecision","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews2","name":"constantViews2","type":"tuple"},{"components":[{"internalType":"bool","name":"isSmartCollateralEnabled","type":"bool"},{"internalType":"bool","name":"isSmartDebtEnabled","type":"bool"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"revenueCut","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"upperShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"lowerShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"shiftingTime","type":"uint256"},{"internalType":"address","name":"centerPriceAddress","type":"address"},{"internalType":"address","name":"hookAddress","type":"address"},{"internalType":"uint256","name":"maxCenterPrice","type":"uint256"},{"internalType":"uint256","name":"minCenterPrice","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"}],"internalType":"struct Structs.Configs","name":"configs","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"geometricMean","type":"uint256"},{"internalType":"uint256","name":"supplyToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyToken1ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken1ExchangePrice","type":"uint256"}],"internalType":"struct IFluidDexT1.PricesAndExchangePrice","name":"pex","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.CollateralReserves","name":"colReserves","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0Debt","type":"uint256"},{"internalType":"uint256","name":"token1Debt","type":"uint256"},{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.DebtReserves","name":"debtReserves","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastToLastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastPricesTimeDiff","type":"uint256"},{"internalType":"uint256","name":"oracleCheckPoint","type":"uint256"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"bool","name":"isSwapAndArbitragePaused","type":"bool"},{"components":[{"internalType":"bool","name":"isRangeChangeActive","type":"bool"},{"internalType":"bool","name":"isThresholdChangeActive","type":"bool"},{"internalType":"bool","name":"isCenterPriceShiftActive","type":"bool"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"rangeShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"thresholdShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"shiftPercentage","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"internalType":"struct Structs.CenterPriceShift","name":"centerPriceShift","type":"tuple"}],"internalType":"struct Structs.ShiftChanges","name":"shifts","type":"tuple"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"}],"internalType":"struct Structs.DexState","name":"dexState","type":"tuple"},{"components":[{"internalType":"uint256","name":"liquiditySupplyToken0","type":"uint256"},{"internalType":"uint256","name":"liquiditySupplyToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken1","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken1","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.SwapLimitsAndAvailability","name":"limitsAndAvailability","type":"tuple"}],"internalType":"struct Structs.DexEntireData[]","name":"datas_","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getCenterPriceShiftRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dexId_","type":"uint256"}],"name":"getDexAddress","outputs":[{"internalType":"address","name":"dex_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexCollateralReserves","outputs":[{"components":[{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.CollateralReserves","name":"reserves_","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexConfigs","outputs":[{"components":[{"internalType":"bool","name":"isSmartCollateralEnabled","type":"bool"},{"internalType":"bool","name":"isSmartDebtEnabled","type":"bool"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"revenueCut","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"upperShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"lowerShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"shiftingTime","type":"uint256"},{"internalType":"address","name":"centerPriceAddress","type":"address"},{"internalType":"address","name":"hookAddress","type":"address"},{"internalType":"uint256","name":"maxCenterPrice","type":"uint256"},{"internalType":"uint256","name":"minCenterPrice","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"}],"internalType":"struct Structs.Configs","name":"configs_","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexConstantsView","outputs":[{"components":[{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"address","name":"liquidity","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"address","name":"shift","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"colOperations","type":"address"},{"internalType":"address","name":"debtOperations","type":"address"},{"internalType":"address","name":"perfectOperationsAndOracle","type":"address"}],"internalType":"struct IFluidDexT1.Implementations","name":"implementations","type":"tuple"},{"internalType":"address","name":"deployerContract","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bytes32","name":"supplyToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"supplyToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken1Slot","type":"bytes32"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews","name":"constantsView_","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexConstantsView2","outputs":[{"components":[{"internalType":"uint256","name":"token0NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token0DenominatorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1DenominatorPrecision","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews2","name":"constantsView2_","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexDebtReserves","outputs":[{"components":[{"internalType":"uint256","name":"token0Debt","type":"uint256"},{"internalType":"uint256","name":"token1Debt","type":"uint256"},{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.DebtReserves","name":"reserves_","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexEntireData","outputs":[{"components":[{"internalType":"address","name":"dex","type":"address"},{"components":[{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"address","name":"liquidity","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"address","name":"shift","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"colOperations","type":"address"},{"internalType":"address","name":"debtOperations","type":"address"},{"internalType":"address","name":"perfectOperationsAndOracle","type":"address"}],"internalType":"struct IFluidDexT1.Implementations","name":"implementations","type":"tuple"},{"internalType":"address","name":"deployerContract","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bytes32","name":"supplyToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"supplyToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken1Slot","type":"bytes32"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews","name":"constantViews","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token0DenominatorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1DenominatorPrecision","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews2","name":"constantViews2","type":"tuple"},{"components":[{"internalType":"bool","name":"isSmartCollateralEnabled","type":"bool"},{"internalType":"bool","name":"isSmartDebtEnabled","type":"bool"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"revenueCut","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"upperShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"lowerShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"shiftingTime","type":"uint256"},{"internalType":"address","name":"centerPriceAddress","type":"address"},{"internalType":"address","name":"hookAddress","type":"address"},{"internalType":"uint256","name":"maxCenterPrice","type":"uint256"},{"internalType":"uint256","name":"minCenterPrice","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"}],"internalType":"struct Structs.Configs","name":"configs","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"geometricMean","type":"uint256"},{"internalType":"uint256","name":"supplyToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyToken1ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken1ExchangePrice","type":"uint256"}],"internalType":"struct IFluidDexT1.PricesAndExchangePrice","name":"pex","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.CollateralReserves","name":"colReserves","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0Debt","type":"uint256"},{"internalType":"uint256","name":"token1Debt","type":"uint256"},{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.DebtReserves","name":"debtReserves","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastToLastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastPricesTimeDiff","type":"uint256"},{"internalType":"uint256","name":"oracleCheckPoint","type":"uint256"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"bool","name":"isSwapAndArbitragePaused","type":"bool"},{"components":[{"internalType":"bool","name":"isRangeChangeActive","type":"bool"},{"internalType":"bool","name":"isThresholdChangeActive","type":"bool"},{"internalType":"bool","name":"isCenterPriceShiftActive","type":"bool"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"rangeShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"thresholdShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"shiftPercentage","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"internalType":"struct Structs.CenterPriceShift","name":"centerPriceShift","type":"tuple"}],"internalType":"struct Structs.ShiftChanges","name":"shifts","type":"tuple"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"}],"internalType":"struct Structs.DexState","name":"dexState","type":"tuple"},{"components":[{"internalType":"uint256","name":"liquiditySupplyToken0","type":"uint256"},{"internalType":"uint256","name":"liquiditySupplyToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken1","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken1","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.SwapLimitsAndAvailability","name":"limitsAndAvailability","type":"tuple"}],"internalType":"struct Structs.DexEntireData","name":"data_","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"dexes_","type":"address[]"}],"name":"getDexEntireDatas","outputs":[{"components":[{"internalType":"address","name":"dex","type":"address"},{"components":[{"internalType":"uint256","name":"dexId","type":"uint256"},{"internalType":"address","name":"liquidity","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"address","name":"shift","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"colOperations","type":"address"},{"internalType":"address","name":"debtOperations","type":"address"},{"internalType":"address","name":"perfectOperationsAndOracle","type":"address"}],"internalType":"struct IFluidDexT1.Implementations","name":"implementations","type":"tuple"},{"internalType":"address","name":"deployerContract","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"bytes32","name":"supplyToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"supplyToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"borrowToken1Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken0Slot","type":"bytes32"},{"internalType":"bytes32","name":"exchangePriceToken1Slot","type":"bytes32"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews","name":"constantViews","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token0DenominatorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1NumeratorPrecision","type":"uint256"},{"internalType":"uint256","name":"token1DenominatorPrecision","type":"uint256"}],"internalType":"struct IFluidDexT1.ConstantViews2","name":"constantViews2","type":"tuple"},{"components":[{"internalType":"bool","name":"isSmartCollateralEnabled","type":"bool"},{"internalType":"bool","name":"isSmartDebtEnabled","type":"bool"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"revenueCut","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"upperShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"lowerShiftThreshold","type":"uint256"},{"internalType":"uint256","name":"shiftingTime","type":"uint256"},{"internalType":"address","name":"centerPriceAddress","type":"address"},{"internalType":"address","name":"hookAddress","type":"address"},{"internalType":"uint256","name":"maxCenterPrice","type":"uint256"},{"internalType":"uint256","name":"minCenterPrice","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"maxSupplyShares","type":"uint256"},{"internalType":"uint256","name":"maxBorrowShares","type":"uint256"}],"internalType":"struct Structs.Configs","name":"configs","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"geometricMean","type":"uint256"},{"internalType":"uint256","name":"supplyToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyToken1ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken1ExchangePrice","type":"uint256"}],"internalType":"struct IFluidDexT1.PricesAndExchangePrice","name":"pex","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.CollateralReserves","name":"colReserves","type":"tuple"},{"components":[{"internalType":"uint256","name":"token0Debt","type":"uint256"},{"internalType":"uint256","name":"token1Debt","type":"uint256"},{"internalType":"uint256","name":"token0RealReserves","type":"uint256"},{"internalType":"uint256","name":"token1RealReserves","type":"uint256"},{"internalType":"uint256","name":"token0ImaginaryReserves","type":"uint256"},{"internalType":"uint256","name":"token1ImaginaryReserves","type":"uint256"}],"internalType":"struct IFluidDexT1.DebtReserves","name":"debtReserves","type":"tuple"},{"components":[{"internalType":"uint256","name":"lastToLastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastPricesTimeDiff","type":"uint256"},{"internalType":"uint256","name":"oracleCheckPoint","type":"uint256"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"bool","name":"isSwapAndArbitragePaused","type":"bool"},{"components":[{"internalType":"bool","name":"isRangeChangeActive","type":"bool"},{"internalType":"bool","name":"isThresholdChangeActive","type":"bool"},{"internalType":"bool","name":"isCenterPriceShiftActive","type":"bool"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"rangeShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"thresholdShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"shiftPercentage","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"internalType":"struct Structs.CenterPriceShift","name":"centerPriceShift","type":"tuple"}],"internalType":"struct Structs.ShiftChanges","name":"shifts","type":"tuple"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"}],"internalType":"struct Structs.DexState","name":"dexState","type":"tuple"},{"components":[{"internalType":"uint256","name":"liquiditySupplyToken0","type":"uint256"},{"internalType":"uint256","name":"liquiditySupplyToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken1","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken1","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.SwapLimitsAndAvailability","name":"limitsAndAvailability","type":"tuple"}],"internalType":"struct Structs.DexEntireData[]","name":"datas_","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexId","outputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256[]","name":"secondsAgos_","type":"uint256[]"}],"name":"getDexOraclePrice","outputs":[{"components":[{"internalType":"uint256","name":"twap1by0","type":"uint256"},{"internalType":"uint256","name":"lowestPrice1by0","type":"uint256"},{"internalType":"uint256","name":"highestPrice1by0","type":"uint256"},{"internalType":"uint256","name":"twap0by1","type":"uint256"},{"internalType":"uint256","name":"lowestPrice0by1","type":"uint256"},{"internalType":"uint256","name":"highestPrice0by1","type":"uint256"}],"internalType":"struct IFluidDexT1.Oracle[]","name":"twaps_","type":"tuple[]"},{"internalType":"uint256","name":"currentPrice_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexPricesAndExchangePrices","outputs":[{"components":[{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"upperRange","type":"uint256"},{"internalType":"uint256","name":"lowerRange","type":"uint256"},{"internalType":"uint256","name":"geometricMean","type":"uint256"},{"internalType":"uint256","name":"supplyToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken0ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyToken1ExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowToken1ExchangePrice","type":"uint256"}],"internalType":"struct IFluidDexT1.PricesAndExchangePrice","name":"pex_","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexState","outputs":[{"components":[{"internalType":"uint256","name":"lastToLastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"lastStoredPrice","type":"uint256"},{"internalType":"uint256","name":"centerPrice","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"lastPricesTimeDiff","type":"uint256"},{"internalType":"uint256","name":"oracleCheckPoint","type":"uint256"},{"internalType":"uint256","name":"oracleMapping","type":"uint256"},{"internalType":"uint256","name":"totalSupplyShares","type":"uint256"},{"internalType":"uint256","name":"totalBorrowShares","type":"uint256"},{"internalType":"bool","name":"isSwapAndArbitragePaused","type":"bool"},{"components":[{"internalType":"bool","name":"isRangeChangeActive","type":"bool"},{"internalType":"bool","name":"isThresholdChangeActive","type":"bool"},{"internalType":"bool","name":"isCenterPriceShiftActive","type":"bool"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"rangeShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"oldUpper","type":"uint256"},{"internalType":"uint256","name":"oldLower","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"oldTime","type":"uint256"}],"internalType":"struct Structs.ShiftData","name":"thresholdShift","type":"tuple"},{"components":[{"internalType":"uint256","name":"shiftPercentage","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"internalType":"struct Structs.CenterPriceShift","name":"centerPriceShift","type":"tuple"}],"internalType":"struct Structs.ShiftChanges","name":"shifts","type":"tuple"},{"internalType":"uint256","name":"token0PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token1PerSupplyShare","type":"uint256"},{"internalType":"uint256","name":"token0PerBorrowShare","type":"uint256"},{"internalType":"uint256","name":"token1PerBorrowShare","type":"uint256"}],"internalType":"struct Structs.DexState","name":"state_","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexSwapLimitsAndAvailability","outputs":[{"components":[{"internalType":"uint256","name":"liquiditySupplyToken0","type":"uint256"},{"internalType":"uint256","name":"liquiditySupplyToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityWithdrawableToken1","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken0","type":"uint256"},{"internalType":"uint256","name":"liquidityBorrowableToken1","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"utilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilUtilizationLimitToken1","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken0","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilUtilizationLimitToken1","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.SwapLimitsAndAvailability","name":"limitsAndAvailability_","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexTokens","outputs":[{"internalType":"address","name":"token0_","type":"address"},{"internalType":"address","name":"token1_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexVariables2Raw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getDexVariablesRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"getOracleRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getRangeShiftRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getThresholdShiftRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getTotalBorrowSharesRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalDexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"}],"name":"getTotalSupplySharesRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address","name":"user_","type":"address"}],"name":"getUserBorrowData","outputs":[{"components":[{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.UserBorrowData","name":"userBorrowData_","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address","name":"user_","type":"address"}],"name":"getUserBorrowDataRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address[]","name":"users_","type":"address[]"}],"name":"getUserBorrowDatas","outputs":[{"components":[{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.UserBorrowData[]","name":"userBorrowingsData_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address[]","name":"users_","type":"address[]"}],"name":"getUserBorrowSupplyDatas","outputs":[{"components":[{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.UserSupplyData[]","name":"userSuppliesData_","type":"tuple[]"},{"components":[{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"borrow","type":"uint256"},{"internalType":"uint256","name":"borrowLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"maxBorrowLimit","type":"uint256"},{"internalType":"uint256","name":"borrowableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"borrowable","type":"uint256"},{"internalType":"uint256","name":"borrowLimitUtilization","type":"uint256"}],"internalType":"struct Structs.UserBorrowData","name":"liquidityUserBorrowDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.UserBorrowData[]","name":"userBorrowingsData_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address","name":"user_","type":"address"}],"name":"getUserSupplyData","outputs":[{"components":[{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.UserSupplyData","name":"userSupplyData_","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address","name":"user_","type":"address"}],"name":"getUserSupplyDataRaw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dex_","type":"address"},{"internalType":"address[]","name":"users_","type":"address[]"}],"name":"getUserSupplyDatas","outputs":[{"components":[{"internalType":"bool","name":"isAllowed","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken0","type":"tuple"},{"components":[{"internalType":"bool","name":"modeWithInterest","type":"bool"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"withdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"expandPercent","type":"uint256"},{"internalType":"uint256","name":"expandDuration","type":"uint256"},{"internalType":"uint256","name":"baseWithdrawalLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawableUntilLimit","type":"uint256"},{"internalType":"uint256","name":"withdrawable","type":"uint256"}],"internalType":"struct Structs.UserSupplyData","name":"liquidityUserSupplyDataToken1","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData0","type":"tuple"},{"components":[{"internalType":"uint256","name":"borrowRate","type":"uint256"},{"internalType":"uint256","name":"supplyRate","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"lastStoredUtilization","type":"uint256"},{"internalType":"uint256","name":"storageUpdateThreshold","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTimestamp","type":"uint256"},{"internalType":"uint256","name":"supplyExchangePrice","type":"uint256"},{"internalType":"uint256","name":"borrowExchangePrice","type":"uint256"},{"internalType":"uint256","name":"supplyRawInterest","type":"uint256"},{"internalType":"uint256","name":"supplyInterestFree","type":"uint256"},{"internalType":"uint256","name":"borrowRawInterest","type":"uint256"},{"internalType":"uint256","name":"borrowInterestFree","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"totalBorrow","type":"uint256"},{"internalType":"uint256","name":"revenue","type":"uint256"},{"internalType":"uint256","name":"maxUtilization","type":"uint256"},{"components":[{"internalType":"uint256","name":"version","type":"uint256"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV1Params","name":"rateDataV1","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"kink1","type":"uint256"},{"internalType":"uint256","name":"kink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationZero","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink1","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationKink2","type":"uint256"},{"internalType":"uint256","name":"rateAtUtilizationMax","type":"uint256"}],"internalType":"struct Structs.RateDataV2Params","name":"rateDataV2","type":"tuple"}],"internalType":"struct Structs.RateData","name":"rateData","type":"tuple"}],"internalType":"struct Structs.OverallTokenData","name":"liquidityTokenData1","type":"tuple"}],"internalType":"struct Structs.UserSupplyData[]","name":"userSuppliesData_","type":"tuple[]"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101006040523480156200001257600080fd5b5060405162005e2038038062005e20833981016040819052620000359162000075565b6001600160a01b0393841660805291831660a052821660c0521660e052620000d2565b80516001600160a01b03811681146200007057600080fd5b919050565b600080600080608085870312156200008c57600080fd5b620000978562000058565b9350620000a76020860162000058565b9250620000b76040860162000058565b9150620000c76060860162000058565b905092959194509250565b60805160a05160c05160e051615cc062000160600039600081816108be0152818161216201526121ae01526000818161068d01528181611ad701528181611b7801528181612345015281816123e601528181612fcc0152818161306b0152818161310a01526131a4015260006104c20152600081816104f601528181610db4015261246b0152615cc06000f3fe6080604052600436106103135760003560e01c80637b05c2001161019a578063cdaf7f22116100e1578063e72ef91b1161008a578063eeb9baeb11610064578063eeb9baeb146109cf578063eee99670146109ef578063f44dfe5014610a0f57600080fd5b8063e72ef91b1461096d578063ebf11ce41461099a578063ee221c08146109af57600080fd5b8063d91a0633116100bb578063d91a0633146108f3578063e1a25ab914610913578063e5c458431461094057600080fd5b8063cdaf7f221461088c578063d1d32444146108ac578063d82ae0fa146108e057600080fd5b8063957755e6116101435780639bb65fc71161011d5780639bb65fc7146108465780639c1b042314610866578063bb39e3a11461087957600080fd5b8063957755e6146107d9578063967915d6146107f957806396cc6dbf1461082657600080fd5b80638ad1fe82116101745780638ad1fe82146107695780638bfe3db21461079757806395430c41146107ac57600080fd5b80637b05c200146106ef5780637f51d07f1461070f57806384502d951461073c57600080fd5b80633a490e6f1161025e5780634f8666a0116102075780636902f79f116101e15780636902f79f1461067b5780636dd5fd85146106af578063741c0b5c146106cf57600080fd5b80634f8666a01461060e578063546b08cd1461062e57806355181f111461064e57600080fd5b8063425711371161023857806342571137146105bb578063472f2d09146105ce5780634dd3a4e0146105ee57600080fd5b80633a490e6f146105455780633cb84b11146105655780633f7256611461059357600080fd5b80631cba0023116102c05780632861c7d11161029a5780632861c7d1146104b05780632dd31000146104e4578063345df8df1461051857600080fd5b80631cba0023146104345780632516d94014610461578063266398ef1461048e57600080fd5b80631272e9ac116102f15780631272e9ac146103bb57806312e366aa146103dc57806318e172d91461041457600080fd5b8063015f6cfa146103185780630208dbb01461034e578063030a68101461037b575b600080fd5b34801561032457600080fd5b506103386103333660046141b0565b610a22565b60405161034591906141cd565b60405180910390f35b34801561035a57600080fd5b5061036e6103693660046141b0565b610b5d565b6040516103459190614ad6565b34801561038757600080fd5b5061039b6103963660046141b0565b610c28565b604080516001600160a01b03938416815292909116602083015201610345565b6103ce6103c9366004614ae5565b610ca6565b604051908152602001610345565b3480156103e857600080fd5b506103fc6103f7366004614b20565b610dad565b6040516001600160a01b039091168152602001610345565b34801561042057600080fd5b506103ce61042f3660046141b0565b610ddf565b34801561044057600080fd5b5061045461044f3660046141b0565b610e4c565b6040516103459190614b39565b34801561046d57600080fd5b5061048161047c3660046141b0565b610e6f565b6040516103459190614b48565b34801561049a57600080fd5b506104a3610ebd565b6040516103459190614b57565b3480156104bc57600080fd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104f057600080fd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561052457600080fd5b50610538610533366004614ceb565b610f6a565b6040516103459190614d7f565b34801561055157600080fd5b506103ce6105603660046141b0565b611021565b34801561057157600080fd5b50610585610580366004614dc2565b611050565b604051610345929190615193565b6105a66105a1366004614ae5565b6111b6565b60408051928352602083019190915201610345565b6103ce6105c93660046151c6565b6112c4565b3480156105da57600080fd5b506103ce6105e936600461520c565b6113bb565b3480156105fa57600080fd5b506103ce610609366004615238565b61143d565b34801561061a57600080fd5b506103ce6106293660046141b0565b611459565b34801561063a57600080fd5b506103ce6106493660046141b0565b6114d0565b34801561065a57600080fd5b5061066e6106693660046141b0565b611555565b6040516103459190615271565b34801561068757600080fd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b3480156106bb57600080fd5b506103ce6106ca3660046141b0565b6115a0565b3480156106db57600080fd5b506103ce6106ea366004614ae5565b6115d0565b3480156106fb57600080fd5b506105a661070a366004614ae5565b611663565b34801561071b57600080fd5b5061072f61072a3660046141b0565b6116f7565b60405161034591906152b4565b34801561074857600080fd5b5061075c610757366004614dc2565b611784565b60405161034591906152df565b34801561077557600080fd5b506107896107843660046152f2565b611836565b604051610345929190615398565b3480156107a357600080fd5b506105386118b7565b3480156107b857600080fd5b506107cc6107c7366004614dc2565b6118c9565b604051610345919061541f565b3480156107e557600080fd5b5061072f6107f43660046141b0565b611972565b34801561080557600080fd5b50610819610814366004615238565b6119af565b6040516103459190615432565b34801561083257600080fd5b506105a6610841366004614ae5565b611bfa565b34801561085257600080fd5b506103ce610861366004614ae5565b611c5b565b6103ce610874366004614ae5565b611d4e565b6103ce6108873660046151c6565b611de1565b34801561089857600080fd5b506103ce6108a73660046141b0565b611e43565b3480156108b857600080fd5b506103fc7f000000000000000000000000000000000000000000000000000000000000000081565b6103ce6108ee366004614ae5565b611e73565b3480156108ff57600080fd5b506103ce61090e3660046141b0565b611ed3565b34801561091f57600080fd5b5061093361092e3660046141b0565b611f03565b6040516103459190615441565b34801561094c57600080fd5b5061096061095b3660046141b0565b612003565b6040516103459190615450565b34801561097957600080fd5b5061098d610988366004615238565b612238565b604051610345919061545f565b3480156109a657600080fd5b506103ce612467565b3480156109bb57600080fd5b506103ce6109ca366004615238565b6124eb565b3480156109db57600080fd5b506103ce6109ea3660046141b0565b612507565b3480156109fb57600080fd5b506103ce610a0a366004614ae5565b612547565b6105a6610a1d366004614ae5565b6125a6565b610a716040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b816001600160a01b031663916cef4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610aac57600080fd5b505af1925050508015610abd575060015b610b58573d808015610aeb576040519150601f19603f3d011682016040523d82523d6000602084013e610af0565b606091505b5060208101517fdc4022c5000000000000000000000000000000000000000000000000000000006001600160e01b0319821601610b5557610b3f826004808551610b3a9190615484565b612608565b806020019051810190610b529190615497565b92505b50505b919050565b610b65613953565b6001600160a01b0382168152610b7a82611f03565b6020820152610b88826116f7565b6040820152610b9682612003565b6060820152610ba482610a22565b60808201526040810151610bb9908390612732565b60a08201526040810151610bce9083906129af565b60c0820181905260a0820151610be691849190612cb3565b8160e00181905250610c1d82826020015160a00151836020015160c0015184606001516101a0015185606001516101c00151612f9d565b610100820152919050565b6000806000836001600160a01b031663b7791bf26040518163ffffffff1660e01b815260040161024060405180830381865afa158015610c6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c909190615598565b90508060a001518160c001519250925050915091565b6040517fe980e1eb000000000000000000000000000000000000000000000000000000008152600481018490526024810183905260448101829052600160648201526000906001600160a01b0386169063e980e1eb9034906084015b60206040518083038185885af193505050508015610d3d575060408051601f3d908101601f19168201909252610d3a9181019061567f565b60015b610da3573d808015610d6b576040519150601f19603f3d011682016040523d82523d6000602084013e610d70565b606091505b50610d9b817fe8d35d06000000000000000000000000000000000000000000000000000000006133c8565b915050610da5565b505b949350505050565b6000610dd97f0000000000000000000000000000000000000000000000000000000000000000836133ff565b92915050565b604051632d71cdb960e21b8152600260048201526000906001600160a01b0383169063b5c736e4906024015b602060405180830381865afa158015610e28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd9919061567f565b610e54613baa565b610dd982610e6184611972565b610e6a85611555565b612cb3565b610e77613c28565b600080610e8384610c28565b915091506000610e92856115a0565b90506103ff60e482901c81169060ee83901c16610eb28786868585612f9d565b979650505050505050565b60606000610ec9612467565b90508067ffffffffffffffff811115610ee457610ee4614ba4565b604051908082528060200260200182016040528015610f0d578160200160208202803683370190505b50915060005b81811015610f6557610f296103f7826001615698565b838281518110610f3b57610f3b6156ab565b6001600160a01b039092166020928302919091019091015280610f5d816156c1565b915050610f13565b505090565b80516060908067ffffffffffffffff811115610f8857610f88614ba4565b604051908082528060200260200182016040528015610fc157816020015b610fae613953565b815260200190600190039081610fa65790505b50915060005b81811015610b5557610ff1848281518110610fe457610fe46156ab565b6020026020010151610b5d565b838281518110611003576110036156ab565b60200260200101819052508080611019906156c1565b915050610fc7565b604051632d71cdb960e21b81526004808201526000906001600160a01b0383169063b5c736e490602401610e0b565b606080828067ffffffffffffffff81111561106d5761106d614ba4565b6040519080825280602002602001820160405280156110a657816020015b611093613e1f565b81526020019060019003908161108b5790505b5092508067ffffffffffffffff8111156110c2576110c2614ba4565b6040519080825280602002602001820160405280156110fb57816020015b6110e8613f13565b8152602001906001900390816110e05790505b50915060005b818110156111ac576111348787878481811061111f5761111f6156ab565b905060200201602081019061098891906141b0565b848281518110611146576111466156ab565b602002602001018190525061117c87878784818110611167576111676156ab565b905060200201602081019061081491906141b0565b83828151811061118e5761118e6156ab565b602002602001018190525080806111a4906156c1565b915050611101565b5050935093915050565b6040517f4d9036de0000000000000000000000000000000000000000000000000000000081526004810184905260248101839052604481018290526001606482015260009081906001600160a01b03871690634d9036de9034906084015b604080518083038185885af19350505050801561124e575060408051601f3d908101601f1916820190925261124b918101906156da565b60015b6112b8573d80801561127c576040519150601f19603f3d011682016040523d82523d6000602084013e611281565b606091505b506112ac817f1458577f00000000000000000000000000000000000000000000000000000000613766565b90935091506112bb9050565b50505b94509492505050565b6040517f286f0e610000000000000000000000000000000000000000000000000000000081528315156004820152602481018390526044810182905261dead60648201526000906001600160a01b0386169063286f0e619034906084015b60206040518083038185885af19350505050801561135d575060408051601f3d908101601f1916820190925261135a9181019061567f565b60015b610da3573d80801561138b576040519150601f19603f3d011682016040523d82523d6000602084013e611390565b606091505b50610d9b817fb3bfda99000000000000000000000000000000000000000000000000000000006133c8565b6000826001600160a01b031663b5c736e46113d76006856137ae565b6040518263ffffffff1660e01b81526004016113f591815260200190565b602060405180830381865afa158015611412573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611436919061567f565b9392505050565b6000826001600160a01b031663b5c736e46113d76005856137e4565b604051632d71cdb960e21b8152600760048201526000906080906001600160a01b0384169063b5c736e490602401602060405180830381865afa1580156114a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c8919061567f565b901c92915050565b604051632d71cdb960e21b8152600760048201526000906fffffffffffffffffffffffffffffffff906001600160a01b0384169063b5c736e490602401602060405180830381865afa15801561152a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154e919061567f565b1692915050565b61158e6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b610dd98261159b846116f7565b6129af565b604051632d71cdb960e21b8152600160048201526000906001600160a01b0383169063b5c736e490602401610e0b565b6040517fd331bef700000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead60648201526000906001600160a01b0386169063d331bef7906084015b6020604051808303816000875af1925050508015610d3d575060408051601f3d908101601f19168201909252610d3a9181019061567f565b6040517fe27203cd00000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead606482015260009081906001600160a01b0387169063e27203cd906084015b60408051808303816000875af192505050801561124e575060408051601f3d908101601f1916820190925261124b918101906156da565b6117226040518060800160405280600081526020016000815260200160008152602001600081525090565b816001600160a01b0316631595cbd36040518163ffffffff1660e01b8152600401608060405180830381865afa158015611760573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd99190615764565b6060818067ffffffffffffffff8111156117a0576117a0614ba4565b6040519080825280602002602001820160405280156117d957816020015b6117c6613e1f565b8152602001906001900390816117be5790505b50915060005b8181101561182d576117fd8686868481811061111f5761111f6156ab565b83828151811061180f5761180f6156ab565b60200260200101819052508080611825906156c1565b9150506117df565b50509392505050565b60606000836001600160a01b031663d811b2ce846040518263ffffffff1660e01b81526004016118669190615780565b600060405180830381865afa158015611883573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118ab9190810190615832565b915091505b9250929050565b60606118c4610533610ebd565b905090565b6060818067ffffffffffffffff8111156118e5576118e5614ba4565b60405190808252806020026020018201604052801561191e57816020015b61190b613f13565b8152602001906001900390816119035790505b50915060005b8181101561182d5761194286868684818110611167576111676156ab565b838281518110611954576119546156ab565b6020026020010181905250808061196a906156c1565b915050611924565b61199d6040518060800160405280600081526020016000815260200160008152602001600081525090565b610dd9826119aa846116f7565b612732565b6119b7613f13565b60006119c3848461143d565b90508015611bf3576001808216811483526119f39082901c67ffffffffffffffff16600860ff9082901c91161b90565b60208301819052611a05908290613808565b60408301526401ffffffff608182901c166060830152613fff60a282901c16608083015262ffffff60b082901c1660a08301526103ff60d082901c1660ff60c883901c161b60c08301526103ff60e282901c1660ff60da83901c161b60e08301526020820151604083015111611a7c576000611a90565b81602001518260400151611a909190615484565b6101008301819052610120830152600080611aaa86610c28565b604051634b3c8aeb60e11b81526001600160a01b03898116600483015280841660248301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063967915d69060440161050060405180830381865afa158015611b21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b459190615adc565b610180860152610140850152604051634b3c8aeb60e11b81526001600160a01b03878116600483015282811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063967915d69060440161050060405180830381865afa158015611bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be49190615adc565b6101a086015261016085015250505b5092915050565b6040517f35f0df9800000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead606482015260009081906001600160a01b038716906335f0df98906084016116c0565b6040517f4c89bfd400000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead60648201526000906001600160a01b03861690634c89bfd4906084016020604051808303816000875af1925050508015611cf0575060408051601f3d908101601f19168201909252611ced9181019061567f565b60015b610da3573d808015611d1e576040519150601f19603f3d011682016040523d82523d6000602084013e611d23565b606091505b50610d9b817f73999506000000000000000000000000000000000000000000000000000000006133c8565b6040517f30acd6fd000000000000000000000000000000000000000000000000000000008152600481018490526024810183905260448101829052600160648201526000906001600160a01b038616906330acd6fd90349060840160206040518083038185885af193505050508015611cf0575060408051601f3d908101601f19168201909252611ced9181019061567f565b6040517f2668dfaa0000000000000000000000000000000000000000000000000000000081528315156004820152602481018390526044810182905261dead60648201526000906001600160a01b03861690632668dfaa903490608401611322565b604051632d71cdb960e21b8152600060048201819052906001600160a01b0383169063b5c736e490602401610e0b565b6040517f68766981000000000000000000000000000000000000000000000000000000008152600481018490526024810183905260448101829052600160648201526000906001600160a01b038616906368766981903490608401610d02565b604051632d71cdb960e21b8152600860048201526000906001600160a01b0383169063b5c736e490602401610e0b565b611fa0604080516101c08101825260008082526020808301829052828401829052835160a08101855282815290810182905292830181905260608381018290526080840191909152909190820190815260006020820181905260408201819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101409091015290565b816001600160a01b031663b7791bf26040518163ffffffff1660e01b815260040161024060405180830381865afa158015611fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd99190615598565b6120a06040518061022001604052806000151581526020016000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006120ab836115a0565b60018181161483526002808216811460208501526201ffff9082901c166040840152607f601382901c166060840152620fffff601b82901c8116608080860191909152602f83901c90911660a08501526103ff604483901c811660c0860152604e83901c1660e085015262ffffff605883901c1661010085015290915061213184610ddf565b901c6101e0830152608061214484611021565b901c610200830152607081901c633fffffff168015612197576121877f0000000000000000000000000000000000000000000000000000000000000000826133ff565b6001600160a01b03166101208401525b50608e81901c633fffffff1680156121e3576121d37f0000000000000000000000000000000000000000000000000000000000000000826133ff565b6001600160a01b03166101408401525b620fffff60b483901c1660ff60ac84901c161b610160840152620fffff60d083901c1660ff60c884901c161b610180840152506103ff60e482901c81166101a084015260ee9190911c166101c0820152919050565b612240613e1f565b600061224c84846124eb565b90508015611bf35760018082168114835261227c9082901c67ffffffffffffffff16600860ff9082901c91161b90565b6020830181905261228e9082906138c3565b60408301819052608182901c6401ffffffff16606084015260a282901c613fff16608084015260b082901c62ffffff1660a084015260d082901c6103ff1660c883901c60ff161b60c08401526020830151116122eb5760006122ff565b816040015182602001516122ff9190615484565b60e0830181905261010083015260008061231886610c28565b60405163e72ef91b60e01b81526001600160a01b03898116600483015280841660248301529294509092507f00000000000000000000000000000000000000000000000000000000000000009091169063e72ef91b906044016104c060405180830381865afa15801561238f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b39190615b9a565b61016086015261012085015260405163e72ef91b60e01b81526001600160a01b03878116600483015282811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063e72ef91b906044016104c060405180830381865afa15801561242e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124529190615b9a565b61018086015261014085015250505092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166393656c176040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c4919061567f565b6000826001600160a01b031663b5c736e46113d76003856137e4565b6000816001600160a01b031663f4b9a3fb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e28573d6000803e3d6000fd5b6040517f242011d500000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead60648201526000906001600160a01b0386169063242011d59060840161162b565b6040517f5b3d38d70000000000000000000000000000000000000000000000000000000081526004810184905260248101839052604481018290526001606482015260009081906001600160a01b03871690635b3d38d7903490608401611214565b60608161261681601f615698565b10156126695760405162461bcd60e51b815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064015b60405180910390fd5b6126738284615698565b845110156126c35760405162461bcd60e51b815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401612660565b811580156126e0576040519150600082526020820160405261272a565b6040519150601f8316801560200281840101848101868315602002848a0101015b81831015612719578051835260209283019201612701565b5050848452601f01601f1916604052505b509392505050565b61275d6040518060800160405280600081526020016000815260200160008152602001600081525090565b6000612768846115a0565b9050806001166001146127a25760405180608001604052806000815260200160008152602001600081526020016000815250915050610dd9565b60405162afb67d60e11b81526001600160a01b0385166004820152309063015f6cfa90602401610120604051808303816000875af1925050508015612804575060408051601f3d908101601f1916820190925261280191810190615497565b60015b61283457604051806080016040528060008152602001600081526020016000815260200160008152509150611bf3565b6080810151604080830151606084015160a085015160e086015193517f6560abaa000000000000000000000000000000000000000000000000000000008152600481019590955260248501929092526044840152606483015260848201526001600160a01b03861690636560abaa9060a401608060405180830381865afa9250505080156128df575060408051601f3d908101601f191682019092526128dc91810190615764565b60015b61290f576040518060800160405280600081526020016000815260200160008152602001600081525092506129a7565b8451602086015182516129229190615c35565b61292c9190615c4c565b84528451602086015160408301516129449190615c35565b61294e9190615c4c565b6040808601919091528501516060860151602083015161296e9190615c35565b6129789190615c4c565b60208501526040850151606080870151908301516129969190615c35565b6129a09190615c4c565b6060850152505b505092915050565b6129e86040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006129f3846115a0565b905080600216600214612a3b576040518060c0016040528060008152602001600081526020016000815260200160008152602001600081526020016000815250915050610dd9565b60405162afb67d60e11b81526001600160a01b0385166004820152309063015f6cfa90602401610120604051808303816000875af1925050508015612a9d575060408051601f3d908101601f19168201909252612a9a91810190615497565b60015b612adb576040518060c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152509150611bf3565b6080810151604080830151606084015160c085015161010086015193517f05d455a9000000000000000000000000000000000000000000000000000000008152600481019590955260248501929092526044840152606483015260848201526001600160a01b038616906305d455a99060a40160c060405180830381865afa925050508015612b87575060408051601f3d908101601f19168201909252612b8491810190615c6e565b60015b612bc5576040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525092506129a7565b845160208601518251612bd89190615c35565b612be29190615c4c565b8452845160208601516040830151612bfa9190615c35565b612c049190615c4c565b6040850152845160208601516080830151612c1f9190615c35565b612c299190615c4c565b6080850152604085015160608601516020830151612c479190615c35565b612c519190615c4c565b6020850152604085015160608087015190830151612c6f9190615c35565b612c799190615c4c565b846060018181525050846040015185606001518260a00151612c9b9190615c35565b612ca59190615c4c565b60a085015250505092915050565b612cbb613baa565b6000612cc685611e43565b64ffffffffff600182901c81168452602982901c81166020850152605182901c1660408401526401ffffffff607982901c166060840152623fffff609a82901c166080840152600760b082901c1660a084015261ffff60b382901c1660c084015290506fffffffffffffffffffffffffffffffff612d4386610ddf565b1660e08301526fffffffffffffffffffffffffffffffff612d6386611021565b16610100830152612d73856115a0565b600160ff82901c811461012085015261014084018051601a84901c8316831490528051604384901c831683146020909101525160f883901c82169091146040909101529050612dc1856114d0565b61014083018051606090810151620fffff8085169091528251820151601485901c82166020909101528251820151602885901c909116604091909101529051810151603c83901c6401ffffffff169101529050612e1d85611459565b610140830180516080908101516103ff8085169091528251820151601485901c9091166020909101528151810151602884901c620fffff166040909101528151810151603c84901c6401ffffffff16606091909101529051810151605d83901c62ffffff169101529050612e9085611ed3565b6101408301805160a0908101516401ffffffff84166040909101528151810151620fffff602185901c811690915291510151603583901c90911660209091015260e083015190915015612f335760e08201518451612ef690670de0b6b3a7640000615c35565b612f009190615c4c565b61016083015260e08201516020850151612f2290670de0b6b3a7640000615c35565b612f2c9190615c4c565b6101808301525b6101008201511561272a576101008201518351612f5890670de0b6b3a7640000615c35565b612f629190615c4c565b6101a08301526101008201516020840151612f8590670de0b6b3a7640000615c35565b612f8f9190615c4c565b6101c0830152509392505050565b612fa5613c28565b60405163e72ef91b60e01b81526001600160a01b03878116600483015286811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063e72ef91b906044016104c060405180830381865afa158015613014573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130389190615b9a565b6102408301526101c082015260405163e72ef91b60e01b81526001600160a01b03878116600483015285811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063e72ef91b906044016104c060405180830381865afa1580156130b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130d79190615b9a565b6102608301526101e0820152604051634b3c8aeb60e11b81526001600160a01b03878116600483015286811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063967915d69060440161050060405180830381865afa158015613152573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131769190615adc565b50610200820152604051634b3c8aeb60e11b81526001600160a01b03878116600483015285811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063967915d69060440161050060405180830381865afa1580156131ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132109190615adc565b506102208201819052610240820151610180808201518085526102608501519182015160208601526101a092830151604086015291015160608401526101c08301516101009081015160808501526101e0840151015160a08401526102008301516101209081015160c08501529091015160e08301526103e890613295908590615c35565b61329f9190615c4c565b61010082015260208101516103e8906132b9908490615c35565b6132c39190615c4c565b61012082015261010081015160408201511015613341578281604001516103e86132ed9190615c35565b6132f79190615c4c565b610140820181905281511161330d57600061331f565b610140810151815161331f9190615484565b610140820152604081015161010082015161333a9190615484565b6101808201525b806101200151816060015110156133bf578181606001516103e86133659190615c35565b61336f9190615c4c565b610160820181905260208201511161338857600061339d565b806101600151816020015161339d9190615484565b61016082015260608101516101208201516133b89190615484565b6101a08201525b95945050505050565b60006024835110156133dc57506000610dd9565b60208301516001600160e01b031980841690821603611bf3575050506024015190565b6000606082600003613415576000915050610dd9565b607f83116134af576040517fd6000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b16602282015260f884901b7fff000000000000000000000000000000000000000000000000000000000000001660368201526037015b6040516020818303038152906040529050613757565b60ff831161355d576040517fd7000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f8100000000000000000000000000000000000000000000000000000000000000603682015260f884901b7fff00000000000000000000000000000000000000000000000000000000000000166037820152603801613499565b61ffff831161360c576040517fd8000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f820000000000000000000000000000000000000000000000000000000000000060368201527fffff00000000000000000000000000000000000000000000000000000000000060f085901b166037820152603901613499565b62ffffff83116136bc576040517fd9000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f830000000000000000000000000000000000000000000000000000000000000060368201527fffffff000000000000000000000000000000000000000000000000000000000060e885901b166037820152603a01613499565b6040517fda000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f840000000000000000000000000000000000000000000000000000000000000060368201526001600160e01b031960e085901b166037820152603b0160405160208183030381529060405290505b80516020909101209392505050565b60008060448451101561377e575060009050806118b0565b60208401516001600160e01b0319808516908216036137a65760248501519250604485015191505b509250929050565b60408051602081018390529081018390526000906060015b60405160208183030381529060405280519060200120905092915050565b604080516001600160a01b03831660208201529081018390526000906060016137c6565b60d082901c6103ff1660c883901c60ff161b613fff60a284901c16612710838202048084018381101561383d57505050610dd9565b608186901c6401ffffffff164203925066ffffffffffffff604987901c1660ff604188901c161b60b087901c62ffffff166138788585615c35565b6138829190615c4c565b61388c9190615698565b93508084111561389a578093505b6103ff60e287901c1660ff60da88901c161b9250828411156138ba578293505b50505092915050565b600066ffffffffffffff604984901c1660ff604185901c161b8082036138ed576000915050610dd9565b612710613fff60a286901c168402046401ffffffff608186901c16420362ffffff60b087901c1661391e8284615c35565b6139289190615c4c565b905080831161393857600061393c565b8083035b935050808403838111156138ba5795945050505050565b604080516101208082018352600080835283516101c0810185528181526020818101839052818601839052855160a080820188528482528183018590529681018490526060808201859052608080830186905290840191909152820183905294810182905260c0810182905260e0810182905261010081018290529182018190526101408201819052610160820181905261018082018190526101a082015290918201908152602001613a276040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001613ac96040518061022001604052806000151581526020016000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613b1d6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613b4d6040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001613b8b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613b98613baa565b8152602001613ba5613c28565b905290565b604051806101e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001613c06613fc6565b8152602001600081526020016000815260200160008152602001600081525090565b6040518061028001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613ce760405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613d3d60405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613da1604051806101600160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613e05604051806101600160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613e1261407e565b8152602001613ba561407e565b604051806101a001604052806000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613ebd60405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613e0560405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806101c00160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613da1604051806101600160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060c0016040528060001515815260200160001515815260200160001515815260200161401e6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b81526020016140556040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b8152602001613ba560405180606001604052806000815260200160008152602001600081525090565b60405180610220016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613ba560405180606001604052806000815260200161414a6040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b8152602001613ba56040518060e0016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146141ad57600080fd5b50565b6000602082840312156141c257600080fd5b813561143681614198565b6101208101610dd98284805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e08301526101008082015181840152505050565b80518252602081015161424f60208401826001600160a01b03169052565b50604081015161426a60408401826001600160a01b03169052565b5060608101516142bb60608401826001600160a01b03808251168352806020830151166020840152806040830151166040840152806060830151166060840152806080830151166080840152505050565b5060808101516101006142d8818501836001600160a01b03169052565b60a083015191506101206142f6818601846001600160a01b03169052565b60c08401519250610140614314818701856001600160a01b03169052565b60e0850151610160878101919091529285015161018080880191909152918501516101a080880191909152908501516101c0870152918401516101e0860152830151610200850152909101516102209092019190915250565b8051151582526020810151614386602084018215159052565b5060408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201518184015250610120808201516143ea828501826001600160a01b03169052565b5050610140818101516001600160a01b031690830152610160808201519083015261018080820151908301526101a080820151908301526101c080820151908301526101e0808201519083015261020090810151910152565b805115158252602081015115156020830152604081015115156040830152606081015161449e606084018280518252602081015160208301526040810151604083015260608101516060830152608081015160808301525050565b506080818101518051610100850152602081015161012085015260408101516101408501526060810151610160850152908101516101808401525060a0015180516101a083015260208101516101c0830152604001516101e090910152565b805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201518184015250610120808201516145678285018215159052565b50506101408082015161457c82850182614443565b50506101608101516103408301526101808101516103608301526101a08101516103808301526101c001516103a090910152565b805182526020808201518184015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e08088015190890152610100808801519089015261012080880151908901526101408088015190890152610160808801519089015261018080880151908901526101a080880151908901526101c080880151908901526101e08088015190890152610200968701518051978901979097528686015180516001600160a01b039081166102208b0152818801516102408b0152818701516102608b0152818601516102808b0152908401516102a08a01529685015180519097166102c0890152948601516102e08801529285015161030087015290840151610320860152830151610340850152820151610360840152015161038090910152565b805182526020808201518184015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e080880151818a015261010080890151818b0152610120808a0151908b0152610140808a0151908b0152610160808a0151908b0152610180808a0151908b01526101a0808a0151908b01526101c0808a015180511515828d0152988901516101e08c0152968801516102008b0152948701516102208a015292860151610240890152908501516102608801528401516102808701528301516102a08601528201516102c08501529050506101e0810151805115156102e0840152602081015161030084015260408101516103208401526060810151610340840152608081015161036084015260a081015161038084015260c08101516103a084015260e08101516103c08401526101008101516103e0840152506102008101516148c36104008401828051151582526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e08301526101008082015181840152506101208082015181840152506101408082015181840152505050565b5061022081015180511515610560840152602081015161058084015260408101516105a084015260608101516105c084015260808101516105e084015260a081015161060084015260c081015161062084015260e081015161064084015261010081015161066084015261012081015161068084015261014001516106a08301526102408101516149586106c08401826145b0565b5061026081015161496d610a608401826145b0565b505050565b80516001600160a01b0316825260208101516149916020840182614231565b5060408181015180516102608501526020810151610280850152908101516102a08401526060908101516102c08401528101516149d26102e084018261436d565b5060808181015180516105008501526020810151610520850152604081015161054085015260608101516105608501529081015161058084015260a08101516105a084015260c08101516105c084015260e08101516105e08401526101008101516106008401525060a081015180516106208401526020810151610640840152604081015161066084015260608101516106808401525060c081015180516106a084015260208101516106c084015260408101516106e08401526060810151610700840152608081015161072084015260a08101516107408401525060e0810151614ac16107608401826144fd565b5061010081015161496d610b208401826146eb565b6119208101610dd98284614972565b60008060008060808587031215614afb57600080fd5b8435614b0681614198565b966020860135965060408601359560600135945092505050565b600060208284031215614b3257600080fd5b5035919050565b6103c08101610dd982846144fd565b610e008101610dd982846146eb565b6020808252825182820181905260009190848201906040850190845b81811015614b985783516001600160a01b031683529284019291840191600101614b73565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715614bde57614bde614ba4565b60405290565b60405160a0810167ffffffffffffffff81118282101715614bde57614bde614ba4565b6040516101c0810167ffffffffffffffff81118282101715614bde57614bde614ba4565b6040516060810167ffffffffffffffff81118282101715614bde57614bde614ba4565b604051610220810167ffffffffffffffff81118282101715614bde57614bde614ba4565b604051610160810167ffffffffffffffff81118282101715614bde57614bde614ba4565b604051601f8201601f1916810167ffffffffffffffff81118282101715614cbf57614cbf614ba4565b604052919050565b600067ffffffffffffffff821115614ce157614ce1614ba4565b5060051b60200190565b60006020808385031215614cfe57600080fd5b823567ffffffffffffffff811115614d1557600080fd5b8301601f81018513614d2657600080fd5b8035614d39614d3482614cc7565b614c96565b81815260059190911b82018301908381019087831115614d5857600080fd5b928401925b82841015610eb2578335614d7081614198565b82529284019290840190614d5d565b6020808252825182820181905260009190848201906040850190845b81811015614b9857614dae838551614972565b928401926119209290920191600101614d9b565b600080600060408486031215614dd757600080fd5b8335614de281614198565b9250602084013567ffffffffffffffff80821115614dff57600080fd5b818601915086601f830112614e1357600080fd5b813581811115614e2257600080fd5b8760208260051b8501011115614e3757600080fd5b6020830194508093505050509250925092565b8051151582526020818101518382015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e080880151818a015261010080890151818b0152610120808a015180511515828d0152988901516101408c0152968801516101608b0152948701516101808a0152928601516101a0890152908501516101c08801528401516101e0870152830151610200860152820151610220850152905050610140810151805115156102408401526020810151610260840152604081015161028084015260608101516102a084015260808101516102c084015260a08101516102e084015260c081015161030084015260e081015161032084015261010081015161034084015250610160810151614f7e6103608401826145b0565b5061018081015161496d6107008401826145b0565b600081518084526020808501945080840160005b83811015614fce57614fba878351614e4a565b610aa0969096019590820190600101614fa7565b509495945050505050565b8051151582526020808201518184015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e080880151818a015261010080890151818b0152610120808a0151818c0152610140808b015180511515828e0152998a01516101608d0152978901516101808c0152958801516101a08b0152938701516101c08a0152918601516101e089015285015161020088015284015161022087015283015161024086015282015161026085015281810151610280850152905050610160810151805115156102a084015260208101516102c084015260408101516102e08401526060810151610300840152608081015161032084015260a081015161034084015260c081015161036084015260e08101516103808401526101008101516103a08401526101208101516103c08401526101408101516103e0840152506101808101516151436104008401826145b0565b506101a081015161496d6107a08401826145b0565b600081518084526020808501945080840160005b83811015614fce5761517f878351614fd9565b610b4096909601959082019060010161516c565b6040815260006151a66040830185614f93565b82810360208401526133bf8185615158565b80151581146141ad57600080fd5b600080600080608085870312156151dc57600080fd5b84356151e781614198565b935060208501356151f7816151b8565b93969395505050506040820135916060013590565b6000806040838503121561521f57600080fd5b823561522a81614198565b946020939093013593505050565b6000806040838503121561524b57600080fd5b823561525681614198565b9150602083013561526681614198565b809150509250929050565b60c08101610dd98284805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a08301525050565b8151815260208083015190820152604080830151908201526060808301519082015260808101610dd9565b6020815260006114366020830184614f93565b6000806040838503121561530557600080fd5b823561531081614198565b915060208381013567ffffffffffffffff81111561532d57600080fd5b8401601f8101861361533e57600080fd5b803561534c614d3482614cc7565b81815260059190911b8201830190838101908883111561536b57600080fd5b928401925b8284101561538957833582529284019290840190615370565b80955050505050509250929050565b604080825283519082018190526000906020906060840190828701845b82811015615410576153fd848351805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a08301525050565b60c09390930192908401906001016153b5565b50505092019290925292915050565b6020815260006114366020830184615158565b610b408101610dd98284614fd9565b6102408101610dd98284614231565b6102208101610dd9828461436d565b610aa08101610dd98284614e4a565b634e487b7160e01b600052601160045260246000fd5b81810381811115610dd957610dd961546e565b600061012082840312156154aa57600080fd5b6154b2614bba565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b8051610b5881614198565b600060a0828403121561552f57600080fd5b615537614be4565b9050815161554481614198565b8152602082015161555481614198565b6020820152604082015161556781614198565b6040820152606082015161557a81614198565b6060820152608082015161558d81614198565b608082015292915050565b600061024082840312156155ab57600080fd5b6155b3614c07565b825181526155c360208401615512565b60208201526155d460408401615512565b60408201526155e6846060850161551d565b60608201526101006155f9818501615512565b608083015261012061560c818601615512565b60a084015261014061561f818701615512565b60c08501526101608087015160e086015261018080880151858701526101a0945084880151848701526101c0880151838701526101e088015182870152610200880151818701525050505061022084015181830152508091505092915050565b60006020828403121561569157600080fd5b5051919050565b80820180821115610dd957610dd961546e565b634e487b7160e01b600052603260045260246000fd5b6000600182016156d3576156d361546e565b5060010190565b600080604083850312156156ed57600080fd5b505080516020909101519092909150565b60006080828403121561571057600080fd5b6040516080810181811067ffffffffffffffff8211171561573357615733614ba4565b8060405250809150825181526020830151602082015260408301516040820152606083015160608201525092915050565b60006080828403121561577657600080fd5b61143683836156fe565b6020808252825182820181905260009190848201906040850190845b81811015614b985783518352928401929184019160010161579c565b600060c082840312156157ca57600080fd5b60405160c0810181811067ffffffffffffffff821117156157ed576157ed614ba4565b8060405250809150825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a08201525092915050565b6000806040838503121561584557600080fd5b825167ffffffffffffffff81111561585c57600080fd5b8301601f8101851361586d57600080fd5b8051602061587d614d3483614cc7565b82815260c0928302840182019282820191908985111561589c57600080fd5b948301945b848610156158c2576158b38a876157b8565b835294850194918301916158a1565b50969091015195979596505050505050565b8051610b58816151b8565b600060e082840312156158f157600080fd5b60405160e0810181811067ffffffffffffffff8211171561591457615914614ba4565b8060405250809150825161592781614198565b808252506020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201525092915050565b60008183036101a081121561598257600080fd5b61598a614c2b565b83518152915060a0601f19820112156159a257600080fd5b506159ab614be4565b60208301516159b981614198565b8082525060408301516020820152606083015160408201526080830151606082015260a08301516080820152806020830152506159f98360c084016158df565b604082015292915050565b60006103a08284031215615a1757600080fd5b615a1f614c4e565b825181526020808401519082015260408084015190820152606080840151908201526080808401519082015260a0808401519082015260c0808401519082015260e08084015190820152610100808401519082015261012080840151908201526101408084015190820152610160808401519082015261018080840151908201526101a080840151908201526101c080840151908201526101e080840151908201529050610200615ad28482850161596e565b9082015292915050565b600080828403610500811215615af157600080fd5b61016080821215615b0157600080fd5b615b09614c72565b9150615b14856158d4565b82526020850151602083015260408501516040830152606085015160608301526080850151608083015260a085015160a083015260c085015160c083015260e085015160e0830152610100808601518184015250610120808601518184015250610140808601518184015250819350615b8f86828701615a04565b925050509250929050565b6000808284036104c0811215615baf57600080fd5b61012080821215615bbf57600080fd5b615bc7614bba565b9150615bd2856158d4565b82526020850151602083015260408501516040830152606085015160608301526080850151608083015260a085015160a083015260c085015160c083015260e085015160e0830152610100808601518184015250819350615b8f86828701615a04565b8082028115828204841417610dd957610dd961546e565b600082615c6957634e487b7160e01b600052601260045260246000fd5b500490565b600060c08284031215615c8057600080fd5b61143683836157b856fea2646970667358221220af9134151c79e0656f8f31c97e5dea23abf096b08b6c02cff0590f02c911fc9c64736f6c6343000815003300000000000000000000000091716c4eda1fb55e84bf8b4c7085f84285c1908500000000000000000000000052aa899454998be5b000ad077a46bbe360f4e49700000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa830000000000000000000000004ec7b668baf70d4a4b0fc7941a7708a07b6d45be
Deployed Bytecode
0x6080604052600436106103135760003560e01c80637b05c2001161019a578063cdaf7f22116100e1578063e72ef91b1161008a578063eeb9baeb11610064578063eeb9baeb146109cf578063eee99670146109ef578063f44dfe5014610a0f57600080fd5b8063e72ef91b1461096d578063ebf11ce41461099a578063ee221c08146109af57600080fd5b8063d91a0633116100bb578063d91a0633146108f3578063e1a25ab914610913578063e5c458431461094057600080fd5b8063cdaf7f221461088c578063d1d32444146108ac578063d82ae0fa146108e057600080fd5b8063957755e6116101435780639bb65fc71161011d5780639bb65fc7146108465780639c1b042314610866578063bb39e3a11461087957600080fd5b8063957755e6146107d9578063967915d6146107f957806396cc6dbf1461082657600080fd5b80638ad1fe82116101745780638ad1fe82146107695780638bfe3db21461079757806395430c41146107ac57600080fd5b80637b05c200146106ef5780637f51d07f1461070f57806384502d951461073c57600080fd5b80633a490e6f1161025e5780634f8666a0116102075780636902f79f116101e15780636902f79f1461067b5780636dd5fd85146106af578063741c0b5c146106cf57600080fd5b80634f8666a01461060e578063546b08cd1461062e57806355181f111461064e57600080fd5b8063425711371161023857806342571137146105bb578063472f2d09146105ce5780634dd3a4e0146105ee57600080fd5b80633a490e6f146105455780633cb84b11146105655780633f7256611461059357600080fd5b80631cba0023116102c05780632861c7d11161029a5780632861c7d1146104b05780632dd31000146104e4578063345df8df1461051857600080fd5b80631cba0023146104345780632516d94014610461578063266398ef1461048e57600080fd5b80631272e9ac116102f15780631272e9ac146103bb57806312e366aa146103dc57806318e172d91461041457600080fd5b8063015f6cfa146103185780630208dbb01461034e578063030a68101461037b575b600080fd5b34801561032457600080fd5b506103386103333660046141b0565b610a22565b60405161034591906141cd565b60405180910390f35b34801561035a57600080fd5b5061036e6103693660046141b0565b610b5d565b6040516103459190614ad6565b34801561038757600080fd5b5061039b6103963660046141b0565b610c28565b604080516001600160a01b03938416815292909116602083015201610345565b6103ce6103c9366004614ae5565b610ca6565b604051908152602001610345565b3480156103e857600080fd5b506103fc6103f7366004614b20565b610dad565b6040516001600160a01b039091168152602001610345565b34801561042057600080fd5b506103ce61042f3660046141b0565b610ddf565b34801561044057600080fd5b5061045461044f3660046141b0565b610e4c565b6040516103459190614b39565b34801561046d57600080fd5b5061048161047c3660046141b0565b610e6f565b6040516103459190614b48565b34801561049a57600080fd5b506104a3610ebd565b6040516103459190614b57565b3480156104bc57600080fd5b506103fc7f00000000000000000000000052aa899454998be5b000ad077a46bbe360f4e49781565b3480156104f057600080fd5b506103fc7f00000000000000000000000091716c4eda1fb55e84bf8b4c7085f84285c1908581565b34801561052457600080fd5b50610538610533366004614ceb565b610f6a565b6040516103459190614d7f565b34801561055157600080fd5b506103ce6105603660046141b0565b611021565b34801561057157600080fd5b50610585610580366004614dc2565b611050565b604051610345929190615193565b6105a66105a1366004614ae5565b6111b6565b60408051928352602083019190915201610345565b6103ce6105c93660046151c6565b6112c4565b3480156105da57600080fd5b506103ce6105e936600461520c565b6113bb565b3480156105fa57600080fd5b506103ce610609366004615238565b61143d565b34801561061a57600080fd5b506103ce6106293660046141b0565b611459565b34801561063a57600080fd5b506103ce6106493660046141b0565b6114d0565b34801561065a57600080fd5b5061066e6106693660046141b0565b611555565b6040516103459190615271565b34801561068757600080fd5b506103fc7f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa8381565b3480156106bb57600080fd5b506103ce6106ca3660046141b0565b6115a0565b3480156106db57600080fd5b506103ce6106ea366004614ae5565b6115d0565b3480156106fb57600080fd5b506105a661070a366004614ae5565b611663565b34801561071b57600080fd5b5061072f61072a3660046141b0565b6116f7565b60405161034591906152b4565b34801561074857600080fd5b5061075c610757366004614dc2565b611784565b60405161034591906152df565b34801561077557600080fd5b506107896107843660046152f2565b611836565b604051610345929190615398565b3480156107a357600080fd5b506105386118b7565b3480156107b857600080fd5b506107cc6107c7366004614dc2565b6118c9565b604051610345919061541f565b3480156107e557600080fd5b5061072f6107f43660046141b0565b611972565b34801561080557600080fd5b50610819610814366004615238565b6119af565b6040516103459190615432565b34801561083257600080fd5b506105a6610841366004614ae5565b611bfa565b34801561085257600080fd5b506103ce610861366004614ae5565b611c5b565b6103ce610874366004614ae5565b611d4e565b6103ce6108873660046151c6565b611de1565b34801561089857600080fd5b506103ce6108a73660046141b0565b611e43565b3480156108b857600080fd5b506103fc7f0000000000000000000000004ec7b668baf70d4a4b0fc7941a7708a07b6d45be81565b6103ce6108ee366004614ae5565b611e73565b3480156108ff57600080fd5b506103ce61090e3660046141b0565b611ed3565b34801561091f57600080fd5b5061093361092e3660046141b0565b611f03565b6040516103459190615441565b34801561094c57600080fd5b5061096061095b3660046141b0565b612003565b6040516103459190615450565b34801561097957600080fd5b5061098d610988366004615238565b612238565b604051610345919061545f565b3480156109a657600080fd5b506103ce612467565b3480156109bb57600080fd5b506103ce6109ca366004615238565b6124eb565b3480156109db57600080fd5b506103ce6109ea3660046141b0565b612507565b3480156109fb57600080fd5b506103ce610a0a366004614ae5565b612547565b6105a6610a1d366004614ae5565b6125a6565b610a716040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b816001600160a01b031663916cef4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610aac57600080fd5b505af1925050508015610abd575060015b610b58573d808015610aeb576040519150601f19603f3d011682016040523d82523d6000602084013e610af0565b606091505b5060208101517fdc4022c5000000000000000000000000000000000000000000000000000000006001600160e01b0319821601610b5557610b3f826004808551610b3a9190615484565b612608565b806020019051810190610b529190615497565b92505b50505b919050565b610b65613953565b6001600160a01b0382168152610b7a82611f03565b6020820152610b88826116f7565b6040820152610b9682612003565b6060820152610ba482610a22565b60808201526040810151610bb9908390612732565b60a08201526040810151610bce9083906129af565b60c0820181905260a0820151610be691849190612cb3565b8160e00181905250610c1d82826020015160a00151836020015160c0015184606001516101a0015185606001516101c00151612f9d565b610100820152919050565b6000806000836001600160a01b031663b7791bf26040518163ffffffff1660e01b815260040161024060405180830381865afa158015610c6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c909190615598565b90508060a001518160c001519250925050915091565b6040517fe980e1eb000000000000000000000000000000000000000000000000000000008152600481018490526024810183905260448101829052600160648201526000906001600160a01b0386169063e980e1eb9034906084015b60206040518083038185885af193505050508015610d3d575060408051601f3d908101601f19168201909252610d3a9181019061567f565b60015b610da3573d808015610d6b576040519150601f19603f3d011682016040523d82523d6000602084013e610d70565b606091505b50610d9b817fe8d35d06000000000000000000000000000000000000000000000000000000006133c8565b915050610da5565b505b949350505050565b6000610dd97f00000000000000000000000091716c4eda1fb55e84bf8b4c7085f84285c19085836133ff565b92915050565b604051632d71cdb960e21b8152600260048201526000906001600160a01b0383169063b5c736e4906024015b602060405180830381865afa158015610e28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd9919061567f565b610e54613baa565b610dd982610e6184611972565b610e6a85611555565b612cb3565b610e77613c28565b600080610e8384610c28565b915091506000610e92856115a0565b90506103ff60e482901c81169060ee83901c16610eb28786868585612f9d565b979650505050505050565b60606000610ec9612467565b90508067ffffffffffffffff811115610ee457610ee4614ba4565b604051908082528060200260200182016040528015610f0d578160200160208202803683370190505b50915060005b81811015610f6557610f296103f7826001615698565b838281518110610f3b57610f3b6156ab565b6001600160a01b039092166020928302919091019091015280610f5d816156c1565b915050610f13565b505090565b80516060908067ffffffffffffffff811115610f8857610f88614ba4565b604051908082528060200260200182016040528015610fc157816020015b610fae613953565b815260200190600190039081610fa65790505b50915060005b81811015610b5557610ff1848281518110610fe457610fe46156ab565b6020026020010151610b5d565b838281518110611003576110036156ab565b60200260200101819052508080611019906156c1565b915050610fc7565b604051632d71cdb960e21b81526004808201526000906001600160a01b0383169063b5c736e490602401610e0b565b606080828067ffffffffffffffff81111561106d5761106d614ba4565b6040519080825280602002602001820160405280156110a657816020015b611093613e1f565b81526020019060019003908161108b5790505b5092508067ffffffffffffffff8111156110c2576110c2614ba4565b6040519080825280602002602001820160405280156110fb57816020015b6110e8613f13565b8152602001906001900390816110e05790505b50915060005b818110156111ac576111348787878481811061111f5761111f6156ab565b905060200201602081019061098891906141b0565b848281518110611146576111466156ab565b602002602001018190525061117c87878784818110611167576111676156ab565b905060200201602081019061081491906141b0565b83828151811061118e5761118e6156ab565b602002602001018190525080806111a4906156c1565b915050611101565b5050935093915050565b6040517f4d9036de0000000000000000000000000000000000000000000000000000000081526004810184905260248101839052604481018290526001606482015260009081906001600160a01b03871690634d9036de9034906084015b604080518083038185885af19350505050801561124e575060408051601f3d908101601f1916820190925261124b918101906156da565b60015b6112b8573d80801561127c576040519150601f19603f3d011682016040523d82523d6000602084013e611281565b606091505b506112ac817f1458577f00000000000000000000000000000000000000000000000000000000613766565b90935091506112bb9050565b50505b94509492505050565b6040517f286f0e610000000000000000000000000000000000000000000000000000000081528315156004820152602481018390526044810182905261dead60648201526000906001600160a01b0386169063286f0e619034906084015b60206040518083038185885af19350505050801561135d575060408051601f3d908101601f1916820190925261135a9181019061567f565b60015b610da3573d80801561138b576040519150601f19603f3d011682016040523d82523d6000602084013e611390565b606091505b50610d9b817fb3bfda99000000000000000000000000000000000000000000000000000000006133c8565b6000826001600160a01b031663b5c736e46113d76006856137ae565b6040518263ffffffff1660e01b81526004016113f591815260200190565b602060405180830381865afa158015611412573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611436919061567f565b9392505050565b6000826001600160a01b031663b5c736e46113d76005856137e4565b604051632d71cdb960e21b8152600760048201526000906080906001600160a01b0384169063b5c736e490602401602060405180830381865afa1580156114a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c8919061567f565b901c92915050565b604051632d71cdb960e21b8152600760048201526000906fffffffffffffffffffffffffffffffff906001600160a01b0384169063b5c736e490602401602060405180830381865afa15801561152a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154e919061567f565b1692915050565b61158e6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b610dd98261159b846116f7565b6129af565b604051632d71cdb960e21b8152600160048201526000906001600160a01b0383169063b5c736e490602401610e0b565b6040517fd331bef700000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead60648201526000906001600160a01b0386169063d331bef7906084015b6020604051808303816000875af1925050508015610d3d575060408051601f3d908101601f19168201909252610d3a9181019061567f565b6040517fe27203cd00000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead606482015260009081906001600160a01b0387169063e27203cd906084015b60408051808303816000875af192505050801561124e575060408051601f3d908101601f1916820190925261124b918101906156da565b6117226040518060800160405280600081526020016000815260200160008152602001600081525090565b816001600160a01b0316631595cbd36040518163ffffffff1660e01b8152600401608060405180830381865afa158015611760573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd99190615764565b6060818067ffffffffffffffff8111156117a0576117a0614ba4565b6040519080825280602002602001820160405280156117d957816020015b6117c6613e1f565b8152602001906001900390816117be5790505b50915060005b8181101561182d576117fd8686868481811061111f5761111f6156ab565b83828151811061180f5761180f6156ab565b60200260200101819052508080611825906156c1565b9150506117df565b50509392505050565b60606000836001600160a01b031663d811b2ce846040518263ffffffff1660e01b81526004016118669190615780565b600060405180830381865afa158015611883573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118ab9190810190615832565b915091505b9250929050565b60606118c4610533610ebd565b905090565b6060818067ffffffffffffffff8111156118e5576118e5614ba4565b60405190808252806020026020018201604052801561191e57816020015b61190b613f13565b8152602001906001900390816119035790505b50915060005b8181101561182d5761194286868684818110611167576111676156ab565b838281518110611954576119546156ab565b6020026020010181905250808061196a906156c1565b915050611924565b61199d6040518060800160405280600081526020016000815260200160008152602001600081525090565b610dd9826119aa846116f7565b612732565b6119b7613f13565b60006119c3848461143d565b90508015611bf3576001808216811483526119f39082901c67ffffffffffffffff16600860ff9082901c91161b90565b60208301819052611a05908290613808565b60408301526401ffffffff608182901c166060830152613fff60a282901c16608083015262ffffff60b082901c1660a08301526103ff60d082901c1660ff60c883901c161b60c08301526103ff60e282901c1660ff60da83901c161b60e08301526020820151604083015111611a7c576000611a90565b81602001518260400151611a909190615484565b6101008301819052610120830152600080611aaa86610c28565b604051634b3c8aeb60e11b81526001600160a01b03898116600483015280841660248301529294509092507f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa839091169063967915d69060440161050060405180830381865afa158015611b21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b459190615adc565b610180860152610140850152604051634b3c8aeb60e11b81526001600160a01b03878116600483015282811660248301527f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83169063967915d69060440161050060405180830381865afa158015611bc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be49190615adc565b6101a086015261016085015250505b5092915050565b6040517f35f0df9800000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead606482015260009081906001600160a01b038716906335f0df98906084016116c0565b6040517f4c89bfd400000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead60648201526000906001600160a01b03861690634c89bfd4906084016020604051808303816000875af1925050508015611cf0575060408051601f3d908101601f19168201909252611ced9181019061567f565b60015b610da3573d808015611d1e576040519150601f19603f3d011682016040523d82523d6000602084013e611d23565b606091505b50610d9b817f73999506000000000000000000000000000000000000000000000000000000006133c8565b6040517f30acd6fd000000000000000000000000000000000000000000000000000000008152600481018490526024810183905260448101829052600160648201526000906001600160a01b038616906330acd6fd90349060840160206040518083038185885af193505050508015611cf0575060408051601f3d908101601f19168201909252611ced9181019061567f565b6040517f2668dfaa0000000000000000000000000000000000000000000000000000000081528315156004820152602481018390526044810182905261dead60648201526000906001600160a01b03861690632668dfaa903490608401611322565b604051632d71cdb960e21b8152600060048201819052906001600160a01b0383169063b5c736e490602401610e0b565b6040517f68766981000000000000000000000000000000000000000000000000000000008152600481018490526024810183905260448101829052600160648201526000906001600160a01b038616906368766981903490608401610d02565b604051632d71cdb960e21b8152600860048201526000906001600160a01b0383169063b5c736e490602401610e0b565b611fa0604080516101c08101825260008082526020808301829052828401829052835160a08101855282815290810182905292830181905260608381018290526080840191909152909190820190815260006020820181905260408201819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082018190526101409091015290565b816001600160a01b031663b7791bf26040518163ffffffff1660e01b815260040161024060405180830381865afa158015611fdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd99190615598565b6120a06040518061022001604052806000151581526020016000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006120ab836115a0565b60018181161483526002808216811460208501526201ffff9082901c166040840152607f601382901c166060840152620fffff601b82901c8116608080860191909152602f83901c90911660a08501526103ff604483901c811660c0860152604e83901c1660e085015262ffffff605883901c1661010085015290915061213184610ddf565b901c6101e0830152608061214484611021565b901c610200830152607081901c633fffffff168015612197576121877f0000000000000000000000004ec7b668baf70d4a4b0fc7941a7708a07b6d45be826133ff565b6001600160a01b03166101208401525b50608e81901c633fffffff1680156121e3576121d37f0000000000000000000000004ec7b668baf70d4a4b0fc7941a7708a07b6d45be826133ff565b6001600160a01b03166101408401525b620fffff60b483901c1660ff60ac84901c161b610160840152620fffff60d083901c1660ff60c884901c161b610180840152506103ff60e482901c81166101a084015260ee9190911c166101c0820152919050565b612240613e1f565b600061224c84846124eb565b90508015611bf35760018082168114835261227c9082901c67ffffffffffffffff16600860ff9082901c91161b90565b6020830181905261228e9082906138c3565b60408301819052608182901c6401ffffffff16606084015260a282901c613fff16608084015260b082901c62ffffff1660a084015260d082901c6103ff1660c883901c60ff161b60c08401526020830151116122eb5760006122ff565b816040015182602001516122ff9190615484565b60e0830181905261010083015260008061231886610c28565b60405163e72ef91b60e01b81526001600160a01b03898116600483015280841660248301529294509092507f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa839091169063e72ef91b906044016104c060405180830381865afa15801561238f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b39190615b9a565b61016086015261012085015260405163e72ef91b60e01b81526001600160a01b03878116600483015282811660248301527f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83169063e72ef91b906044016104c060405180830381865afa15801561242e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124529190615b9a565b61018086015261014085015250505092915050565b60007f00000000000000000000000091716c4eda1fb55e84bf8b4c7085f84285c190856001600160a01b03166393656c176040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c4919061567f565b6000826001600160a01b031663b5c736e46113d76003856137e4565b6000816001600160a01b031663f4b9a3fb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e28573d6000803e3d6000fd5b6040517f242011d500000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044810182905261dead60648201526000906001600160a01b0386169063242011d59060840161162b565b6040517f5b3d38d70000000000000000000000000000000000000000000000000000000081526004810184905260248101839052604481018290526001606482015260009081906001600160a01b03871690635b3d38d7903490608401611214565b60608161261681601f615698565b10156126695760405162461bcd60e51b815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064015b60405180910390fd5b6126738284615698565b845110156126c35760405162461bcd60e51b815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401612660565b811580156126e0576040519150600082526020820160405261272a565b6040519150601f8316801560200281840101848101868315602002848a0101015b81831015612719578051835260209283019201612701565b5050848452601f01601f1916604052505b509392505050565b61275d6040518060800160405280600081526020016000815260200160008152602001600081525090565b6000612768846115a0565b9050806001166001146127a25760405180608001604052806000815260200160008152602001600081526020016000815250915050610dd9565b60405162afb67d60e11b81526001600160a01b0385166004820152309063015f6cfa90602401610120604051808303816000875af1925050508015612804575060408051601f3d908101601f1916820190925261280191810190615497565b60015b61283457604051806080016040528060008152602001600081526020016000815260200160008152509150611bf3565b6080810151604080830151606084015160a085015160e086015193517f6560abaa000000000000000000000000000000000000000000000000000000008152600481019590955260248501929092526044840152606483015260848201526001600160a01b03861690636560abaa9060a401608060405180830381865afa9250505080156128df575060408051601f3d908101601f191682019092526128dc91810190615764565b60015b61290f576040518060800160405280600081526020016000815260200160008152602001600081525092506129a7565b8451602086015182516129229190615c35565b61292c9190615c4c565b84528451602086015160408301516129449190615c35565b61294e9190615c4c565b6040808601919091528501516060860151602083015161296e9190615c35565b6129789190615c4c565b60208501526040850151606080870151908301516129969190615c35565b6129a09190615c4c565b6060850152505b505092915050565b6129e86040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006129f3846115a0565b905080600216600214612a3b576040518060c0016040528060008152602001600081526020016000815260200160008152602001600081526020016000815250915050610dd9565b60405162afb67d60e11b81526001600160a01b0385166004820152309063015f6cfa90602401610120604051808303816000875af1925050508015612a9d575060408051601f3d908101601f19168201909252612a9a91810190615497565b60015b612adb576040518060c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152509150611bf3565b6080810151604080830151606084015160c085015161010086015193517f05d455a9000000000000000000000000000000000000000000000000000000008152600481019590955260248501929092526044840152606483015260848201526001600160a01b038616906305d455a99060a40160c060405180830381865afa925050508015612b87575060408051601f3d908101601f19168201909252612b8491810190615c6e565b60015b612bc5576040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525092506129a7565b845160208601518251612bd89190615c35565b612be29190615c4c565b8452845160208601516040830151612bfa9190615c35565b612c049190615c4c565b6040850152845160208601516080830151612c1f9190615c35565b612c299190615c4c565b6080850152604085015160608601516020830151612c479190615c35565b612c519190615c4c565b6020850152604085015160608087015190830151612c6f9190615c35565b612c799190615c4c565b846060018181525050846040015185606001518260a00151612c9b9190615c35565b612ca59190615c4c565b60a085015250505092915050565b612cbb613baa565b6000612cc685611e43565b64ffffffffff600182901c81168452602982901c81166020850152605182901c1660408401526401ffffffff607982901c166060840152623fffff609a82901c166080840152600760b082901c1660a084015261ffff60b382901c1660c084015290506fffffffffffffffffffffffffffffffff612d4386610ddf565b1660e08301526fffffffffffffffffffffffffffffffff612d6386611021565b16610100830152612d73856115a0565b600160ff82901c811461012085015261014084018051601a84901c8316831490528051604384901c831683146020909101525160f883901c82169091146040909101529050612dc1856114d0565b61014083018051606090810151620fffff8085169091528251820151601485901c82166020909101528251820151602885901c909116604091909101529051810151603c83901c6401ffffffff169101529050612e1d85611459565b610140830180516080908101516103ff8085169091528251820151601485901c9091166020909101528151810151602884901c620fffff166040909101528151810151603c84901c6401ffffffff16606091909101529051810151605d83901c62ffffff169101529050612e9085611ed3565b6101408301805160a0908101516401ffffffff84166040909101528151810151620fffff602185901c811690915291510151603583901c90911660209091015260e083015190915015612f335760e08201518451612ef690670de0b6b3a7640000615c35565b612f009190615c4c565b61016083015260e08201516020850151612f2290670de0b6b3a7640000615c35565b612f2c9190615c4c565b6101808301525b6101008201511561272a576101008201518351612f5890670de0b6b3a7640000615c35565b612f629190615c4c565b6101a08301526101008201516020840151612f8590670de0b6b3a7640000615c35565b612f8f9190615c4c565b6101c0830152509392505050565b612fa5613c28565b60405163e72ef91b60e01b81526001600160a01b03878116600483015286811660248301527f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83169063e72ef91b906044016104c060405180830381865afa158015613014573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130389190615b9a565b6102408301526101c082015260405163e72ef91b60e01b81526001600160a01b03878116600483015285811660248301527f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83169063e72ef91b906044016104c060405180830381865afa1580156130b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130d79190615b9a565b6102608301526101e0820152604051634b3c8aeb60e11b81526001600160a01b03878116600483015286811660248301527f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83169063967915d69060440161050060405180830381865afa158015613152573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131769190615adc565b50610200820152604051634b3c8aeb60e11b81526001600160a01b03878116600483015285811660248301527f00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83169063967915d69060440161050060405180830381865afa1580156131ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132109190615adc565b506102208201819052610240820151610180808201518085526102608501519182015160208601526101a092830151604086015291015160608401526101c08301516101009081015160808501526101e0840151015160a08401526102008301516101209081015160c08501529091015160e08301526103e890613295908590615c35565b61329f9190615c4c565b61010082015260208101516103e8906132b9908490615c35565b6132c39190615c4c565b61012082015261010081015160408201511015613341578281604001516103e86132ed9190615c35565b6132f79190615c4c565b610140820181905281511161330d57600061331f565b610140810151815161331f9190615484565b610140820152604081015161010082015161333a9190615484565b6101808201525b806101200151816060015110156133bf578181606001516103e86133659190615c35565b61336f9190615c4c565b610160820181905260208201511161338857600061339d565b806101600151816020015161339d9190615484565b61016082015260608101516101208201516133b89190615484565b6101a08201525b95945050505050565b60006024835110156133dc57506000610dd9565b60208301516001600160e01b031980841690821603611bf3575050506024015190565b6000606082600003613415576000915050610dd9565b607f83116134af576040517fd6000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b16602282015260f884901b7fff000000000000000000000000000000000000000000000000000000000000001660368201526037015b6040516020818303038152906040529050613757565b60ff831161355d576040517fd7000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f8100000000000000000000000000000000000000000000000000000000000000603682015260f884901b7fff00000000000000000000000000000000000000000000000000000000000000166037820152603801613499565b61ffff831161360c576040517fd8000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f820000000000000000000000000000000000000000000000000000000000000060368201527fffff00000000000000000000000000000000000000000000000000000000000060f085901b166037820152603901613499565b62ffffff83116136bc576040517fd9000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f830000000000000000000000000000000000000000000000000000000000000060368201527fffffff000000000000000000000000000000000000000000000000000000000060e885901b166037820152603a01613499565b6040517fda000000000000000000000000000000000000000000000000000000000000006020820152602560fa1b60218201526bffffffffffffffffffffffff19606086901b1660228201527f840000000000000000000000000000000000000000000000000000000000000060368201526001600160e01b031960e085901b166037820152603b0160405160208183030381529060405290505b80516020909101209392505050565b60008060448451101561377e575060009050806118b0565b60208401516001600160e01b0319808516908216036137a65760248501519250604485015191505b509250929050565b60408051602081018390529081018390526000906060015b60405160208183030381529060405280519060200120905092915050565b604080516001600160a01b03831660208201529081018390526000906060016137c6565b60d082901c6103ff1660c883901c60ff161b613fff60a284901c16612710838202048084018381101561383d57505050610dd9565b608186901c6401ffffffff164203925066ffffffffffffff604987901c1660ff604188901c161b60b087901c62ffffff166138788585615c35565b6138829190615c4c565b61388c9190615698565b93508084111561389a578093505b6103ff60e287901c1660ff60da88901c161b9250828411156138ba578293505b50505092915050565b600066ffffffffffffff604984901c1660ff604185901c161b8082036138ed576000915050610dd9565b612710613fff60a286901c168402046401ffffffff608186901c16420362ffffff60b087901c1661391e8284615c35565b6139289190615c4c565b905080831161393857600061393c565b8083035b935050808403838111156138ba5795945050505050565b604080516101208082018352600080835283516101c0810185528181526020818101839052818601839052855160a080820188528482528183018590529681018490526060808201859052608080830186905290840191909152820183905294810182905260c0810182905260e0810182905261010081018290529182018190526101408201819052610160820181905261018082018190526101a082015290918201908152602001613a276040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001613ac96040518061022001604052806000151581526020016000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613b1d6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613b4d6040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001613b8b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613b98613baa565b8152602001613ba5613c28565b905290565b604051806101e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001613c06613fc6565b8152602001600081526020016000815260200160008152602001600081525090565b6040518061028001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613ce760405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613d3d60405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613da1604051806101600160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613e05604051806101600160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613e1261407e565b8152602001613ba561407e565b604051806101a001604052806000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613ebd60405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001613e0560405180610120016040528060001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806101c00160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613da1604051806101600160405280600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060c0016040528060001515815260200160001515815260200160001515815260200161401e6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b81526020016140556040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b8152602001613ba560405180606001604052806000815260200160008152602001600081525090565b60405180610220016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001613ba560405180606001604052806000815260200161414a6040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b8152602001613ba56040518060e0016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146141ad57600080fd5b50565b6000602082840312156141c257600080fd5b813561143681614198565b6101208101610dd98284805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e08301526101008082015181840152505050565b80518252602081015161424f60208401826001600160a01b03169052565b50604081015161426a60408401826001600160a01b03169052565b5060608101516142bb60608401826001600160a01b03808251168352806020830151166020840152806040830151166040840152806060830151166060840152806080830151166080840152505050565b5060808101516101006142d8818501836001600160a01b03169052565b60a083015191506101206142f6818601846001600160a01b03169052565b60c08401519250610140614314818701856001600160a01b03169052565b60e0850151610160878101919091529285015161018080880191909152918501516101a080880191909152908501516101c0870152918401516101e0860152830151610200850152909101516102209092019190915250565b8051151582526020810151614386602084018215159052565b5060408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201518184015250610120808201516143ea828501826001600160a01b03169052565b5050610140818101516001600160a01b031690830152610160808201519083015261018080820151908301526101a080820151908301526101c080820151908301526101e0808201519083015261020090810151910152565b805115158252602081015115156020830152604081015115156040830152606081015161449e606084018280518252602081015160208301526040810151604083015260608101516060830152608081015160808301525050565b506080818101518051610100850152602081015161012085015260408101516101408501526060810151610160850152908101516101808401525060a0015180516101a083015260208101516101c0830152604001516101e090910152565b805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201518184015250610120808201516145678285018215159052565b50506101408082015161457c82850182614443565b50506101608101516103408301526101808101516103608301526101a08101516103808301526101c001516103a090910152565b805182526020808201518184015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e08088015190890152610100808801519089015261012080880151908901526101408088015190890152610160808801519089015261018080880151908901526101a080880151908901526101c080880151908901526101e08088015190890152610200968701518051978901979097528686015180516001600160a01b039081166102208b0152818801516102408b0152818701516102608b0152818601516102808b0152908401516102a08a01529685015180519097166102c0890152948601516102e08801529285015161030087015290840151610320860152830151610340850152820151610360840152015161038090910152565b805182526020808201518184015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e080880151818a015261010080890151818b0152610120808a0151908b0152610140808a0151908b0152610160808a0151908b0152610180808a0151908b01526101a0808a0151908b01526101c0808a015180511515828d0152988901516101e08c0152968801516102008b0152948701516102208a015292860151610240890152908501516102608801528401516102808701528301516102a08601528201516102c08501529050506101e0810151805115156102e0840152602081015161030084015260408101516103208401526060810151610340840152608081015161036084015260a081015161038084015260c08101516103a084015260e08101516103c08401526101008101516103e0840152506102008101516148c36104008401828051151582526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e08301526101008082015181840152506101208082015181840152506101408082015181840152505050565b5061022081015180511515610560840152602081015161058084015260408101516105a084015260608101516105c084015260808101516105e084015260a081015161060084015260c081015161062084015260e081015161064084015261010081015161066084015261012081015161068084015261014001516106a08301526102408101516149586106c08401826145b0565b5061026081015161496d610a608401826145b0565b505050565b80516001600160a01b0316825260208101516149916020840182614231565b5060408181015180516102608501526020810151610280850152908101516102a08401526060908101516102c08401528101516149d26102e084018261436d565b5060808181015180516105008501526020810151610520850152604081015161054085015260608101516105608501529081015161058084015260a08101516105a084015260c08101516105c084015260e08101516105e08401526101008101516106008401525060a081015180516106208401526020810151610640840152604081015161066084015260608101516106808401525060c081015180516106a084015260208101516106c084015260408101516106e08401526060810151610700840152608081015161072084015260a08101516107408401525060e0810151614ac16107608401826144fd565b5061010081015161496d610b208401826146eb565b6119208101610dd98284614972565b60008060008060808587031215614afb57600080fd5b8435614b0681614198565b966020860135965060408601359560600135945092505050565b600060208284031215614b3257600080fd5b5035919050565b6103c08101610dd982846144fd565b610e008101610dd982846146eb565b6020808252825182820181905260009190848201906040850190845b81811015614b985783516001600160a01b031683529284019291840191600101614b73565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715614bde57614bde614ba4565b60405290565b60405160a0810167ffffffffffffffff81118282101715614bde57614bde614ba4565b6040516101c0810167ffffffffffffffff81118282101715614bde57614bde614ba4565b6040516060810167ffffffffffffffff81118282101715614bde57614bde614ba4565b604051610220810167ffffffffffffffff81118282101715614bde57614bde614ba4565b604051610160810167ffffffffffffffff81118282101715614bde57614bde614ba4565b604051601f8201601f1916810167ffffffffffffffff81118282101715614cbf57614cbf614ba4565b604052919050565b600067ffffffffffffffff821115614ce157614ce1614ba4565b5060051b60200190565b60006020808385031215614cfe57600080fd5b823567ffffffffffffffff811115614d1557600080fd5b8301601f81018513614d2657600080fd5b8035614d39614d3482614cc7565b614c96565b81815260059190911b82018301908381019087831115614d5857600080fd5b928401925b82841015610eb2578335614d7081614198565b82529284019290840190614d5d565b6020808252825182820181905260009190848201906040850190845b81811015614b9857614dae838551614972565b928401926119209290920191600101614d9b565b600080600060408486031215614dd757600080fd5b8335614de281614198565b9250602084013567ffffffffffffffff80821115614dff57600080fd5b818601915086601f830112614e1357600080fd5b813581811115614e2257600080fd5b8760208260051b8501011115614e3757600080fd5b6020830194508093505050509250925092565b8051151582526020818101518382015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e080880151818a015261010080890151818b0152610120808a015180511515828d0152988901516101408c0152968801516101608b0152948701516101808a0152928601516101a0890152908501516101c08801528401516101e0870152830151610200860152820151610220850152905050610140810151805115156102408401526020810151610260840152604081015161028084015260608101516102a084015260808101516102c084015260a08101516102e084015260c081015161030084015260e081015161032084015261010081015161034084015250610160810151614f7e6103608401826145b0565b5061018081015161496d6107008401826145b0565b600081518084526020808501945080840160005b83811015614fce57614fba878351614e4a565b610aa0969096019590820190600101614fa7565b509495945050505050565b8051151582526020808201518184015260408083015181850152606080840151818601526080808501518187015260a0808601518188015260c0808701518189015260e080880151818a015261010080890151818b0152610120808a0151818c0152610140808b015180511515828e0152998a01516101608d0152978901516101808c0152958801516101a08b0152938701516101c08a0152918601516101e089015285015161020088015284015161022087015283015161024086015282015161026085015281810151610280850152905050610160810151805115156102a084015260208101516102c084015260408101516102e08401526060810151610300840152608081015161032084015260a081015161034084015260c081015161036084015260e08101516103808401526101008101516103a08401526101208101516103c08401526101408101516103e0840152506101808101516151436104008401826145b0565b506101a081015161496d6107a08401826145b0565b600081518084526020808501945080840160005b83811015614fce5761517f878351614fd9565b610b4096909601959082019060010161516c565b6040815260006151a66040830185614f93565b82810360208401526133bf8185615158565b80151581146141ad57600080fd5b600080600080608085870312156151dc57600080fd5b84356151e781614198565b935060208501356151f7816151b8565b93969395505050506040820135916060013590565b6000806040838503121561521f57600080fd5b823561522a81614198565b946020939093013593505050565b6000806040838503121561524b57600080fd5b823561525681614198565b9150602083013561526681614198565b809150509250929050565b60c08101610dd98284805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a08301525050565b8151815260208083015190820152604080830151908201526060808301519082015260808101610dd9565b6020815260006114366020830184614f93565b6000806040838503121561530557600080fd5b823561531081614198565b915060208381013567ffffffffffffffff81111561532d57600080fd5b8401601f8101861361533e57600080fd5b803561534c614d3482614cc7565b81815260059190911b8201830190838101908883111561536b57600080fd5b928401925b8284101561538957833582529284019290840190615370565b80955050505050509250929050565b604080825283519082018190526000906020906060840190828701845b82811015615410576153fd848351805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a08301525050565b60c09390930192908401906001016153b5565b50505092019290925292915050565b6020815260006114366020830184615158565b610b408101610dd98284614fd9565b6102408101610dd98284614231565b6102208101610dd9828461436d565b610aa08101610dd98284614e4a565b634e487b7160e01b600052601160045260246000fd5b81810381811115610dd957610dd961546e565b600061012082840312156154aa57600080fd5b6154b2614bba565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b8051610b5881614198565b600060a0828403121561552f57600080fd5b615537614be4565b9050815161554481614198565b8152602082015161555481614198565b6020820152604082015161556781614198565b6040820152606082015161557a81614198565b6060820152608082015161558d81614198565b608082015292915050565b600061024082840312156155ab57600080fd5b6155b3614c07565b825181526155c360208401615512565b60208201526155d460408401615512565b60408201526155e6846060850161551d565b60608201526101006155f9818501615512565b608083015261012061560c818601615512565b60a084015261014061561f818701615512565b60c08501526101608087015160e086015261018080880151858701526101a0945084880151848701526101c0880151838701526101e088015182870152610200880151818701525050505061022084015181830152508091505092915050565b60006020828403121561569157600080fd5b5051919050565b80820180821115610dd957610dd961546e565b634e487b7160e01b600052603260045260246000fd5b6000600182016156d3576156d361546e565b5060010190565b600080604083850312156156ed57600080fd5b505080516020909101519092909150565b60006080828403121561571057600080fd5b6040516080810181811067ffffffffffffffff8211171561573357615733614ba4565b8060405250809150825181526020830151602082015260408301516040820152606083015160608201525092915050565b60006080828403121561577657600080fd5b61143683836156fe565b6020808252825182820181905260009190848201906040850190845b81811015614b985783518352928401929184019160010161579c565b600060c082840312156157ca57600080fd5b60405160c0810181811067ffffffffffffffff821117156157ed576157ed614ba4565b8060405250809150825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a08201525092915050565b6000806040838503121561584557600080fd5b825167ffffffffffffffff81111561585c57600080fd5b8301601f8101851361586d57600080fd5b8051602061587d614d3483614cc7565b82815260c0928302840182019282820191908985111561589c57600080fd5b948301945b848610156158c2576158b38a876157b8565b835294850194918301916158a1565b50969091015195979596505050505050565b8051610b58816151b8565b600060e082840312156158f157600080fd5b60405160e0810181811067ffffffffffffffff8211171561591457615914614ba4565b8060405250809150825161592781614198565b808252506020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201525092915050565b60008183036101a081121561598257600080fd5b61598a614c2b565b83518152915060a0601f19820112156159a257600080fd5b506159ab614be4565b60208301516159b981614198565b8082525060408301516020820152606083015160408201526080830151606082015260a08301516080820152806020830152506159f98360c084016158df565b604082015292915050565b60006103a08284031215615a1757600080fd5b615a1f614c4e565b825181526020808401519082015260408084015190820152606080840151908201526080808401519082015260a0808401519082015260c0808401519082015260e08084015190820152610100808401519082015261012080840151908201526101408084015190820152610160808401519082015261018080840151908201526101a080840151908201526101c080840151908201526101e080840151908201529050610200615ad28482850161596e565b9082015292915050565b600080828403610500811215615af157600080fd5b61016080821215615b0157600080fd5b615b09614c72565b9150615b14856158d4565b82526020850151602083015260408501516040830152606085015160608301526080850151608083015260a085015160a083015260c085015160c083015260e085015160e0830152610100808601518184015250610120808601518184015250610140808601518184015250819350615b8f86828701615a04565b925050509250929050565b6000808284036104c0811215615baf57600080fd5b61012080821215615bbf57600080fd5b615bc7614bba565b9150615bd2856158d4565b82526020850151602083015260408501516040830152606085015160608301526080850151608083015260a085015160a083015260c085015160c083015260e085015160e0830152610100808601518184015250819350615b8f86828701615a04565b8082028115828204841417610dd957610dd961546e565b600082615c6957634e487b7160e01b600052601260045260246000fd5b500490565b600060c08284031215615c8057600080fd5b61143683836157b856fea2646970667358221220af9134151c79e0656f8f31c97e5dea23abf096b08b6c02cff0590f02c911fc9c64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000091716c4eda1fb55e84bf8b4c7085f84285c1908500000000000000000000000052aa899454998be5b000ad077a46bbe360f4e49700000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa830000000000000000000000004ec7b668baf70d4a4b0fc7941a7708a07b6d45be
-----Decoded View---------------
Arg [0] : factory_ (address): 0x91716C4EDA1Fb55e84Bf8b4c7085f84285c19085
Arg [1] : liquidity_ (address): 0x52Aa899454998Be5b000Ad077a46Bbe360F4e497
Arg [2] : liquidityResolver_ (address): 0x98d900e25AAf345A4B23f454751EC5083443Fa83
Arg [3] : deployer_ (address): 0x4EC7b668BAF70d4A4b0FC7941a7708A07b6d45Be
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000091716c4eda1fb55e84bf8b4c7085f84285c19085
Arg [1] : 00000000000000000000000052aa899454998be5b000ad077a46bbe360f4e497
Arg [2] : 00000000000000000000000098d900e25aaf345a4b23f454751ec5083443fa83
Arg [3] : 0000000000000000000000004ec7b668baf70d4a4b0fc7941a7708a07b6d45be
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.