Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- QuoterV2
- Optimization enabled
- true
- Compiler version
- v0.7.6+commit.7338295f
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2023-07-04T06:52:55.531409Z
contracts/periphery/lens/QuoterV2.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity =0.7.6;pragma abicoder v2;import "../../core/libraries/SafeCast.sol";import "../../core/libraries/TickMath.sol";import "../../core/libraries/TickBitmap.sol";import "../../core/interfaces/IUniswapV3Pool.sol";import "../../core/interfaces/callback/IUniswapV3SwapCallback.sol";import "../interfaces/IQuoterV2.sol";import "../base/PeripheryImmutableState.sol";import "../libraries/Path.sol";import "../libraries/PoolAddress.sol";import "../libraries/CallbackValidation.sol";import "../libraries/PoolTicksCounter.sol";/// @title Provides quotes for swaps/// @notice Allows getting the expected amount out or amount in for a given swap without executing the swap/// @dev These functions are not gas efficient and should _not_ be called on chain. Instead, optimistically execute/// the swap and check the amounts in the callback.contract QuoterV2 isIQuoterV2,IUniswapV3SwapCallback,PeripheryImmutableState{using Path for bytes;using SafeCast for uint256;using PoolTicksCounter for IUniswapV3Pool;/// @dev Transient storage variable used to check a safety condition in exact output swaps.uint256 private amountOutCached;function initialize(address _factory, address _WETH9) external initializer {__PeripheryImmutableState_init(_factory, _WETH9);}function getPool(address tokenA,address tokenB,uint24 fee
contracts/core/interfaces/pool/IUniswapV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Pool state that can change/// @notice These methods compose the pool's state, and can change with any frequency including multiple times/// per transactioninterface IUniswapV3PoolState {/// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas/// when accessed externally./// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value/// tick The current tick of the pool, i.e. according to the last tick transition that was run./// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick/// boundary./// observationIndex The index of the last oracle observation that was written,/// observationCardinality The current maximum number of observations stored in the pool,/// observationCardinalityNext The next maximum number of observations, to be updated when the observation./// feeProtocol The protocol fee for both tokens of the pool./// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0/// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee./// unlocked Whether the pool is currently locked to reentrancyfunction slot0()externalviewreturns (uint160 sqrtPriceX96,int24 tick,uint16 observationIndex,uint16 observationCardinality,uint16 observationCardinalityNext,uint8 feeProtocol,bool unlocked);/// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool/// @dev This value can overflow the uint256function feeGrowthGlobal0X128() external view returns (uint256);/// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool/// @dev This value can overflow the uint256function feeGrowthGlobal1X128() external view returns (uint256);
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.0 <0.8.0;import "../utils/ContextUpgradeable.sol";import "../proxy/Initializable.sol";/*** @dev Contract module which provides a basic access control mechanism, where* there is an account (an owner) that can be granted exclusive access to* specific functions.** By default, the owner account will be the one that deploys the contract. This* can later be changed with {transferOwnership}.** This module is used through inheritance. It will make available the modifier* `onlyOwner`, which can be applied to your functions to restrict their use to* the owner.*/abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {address private _owner;event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);/*** @dev Initializes the contract setting the deployer as the initial owner.*/function __Ownable_init() internal initializer {__Context_init_unchained();__Ownable_init_unchained();}function __Ownable_init_unchained() internal initializer {address msgSender = _msgSender();_owner = msgSender;emit OwnershipTransferred(address(0), msgSender);}/*** @dev Returns the address of the current owner.*/function owner() public view virtual returns (address) {
@openzeppelin/contracts-upgradeable/proxy/Initializable.sol
// SPDX-License-Identifier: MIT// solhint-disable-next-line compiler-versionpragma solidity >=0.4.24 <0.8.0;import "../utils/AddressUpgradeable.sol";/*** @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.** TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as* possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.** CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.*/abstract contract Initializable {/*** @dev Indicates that the contract has been initialized.*/bool private _initialized;/*** @dev Indicates that the contract is in the process of being initialized.*/bool private _initializing;/*** @dev Modifier to protect an initializer function from being invoked twice.*/modifier initializer() {require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");bool isTopLevelCall = !_initializing;if (isTopLevelCall) {_initializing = true;_initialized = true;
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.2 <0.8.0;/*** @dev Collection of functions related to the address type*/library AddressUpgradeable {/*** @dev Returns true if `account` is a contract.** [IMPORTANT]* ====* It is unsafe to assume that an address for which this function returns* false is an externally-owned account (EOA) and not a contract.** Among others, `isContract` will return false for the following* types of addresses:** - an externally-owned account* - a contract in construction* - an address where a contract will be created* - an address where a contract lived, but was destroyed* ====*/function isContract(address account) internal view returns (bool) {// This method relies on extcodesize, which returns 0 for contracts in// construction, since the code is only stored at the end of the// constructor execution.uint256 size;// solhint-disable-next-line no-inline-assemblyassembly { size := extcodesize(account) }return size > 0;}/*** @dev Replacement for Solidity's `transfer`: sends `amount` wei to* `recipient`, forwarding all available gas and reverting on errors.** https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MITpragma solidity >=0.6.0 <0.8.0;import "../proxy/Initializable.sol";/** @dev Provides information about the current execution context, including the* sender of the transaction and its data. While these are generally available* via msg.sender and msg.data, they should not be accessed in such a direct* manner, since when dealing with GSN meta-transactions the account sending and* paying for execution may not be the actual sender (as far as an application* is concerned).** This contract is only required for intermediate, library-like contracts.*/abstract contract ContextUpgradeable is Initializable {function __Context_init() internal initializer {__Context_init_unchained();}function __Context_init_unchained() internal initializer {}function _msgSender() internal view virtual returns (address payable) {return msg.sender;}function _msgData() internal view virtual returns (bytes memory) {this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691return msg.data;}uint256[50] private __gap;}
contracts/core/interfaces/IUniswapV3Factory.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title The interface for the Uniswap V3 Factory/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol feesinterface IUniswapV3Factory {/// @notice Emitted when the owner of the factory is changed/// @param oldOwner The owner before the owner was changed/// @param newOwner The owner after the owner was changedevent OwnerChanged(address indexed oldOwner, address indexed newOwner);/// @notice Emitted when a pool is created/// @param token0 The first token of the pool by address sort order/// @param token1 The second token of the pool by address sort order/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip/// @param tickSpacing The minimum number of ticks between initialized ticks/// @param pool The address of the created poolevent PoolCreated(address indexed token0,address indexed token1,uint24 indexed fee,int24 tickSpacing,address pool);/// @notice Emitted when a new fee amount is enabled for pool creation via the factory/// @param fee The enabled fee, denominated in hundredths of a bip/// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given feeevent FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);event SetFeeProtocol(uint8 feeProtocol0Old,uint8 feeProtocol1Old,uint8 feeProtocol0New,uint8 feeProtocol1New);event SetFeeTo(address feeToOld, address feeTo);//function getUniswapV3PoolImplementation() external view returns (address);
contracts/core/interfaces/IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;import "./pool/IUniswapV3PoolImmutables.sol";import "./pool/IUniswapV3PoolState.sol";import "./pool/IUniswapV3PoolDerivedState.sol";import "./pool/IUniswapV3PoolActions.sol";import "./pool/IUniswapV3PoolOwnerActions.sol";import "./pool/IUniswapV3PoolEvents.sol";/// @title The interface for a Uniswap V3 Pool/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform/// to the ERC20 specification/// @dev The pool interface is broken up into many smaller piecesinterface IUniswapV3Pool isIUniswapV3PoolImmutables,IUniswapV3PoolState,IUniswapV3PoolDerivedState,IUniswapV3PoolActions,IUniswapV3PoolOwnerActions,IUniswapV3PoolEvents{function init() external;}
contracts/core/libraries/BitMath.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title BitMath/// @dev This library provides functionality for computing bit properties of an unsigned integerlibrary BitMath {/// @notice Returns the index of the most significant bit of the number,/// where the least significant bit is at index 0 and the most significant bit is at index 255/// @dev The function satisfies the property:/// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1)/// @param x the value for which to compute the most significant bit, must be greater than 0/// @return r the index of the most significant bitfunction mostSignificantBit(uint256 x) internal pure returns (uint8 r) {require(x > 0);if (x >= 0x100000000000000000000000000000000) {x >>= 128;r += 128;}if (x >= 0x10000000000000000) {x >>= 64;r += 64;}if (x >= 0x100000000) {x >>= 32;r += 32;}if (x >= 0x10000) {x >>= 16;r += 16;}if (x >= 0x100) {x >>= 8;r += 8;}if (x >= 0x10) {x >>= 4;r += 4;}if (x >= 0x4) {x >>= 2;
contracts/core/interfaces/callback/IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Callback for IUniswapV3PoolActions#swap/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interfaceinterface IUniswapV3SwapCallback {/// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap./// @dev In the implementation you must pay the pool tokens owed for the swap./// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory./// amount0Delta and amount1Delta can both be 0 if no tokens were swapped./// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by/// the end of the swap. If positive, the callback must send that amount of token0 to the pool./// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by/// the end of the swap. If positive, the callback must send that amount of token1 to the pool./// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap callfunction uniswapV3SwapCallback(int256 amount0Delta,int256 amount1Delta,bytes calldata data) external;}
contracts/core/interfaces/pool/IUniswapV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Permissionless pool actions/// @notice Contains pool methods that can be called by anyoneinterface IUniswapV3PoolActions {/// @notice Sets the initial price for the pool/// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value/// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96function initialize(uint160 sqrtPriceX96) external;/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends/// on tickLower, tickUpper, the amount of liquidity, and the current price./// @param recipient The address for which the liquidity will be created/// @param tickLower The lower tick of the position in which to add liquidity/// @param tickUpper The upper tick of the position in which to add liquidity/// @param amount The amount of liquidity to mint/// @param data Any data that should be passed through to the callback/// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback/// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callbackfunction mint(address recipient,int24 tickLower,int24 tickUpper,uint128 amount,bytes calldata data) external returns (uint256 amount0, uint256 amount1);/// @notice Collects tokens owed to a position/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity./// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or/// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the/// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity./// @param recipient The address which should receive the fees collected/// @param tickLower The lower tick of the position for which to collect fees/// @param tickUpper The upper tick of the position for which to collect fees/// @param amount0Requested How much token0 should be withdrawn from the fees owed/// @param amount1Requested How much token1 should be withdrawn from the fees owed/// @return amount0 The amount of fees collected in token0
contracts/core/interfaces/pool/IUniswapV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Pool state that is not stored/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the/// blockchain. The functions here may have variable gas costs.interface IUniswapV3PoolDerivedState {/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing/// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,/// you must call it with secondsAgos = [3600, 0]./// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in/// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio./// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned/// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp/// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block/// timestampfunction observe(uint32[] calldata secondsAgos)externalviewreturns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);/// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range/// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed./// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first/// snapshot is taken and the second snapshot is taken./// @param tickLower The lower tick of the range/// @param tickUpper The upper tick of the range/// @return tickCumulativeInside The snapshot of the tick accumulator for the range/// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range/// @return secondsInside The snapshot of seconds per liquidity for the rangefunction snapshotCumulativesInside(int24 tickLower, int24 tickUpper)externalviewreturns (int56 tickCumulativeInside,uint160 secondsPerLiquidityInsideX128,uint32 secondsInside);}
contracts/core/interfaces/pool/IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Events emitted by a pool/// @notice Contains all events emitted by the poolinterface IUniswapV3PoolEvents {/// @notice Emitted exactly once by a pool when #initialize is first called on the pool/// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize/// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96/// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the poolevent Initialize(uint160 sqrtPriceX96, int24 tick);/// @notice Emitted when liquidity is minted for a given position/// @param sender The address that minted the liquidity/// @param owner The owner of the position and recipient of any minted liquidity/// @param tickLower The lower tick of the position/// @param tickUpper The upper tick of the position/// @param amount The amount of liquidity minted to the position range/// @param amount0 How much token0 was required for the minted liquidity/// @param amount1 How much token1 was required for the minted liquidityevent Mint(address sender,address indexed owner,int24 indexed tickLower,int24 indexed tickUpper,uint128 amount,uint256 amount0,uint256 amount1);/// @notice Emitted when fees are collected by the owner of a position/// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees/// @param owner The owner of the position for which fees are collected/// @param tickLower The lower tick of the position/// @param tickUpper The upper tick of the position/// @param amount0 The amount of token0 fees collected/// @param amount1 The amount of token1 fees collectedevent Collect(address indexed owner,address recipient,int24 indexed tickLower,
contracts/core/interfaces/pool/IUniswapV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Pool state that never changes/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same valuesinterface IUniswapV3PoolImmutables {/// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface/// @return The contract addressfunction factory() external view returns (address);/// @notice The first of the two tokens of the pool, sorted by address/// @return The token contract addressfunction token0() external view returns (address);/// @notice The second of the two tokens of the pool, sorted by address/// @return The token contract addressfunction token1() external view returns (address);/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6/// @return The feefunction fee() external view returns (uint24);/// @notice The pool tick spacing/// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, .../// This value is an int24 to avoid casting even though it is always positive./// @return The tick spacingfunction tickSpacing() external view returns (int24);/// @notice The maximum amount of position liquidity that can use any tick in the range/// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and/// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool/// @return The max amount of liquidity per tickfunction maxLiquidityPerTick() external view returns (uint128);}
contracts/core/interfaces/pool/IUniswapV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Permissioned pool actions/// @notice Contains pool methods that may only be called by the factory ownerinterface IUniswapV3PoolOwnerActions {/// @notice Set the denominator of the protocol's % share of the fees/// @param feeProtocol0 new protocol fee for token0 of the pool/// @param feeProtocol1 new protocol fee for token1 of the pool// function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;/// @notice Collect the protocol fee accrued to the pool/// @param recipient The address to which collected protocol fees should be sent/// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1/// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0/// @return amount0 The protocol fee collected in token0/// @return amount1 The protocol fee collected in token1// function collectProtocol(// address recipient,// uint128 amount0Requested,// uint128 amount1Requested// ) external returns (uint128 amount0, uint128 amount1);}
contracts/core/libraries/SafeCast.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Safe casting methods/// @notice Contains methods for safely casting between typeslibrary SafeCast {/// @notice Cast a uint256 to a uint160, revert on overflow/// @param y The uint256 to be downcasted/// @return z The downcasted integer, now type uint160function toUint160(uint256 y) internal pure returns (uint160 z) {require((z = uint160(y)) == y);}/// @notice Cast a int256 to a int128, revert on overflow or underflow/// @param y The int256 to be downcasted/// @return z The downcasted integer, now type int128function toInt128(int256 y) internal pure returns (int128 z) {require((z = int128(y)) == y);}/// @notice Cast a uint256 to a int256, revert on overflow/// @param y The uint256 to be casted/// @return z The casted integer, now type int256function toInt256(uint256 y) internal pure returns (int256 z) {require(y < 2**255);z = int256(y);}}
contracts/core/libraries/TickBitmap.sol
// SPDX-License-Identifier: BUSL-1.1pragma solidity >=0.5.0;import './BitMath.sol';/// @title Packed tick initialized state library/// @notice Stores a packed mapping of tick index to its initialized state/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word.library TickBitmap {/// @notice Computes the position in the mapping where the initialized bit for a tick lives/// @param tick The tick for which to compute the position/// @return wordPos The key in the mapping containing the word in which the bit is stored/// @return bitPos The bit position in the word where the flag is storedfunction position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) {wordPos = int16(tick >> 8);bitPos = uint8(tick % 256);}/// @notice Flips the initialized state for a given tick from false to true, or vice versa/// @param self The mapping in which to flip the tick/// @param tick The tick to flip/// @param tickSpacing The spacing between usable ticksfunction flipTick(mapping(int16 => uint256) storage self,int24 tick,int24 tickSpacing) internal {require(tick % tickSpacing == 0); // ensure that the tick is spaced(int16 wordPos, uint8 bitPos) = position(tick / tickSpacing);uint256 mask = 1 << bitPos;self[wordPos] ^= mask;}/// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either/// to the left (less than or equal to) or right (greater than) of the given tick/// @param self The mapping in which to compute the next initialized tick/// @param tick The starting tick/// @param tickSpacing The spacing between usable ticks/// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick)/// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick/// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks
contracts/core/libraries/TickMath.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0 <0.8.0;/// @title Math library for computing sqrt prices from ticks and vice versa/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports/// prices between 2**-128 and 2**128library TickMath {/// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128int24 internal constant MIN_TICK = -887272;/// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128int24 internal constant MAX_TICK = -MIN_TICK;/// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)uint160 internal constant MIN_SQRT_RATIO = 4295128739;/// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;/// @notice Calculates sqrt(1.0001^tick) * 2^96/// @dev Throws if |tick| > max tick/// @param tick The input tick for the above formula/// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)/// at the given tickfunction getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));require(absTick <= uint256(MAX_TICK), 'T');uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
contracts/periphery/base/PeripheryImmutableState.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity =0.7.6;import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";import "../interfaces/IPeripheryImmutableState.sol";/// @title Immutable state/// @notice Immutable state used by periphery contractsabstract contract PeripheryImmutableState isIPeripheryImmutableState,OwnableUpgradeable{/// @inheritdoc IPeripheryImmutableStateaddress public override factory;/// @inheritdoc IPeripheryImmutableStateaddress public override WETH9;function __PeripheryImmutableState_init(address _factory,address _WETH9) internal initializer {__Ownable_init();//factory = _factory;WETH9 = _WETH9;}function setWETH9(address weth9Arg) external onlyOwner {WETH9 = weth9Arg;}}
contracts/periphery/interfaces/IPeripheryImmutableState.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;/// @title Immutable state/// @notice Functions that return immutable state of the routerinterface IPeripheryImmutableState {/// @return Returns the address of the Uniswap V3 factoryfunction factory() external view returns (address);/// @return Returns the address of WETH9function WETH9() external view returns (address);}
contracts/periphery/interfaces/IQuoterV2.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.7.5;pragma abicoder v2;/// @title QuoterV2 Interface/// @notice Supports quoting the calculated amounts from exact input or exact output swaps./// @notice For each pool also tells you the number of initialized ticks crossed and the sqrt price of the pool after the swap./// @dev These functions are not marked view because they rely on calling non-view functions and reverting/// to compute the result. They are also not gas efficient and should not be called on-chain.interface IQuoterV2 {/// @notice Returns the amount out received for a given exact input swap without executing the swap/// @param path The path of the swap, i.e. each token pair and the pool fee/// @param amountIn The amount of the first token to swap/// @return amountOut The amount of the last token that would be received/// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path/// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path/// @return gasEstimate The estimate of the gas that the swap consumesfunction quoteExactInput(bytes memory path, uint256 amountIn)externalreturns (uint256 amountOut,uint160[] memory sqrtPriceX96AfterList,uint32[] memory initializedTicksCrossedList,uint256 gasEstimate);struct QuoteExactInputSingleParams {address tokenIn;address tokenOut;uint256 amountIn;uint24 fee;uint160 sqrtPriceLimitX96;}/// @notice Returns the amount out received for a given exact input but for a swap of a single pool/// @param params The params for the quote, encoded as `QuoteExactInputSingleParams`/// tokenIn The token being swapped in/// tokenOut The token being swapped out/// fee The fee of the token pool to consider for the pair/// amountIn The desired input amount/// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
contracts/periphery/libraries/BytesLib.sol
// SPDX-License-Identifier: GPL-2.0-or-later/** @title Solidity Bytes Arrays Utils* @author Gonçalo Sá <goncalo.sa@consensys.net>** @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.* The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.*/pragma solidity >=0.5.0 <0.8.0;library BytesLib {function slice(bytes memory _bytes,uint256 _start,uint256 _length) internal pure returns (bytes memory) {require(_length + 31 >= _length, 'slice_overflow');require(_start + _length >= _start, 'slice_overflow');require(_bytes.length >= _start + _length, 'slice_outOfBounds');bytes memory tempBytes;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)
contracts/periphery/libraries/CallbackValidation.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity =0.7.6;import '../../core/interfaces/IUniswapV3Pool.sol';import './PoolAddress.sol';/// @notice Provides validation for callbacks from Uniswap V3 Poolslibrary CallbackValidation {/// @notice Returns the address of a valid Uniswap V3 Pool/// @param factory The contract address of the Uniswap V3 factory/// @param tokenA The contract address of either token0 or token1/// @param tokenB The contract address of the other token/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip/// @return pool The V3 pool contract addressfunction verifyCallback(address factory,address tokenA,address tokenB,uint24 fee) internal view returns (IUniswapV3Pool pool) {return verifyCallback(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee));}/// @notice Returns the address of a valid Uniswap V3 Pool/// @param factory The contract address of the Uniswap V3 factory/// @param poolKey The identifying key of the V3 pool/// @return pool The V3 pool contract addressfunction verifyCallback(address factory, PoolAddress.PoolKey memory poolKey)internalviewreturns (IUniswapV3Pool pool){pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey));require(msg.sender == address(pool));}}
contracts/periphery/libraries/Path.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.6.0;import './BytesLib.sol';/// @title Functions for manipulating path data for multihop swapslibrary Path {using BytesLib for bytes;/// @dev The length of the bytes encoded addressuint256 private constant ADDR_SIZE = 20;/// @dev The length of the bytes encoded feeuint256 private constant FEE_SIZE = 3;/// @dev The offset of a single token address and pool feeuint256 private constant NEXT_OFFSET = ADDR_SIZE + FEE_SIZE;/// @dev The offset of an encoded pool keyuint256 private constant POP_OFFSET = NEXT_OFFSET + ADDR_SIZE;/// @dev The minimum length of an encoding that contains 2 or more poolsuint256 private constant MULTIPLE_POOLS_MIN_LENGTH = POP_OFFSET + NEXT_OFFSET;/// @notice Returns true iff the path contains two or more pools/// @param path The encoded swap path/// @return True if path contains two or more pools, otherwise falsefunction hasMultiplePools(bytes memory path) internal pure returns (bool) {return path.length >= MULTIPLE_POOLS_MIN_LENGTH;}/// @notice Returns the number of pools in the path/// @param path The encoded swap path/// @return The number of pools in the pathfunction numPools(bytes memory path) internal pure returns (uint256) {// Ignore the first token address. From then on every fee and token offset indicates a pool.return ((path.length - ADDR_SIZE) / NEXT_OFFSET);}/// @notice Decodes the first pool in path/// @param path The bytes encoded swap path/// @return tokenA The first token of the given pool/// @return tokenB The second token of the given pool/// @return fee The fee level of the pool
contracts/periphery/libraries/PoolAddress.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.5.0;import "../../core/interfaces/IUniswapV3Factory.sol";/// @title Provides functions for deriving a pool address from the factory, tokens, and the feelibrary PoolAddress {bytes32 internal constant POOL_INIT_CODE_HASH =0x04759a882be3a45ff74719de5c82516d29af4b3480d076fc0c57b2fdab813bc7;/// @notice The identifying key of the poolstruct PoolKey {address token0;address token1;uint24 fee;}/// @notice Returns PoolKey: the ordered tokens with the matched fee levels/// @param tokenA The first token of a pool, unsorted/// @param tokenB The second token of a pool, unsorted/// @param fee The fee level of the pool/// @return Poolkey The pool details with ordered token0 and token1 assignmentsfunction getPoolKey(address tokenA,address tokenB,uint24 fee) internal pure returns (PoolKey memory) {if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);return PoolKey({token0: tokenA, token1: tokenB, fee: fee});}/// @notice Deterministically computes the pool address given the factory and PoolKey/// @param factory The Uniswap V3 factory contract address/// @param key The PoolKey/// @return pool The contract address of the V3 poolfunction computeAddress(address factory,PoolKey memory key) internal pure returns (address pool) {require(key.token0 < key.token1);pool = address(
contracts/periphery/libraries/PoolTicksCounter.sol
// SPDX-License-Identifier: GPL-2.0-or-laterpragma solidity >=0.6.0;import '../../core/interfaces/IUniswapV3Pool.sol';library PoolTicksCounter {/// @dev This function counts the number of initialized ticks that would incur a gas cost between tickBefore and tickAfter./// When tickBefore and/or tickAfter themselves are initialized, the logic over whether we should count them depends on the/// direction of the swap. If we are swapping upwards (tickAfter > tickBefore) we don't want to count tickBefore but we do/// want to count tickAfter. The opposite is true if we are swapping downwards.function countInitializedTicksCrossed(IUniswapV3Pool self,int24 tickBefore,int24 tickAfter) internal view returns (uint32 initializedTicksCrossed) {int16 wordPosLower;int16 wordPosHigher;uint8 bitPosLower;uint8 bitPosHigher;bool tickBeforeInitialized;bool tickAfterInitialized;{// Get the key and offset in the tick bitmap of the active tick before and after the swap.int16 wordPos = int16((tickBefore / self.tickSpacing()) >> 8);uint8 bitPos = uint8((tickBefore / self.tickSpacing()) % 256);int16 wordPosAfter = int16((tickAfter / self.tickSpacing()) >> 8);uint8 bitPosAfter = uint8((tickAfter / self.tickSpacing()) % 256);// In the case where tickAfter is initialized, we only want to count it if we are swapping downwards.// If the initializable tick after the swap is initialized, our original tickAfter is a// multiple of tick spacing, and we are swapping downwards we know that tickAfter is initialized// and we shouldn't count it.tickAfterInitialized =((self.tickBitmap(wordPosAfter) & (1 << bitPosAfter)) > 0) &&((tickAfter % self.tickSpacing()) == 0) &&(tickBefore > tickAfter);// In the case where tickBefore is initialized, we only want to count it if we are swapping upwards.// Use the same logic as above to decide whether we should count tickBefore or not.
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"none"},"libraries":{}}
Contract ABI
[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"WETH9","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"factory","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_factory","internalType":"address"},{"type":"address","name":"_WETH9","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint160[]","name":"sqrtPriceX96AfterList","internalType":"uint160[]"},{"type":"uint32[]","name":"initializedTicksCrossedList","internalType":"uint32[]"},{"type":"uint256","name":"gasEstimate","internalType":"uint256"}],"name":"quoteExactInput","inputs":[{"type":"bytes","name":"path","internalType":"bytes"},{"type":"uint256","name":"amountIn","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint160","name":"sqrtPriceX96After","internalType":"uint160"},{"type":"uint32","name":"initializedTicksCrossed","internalType":"uint32"},{"type":"uint256","name":"gasEstimate","internalType":"uint256"}],"name":"quoteExactInputSingle","inputs":[{"type":"tuple","name":"params","internalType":"struct IQuoterV2.QuoteExactInputSingleParams","components":[{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint24","name":"fee","internalType":"uint24"},{"type":"uint160","name":"sqrtPriceLimitX96","internalType":"uint160"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint160[]","name":"sqrtPriceX96AfterList","internalType":"uint160[]"},{"type":"uint32[]","name":"initializedTicksCrossedList","internalType":"uint32[]"},{"type":"uint256","name":"gasEstimate","internalType":"uint256"}],"name":"quoteExactOutput","inputs":[{"type":"bytes","name":"path","internalType":"bytes"},{"type":"uint256","name":"amountOut","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint160","name":"sqrtPriceX96After","internalType":"uint160"},{"type":"uint32","name":"initializedTicksCrossed","internalType":"uint32"},{"type":"uint256","name":"gasEstimate","internalType":"uint256"}],"name":"quoteExactOutputSingle","inputs":[{"type":"tuple","name":"params","internalType":"struct IQuoterV2.QuoteExactOutputSingleParams","components":[{"type":"address","name":"tokenIn","internalType":"address"},{"type":"address","name":"tokenOut","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint24","name":"fee","internalType":"uint24"},{"type":"uint160","name":"sqrtPriceLimitX96","internalType":"uint160"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWETH9","inputs":[{"type":"address","name":"weth9Arg","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[],"name":"uniswapV3SwapCallback","inputs":[{"type":"int256","name":"amount0Delta","internalType":"int256"},{"type":"int256","name":"amount1Delta","internalType":"int256"},{"type":"bytes","name":"path","internalType":"bytes"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061222c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063c45a015511610071578063c45a015514610142578063c6a5026a1461014a578063ca91e18c1461015d578063cdca175314610170578063f2fde38b14610183578063fa461e3314610196576100b4565b80632f80bb1d146100b9578063485cc955146100e55780634aa4a4fc146100fa578063715018a61461010f5780638da5cb5b14610117578063bd21704a1461011f575b600080fd5b6100cc6100c7366004611d70565b6101a9565b6040516100dc949392919061207b565b60405180910390f35b6100f86100f3366004611d38565b61035e565b005b61010261040c565b6040516100dc9190611fe4565b6100f861041b565b6101026104d9565b61013261012d366004611e8e565b6104e8565b6040516100dc9493929190612116565b6101026106bc565b610132610158366004611e8e565b6106cb565b6100f861016b366004611d15565b610841565b6100cc61017e366004611d70565b6108d7565b6100f8610191366004611d15565b610a6e565b6100f86101a4366004611dd6565b610b83565b600060608060006101b986610cec565b67ffffffffffffffff811180156101cf57600080fd5b506040519080825280602002602001820160405280156101f9578160200160208202803683370190505b50925061020586610cec565b67ffffffffffffffff8111801561021b57600080fd5b50604051908082528060200260200182016040528015610245578160200160208202803683370190505b50915060005b60008060006102598a610cfd565b9250925092506000806000806102b56040518060a00160405280886001600160a01b03168152602001896001600160a01b031681526020018f81526020018762ffffff16815260200160006001600160a01b03168152506104e8565b9350935093509350828b89815181106102ca57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050818a89815181106102f757fe5b63ffffffff90921660209283029190910190910152929b50968201966001909601958b926103248e610d2e565b15610339576103328e610d36565b9d50610349565b8c9b505050505050505050610355565b5050505050505061024b565b92959194509250565b600054610100900460ff16806103775750610377610d53565b80610385575060005460ff16155b6103c05760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff161580156103eb576000805460ff1961ff0019909116610100171660011790555b6103f58383610d64565b8015610407576000805461ff00191690555b505050565b6066546001600160a01b031681565b610423610e3f565b6001600160a01b03166104346104d9565b6001600160a01b03161461048f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6033546001600160a01b031690565b6020810151815160608301516000928392839283926001600160a01b03808216908416109284926105199290610e43565b905086608001516001600160a01b03166000141561053a5760408701516067555b60005a9050816001600160a01b031663128acb08308561055d8c60400151610e6e565b6000038c608001516001600160a01b031660001461057f578c608001516105a5565b8761059e5773fffd8963efd1fc6a506488495d951d5263988d256105a5565b6401000276a45b8d602001518e606001518f600001516040516020016105c693929190611fa9565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016105f5959493929190611ff8565b6040805180830381600087803b15801561060e57600080fd5b505af192505050801561063e575060408051601f3d908101601f1916820190925261063b91810190611db3565b60015b6106af573d80801561066c576040519150601f19603f3d011682016040523d82523d6000602084013e610671565b606091505b505a8203945088608001516001600160a01b0316600014156106935760006067555b61069e818487610e84565b9750975097509750505050506106b5565b50505050505b9193509193565b6065546001600160a01b031681565b6020810151815160608301516000928392839283926001600160a01b03808216908416109284926106fc9290610e43565b905060005a9050816001600160a01b031663128acb0830856107218c60400151610e6e565b60808d01516001600160a01b03161561073e578c60800151610764565b8761075d5773fffd8963efd1fc6a506488495d951d5263988d25610764565b6401000276a45b8d600001518e606001518f6020015160405160200161078593929190611fa9565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016107b4959493929190611ff8565b6040805180830381600087803b1580156107cd57600080fd5b505af19250505080156107fd575060408051601f3d908101601f191682019092526107fa91810190611db3565b60015b6106af573d80801561082b576040519150601f19603f3d011682016040523d82523d6000602084013e610830565b606091505b505a8203945061069e818487610e84565b610849610e3f565b6001600160a01b031661085a6104d9565b6001600160a01b0316146108b5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606680546001600160a01b0319166001600160a01b0392909216919091179055565b600060608060006108e786610cec565b67ffffffffffffffff811180156108fd57600080fd5b50604051908082528060200260200182016040528015610927578160200160208202803683370190505b50925061093386610cec565b67ffffffffffffffff8111801561094957600080fd5b50604051908082528060200260200182016040528015610973578160200160208202803683370190505b50915060005b60008060006109878a610cfd565b9250925092506000806000806109e36040518060a00160405280896001600160a01b03168152602001886001600160a01b031681526020018f81526020018762ffffff16815260200160006001600160a01b03168152506106cb565b9350935093509350828b89815181106109f857fe5b60200260200101906001600160a01b031690816001600160a01b031681525050818a8981518110610a2557fe5b63ffffffff90921660209283029190910190910152929b50968201966001909601958b92610a528e610d2e565b1561033957610a608e610d36565b9d5050505050505050610979565b610a76610e3f565b6001600160a01b0316610a876104d9565b6001600160a01b031614610ae2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610b275760405162461bcd60e51b81526004018080602001828103825260268152602001806121cc6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6000831380610b925750600082135b610b9b57600080fd5b6000806000610ba984610cfd565b6065549295509093509150610bc9906001600160a01b0316848484610f3e565b506000806000808913610bf557856001600160a01b0316856001600160a01b031610888a600003610c10565b846001600160a01b0316866001600160a01b03161089896000035b9250925092506000610c23878787610e43565b9050600080826001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610c6157600080fd5b505afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190611ea9565b5050505050915091508515610cbf57604051848152826020820152816040820152606081fd5b60675415610cd5576067548414610cd557600080fd5b604051858152826020820152816040820152606081fd5b80516017601319909101045b919050565b60008080610d0b8482610f5d565b9250610d1884601461100d565b9050610d25846017610f5d565b91509193909250565b516042111590565b8051606090610d4d908390601790601619016110b4565b92915050565b6000610d5e30611205565b15905090565b600054610100900460ff1680610d7d5750610d7d610d53565b80610d8b575060005460ff16155b610dc65760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff16158015610df1576000805460ff1961ff0019909116610100171660011790555b610df961120b565b606580546001600160a01b038086166001600160a01b03199283161790925560668054928516929091169190911790558015610407576000805461ff0019169055505050565b3390565b606554600090610e66906001600160a01b0316610e618686866112bd565b611313565b949350505050565b6000600160ff1b8210610e8057600080fd5b5090565b600080600080600080876001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610ec657600080fd5b505afa158015610eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efe9190611ea9565b50939650610f1394508d93506113f792505050565b91975095509050610f2e6001600160a01b0389168383611484565b9350869250505093509350935093565b6000610f5485610f4f8686866112bd565b611a0d565b95945050505050565b600081826014011015610fac576040805162461bcd60e51b8152602060048201526012602482015271746f416464726573735f6f766572666c6f7760701b604482015290519081900360640190fd5b8160140183511015610ffd576040805162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b604482015290519081900360640190fd5b500160200151600160601b900490565b60008182600301101561105b576040805162461bcd60e51b8152602060048201526011602482015270746f55696e7432345f6f766572666c6f7760781b604482015290519081900360640190fd5b81600301835110156110ab576040805162461bcd60e51b8152602060048201526014602482015273746f55696e7432345f6f75744f66426f756e647360601b604482015290519081900360640190fd5b50016003015190565b60608182601f0110156110ff576040805162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b604482015290519081900360640190fd5b828284011015611147576040805162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b604482015290519081900360640190fd5b81830184511015611193576040805162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b604482015290519081900360640190fd5b6060821580156111b257604051915060008252602082016040526111fc565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156111eb5780518352602092830192016111d3565b5050858452601f01601f1916604052505b50949350505050565b3b151590565b600054610100900460ff16806112245750611224610d53565b80611232575060005460ff16155b61126d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff16158015611298576000805460ff1961ff0019909116610100171660011790555b6112a0611a30565b6112a8611ad0565b80156112ba576000805461ff00191690555b50565b6112c5611be4565b826001600160a01b0316846001600160a01b031611156112e3579192915b50604080516060810182526001600160a01b03948516815292909316602083015262ffffff169181019190915290565b600081602001516001600160a01b031682600001516001600160a01b03161061133b57600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6bffffffffffffffffffffffff191660a183015260b58201939093527f04759a882be3a45ff74719de5c82516d29af4b3480d076fc0c57b2fdab813bc760d5808301919091528251808303909101815260f5909101909152805191012090565b60008060008351606014611463576044845110156114305760405162461bcd60e51b815260040161142790612051565b60405180910390fd5b6004840193508380602001905181019061144a9190611e24565b60405162461bcd60e51b8152600401611427919061203e565b838060200190518101906114779190611f40565b9250925092509193909250565b60008060008060008060008060088b6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114cb57600080fd5b505afa1580156114df573d6000803e3d6000fd5b505050506040513d60208110156114f557600080fd5b5051600290810b908c900b8161150757fe5b0560020b901d905060006101008c6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561154d57600080fd5b505afa158015611561573d6000803e3d6000fd5b505050506040513d602081101561157757600080fd5b5051600290810b908d900b8161158957fe5b0560020b8161159457fe5b079050600060088d6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d457600080fd5b505afa1580156115e8573d6000803e3d6000fd5b505050506040513d60208110156115fe57600080fd5b5051600290810b908d900b8161161057fe5b0560020b901d905060006101008e6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561165657600080fd5b505afa15801561166a573d6000803e3d6000fd5b505050506040513d602081101561168057600080fd5b5051600290810b908e900b8161169257fe5b0560020b8161169d57fe5b07905060008160ff166001901b8f6001600160a01b0316635339c296856040518263ffffffff1660e01b8152600401808260010b815260200191505060206040518083038186803b1580156116f157600080fd5b505afa158015611705573d6000803e3d6000fd5b505050506040513d602081101561171b57600080fd5b5051161180156117a157508d6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561175f57600080fd5b505afa158015611773573d6000803e3d6000fd5b505050506040513d602081101561178957600080fd5b5051600290810b908d900b8161179b57fe5b0760020b155b80156117b257508b60020b8d60020b135b945060008360ff166001901b8f6001600160a01b0316635339c296876040518263ffffffff1660e01b8152600401808260010b815260200191505060206040518083038186803b15801561180557600080fd5b505afa158015611819573d6000803e3d6000fd5b505050506040513d602081101561182f57600080fd5b5051161180156118b557508d6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561187357600080fd5b505afa158015611887573d6000803e3d6000fd5b505050506040513d602081101561189d57600080fd5b5051600290810b908e900b816118af57fe5b0760020b155b80156118c657508b60020b8d60020b125b95508160010b8460010b12806118f257508160010b8460010b1480156118f257508060ff168360ff1611155b1561190857839950829750819850809650611915565b8199508097508398508296505b505060001960ff87161b9150505b8560010b8760010b136119e5578560010b8760010b141561194a5760001960ff858103161c165b6000818c6001600160a01b0316635339c2968a6040518263ffffffff1660e01b8152600401808260010b815260200191505060206040518083038186803b15801561199457600080fd5b505afa1580156119a8573d6000803e3d6000fd5b505050506040513d60208110156119be57600080fd5b50511690506119cc81611bc9565b61ffff1698909801975050600190950194600019611923565b81156119f2576001880397505b82156119ff576001880397505b505050505050509392505050565b6000611a198383611313565b9050336001600160a01b03821614610d4d57600080fd5b600054610100900460ff1680611a495750611a49610d53565b80611a57575060005460ff16155b611a925760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff161580156112a8576000805460ff1961ff00199091166101001716600117905580156112ba576000805461ff001916905550565b600054610100900460ff1680611ae95750611ae9610d53565b80611af7575060005460ff16155b611b325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff16158015611b5d576000805460ff1961ff0019909116610100171660011790555b6000611b67610e3f565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156112ba576000805461ff001916905550565b6000805b8215610d4d57600019830190921691600101611bcd565b604080516060810182526000808252602082018190529181019190915290565b600082601f830112611c14578081fd5b8135611c27611c2282612164565b612140565b818152846020838601011115611c3b578283fd5b816020850160208301379081016020019190915292915050565b8051600281900b8114610cf857600080fd5b600060a08284031215611c78578081fd5b60405160a0810181811067ffffffffffffffff82111715611c9557fe5b6040529050808235611ca6816121b6565b81526020830135611cb6816121b6565b602082015260408381013590820152606083013562ffffff81168114611cdb57600080fd5b6060820152611cec60808401611cf8565b60808201525092915050565b8035610cf8816121b6565b805161ffff81168114610cf857600080fd5b600060208284031215611d26578081fd5b8135611d31816121b6565b9392505050565b60008060408385031215611d4a578081fd5b8235611d55816121b6565b91506020830135611d65816121b6565b809150509250929050565b60008060408385031215611d82578182fd5b823567ffffffffffffffff811115611d98578283fd5b611da485828601611c04565b95602094909401359450505050565b60008060408385031215611dc5578182fd5b505080516020909101519092909150565b600080600060608486031215611dea578081fd5b8335925060208401359150604084013567ffffffffffffffff811115611e0e578182fd5b611e1a86828701611c04565b9150509250925092565b600060208284031215611e35578081fd5b815167ffffffffffffffff811115611e4b578182fd5b8201601f81018413611e5b578182fd5b8051611e69611c2282612164565b818152856020838501011115611e7d578384fd5b610f54826020830160208601612186565b600060a08284031215611e9f578081fd5b611d318383611c67565b600080600080600080600060e0888a031215611ec3578485fd5b8751611ece816121b6565b9650611edc60208901611c55565b9550611eea60408901611d03565b9450611ef860608901611d03565b9350611f0660808901611d03565b925060a088015160ff81168114611f1b578283fd5b60c08901519092508015158114611f30578182fd5b8091505092959891949750929550565b600080600060608486031215611f54578081fd5b835192506020840151611f66816121b6565b9150611f7460408501611c55565b90509250925092565b60008151808452611f95816020860160208601612186565b601f01601f19169290920160200192915050565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528515156020830152604082018590528316606082015260a06080820181905260009061203390830184611f7d565b979650505050505050565b600060208252611d316020830184611f7d565b60208082526010908201526f2ab732bc3832b1ba32b21032b93937b960811b604082015260600190565b600060808201868352602060808185015281875180845260a0860191508289019350845b818110156120c45784516001600160a01b03168352938301939183019160010161209f565b505084810360408601528651808252908201925081870190845b8181101561210057825163ffffffff16855293830193918301916001016120de565b5050505060609290920192909252949350505050565b9384526001600160a01b0392909216602084015263ffffffff166040830152606082015260800190565b60405181810167ffffffffffffffff8111828210171561215c57fe5b604052919050565b600067ffffffffffffffff82111561217857fe5b50601f01601f191660200190565b60005b838110156121a1578181015183820152602001612189565b838111156121b0576000848401525b50505050565b6001600160a01b03811681146112ba57600080fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a164736f6c6343000706000a
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063c45a015511610071578063c45a015514610142578063c6a5026a1461014a578063ca91e18c1461015d578063cdca175314610170578063f2fde38b14610183578063fa461e3314610196576100b4565b80632f80bb1d146100b9578063485cc955146100e55780634aa4a4fc146100fa578063715018a61461010f5780638da5cb5b14610117578063bd21704a1461011f575b600080fd5b6100cc6100c7366004611d70565b6101a9565b6040516100dc949392919061207b565b60405180910390f35b6100f86100f3366004611d38565b61035e565b005b61010261040c565b6040516100dc9190611fe4565b6100f861041b565b6101026104d9565b61013261012d366004611e8e565b6104e8565b6040516100dc9493929190612116565b6101026106bc565b610132610158366004611e8e565b6106cb565b6100f861016b366004611d15565b610841565b6100cc61017e366004611d70565b6108d7565b6100f8610191366004611d15565b610a6e565b6100f86101a4366004611dd6565b610b83565b600060608060006101b986610cec565b67ffffffffffffffff811180156101cf57600080fd5b506040519080825280602002602001820160405280156101f9578160200160208202803683370190505b50925061020586610cec565b67ffffffffffffffff8111801561021b57600080fd5b50604051908082528060200260200182016040528015610245578160200160208202803683370190505b50915060005b60008060006102598a610cfd565b9250925092506000806000806102b56040518060a00160405280886001600160a01b03168152602001896001600160a01b031681526020018f81526020018762ffffff16815260200160006001600160a01b03168152506104e8565b9350935093509350828b89815181106102ca57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050818a89815181106102f757fe5b63ffffffff90921660209283029190910190910152929b50968201966001909601958b926103248e610d2e565b15610339576103328e610d36565b9d50610349565b8c9b505050505050505050610355565b5050505050505061024b565b92959194509250565b600054610100900460ff16806103775750610377610d53565b80610385575060005460ff16155b6103c05760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff161580156103eb576000805460ff1961ff0019909116610100171660011790555b6103f58383610d64565b8015610407576000805461ff00191690555b505050565b6066546001600160a01b031681565b610423610e3f565b6001600160a01b03166104346104d9565b6001600160a01b03161461048f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6033546001600160a01b031690565b6020810151815160608301516000928392839283926001600160a01b03808216908416109284926105199290610e43565b905086608001516001600160a01b03166000141561053a5760408701516067555b60005a9050816001600160a01b031663128acb08308561055d8c60400151610e6e565b6000038c608001516001600160a01b031660001461057f578c608001516105a5565b8761059e5773fffd8963efd1fc6a506488495d951d5263988d256105a5565b6401000276a45b8d602001518e606001518f600001516040516020016105c693929190611fa9565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016105f5959493929190611ff8565b6040805180830381600087803b15801561060e57600080fd5b505af192505050801561063e575060408051601f3d908101601f1916820190925261063b91810190611db3565b60015b6106af573d80801561066c576040519150601f19603f3d011682016040523d82523d6000602084013e610671565b606091505b505a8203945088608001516001600160a01b0316600014156106935760006067555b61069e818487610e84565b9750975097509750505050506106b5565b50505050505b9193509193565b6065546001600160a01b031681565b6020810151815160608301516000928392839283926001600160a01b03808216908416109284926106fc9290610e43565b905060005a9050816001600160a01b031663128acb0830856107218c60400151610e6e565b60808d01516001600160a01b03161561073e578c60800151610764565b8761075d5773fffd8963efd1fc6a506488495d951d5263988d25610764565b6401000276a45b8d600001518e606001518f6020015160405160200161078593929190611fa9565b6040516020818303038152906040526040518663ffffffff1660e01b81526004016107b4959493929190611ff8565b6040805180830381600087803b1580156107cd57600080fd5b505af19250505080156107fd575060408051601f3d908101601f191682019092526107fa91810190611db3565b60015b6106af573d80801561082b576040519150601f19603f3d011682016040523d82523d6000602084013e610830565b606091505b505a8203945061069e818487610e84565b610849610e3f565b6001600160a01b031661085a6104d9565b6001600160a01b0316146108b5576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606680546001600160a01b0319166001600160a01b0392909216919091179055565b600060608060006108e786610cec565b67ffffffffffffffff811180156108fd57600080fd5b50604051908082528060200260200182016040528015610927578160200160208202803683370190505b50925061093386610cec565b67ffffffffffffffff8111801561094957600080fd5b50604051908082528060200260200182016040528015610973578160200160208202803683370190505b50915060005b60008060006109878a610cfd565b9250925092506000806000806109e36040518060a00160405280896001600160a01b03168152602001886001600160a01b031681526020018f81526020018762ffffff16815260200160006001600160a01b03168152506106cb565b9350935093509350828b89815181106109f857fe5b60200260200101906001600160a01b031690816001600160a01b031681525050818a8981518110610a2557fe5b63ffffffff90921660209283029190910190910152929b50968201966001909601958b92610a528e610d2e565b1561033957610a608e610d36565b9d5050505050505050610979565b610a76610e3f565b6001600160a01b0316610a876104d9565b6001600160a01b031614610ae2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610b275760405162461bcd60e51b81526004018080602001828103825260268152602001806121cc6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b6000831380610b925750600082135b610b9b57600080fd5b6000806000610ba984610cfd565b6065549295509093509150610bc9906001600160a01b0316848484610f3e565b506000806000808913610bf557856001600160a01b0316856001600160a01b031610888a600003610c10565b846001600160a01b0316866001600160a01b03161089896000035b9250925092506000610c23878787610e43565b9050600080826001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610c6157600080fd5b505afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190611ea9565b5050505050915091508515610cbf57604051848152826020820152816040820152606081fd5b60675415610cd5576067548414610cd557600080fd5b604051858152826020820152816040820152606081fd5b80516017601319909101045b919050565b60008080610d0b8482610f5d565b9250610d1884601461100d565b9050610d25846017610f5d565b91509193909250565b516042111590565b8051606090610d4d908390601790601619016110b4565b92915050565b6000610d5e30611205565b15905090565b600054610100900460ff1680610d7d5750610d7d610d53565b80610d8b575060005460ff16155b610dc65760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff16158015610df1576000805460ff1961ff0019909116610100171660011790555b610df961120b565b606580546001600160a01b038086166001600160a01b03199283161790925560668054928516929091169190911790558015610407576000805461ff0019169055505050565b3390565b606554600090610e66906001600160a01b0316610e618686866112bd565b611313565b949350505050565b6000600160ff1b8210610e8057600080fd5b5090565b600080600080600080876001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610ec657600080fd5b505afa158015610eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efe9190611ea9565b50939650610f1394508d93506113f792505050565b91975095509050610f2e6001600160a01b0389168383611484565b9350869250505093509350935093565b6000610f5485610f4f8686866112bd565b611a0d565b95945050505050565b600081826014011015610fac576040805162461bcd60e51b8152602060048201526012602482015271746f416464726573735f6f766572666c6f7760701b604482015290519081900360640190fd5b8160140183511015610ffd576040805162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b604482015290519081900360640190fd5b500160200151600160601b900490565b60008182600301101561105b576040805162461bcd60e51b8152602060048201526011602482015270746f55696e7432345f6f766572666c6f7760781b604482015290519081900360640190fd5b81600301835110156110ab576040805162461bcd60e51b8152602060048201526014602482015273746f55696e7432345f6f75744f66426f756e647360601b604482015290519081900360640190fd5b50016003015190565b60608182601f0110156110ff576040805162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b604482015290519081900360640190fd5b828284011015611147576040805162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b604482015290519081900360640190fd5b81830184511015611193576040805162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b604482015290519081900360640190fd5b6060821580156111b257604051915060008252602082016040526111fc565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156111eb5780518352602092830192016111d3565b5050858452601f01601f1916604052505b50949350505050565b3b151590565b600054610100900460ff16806112245750611224610d53565b80611232575060005460ff16155b61126d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff16158015611298576000805460ff1961ff0019909116610100171660011790555b6112a0611a30565b6112a8611ad0565b80156112ba576000805461ff00191690555b50565b6112c5611be4565b826001600160a01b0316846001600160a01b031611156112e3579192915b50604080516060810182526001600160a01b03948516815292909316602083015262ffffff169181019190915290565b600081602001516001600160a01b031682600001516001600160a01b03161061133b57600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6bffffffffffffffffffffffff191660a183015260b58201939093527f04759a882be3a45ff74719de5c82516d29af4b3480d076fc0c57b2fdab813bc760d5808301919091528251808303909101815260f5909101909152805191012090565b60008060008351606014611463576044845110156114305760405162461bcd60e51b815260040161142790612051565b60405180910390fd5b6004840193508380602001905181019061144a9190611e24565b60405162461bcd60e51b8152600401611427919061203e565b838060200190518101906114779190611f40565b9250925092509193909250565b60008060008060008060008060088b6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114cb57600080fd5b505afa1580156114df573d6000803e3d6000fd5b505050506040513d60208110156114f557600080fd5b5051600290810b908c900b8161150757fe5b0560020b901d905060006101008c6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561154d57600080fd5b505afa158015611561573d6000803e3d6000fd5b505050506040513d602081101561157757600080fd5b5051600290810b908d900b8161158957fe5b0560020b8161159457fe5b079050600060088d6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d457600080fd5b505afa1580156115e8573d6000803e3d6000fd5b505050506040513d60208110156115fe57600080fd5b5051600290810b908d900b8161161057fe5b0560020b901d905060006101008e6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561165657600080fd5b505afa15801561166a573d6000803e3d6000fd5b505050506040513d602081101561168057600080fd5b5051600290810b908e900b8161169257fe5b0560020b8161169d57fe5b07905060008160ff166001901b8f6001600160a01b0316635339c296856040518263ffffffff1660e01b8152600401808260010b815260200191505060206040518083038186803b1580156116f157600080fd5b505afa158015611705573d6000803e3d6000fd5b505050506040513d602081101561171b57600080fd5b5051161180156117a157508d6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561175f57600080fd5b505afa158015611773573d6000803e3d6000fd5b505050506040513d602081101561178957600080fd5b5051600290810b908d900b8161179b57fe5b0760020b155b80156117b257508b60020b8d60020b135b945060008360ff166001901b8f6001600160a01b0316635339c296876040518263ffffffff1660e01b8152600401808260010b815260200191505060206040518083038186803b15801561180557600080fd5b505afa158015611819573d6000803e3d6000fd5b505050506040513d602081101561182f57600080fd5b5051161180156118b557508d6001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561187357600080fd5b505afa158015611887573d6000803e3d6000fd5b505050506040513d602081101561189d57600080fd5b5051600290810b908e900b816118af57fe5b0760020b155b80156118c657508b60020b8d60020b125b95508160010b8460010b12806118f257508160010b8460010b1480156118f257508060ff168360ff1611155b1561190857839950829750819850809650611915565b8199508097508398508296505b505060001960ff87161b9150505b8560010b8760010b136119e5578560010b8760010b141561194a5760001960ff858103161c165b6000818c6001600160a01b0316635339c2968a6040518263ffffffff1660e01b8152600401808260010b815260200191505060206040518083038186803b15801561199457600080fd5b505afa1580156119a8573d6000803e3d6000fd5b505050506040513d60208110156119be57600080fd5b50511690506119cc81611bc9565b61ffff1698909801975050600190950194600019611923565b81156119f2576001880397505b82156119ff576001880397505b505050505050509392505050565b6000611a198383611313565b9050336001600160a01b03821614610d4d57600080fd5b600054610100900460ff1680611a495750611a49610d53565b80611a57575060005460ff16155b611a925760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff161580156112a8576000805460ff1961ff00199091166101001716600117905580156112ba576000805461ff001916905550565b600054610100900460ff1680611ae95750611ae9610d53565b80611af7575060005460ff16155b611b325760405162461bcd60e51b815260040180806020018281038252602e8152602001806121f2602e913960400191505060405180910390fd5b600054610100900460ff16158015611b5d576000805460ff1961ff0019909116610100171660011790555b6000611b67610e3f565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156112ba576000805461ff001916905550565b6000805b8215610d4d57600019830190921691600101611bcd565b604080516060810182526000808252602082018190529181019190915290565b600082601f830112611c14578081fd5b8135611c27611c2282612164565b612140565b818152846020838601011115611c3b578283fd5b816020850160208301379081016020019190915292915050565b8051600281900b8114610cf857600080fd5b600060a08284031215611c78578081fd5b60405160a0810181811067ffffffffffffffff82111715611c9557fe5b6040529050808235611ca6816121b6565b81526020830135611cb6816121b6565b602082015260408381013590820152606083013562ffffff81168114611cdb57600080fd5b6060820152611cec60808401611cf8565b60808201525092915050565b8035610cf8816121b6565b805161ffff81168114610cf857600080fd5b600060208284031215611d26578081fd5b8135611d31816121b6565b9392505050565b60008060408385031215611d4a578081fd5b8235611d55816121b6565b91506020830135611d65816121b6565b809150509250929050565b60008060408385031215611d82578182fd5b823567ffffffffffffffff811115611d98578283fd5b611da485828601611c04565b95602094909401359450505050565b60008060408385031215611dc5578182fd5b505080516020909101519092909150565b600080600060608486031215611dea578081fd5b8335925060208401359150604084013567ffffffffffffffff811115611e0e578182fd5b611e1a86828701611c04565b9150509250925092565b600060208284031215611e35578081fd5b815167ffffffffffffffff811115611e4b578182fd5b8201601f81018413611e5b578182fd5b8051611e69611c2282612164565b818152856020838501011115611e7d578384fd5b610f54826020830160208601612186565b600060a08284031215611e9f578081fd5b611d318383611c67565b600080600080600080600060e0888a031215611ec3578485fd5b8751611ece816121b6565b9650611edc60208901611c55565b9550611eea60408901611d03565b9450611ef860608901611d03565b9350611f0660808901611d03565b925060a088015160ff81168114611f1b578283fd5b60c08901519092508015158114611f30578182fd5b8091505092959891949750929550565b600080600060608486031215611f54578081fd5b835192506020840151611f66816121b6565b9150611f7460408501611c55565b90509250925092565b60008151808452611f95816020860160208601612186565b601f01601f19169290920160200192915050565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528515156020830152604082018590528316606082015260a06080820181905260009061203390830184611f7d565b979650505050505050565b600060208252611d316020830184611f7d565b60208082526010908201526f2ab732bc3832b1ba32b21032b93937b960811b604082015260600190565b600060808201868352602060808185015281875180845260a0860191508289019350845b818110156120c45784516001600160a01b03168352938301939183019160010161209f565b505084810360408601528651808252908201925081870190845b8181101561210057825163ffffffff16855293830193918301916001016120de565b5050505060609290920192909252949350505050565b9384526001600160a01b0392909216602084015263ffffffff166040830152606082015260800190565b60405181810167ffffffffffffffff8111828210171561215c57fe5b604052919050565b600067ffffffffffffffff82111561217857fe5b50601f01601f191660200190565b60005b838110156121a1578181015183820152602001612189565b838111156121b0576000848401525b50505050565b6001600160a01b03811681146112ba57600080fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a164736f6c6343000706000a