Address Details
contract

0x17a68574119ec182B4d290fEC1e1435eCF1B573e

Contract Name
PairUniswapV3
Creator
0x46cb08–b400d1 at 0x2ffbc6–601c42
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
14676146
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
PairUniswapV3




Optimization enabled
true
Compiler version
v0.6.8+commit.0bbfe453




Optimization runs
10000
EVM Version
istanbul




Verified at
2022-12-16T12:19:50.878656Z

project:/contracts/swappa/PairUniswapV3.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../interfaces/uniswap/IUniswapV3Pool.sol";
import "../interfaces/uniswap/IUniswapV3SwapCallback.sol";
import "../interfaces/uniswap/Quoter.sol";
import "../interfaces/uniswap/SafeCast.sol";
import "../interfaces/uniswap/TickLens.sol";
import "../interfaces/uniswap/TickMath.sol";
import "./ISwappaPairV1.sol";

contract PairUniswapV3 is ISwappaPairV1, IUniswapV3SwapCallback {
    using SafeMath for uint256;
    using SafeCast for uint256;

    function swap(
        address input,
        address output,
        address to,
        bytes calldata data
    ) external override {
        address pairAddr = parseData(data);
        uint256 inputAmount = ERC20(input).balanceOf(address(this));
        IUniswapV3Pool pair = IUniswapV3Pool(pairAddr);
        bool zeroForOne = pair.token0() == input;
        // calling swap will trigger the uniswapV3SwapCallback
        pair.swap(
            to,
            zeroForOne,
            inputAmount.toInt256(),
            zeroForOne
                ? TickMath.MIN_SQRT_RATIO + 1
                : TickMath.MAX_SQRT_RATIO - 1,
            new bytes(0)
        );
    }

    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external override {
        ERC20 token;
        uint256 amount;
        if (amount0Delta > 0) {
            amount = uint256(amount0Delta);
            token = ERC20(IUniswapV3Pool(msg.sender).token0());
        } else if (amount1Delta > 0) {
            amount = uint256(amount1Delta);
            token = ERC20(IUniswapV3Pool(msg.sender).token1());
        }
        require(
            token.transfer(msg.sender, amount),
            "PairUniswapV3: transfer failed!"
        );
    }

    function parseData(bytes memory data)
        private
        pure
        returns (address pairAddr)
    {
        require(data.length == 20, "PairUniswapV3: invalid data!");
        assembly {
            pairAddr := mload(add(data, 20))
        }
    }

    function getOutputAmount(
        address input,
        address output,
        uint256 amountIn,
        bytes calldata data
    ) external view override returns (uint256 amountOut) {
        address pairAddr = parseData(data);
        IUniswapV3Pool pair = IUniswapV3Pool(pairAddr);
        bool zeroForOne = pair.token0() == input;
        // amount0, amount1 are delta of the pair reserves
        (int256 amount0, int256 amount1) = Quoter.quote(
            pair,
            zeroForOne,
            amountIn.toInt256(),
            zeroForOne
                ? TickMath.MIN_SQRT_RATIO + 1
                : TickMath.MAX_SQRT_RATIO - 1
        );
        return uint256(-(zeroForOne ? amount1 : amount0));
    }

    function getInputAmount(
        address input,
        address output,
        uint256 amountOut,
        bytes calldata data
    ) external view returns (uint256 amountIn) {
        address pairAddr = parseData(data);
        IUniswapV3Pool pair = IUniswapV3Pool(pairAddr);
        bool zeroForOne = pair.token0() == input;
        // amount0, amount1 are delta of the pair reserves
        (int256 amount0, int256 amount1) = Quoter.quote(
            pair,
            zeroForOne,
            -amountOut.toInt256(),
            zeroForOne
                ? TickMath.MIN_SQRT_RATIO + 1
                : TickMath.MAX_SQRT_RATIO - 1
        );
        return uint256(zeroForOne ? amount0 : amount1);
    }

    function getSpotTicks(IUniswapV3Pool pool)
        public
        view
        returns (
            uint160 sqrtPriceX96,
            uint128 liquidity,
            int24 tick,
            int16 tickBitmapIndex,
            TickLens.PopulatedTick[] memory populatedTicks
        )
    {
        // use invalid tick bitmap index
        return getSpotTicksIfChanged(pool, TickMath.MIN_TICK);
    }

    function getSpotTicksIfChanged(
        IUniswapV3Pool pool,
        int256 previousTickBitmapIndex
    )
        public
        view
        returns (
            uint160 sqrtPriceX96,
            uint128 liquidity,
            int24 tick,
            int16 tickBitmapIndex,
            TickLens.PopulatedTick[] memory populatedTicks
        )
    {
        (sqrtPriceX96, liquidity, tick, tickBitmapIndex) = TickLens.getSpotInfo(
            pool
        );

        if (int256(tickBitmapIndex) == previousTickBitmapIndex) {
            // the active tick bitmap index did not change, fetching only the current word is enough
            populatedTicks = TickLens.getPopulatedTicksInWord(
                pool,
                tickBitmapIndex
            );
        } else {
            // set the populated ticks from the bitmap word below to the bitmap word above
            populatedTicks = TickLens.getPopulatedTicksInWords(
                pool,
                tickBitmapIndex - 1,
                tickBitmapIndex + 1
            );
        }
    }

    function getPopulatedTicksInWords(
        IUniswapV3Pool pool,
        int16 fromTickBitmapIndex,
        int16 toTickBitmapIndex
    ) public view returns (TickLens.PopulatedTick[] memory populatedTicks) {
        return
            TickLens.getPopulatedTicksInWords(
                pool,
                fromTickBitmapIndex,
                toTickBitmapIndex
            );
    }

    function recoverERC20(ERC20 token) public {
        token.transfer(msg.sender, token.balanceOf(address(this)));
    }
}
        

/_openzeppelin/contracts/GSN/Context.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/*
 * @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 Context {
    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/2691
        return msg.data;
    }
}
          

/_openzeppelin/contracts/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}
          

/_openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
          

/_openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}
          

/_openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @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 in 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-assembly
        assembly { 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
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
          

/project_/contracts/interfaces/uniswap/BitMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title BitMath
/// @dev This library provides functionality for computing bit properties of an unsigned integer
library 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 bit
    function 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;
            r += 2;
        }
        if (x >= 0x2) r += 1;
    }

    /// @notice Returns the index of the least 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**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0)
    /// @param x the value for which to compute the least significant bit, must be greater than 0
    /// @return r the index of the least significant bit
    function leastSignificantBit(uint256 x) internal pure returns (uint8 r) {
        require(x > 0);

        r = 255;
        if (x & type(uint128).max > 0) {
            r -= 128;
        } else {
            x >>= 128;
        }
        if (x & type(uint64).max > 0) {
            r -= 64;
        } else {
            x >>= 64;
        }
        if (x & type(uint32).max > 0) {
            r -= 32;
        } else {
            x >>= 32;
        }
        if (x & type(uint16).max > 0) {
            r -= 16;
        } else {
            x >>= 16;
        }
        if (x & type(uint8).max > 0) {
            r -= 8;
        } else {
            x >>= 8;
        }
        if (x & 0xf > 0) {
            r -= 4;
        } else {
            x >>= 4;
        }
        if (x & 0x3 > 0) {
            r -= 2;
        } else {
            x >>= 2;
        }
        if (x & 0x1 > 0) r -= 1;
    }
}
          

/project_/contracts/interfaces/uniswap/FixedPoint96.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.4.0;

/// @title FixedPoint96
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
/// @dev Used in SqrtPriceMath.sol
library FixedPoint96 {
    uint8 internal constant RESOLUTION = 96;
    uint256 internal constant Q96 = 0x1000000000000000000000000;
}
          

/project_/contracts/interfaces/uniswap/FullMath.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.8.0;

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // 512-bit multiply [prod1 prod0] = a * b
        // Compute the product mod 2**256 and mod 2**256 - 1
        // then use the Chinese Remainder Theorem to reconstruct
        // the 512 bit result. The result is stored in two 256
        // variables such that product = prod1 * 2**256 + prod0
        uint256 prod0; // Least significant 256 bits of the product
        uint256 prod1; // Most significant 256 bits of the product
        assembly {
            let mm := mulmod(a, b, not(0))
            prod0 := mul(a, b)
            prod1 := sub(sub(mm, prod0), lt(mm, prod0))
        }

        // Handle non-overflow cases, 256 by 256 division
        if (prod1 == 0) {
            require(denominator > 0);
            assembly {
                result := div(prod0, denominator)
            }
            return result;
        }

        // Make sure the result is less than 2**256.
        // Also prevents denominator == 0
        require(denominator > prod1);

        ///////////////////////////////////////////////
        // 512 by 256 division.
        ///////////////////////////////////////////////

        // Make division exact by subtracting the remainder from [prod1 prod0]
        // Compute remainder using mulmod
        uint256 remainder;
        assembly {
            remainder := mulmod(a, b, denominator)
        }
        // Subtract 256 bit number from 512 bit number
        assembly {
            prod1 := sub(prod1, gt(remainder, prod0))
            prod0 := sub(prod0, remainder)
        }

        // Factor powers of two out of denominator
        // Compute largest power of two divisor of denominator.
        // Always >= 1.
        uint256 twos = -denominator & denominator;
        // Divide denominator by power of two
        assembly {
            denominator := div(denominator, twos)
        }

        // Divide [prod1 prod0] by the factors of two
        assembly {
            prod0 := div(prod0, twos)
        }
        // Shift in bits from prod1 into prod0. For this we need
        // to flip `twos` such that it is 2**256 / twos.
        // If twos is zero, then it becomes one
        assembly {
            twos := add(div(sub(0, twos), twos), 1)
        }
        prod0 |= prod1 * twos;

        // Invert denominator mod 2**256
        // Now that denominator is an odd number, it has an inverse
        // modulo 2**256 such that denominator * inv = 1 mod 2**256.
        // Compute the inverse by starting with a seed that is correct
        // correct for four bits. That is, denominator * inv = 1 mod 2**4
        uint256 inv = (3 * denominator) ^ 2;
        // Now use Newton-Raphson iteration to improve the precision.
        // Thanks to Hensel's lifting lemma, this also works in modular
        // arithmetic, doubling the correct bits in each step.
        inv *= 2 - denominator * inv; // inverse mod 2**8
        inv *= 2 - denominator * inv; // inverse mod 2**16
        inv *= 2 - denominator * inv; // inverse mod 2**32
        inv *= 2 - denominator * inv; // inverse mod 2**64
        inv *= 2 - denominator * inv; // inverse mod 2**128
        inv *= 2 - denominator * inv; // inverse mod 2**256

        // Because the division is now exact we can divide by multiplying
        // with the modular inverse of denominator. This will give us the
        // correct result modulo 2**256. Since the precoditions guarantee
        // that the outcome is less than 2**256, this is the final result.
        // We don't need to compute the high bits of the result and prod1
        // is no longer required.
        result = prod0 * inv;
        return result;
    }

    /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    function mulDivRoundingUp(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        result = mulDiv(a, b, denominator);
        if (mulmod(a, b, denominator) > 0) {
            require(result < type(uint256).max);
            result++;
        }
    }
}
          

/project_/contracts/interfaces/uniswap/IUniswapV3Pool.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import './IUniswapV3PoolImmutables.sol';
import './IUniswapV3PoolState.sol';
import './IUniswapV3PoolActions.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 pieces
interface IUniswapV3Pool is
    IUniswapV3PoolImmutables,
    IUniswapV3PoolState,
    IUniswapV3PoolActions
{
}
          

/project_/contracts/interfaces/uniswap/IUniswapV3PoolActions.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface 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.96
    function 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 callback
    function 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
    /// @return amount1 The amount of fees collected in token1
    function collect(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);

    /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
    /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
    /// @dev Fees must be collected separately via a call to #collect
    /// @param tickLower The lower tick of the position for which to burn liquidity
    /// @param tickUpper The upper tick of the position for which to burn liquidity
    /// @param amount How much liquidity to burn
    /// @return amount0 The amount of token0 sent to the recipient
    /// @return amount1 The amount of token1 sent to the recipient
    function burn(
        int24 tickLower,
        int24 tickUpper,
        uint128 amount
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);

    /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
    /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(
        address recipient,
        uint256 amount0,
        uint256 amount1,
        bytes calldata data
    ) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}
          

/project_/contracts/interfaces/uniswap/IUniswapV3PoolImmutables.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma 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 values
interface IUniswapV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function 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 spacing
    function 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 tick
    function maxLiquidityPerTick() external view returns (uint128);
}
          

/project_/contracts/interfaces/uniswap/IUniswapV3PoolState.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma 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 transaction
interface 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 reentrancy
    function slot0()
        external
        view
        returns (
            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 uint256
    function 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 uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

    /// @notice The amounts of token0 and token1 that are owed to the protocol
    /// @dev Protocol fees will never exceed uint128 max in either token
    function protocolFees() external view returns (uint128 token0, uint128 token1);

    /// @notice The currently in range liquidity available to the pool
    /// @dev This value has no relationship to the total liquidity across all ticks
    function liquidity() external view returns (uint128);

    /// @notice Look up information about a specific tick in the pool
    /// @param tick The tick to look up
    /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
    /// tick upper,
    /// liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
    /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
    /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
    /// a specific position.
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside0X128,
            uint256 feeGrowthOutside1X128,
            int56 tickCumulativeOutside,
            uint160 secondsPerLiquidityOutsideX128,
            uint32 secondsOutside,
            bool initialized
        );

    /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
    function tickBitmap(int16 wordPosition) external view returns (uint256);

    /// @notice Returns the information about a position by the position's key
    /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
    /// @return _liquidity The amount of liquidity in the position,
    /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
    function positions(bytes32 key)
        external
        view
        returns (
            uint128 _liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    /// @notice Returns data about a specific observation index
    /// @param index The element of the observations array to fetch
    /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
    /// ago, rather than at a specific index in the array.
    /// @return blockTimestamp The timestamp of the observation,
    /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// Returns initialized whether the observation has been initialized and the values are safe to use
    function observations(uint256 index)
        external
        view
        returns (
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint160 secondsPerLiquidityCumulativeX128,
            bool initialized
        );
}
          

/project_/contracts/interfaces/uniswap/IUniswapV3SwapCallback.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface 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 call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}
          

/project_/contracts/interfaces/uniswap/LiquidityMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Math library for liquidity
library LiquidityMath {
    /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows
    /// @param x The liquidity before change
    /// @param y The delta by which liquidity should be changed
    /// @return z The liquidity delta
    function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) {
        if (y < 0) {
            require((z = x - uint128(-y)) < x, 'LS');
        } else {
            require((z = x + uint128(y)) >= x, 'LA');
        }
    }
}
          

/project_/contracts/interfaces/uniswap/LowGasSafeMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;

/// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
library LowGasSafeMath {
    /// @notice Returns x + y, reverts if sum overflows uint256
    /// @param x The augend
    /// @param y The addend
    /// @return z The sum of x and y
    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x + y) >= x);
    }

    /// @notice Returns x - y, reverts if underflows
    /// @param x The minuend
    /// @param y The subtrahend
    /// @return z The difference of x and y
    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x - y) <= x);
    }

    /// @notice Returns x * y, reverts if overflows
    /// @param x The multiplicand
    /// @param y The multiplier
    /// @return z The product of x and y
    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require(x == 0 || (z = x * y) / x == y);
    }

    /// @notice Returns x + y, reverts if overflows or underflows
    /// @param x The augend
    /// @param y The addend
    /// @return z The sum of x and y
    function add(int256 x, int256 y) internal pure returns (int256 z) {
        require((z = x + y) >= x == (y >= 0));
    }

    /// @notice Returns x - y, reverts if overflows or underflows
    /// @param x The minuend
    /// @param y The subtrahend
    /// @return z The difference of x and y
    function sub(int256 x, int256 y) internal pure returns (int256 z) {
        require((z = x - y) <= x == (y >= 0));
    }
}
          

/project_/contracts/interfaces/uniswap/Quoter.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.8.0;

import "./IUniswapV3Pool.sol";
import "./LiquidityMath.sol";
import "./LowGasSafeMath.sol";
import "./SafeCast.sol";
import "./SwapMath.sol";
import "./TickBitmap.sol";
import "./TickMath.sol";

library Quoter {
    using LowGasSafeMath for uint256;
    using LowGasSafeMath for int256;
    using SafeCast for uint256;
    using SafeCast for int256;

    // the top level state of the swap, the results of which are recorded in storage at the end
    struct SwapState {
        // the amount remaining to be swapped in/out of the input/output asset
        int256 amountSpecifiedRemaining;
        // the amount already swapped out/in of the output/input asset
        int256 amountCalculated;
        // current sqrt(price)
        uint160 sqrtPriceX96;
        // the tick associated with the current price
        int24 tick;
        // the current liquidity in range
        uint128 liquidity;
    }

    struct StepComputations {
        // the price at the beginning of the step
        uint160 sqrtPriceStartX96;
        // the next tick to swap to from the current tick in the swap direction
        int24 tickNext;
        // whether tickNext is initialized or not
        bool initialized;
        // sqrt(price) for the next tick (1/0)
        uint160 sqrtPriceNextX96;
        // how much is being swapped in in this step
        uint256 amountIn;
        // how much is being swapped out
        uint256 amountOut;
        // how much fee is being paid in
        uint256 feeAmount;
    }

    struct Slot0 {
        // the current price
        uint160 sqrtPriceX96;
        // the current tick
        int24 tick;
    }

    function quote(
        IUniswapV3Pool pool,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96
    ) internal view returns (int256 amount0, int256 amount1) {
        Slot0 memory slot0Start;
        (
            slot0Start.sqrtPriceX96,
            slot0Start.tick,
            , // uint16 observationIndex
            , // uint16 observationCardinality
            , // uint16 observationCardinalityNext
            , // slot0Start.feeProtocol
            // bool unlocked

        ) = pool.slot0();

        require(
            zeroForOne
                ? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 &&
                    sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO
                : sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 &&
                    sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO,
            "SPL"
        );

        bool exactInput = amountSpecified > 0;
        int24 poolTickSpacing = pool.tickSpacing();
        uint24 poolFee = pool.fee();

        SwapState memory state = SwapState({
            amountSpecifiedRemaining: amountSpecified,
            amountCalculated: 0,
            sqrtPriceX96: slot0Start.sqrtPriceX96,
            tick: slot0Start.tick,
            liquidity: pool.liquidity()
        });

        // continue swapping as long as we haven't used the entire input/output and haven't reached the price limit
        while (
            state.amountSpecifiedRemaining != 0 &&
            state.sqrtPriceX96 != sqrtPriceLimitX96
        ) {
            StepComputations memory step;

            step.sqrtPriceStartX96 = state.sqrtPriceX96;

            (step.tickNext, step.initialized) = TickBitmap
                .nextInitializedTickWithinOneWord(
                    pool,
                    state.tick,
                    poolTickSpacing,
                    zeroForOne
                );

            // ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds
            if (step.tickNext < TickMath.MIN_TICK) {
                step.tickNext = TickMath.MIN_TICK;
            } else if (step.tickNext > TickMath.MAX_TICK) {
                step.tickNext = TickMath.MAX_TICK;
            }

            // get the price for the next tick
            step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext);

            // compute values to swap to the target tick, price limit, or point where input/output amount is exhausted
            (
                state.sqrtPriceX96,
                step.amountIn,
                step.amountOut,
                step.feeAmount
            ) = SwapMath.computeSwapStep(
                state.sqrtPriceX96,
                (
                    zeroForOne
                        ? step.sqrtPriceNextX96 < sqrtPriceLimitX96
                        : step.sqrtPriceNextX96 > sqrtPriceLimitX96
                )
                    ? sqrtPriceLimitX96
                    : step.sqrtPriceNextX96,
                state.liquidity,
                state.amountSpecifiedRemaining,
                poolFee
            );

            if (exactInput) {
                state.amountSpecifiedRemaining -= (step.amountIn +
                    step.feeAmount).toInt256();
                state.amountCalculated = state.amountCalculated.sub(
                    step.amountOut.toInt256()
                );
            } else {
                state.amountSpecifiedRemaining += step.amountOut.toInt256();
                state.amountCalculated = state.amountCalculated.add(
                    (step.amountIn + step.feeAmount).toInt256()
                );
            }

            // shift tick if we reached the next price
            if (state.sqrtPriceX96 == step.sqrtPriceNextX96) {
                // if the tick is initialized, run the tick transition
                if (step.initialized) {
                    (
                        ,
                        // uint128 liquidityGross,
                        int128 liquidityNet,
                        , // uint256 feeGrowthOutside0X128
                        , // uint256 feeGrowthOutside1X128
                        , // int56 tickCumulativeOutside
                        , // uint160 secondsPerLiquidityOutsideX128
                        , // uint32 secondsOutside
                        // bool initialized
                    ) =
                        pool.ticks(step.tickNext);

                    // if we're moving leftward, we interpret liquidityNet as the opposite sign
                    // safe because liquidityNet cannot be type(int128).min
                    if (zeroForOne) liquidityNet = -liquidityNet;

                    state.liquidity = LiquidityMath.addDelta(
                        state.liquidity,
                        liquidityNet
                    );
                }

                state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext;
            } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {
                // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved
                state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96);
            }
        }

        (amount0, amount1) = zeroForOne == exactInput
            ? (
                amountSpecified - state.amountSpecifiedRemaining,
                state.amountCalculated
            )
            : (
                state.amountCalculated,
                amountSpecified - state.amountSpecifiedRemaining
            );
    }
}
          

/project_/contracts/interfaces/uniswap/SafeCast.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library 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 uint160
    function 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 int128
    function 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 int256
    function toInt256(uint256 y) internal pure returns (int256 z) {
        require(y < 2**255);
        z = int256(y);
    }
}
          

/project_/contracts/interfaces/uniswap/SqrtPriceMath.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.5.0;

import './LowGasSafeMath.sol';
import './SafeCast.sol';

import './FullMath.sol';
import './UnsafeMath.sol';
import './FixedPoint96.sol';

/// @title Functions based on Q64.96 sqrt price and liquidity
/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas
library SqrtPriceMath {
    using LowGasSafeMath for uint256;
    using SafeCast for uint256;

    /// @notice Gets the next sqrt price given a delta of token0
    /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least
    /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the
    /// price less in order to not send too much output.
    /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96),
    /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount).
    /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta
    /// @param liquidity The amount of usable liquidity
    /// @param amount How much of token0 to add or remove from virtual reserves
    /// @param add Whether to add or remove the amount of token0
    /// @return The price after adding or removing amount, depending on add
    function getNextSqrtPriceFromAmount0RoundingUp(
        uint160 sqrtPX96,
        uint128 liquidity,
        uint256 amount,
        bool add
    ) internal pure returns (uint160) {
        // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price
        if (amount == 0) return sqrtPX96;
        uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;

        if (add) {
            uint256 product;
            if ((product = amount * sqrtPX96) / amount == sqrtPX96) {
                uint256 denominator = numerator1 + product;
                if (denominator >= numerator1)
                    // always fits in 160 bits
                    return uint160(FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator));
            }

            return uint160(UnsafeMath.divRoundingUp(numerator1, (numerator1 / sqrtPX96).add(amount)));
        } else {
            uint256 product;
            // if the product overflows, we know the denominator underflows
            // in addition, we must check that the denominator does not underflow
            require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product);
            uint256 denominator = numerator1 - product;
            return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator).toUint160();
        }
    }

    /// @notice Gets the next sqrt price given a delta of token1
    /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least
    /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the
    /// price less in order to not send too much output.
    /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity
    /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta
    /// @param liquidity The amount of usable liquidity
    /// @param amount How much of token1 to add, or remove, from virtual reserves
    /// @param add Whether to add, or remove, the amount of token1
    /// @return The price after adding or removing `amount`
    function getNextSqrtPriceFromAmount1RoundingDown(
        uint160 sqrtPX96,
        uint128 liquidity,
        uint256 amount,
        bool add
    ) internal pure returns (uint160) {
        // if we're adding (subtracting), rounding down requires rounding the quotient down (up)
        // in both cases, avoid a mulDiv for most inputs
        if (add) {
            uint256 quotient =
                (
                    amount <= type(uint160).max
                        ? (amount << FixedPoint96.RESOLUTION) / liquidity
                        : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity)
                );

            return uint256(sqrtPX96).add(quotient).toUint160();
        } else {
            uint256 quotient =
                (
                    amount <= type(uint160).max
                        ? UnsafeMath.divRoundingUp(amount << FixedPoint96.RESOLUTION, liquidity)
                        : FullMath.mulDivRoundingUp(amount, FixedPoint96.Q96, liquidity)
                );

            require(sqrtPX96 > quotient);
            // always fits 160 bits
            return uint160(sqrtPX96 - quotient);
        }
    }

    /// @notice Gets the next sqrt price given an input amount of token0 or token1
    /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds
    /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount
    /// @param liquidity The amount of usable liquidity
    /// @param amountIn How much of token0, or token1, is being swapped in
    /// @param zeroForOne Whether the amount in is token0 or token1
    /// @return sqrtQX96 The price after adding the input amount to token0 or token1
    function getNextSqrtPriceFromInput(
        uint160 sqrtPX96,
        uint128 liquidity,
        uint256 amountIn,
        bool zeroForOne
    ) internal pure returns (uint160 sqrtQX96) {
        require(sqrtPX96 > 0);
        require(liquidity > 0);

        // round to make sure that we don't pass the target price
        return
            zeroForOne
                ? getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)
                : getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true);
    }

    /// @notice Gets the next sqrt price given an output amount of token0 or token1
    /// @dev Throws if price or liquidity are 0 or the next price is out of bounds
    /// @param sqrtPX96 The starting price before accounting for the output amount
    /// @param liquidity The amount of usable liquidity
    /// @param amountOut How much of token0, or token1, is being swapped out
    /// @param zeroForOne Whether the amount out is token0 or token1
    /// @return sqrtQX96 The price after removing the output amount of token0 or token1
    function getNextSqrtPriceFromOutput(
        uint160 sqrtPX96,
        uint128 liquidity,
        uint256 amountOut,
        bool zeroForOne
    ) internal pure returns (uint160 sqrtQX96) {
        require(sqrtPX96 > 0);
        require(liquidity > 0);

        // round to make sure that we pass the target price
        return
            zeroForOne
                ? getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)
                : getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false);
    }

    /// @notice Gets the amount0 delta between two prices
    /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper),
    /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower))
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param liquidity The amount of usable liquidity
    /// @param roundUp Whether to round the amount up or down
    /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices
    function getAmount0Delta(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity,
        bool roundUp
    ) internal pure returns (uint256 amount0) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;
        uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96;

        require(sqrtRatioAX96 > 0);

        return
            roundUp
                ? UnsafeMath.divRoundingUp(
                    FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96),
                    sqrtRatioAX96
                )
                : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96;
    }

    /// @notice Gets the amount1 delta between two prices
    /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower))
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param liquidity The amount of usable liquidity
    /// @param roundUp Whether to round the amount up, or down
    /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices
    function getAmount1Delta(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity,
        bool roundUp
    ) internal pure returns (uint256 amount1) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        return
            roundUp
                ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96)
                : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96);
    }

    /// @notice Helper that gets signed token0 delta
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param liquidity The change in liquidity for which to compute the amount0 delta
    /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices
    function getAmount0Delta(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        int128 liquidity
    ) internal pure returns (int256 amount0) {
        return
            liquidity < 0
                ? -getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256()
                : getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256();
    }

    /// @notice Helper that gets signed token1 delta
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param liquidity The change in liquidity for which to compute the amount1 delta
    /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices
    function getAmount1Delta(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        int128 liquidity
    ) internal pure returns (int256 amount1) {
        return
            liquidity < 0
                ? -getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256()
                : getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256();
    }
}
          

/project_/contracts/interfaces/uniswap/SwapMath.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.5.0;

import './FullMath.sol';
import './SqrtPriceMath.sol';

/// @title Computes the result of a swap within ticks
/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick.
library SwapMath {
    /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap
    /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive
    /// @param sqrtRatioCurrentX96 The current sqrt price of the pool
    /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred
    /// @param liquidity The usable liquidity
    /// @param amountRemaining How much input or output amount is remaining to be swapped in/out
    /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip
    /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target
    /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap
    /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap
    /// @return feeAmount The amount of input that will be taken as a fee
    function computeSwapStep(
        uint160 sqrtRatioCurrentX96,
        uint160 sqrtRatioTargetX96,
        uint128 liquidity,
        int256 amountRemaining,
        uint24 feePips
    )
        internal
        pure
        returns (
            uint160 sqrtRatioNextX96,
            uint256 amountIn,
            uint256 amountOut,
            uint256 feeAmount
        )
    {
        bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96;
        bool exactIn = amountRemaining >= 0;

        if (exactIn) {
            uint256 amountRemainingLessFee = FullMath.mulDiv(uint256(amountRemaining), 1e6 - feePips, 1e6);
            amountIn = zeroForOne
                ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true)
                : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true);
            if (amountRemainingLessFee >= amountIn) sqrtRatioNextX96 = sqrtRatioTargetX96;
            else
                sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput(
                    sqrtRatioCurrentX96,
                    liquidity,
                    amountRemainingLessFee,
                    zeroForOne
                );
        } else {
            amountOut = zeroForOne
                ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false)
                : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false);
            if (uint256(-amountRemaining) >= amountOut) sqrtRatioNextX96 = sqrtRatioTargetX96;
            else
                sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput(
                    sqrtRatioCurrentX96,
                    liquidity,
                    uint256(-amountRemaining),
                    zeroForOne
                );
        }

        bool max = sqrtRatioTargetX96 == sqrtRatioNextX96;

        // get the input/output amounts
        if (zeroForOne) {
            amountIn = max && exactIn
                ? amountIn
                : SqrtPriceMath.getAmount0Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true);
            amountOut = max && !exactIn
                ? amountOut
                : SqrtPriceMath.getAmount1Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false);
        } else {
            amountIn = max && exactIn
                ? amountIn
                : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, true);
            amountOut = max && !exactIn
                ? amountOut
                : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, false);
        }

        // cap the output amount to not exceed the remaining output amount
        if (!exactIn && amountOut > uint256(-amountRemaining)) {
            amountOut = uint256(-amountRemaining);
        }

        if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) {
            // we didn't reach the target, so take the remainder of the maximum input as fee
            feeAmount = uint256(amountRemaining) - amountIn;
        } else {
            feeAmount = FullMath.mulDivRoundingUp(amountIn, feePips, 1e6 - feePips);
        }
    }
}
          

/project_/contracts/interfaces/uniswap/TickBitmap.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.5.0;

import './BitMath.sol';
import './IUniswapV3PoolState.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 stored
    function 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 ticks
    function 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 pool 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
    function nextInitializedTickWithinOneWord(
        IUniswapV3PoolState pool,
        int24 tick,
        int24 tickSpacing,
        bool lte
    ) internal view returns (int24 next, bool initialized) {
        int24 compressed = tick / tickSpacing;
        if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity

        if (lte) {
            (int16 wordPos, uint8 bitPos) = position(compressed);
            // all the 1s at or to the right of the current bitPos
            uint256 mask = (1 << bitPos) - 1 + (1 << bitPos);
            uint256 masked = pool.tickBitmap(wordPos) & mask;

            // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word
            initialized = masked != 0;
            // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick
            next = initialized
                ? (compressed - int24(bitPos - BitMath.mostSignificantBit(masked))) * tickSpacing
                : (compressed - int24(bitPos)) * tickSpacing;
        } else {
            // start from the word of the next tick, since the current tick state doesn't matter
            (int16 wordPos, uint8 bitPos) = position(compressed + 1);
            // all the 1s at or to the left of the bitPos
            uint256 mask = ~((1 << bitPos) - 1);
            uint256 masked = pool.tickBitmap(wordPos) & mask;

            // if there are no initialized ticks to the left of the current tick, return leftmost in the word
            initialized = masked != 0;
            // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick
            next = initialized
                ? (compressed + 1 + int24(BitMath.leastSignificantBit(masked) - bitPos)) * tickSpacing
                : (compressed + 1 + int24(type(uint8).max - bitPos)) * tickSpacing;
        }
    }
}
          

/project_/contracts/interfaces/uniswap/TickLens.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.8.0;
pragma experimental ABIEncoderV2;

import "./IUniswapV3Pool.sol";

library TickLens {
    struct PopulatedTick {
        int24 tick;
        int128 liquidityNet;
        uint128 liquidityGross;
    }

    function getSpotInfo(IUniswapV3Pool pool)
        internal
        view
        returns (
            uint160 sqrtPriceX96,
            uint128 liquidity,
            int24 tick,
            int16 tickBitmapIndex
        )
    {
        // get the populated ticks above and below the current spot tick
        (
            sqrtPriceX96,
            tick,
            , // uint16 observationIndex
            , // uint16 observationCardinality
            , // uint16 observationCardinalityNext
            , // uint8 feeProtocol
            // bool unlocked
        ) = pool.slot0();
        liquidity = pool.liquidity();

        int24 tickSpacing = pool.tickSpacing();
        int24 compressed = tick / tickSpacing;
        if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity

        // current word position within bitmap
        tickBitmapIndex = int16(compressed >> 8);
    }

    function getPopulatedTicksInWord(IUniswapV3Pool pool, int16 tickBitmapIndex)
        internal
        view
        returns (PopulatedTick[] memory populatedTicks)
    {
        // fetch bitmap
        uint256 bitmap = pool.tickBitmap(tickBitmapIndex);

        // calculate the number of populated ticks
        uint256 numberOfPopulatedTicks;
        for (uint256 i = 0; i < 256; i++) {
            if (bitmap & (1 << i) > 0) numberOfPopulatedTicks++;
        }

        // fetch populated tick data
        int24 tickSpacing = pool.tickSpacing();
        populatedTicks = new PopulatedTick[](numberOfPopulatedTicks);
        for (uint256 i = 0; i < 256; i++) {
            if (bitmap & (1 << i) > 0) {
                int24 populatedTick = ((int24(tickBitmapIndex) << 8) +
                    int24(i)) * tickSpacing;
                (uint128 liquidityGross, int128 liquidityNet, , , , , , ) = pool
                    .ticks(populatedTick);
                populatedTicks[--numberOfPopulatedTicks] = PopulatedTick({
                    tick: populatedTick,
                    liquidityNet: liquidityNet,
                    liquidityGross: liquidityGross
                });
            }
        }
    }

    function getPopulatedTicksInWords(
        IUniswapV3Pool pool,
        int16 fromTickBitmapIndex,
        int16 toTickBitmapIndex
    ) internal view returns (PopulatedTick[] memory populatedTicks) {
        // calculate the number of populated ticks
        uint256 numberOfPopulatedTicks;

        // fetch bitmaps
        for (int16 b = fromTickBitmapIndex; b <= toTickBitmapIndex; b++) {
            uint256 bitmap = pool.tickBitmap(b);
            for (uint256 i = 0; i < 256; i++) {
                if (bitmap & (1 << i) > 0) numberOfPopulatedTicks++;
            }
        }

        int24 tickSpacing = pool.tickSpacing();
        populatedTicks = new PopulatedTick[](numberOfPopulatedTicks);

        // fetch populated tick data for each of the tick bitmap
        for (int16 b = fromTickBitmapIndex; b <= toTickBitmapIndex; b++) {
            uint256 bitmap = pool.tickBitmap(b);
            for (uint256 i = 0; i < 256; i++) {
                if (bitmap & (1 << i) > 0) {
                    int24 populatedTick = ((int24(b) << 8) + int24(i)) *
                        tickSpacing;
                    (
                        uint128 liquidityGross,
                        int128 liquidityNet,
                        ,
                        ,
                        ,
                        ,
                        ,

                    ) = pool.ticks(populatedTick);
                    populatedTicks[--numberOfPopulatedTicks] = PopulatedTick({
                        tick: populatedTick,
                        liquidityNet: liquidityNet,
                        liquidityGross: liquidityGross
                    });
                }
            }
        }
    }
}
          

/project_/contracts/interfaces/uniswap/TickMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma 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**128
library TickMath {
    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 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 tick
    function 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;
        if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
        if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
        if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
        if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
        if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

        if (tick > 0) ratio = type(uint256).max / ratio;

        // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
        // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
        // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
        sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
    }

    /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
    function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
        // second inequality must be < because the price can never reach the price at the max tick
        require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
        uint256 ratio = uint256(sqrtPriceX96) << 32;

        uint256 r = ratio;
        uint256 msb = 0;

        assembly {
            let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(5, gt(r, 0xFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(4, gt(r, 0xFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(3, gt(r, 0xFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(2, gt(r, 0xF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(1, gt(r, 0x3))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := gt(r, 0x1)
            msb := or(msb, f)
        }

        if (msb >= 128) r = ratio >> (msb - 127);
        else r = ratio << (127 - msb);

        int256 log_2 = (int256(msb) - 128) << 64;

        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(63, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(62, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(61, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(60, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(59, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(58, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(57, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(56, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(55, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(54, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(53, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(52, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(51, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(50, f))
        }

        int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number

        int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
        int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);

        tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
    }
}
          

/project_/contracts/interfaces/uniswap/UnsafeMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Math functions that do not check inputs or outputs
/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks
library UnsafeMath {
    /// @notice Returns ceil(x / y)
    /// @dev division by 0 has unspecified behavior, and must be checked externally
    /// @param x The dividend
    /// @param y The divisor
    /// @return z The quotient, ceil(x / y)
    function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
        assembly {
            z := add(div(x, y), gt(mod(x, y), 0))
        }
    }
}
          

/project_/contracts/swappa/ISwappaPairV1.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;

interface ISwappaPairV1 {
	function swap(
		address input,
		address output,
		address to,
		bytes calldata data
	) external;

	// Get the output amount in output token for a given amountIn of the input token, with the encoded extra data.
	// Output amount is undefined if input token is invalid for the swap pair.
	function getOutputAmount(
		address input,
		address output,
		uint amountIn,
		bytes calldata data
	) external view returns (uint amountOut);
}
          

Contract ABI

[{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"getInputAmount","inputs":[{"type":"address","name":"input","internalType":"address"},{"type":"address","name":"output","internalType":"address"},{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"getOutputAmount","inputs":[{"type":"address","name":"input","internalType":"address"},{"type":"address","name":"output","internalType":"address"},{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"populatedTicks","internalType":"struct TickLens.PopulatedTick[]","components":[{"type":"int24","name":"tick","internalType":"int24"},{"type":"int128","name":"liquidityNet","internalType":"int128"},{"type":"uint128","name":"liquidityGross","internalType":"uint128"}]}],"name":"getPopulatedTicksInWords","inputs":[{"type":"address","name":"pool","internalType":"contract IUniswapV3Pool"},{"type":"int16","name":"fromTickBitmapIndex","internalType":"int16"},{"type":"int16","name":"toTickBitmapIndex","internalType":"int16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint160","name":"sqrtPriceX96","internalType":"uint160"},{"type":"uint128","name":"liquidity","internalType":"uint128"},{"type":"int24","name":"tick","internalType":"int24"},{"type":"int16","name":"tickBitmapIndex","internalType":"int16"},{"type":"tuple[]","name":"populatedTicks","internalType":"struct TickLens.PopulatedTick[]","components":[{"type":"int24","name":"tick","internalType":"int24"},{"type":"int128","name":"liquidityNet","internalType":"int128"},{"type":"uint128","name":"liquidityGross","internalType":"uint128"}]}],"name":"getSpotTicks","inputs":[{"type":"address","name":"pool","internalType":"contract IUniswapV3Pool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint160","name":"sqrtPriceX96","internalType":"uint160"},{"type":"uint128","name":"liquidity","internalType":"uint128"},{"type":"int24","name":"tick","internalType":"int24"},{"type":"int16","name":"tickBitmapIndex","internalType":"int16"},{"type":"tuple[]","name":"populatedTicks","internalType":"struct TickLens.PopulatedTick[]","components":[{"type":"int24","name":"tick","internalType":"int24"},{"type":"int128","name":"liquidityNet","internalType":"int128"},{"type":"uint128","name":"liquidityGross","internalType":"uint128"}]}],"name":"getSpotTicksIfChanged","inputs":[{"type":"address","name":"pool","internalType":"contract IUniswapV3Pool"},{"type":"int256","name":"previousTickBitmapIndex","internalType":"int256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"address","name":"token","internalType":"contract ERC20"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"address","name":"input","internalType":"address"},{"type":"address","name":"output","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"uniswapV3SwapCallback","inputs":[{"type":"int256","name":"amount0Delta","internalType":"int256"},{"type":"int256","name":"amount1Delta","internalType":"int256"},{"type":"bytes","name":"data","internalType":"bytes"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b506134e3806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80639e8c708e1161005b5780639e8c708e146100fe578063b80ed83214610111578063f10ec89314610135578063fa461e331461014857610088565b80631548d79e1461008d57806332ef8314146100b65780637eace892146100cb5780638e48b859146100de575b600080fd5b6100a061009b366004612e29565b61015b565b6040516100ad919061347d565b60405180910390f35b6100c96100c4366004612daf565b61028c565b005b6100a06100d9366004612e29565b6104c6565b6100f16100ec366004612eb9565b6105eb565b6040516100ad9190613281565b6100c961010c366004612e9d565b610602565b61012461011f366004612f03565b610714565b6040516100ad959493929190613431565b610124610143366004612e9d565b61076a565b6100c9610156366004612f6c565b6107ad565b60008061019d84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099492505050565b905060008190506000886001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156101e957600080fd5b505afa1580156101fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102219190612d93565b6001600160a01b031614905060008061026c848461023e8c6109d9565b600003866102605773fffd8963efd1fc6a506488495d951d5263988d25610267565b6401000276a45b610a0b565b915091508261027b578061027d565b815b9b9a5050505050505050505050565b60006102cd83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099492505050565b90506000866001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016102fd91906131b6565b60206040518083038186803b15801561031557600080fd5b505afa158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d9190613136565b905060008290506000886001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561039957600080fd5b505afa1580156103ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d19190612d93565b6001600160a01b0316149050816001600160a01b031663128acb0888836103f7876109d9565b856104165773fffd8963efd1fc6a506488495d951d5263988d2561041d565b6401000276a45b604080516000815260208101918290527fffffffff0000000000000000000000000000000000000000000000000000000060e088901b169091526104689493929190602481016131e3565b6040805180830381600087803b15801561048157600080fd5b505af1158015610495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b99190612f49565b5050505050505050505050565b60008061050884848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099492505050565b905060008190506000886001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561055457600080fd5b505afa158015610568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058c9190612d93565b6001600160a01b03161490506000806105c884846105a98c6109d9565b866102605773fffd8963efd1fc6a506488495d951d5263988d25610267565b91509150826105d757816105d9565b805b6000039b9a5050505050505050505050565b60606105f88484846110b7565b90505b9392505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063a9059cbb90339083906370a08231906106519030906004016131b6565b60206040518083038186803b15801561066957600080fd5b505afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a19190613136565b6040518363ffffffff1660e01b81526004016106be9291906131ca565b602060405180830381600087803b1580156106d857600080fd5b505af11580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107109190612e7d565b5050565b600080600080606061072587611446565b92975090955093509150600182900b86141561074c576107458783611624565b9050610760565b61075d8760018403846001016110b7565b90505b9295509295909350565b6000808080606061079b867ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff27618610714565b939a9299509097509550909350915050565b600080600086131561083457859050336001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f557600080fd5b505afa158015610809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082d9190612d93565b91506108b4565b60008513156108b457849050336001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561087957600080fd5b505afa15801561088d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b19190612d93565b91505b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383169063a9059cbb906108fb90339085906004016131ca565b602060405180830381600087803b15801561091557600080fd5b505af1158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190612e7d565b61098c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109839061331e565b60405180910390fd5b505050505050565b600081516014146109d1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906132e7565b506014015190565b60007f80000000000000000000000000000000000000000000000000000000000000008210610a0757600080fd5b5090565b600080610a16612c57565b866001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610a4f57600080fd5b505afa158015610a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a879190613080565b5050505050600290810b900b60208301526001600160a01b0316815285610aee5780600001516001600160a01b0316846001600160a01b0316118015610ae9575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038516105b610b20565b80600001516001600160a01b0316846001600160a01b0316108015610b2057506401000276a36001600160a01b038516115b610b56576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109839061338c565b600080861390506000886001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9857600080fd5b505afa158015610bac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd09190612f2e565b90506000896001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0d57600080fd5b505afa158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c459190613113565b9050610c4f612c6e565b6040518060a001604052808a81526020016000815260200186600001516001600160a01b03168152602001866020015160020b81526020018c6001600160a01b0316631a6865026040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc057600080fd5b505afa158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf89190612fbd565b6fffffffffffffffffffffffffffffffff16905290505b805115801590610d355750876001600160a01b031681604001516001600160a01b031614155b1561107f57610d42612c9c565b60408201516001600160a01b031681526060820151610d64908d90868e6118cc565b15156040830152600290810b810b602083018190527ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff27618910b1215610dcd577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff276186020820152610dec565b6020810151620d89e860029190910b1315610dec57620d89e860208201525b610df98160200151611af9565b6001600160a01b031660608201526040820151610e6a908c610e33578a6001600160a01b031683606001516001600160a01b031611610e4d565b8a6001600160a01b031683606001516001600160a01b0316105b610e5b578260600151610e5d565b8a5b6080850151855187611e39565b60c085015260a084015260808301526001600160a01b031660408301528415610ed257610ea08160c001518260800151016109d9565b825103825260a0810151610ec890610eb7906109d9565b60208401519063ffffffff61202b16565b6020830152610f13565b610edf8160a001516109d9565b825101825260c08101516080820151610f0d91610efc91016109d9565b60208401519063ffffffff61204716565b60208301525b80606001516001600160a01b031682604001516001600160a01b0316141561103e578060400151156110155760208101516040517ff30dba930000000000000000000000000000000000000000000000000000000081526000916001600160a01b038f169163f30dba9391610f8a916004016132a2565b6101006040518083038186803b158015610fa357600080fd5b505afa158015610fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdb9190612fd8565b5050505050509150508b15610fee576000035b610ffc83608001518261205d565b6fffffffffffffffffffffffffffffffff166080840152505b8a61102457806020015161102d565b60018160200151035b600290810b900b6060830152611079565b80600001516001600160a01b031682604001516001600160a01b0316146110795761106c8260400151612137565b600290810b900b60608301525b50610d0f565b8315158a15151461109857602081015181518a036110a5565b8060000151890381602001515b909c909b509950505050505050505050565b60606000835b8360010b8160010b13611195576040517f5339c2960000000000000000000000000000000000000000000000000000000081526000906001600160a01b03881690635339c29690611112908590600401613294565b60206040518083038186803b15801561112a57600080fd5b505afa15801561113e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111629190613136565b905060005b61010081101561118b576001811b821615611183576001909301925b600101611167565b50506001016110bd565b506000856001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111d157600080fd5b505afa1580156111e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112099190612f2e565b90508167ffffffffffffffff8111801561122257600080fd5b5060405190808252806020026020018201604052801561125c57816020015b611249612cd8565b8152602001906001900390816112415790505b509250845b8460010b8160010b1361143c576040517f5339c2960000000000000000000000000000000000000000000000000000000081526000906001600160a01b03891690635339c296906112b6908590600401613294565b60206040518083038186803b1580156112ce57600080fd5b505afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113069190613136565b905060005b610100811015611432576001811b82161561142a576040517ff30dba93000000000000000000000000000000000000000000000000000000008152600184900b60020b60081b820185029060009081906001600160a01b038d169063f30dba939061137a9086906004016132a2565b6101006040518083038186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190612fd8565b5050505050509150915060405180606001604052808460020b815260200182600f0b8152602001836fffffffffffffffffffffffffffffffff168152508989600190039950898151811061141b57fe5b60200260200101819052505050505b60010161130b565b5050600101611261565b5050509392505050565b600080600080846001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561148557600080fd5b505afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd9190613080565b5050604080517f1a6865020000000000000000000000000000000000000000000000000000000081529051959950939650506001600160a01b03891693631a68650293600480820194506020935090829003018186803b15801561152057600080fd5b505afa158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190612fbd565b92506000856001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159557600080fd5b505afa1580156115a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cd9190612f2e565b905060008160020b8460020b816115e057fe5b05905060008460020b12801561160757508160020b8460020b8161160057fe5b0760020b15155b1561161157600019015b60088160020b901d925050509193509193565b60606000836001600160a01b0316635339c296846040518263ffffffff1660e01b81526004016116549190613294565b60206040518083038186803b15801561166c57600080fd5b505afa158015611680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a49190613136565b90506000805b6101008110156116ce576001811b8316156116c6576001909101905b6001016116aa565b506000856001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561170a57600080fd5b505afa15801561171e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117429190612f2e565b90508167ffffffffffffffff8111801561175b57600080fd5b5060405190808252806020026020018201604052801561179557816020015b611782612cd8565b81526020019060019003908161177a5790505b50935060005b6101008110156118c2576001811b8416156118ba576040517ff30dba93000000000000000000000000000000000000000000000000000000008152600187900b60020b60081b820183029060009081906001600160a01b038b169063f30dba939061180a9086906004016132a2565b6101006040518083038186803b15801561182357600080fd5b505afa158015611837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185b9190612fd8565b5050505050509150915060405180606001604052808460020b815260200182600f0b8152602001836fffffffffffffffffffffffffffffffff16815250888760019003975087815181106118ab57fe5b60200260200101819052505050505b60010161179b565b5050505092915050565b60008060008460020b8660020b816118e057fe5b05905060008660020b12801561190757508460020b8660020b8161190057fe5b0760020b15155b1561191157600019015b8315611a0d576000806119238361249a565b6040517f5339c2960000000000000000000000000000000000000000000000000000000081529193509150600160ff8084169190911b800160001901169060009082906001600160a01b038d1690635339c29690611985908890600401613294565b60206040518083038186803b15801561199d57600080fd5b505afa1580156119b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d59190613136565b1680151596509050856119ef57888360ff16860302611a02565b886119f9826124ac565b840360ff168603025b965050505050611aef565b600080611a1c8360010161249a565b91509150600060018260ff166001901b031960ff1690506000818b6001600160a01b0316635339c296866040518263ffffffff1660e01b8152600401611a629190613294565b60206040518083038186803b158015611a7a57600080fd5b505afa158015611a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab29190613136565b168015159650905085611ad257888360ff0360ff16866001010102611ae8565b8883611add8361255a565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12611b10578260020b611b18565b8260020b6000035b9050620d89e8811115611b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098390613355565b600060018216611b7857700100000000000000000000000000000000611b8a565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611bbe576ffff97272373d413259a46990580e213a0260801c5b6004821615611bdd576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615611bfc576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615611c1b576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615611c3a576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615611c59576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615611c78576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615611c98576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615611cb8576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615611cd8576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615611cf8576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615611d18576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615611d38576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615611d58576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615611d78576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615611d99576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615611db9576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615611dd8576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615611df5576b048a170391f7dc42444e8fa20260801c5b60008460020b1315611e10578060001981611e0c57fe5b0490505b640100000000810615611e24576001611e27565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a161015818712801590611ebe576000611e728989620f42400362ffffff16620f424061271f565b905082611e8b57611e868c8c8c60016127ce565b611e98565b611e988b8d8c600161286d565b9550858110611ea9578a9650611eb8565b611eb58c8b838661292a565b96505b50611f08565b81611ed557611ed08b8b8b600061286d565b611ee2565b611ee28a8c8b60006127ce565b9350838860000310611ef657899550611f08565b611f058b8a8a6000038561297f565b95505b6001600160a01b038a8116908716148215611f6b57808015611f275750815b611f3d57611f38878d8c600161286d565b611f3f565b855b9550808015611f4c575081155b611f6257611f5d878d8c60006127ce565b611f64565b845b9450611fb5565b808015611f755750815b611f8b57611f868c888c60016127ce565b611f8d565b855b9550808015611f9a575081155b611fb057611fab8c888c600061286d565b611fb2565b845b94505b81158015611fc557508860000385115b15611fd1578860000394505b818015611ff057508a6001600160a01b0316876001600160a01b031614155b15611fff57858903935061201c565b612019868962ffffff168a620f42400362ffffff166129d4565b93505b50505095509550955095915050565b8082038281131560008312151461204157600080fd5b92915050565b8181018281121560008312151461204157600080fd5b60008082600f0b12156120d457826fffffffffffffffffffffffffffffffff168260000384039150816fffffffffffffffffffffffffffffffff16106120cf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906132b0565b612041565b826fffffffffffffffffffffffffffffffff168284019150816fffffffffffffffffffffffffffffffff161015612041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906133c3565b60006401000276a36001600160a01b03831610801590612173575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b6121a9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906133fa565b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166fffffffffffffffffffffffffffffffff811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c9790881196179094179092171790911717176080811061225357607f810383901c915061225d565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581027ffffffffffffffffffffffffffffffffffd709b7e5480fba5a50fed5e62ffc5568101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b1461248b57886001600160a01b031661246f82611af9565b6001600160a01b031611156124845781612486565b805b61248d565b815b9998505050505050505050565b60020b600881901d9161010090910790565b60008082116124ba57600080fd5b70010000000000000000000000000000000082106124da57608091821c91015b6801000000000000000082106124f257604091821c91015b640100000000821061250657602091821c91015b62010000821061251857601091821c91015b610100821061252957600891821c91015b6010821061253957600491821c91015b6004821061254957600291821c91015b60028210612555576001015b919050565b600080821161256857600080fd5b5060ff6fffffffffffffffffffffffffffffffff8216156125aa577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80016125b2565b608082901c91505b67ffffffffffffffff8216156125e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0016125f1565b604082901c91505b63ffffffff821615612624577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00161262c565b602082901c91505b61ffff82161561265d577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001612665565b601082901c91505b60ff821615612695577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80161269d565b600882901c91505b600f8216156126cd577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc016126d5565b600482901c91505b6003821615612705577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0161270d565b600282901c91505b60018216156125555760001901919050565b6000808060001985870986860292508281109083900303905080612755576000841161274a57600080fd5b5082900490506105fb565b80841161276157600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000836001600160a01b0316856001600160a01b031611156127ee579293925b8161282d57612828836fffffffffffffffffffffffffffffffff168686036001600160a01b03166c0100000000000000000000000061271f565b612862565b612862836fffffffffffffffffffffffffffffffff168686036001600160a01b03166c010000000000000000000000006129d4565b90505b949350505050565b6000836001600160a01b0316856001600160a01b0316111561288d579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b0386860381169087166128c957600080fd5b836128f957866001600160a01b03166128ec8383896001600160a01b031661271f565b816128f357fe5b0461291f565b61291f6129108383896001600160a01b03166129d4565b886001600160a01b0316612a0e565b979650505050505050565b600080856001600160a01b03161161294157600080fd5b6000846fffffffffffffffffffffffffffffffff161161296057600080fd5b81612972576128288585856001612a19565b6128628585856001612b36565b600080856001600160a01b03161161299657600080fd5b6000846fffffffffffffffffffffffffffffffff16116129b557600080fd5b816129c7576128288585856000612b36565b6128628585856000612a19565b60006129e184848461271f565b9050600082806129ed57fe5b84860911156105fb576000198110612a0457600080fd5b6001019392505050565b808204910615150190565b60008115612aad5760006001600160a01b03841115612a6157612a5c846c01000000000000000000000000876fffffffffffffffffffffffffffffffff1661271f565b612a82565b6fffffffffffffffffffffffffffffffff8516606085901b81612a8057fe5b045b9050612aa5612aa06001600160a01b0388168363ffffffff612c3116565b612c41565b915050612865565b60006001600160a01b03841115612aed57612ae8846c01000000000000000000000000876fffffffffffffffffffffffffffffffff166129d4565b612b0d565b612b0d606085901b6fffffffffffffffffffffffffffffffff8716612a0e565b905080866001600160a01b031611612b2457600080fd5b6001600160a01b038616039050612865565b600082612b44575083612865565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215612bea576001600160a01b03861684810290858281612b8457fe5b041415612bb557818101828110612bb357612ba983896001600160a01b0316836129d4565b9350505050612865565b505b612be182612bdc878a6001600160a01b03168681612bcf57fe5b049063ffffffff612c3116565b612a0e565b92505050612865565b6001600160a01b03861684810290858281612c0157fe5b04148015612c0e57508082115b612c1757600080fd5b808203612ba9612aa0846001600160a01b038b16846129d4565b8082018281101561204157600080fd5b806001600160a01b038116811461255557600080fd5b604080518082019091526000808252602082015290565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b604080516060810182526000808252602082018190529181019190915290565b8051801515811461204157600080fd5b60008083601f840112612d19578182fd5b50813567ffffffffffffffff811115612d30578182fd5b602083019150836020828501011115612d4857600080fd5b9250929050565b8051600281900b811461204157600080fd5b80516fffffffffffffffffffffffffffffffff8116811461204157600080fd5b805161ffff8116811461204157600080fd5b600060208284031215612da4578081fd5b81516105fb81613486565b600080600080600060808688031215612dc6578081fd5b8535612dd181613486565b94506020860135612de181613486565b93506040860135612df181613486565b9250606086013567ffffffffffffffff811115612e0c578182fd5b612e1888828901612d08565b969995985093965092949392505050565b600080600080600060808688031215612e40578081fd5b8535612e4b81613486565b94506020860135612e5b81613486565b935060408601359250606086013567ffffffffffffffff811115612e0c578182fd5b600060208284031215612e8e578081fd5b815180151581146105fb578182fd5b600060208284031215612eae578081fd5b81356105fb81613486565b600080600060608486031215612ecd578283fd5b8335612ed881613486565b92506020840135612ee88161349e565b91506040840135612ef88161349e565b809150509250925092565b60008060408385031215612f15578182fd5b8235612f2081613486565b946020939093013593505050565b600060208284031215612f3f578081fd5b6105fb8383612d4f565b60008060408385031215612f5b578182fd5b505080516020909101519092909150565b60008060008060608587031215612f81578182fd5b8435935060208501359250604085013567ffffffffffffffff811115612fa5578283fd5b612fb187828801612d08565b95989497509550505050565b600060208284031215612fce578081fd5b6105fb8383612d61565b600080600080600080600080610100898b031215612ff4578586fd5b612ffe8a8a612d61565b9750602089015180600f0b8114613013578687fd5b80975050604089015195506060890151945060808901518060060b8114613038578384fd5b60a08a015190945061304981613486565b60c08a015190935063ffffffff81168114613062578283fd5b91506130718a60e08b01612cf8565b90509295985092959890939650565b600080600080600080600060e0888a03121561309a578081fd5b87516130a581613486565b96506130b48960208a01612d4f565b95506130c38960408a01612d81565b94506130d28960608a01612d81565b93506130e18960808a01612d81565b925060a088015160ff811681146130f6578182fd5b91506131058960c08a01612cf8565b905092959891949750929550565b600060208284031215613124578081fd5b815162ffffff811681146105fb578182fd5b600060208284031215613147578081fd5b5051919050565b6000815180845260208085019450808401835b838110156131ab578151805160020b885283810151600f0b848901526040908101516fffffffffffffffffffffffffffffffff169088015260609096019590820190600101613161565b509495945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60006001600160a01b038088168352602087151581850152866040850152818616606085015260a06080850152845191508160a0850152825b828110156132385785810182015185820160c00152810161321c565b82811115613249578360c084870101525b5050601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160c0019695505050505050565b6000602082526105fb602083018461314e565b60019190910b815260200190565b60029190910b815260200190565b60208082526002908201527f4c53000000000000000000000000000000000000000000000000000000000000604082015260600190565b6020808252601c908201527f50616972556e697377617056333a20696e76616c696420646174612100000000604082015260600190565b6020808252601f908201527f50616972556e697377617056333a207472616e73666572206661696c65642100604082015260600190565b60208082526001908201527f5400000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f53504c0000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f4c41000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526001908201527f5200000000000000000000000000000000000000000000000000000000000000604082015260600190565b60006001600160a01b03871682526fffffffffffffffffffffffffffffffff861660208301528460020b60408301528360010b606083015260a0608083015261291f60a083018461314e565b90815260200190565b6001600160a01b038116811461349b57600080fd5b50565b8060010b811461349b57600080fdfea2646970667358221220e817ae9ec3b90d3c3840d8d9a2a105b2d7a2f1808db3c35597975ead83336acd64736f6c63430006080033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c80639e8c708e1161005b5780639e8c708e146100fe578063b80ed83214610111578063f10ec89314610135578063fa461e331461014857610088565b80631548d79e1461008d57806332ef8314146100b65780637eace892146100cb5780638e48b859146100de575b600080fd5b6100a061009b366004612e29565b61015b565b6040516100ad919061347d565b60405180910390f35b6100c96100c4366004612daf565b61028c565b005b6100a06100d9366004612e29565b6104c6565b6100f16100ec366004612eb9565b6105eb565b6040516100ad9190613281565b6100c961010c366004612e9d565b610602565b61012461011f366004612f03565b610714565b6040516100ad959493929190613431565b610124610143366004612e9d565b61076a565b6100c9610156366004612f6c565b6107ad565b60008061019d84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099492505050565b905060008190506000886001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156101e957600080fd5b505afa1580156101fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102219190612d93565b6001600160a01b031614905060008061026c848461023e8c6109d9565b600003866102605773fffd8963efd1fc6a506488495d951d5263988d25610267565b6401000276a45b610a0b565b915091508261027b578061027d565b815b9b9a5050505050505050505050565b60006102cd83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099492505050565b90506000866001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016102fd91906131b6565b60206040518083038186803b15801561031557600080fd5b505afa158015610329573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034d9190613136565b905060008290506000886001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561039957600080fd5b505afa1580156103ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d19190612d93565b6001600160a01b0316149050816001600160a01b031663128acb0888836103f7876109d9565b856104165773fffd8963efd1fc6a506488495d951d5263988d2561041d565b6401000276a45b604080516000815260208101918290527fffffffff0000000000000000000000000000000000000000000000000000000060e088901b169091526104689493929190602481016131e3565b6040805180830381600087803b15801561048157600080fd5b505af1158015610495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b99190612f49565b5050505050505050505050565b60008061050884848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061099492505050565b905060008190506000886001600160a01b0316826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561055457600080fd5b505afa158015610568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058c9190612d93565b6001600160a01b03161490506000806105c884846105a98c6109d9565b866102605773fffd8963efd1fc6a506488495d951d5263988d25610267565b91509150826105d757816105d9565b805b6000039b9a5050505050505050505050565b60606105f88484846110b7565b90505b9392505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063a9059cbb90339083906370a08231906106519030906004016131b6565b60206040518083038186803b15801561066957600080fd5b505afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a19190613136565b6040518363ffffffff1660e01b81526004016106be9291906131ca565b602060405180830381600087803b1580156106d857600080fd5b505af11580156106ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107109190612e7d565b5050565b600080600080606061072587611446565b92975090955093509150600182900b86141561074c576107458783611624565b9050610760565b61075d8760018403846001016110b7565b90505b9295509295909350565b6000808080606061079b867ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff27618610714565b939a9299509097509550909350915050565b600080600086131561083457859050336001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f557600080fd5b505afa158015610809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082d9190612d93565b91506108b4565b60008513156108b457849050336001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561087957600080fd5b505afa15801561088d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b19190612d93565b91505b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383169063a9059cbb906108fb90339085906004016131ca565b602060405180830381600087803b15801561091557600080fd5b505af1158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190612e7d565b61098c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109839061331e565b60405180910390fd5b505050505050565b600081516014146109d1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906132e7565b506014015190565b60007f80000000000000000000000000000000000000000000000000000000000000008210610a0757600080fd5b5090565b600080610a16612c57565b866001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610a4f57600080fd5b505afa158015610a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a879190613080565b5050505050600290810b900b60208301526001600160a01b0316815285610aee5780600001516001600160a01b0316846001600160a01b0316118015610ae9575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038516105b610b20565b80600001516001600160a01b0316846001600160a01b0316108015610b2057506401000276a36001600160a01b038516115b610b56576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109839061338c565b600080861390506000886001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9857600080fd5b505afa158015610bac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd09190612f2e565b90506000896001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0d57600080fd5b505afa158015610c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c459190613113565b9050610c4f612c6e565b6040518060a001604052808a81526020016000815260200186600001516001600160a01b03168152602001866020015160020b81526020018c6001600160a01b0316631a6865026040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc057600080fd5b505afa158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf89190612fbd565b6fffffffffffffffffffffffffffffffff16905290505b805115801590610d355750876001600160a01b031681604001516001600160a01b031614155b1561107f57610d42612c9c565b60408201516001600160a01b031681526060820151610d64908d90868e6118cc565b15156040830152600290810b810b602083018190527ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff27618910b1215610dcd577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff276186020820152610dec565b6020810151620d89e860029190910b1315610dec57620d89e860208201525b610df98160200151611af9565b6001600160a01b031660608201526040820151610e6a908c610e33578a6001600160a01b031683606001516001600160a01b031611610e4d565b8a6001600160a01b031683606001516001600160a01b0316105b610e5b578260600151610e5d565b8a5b6080850151855187611e39565b60c085015260a084015260808301526001600160a01b031660408301528415610ed257610ea08160c001518260800151016109d9565b825103825260a0810151610ec890610eb7906109d9565b60208401519063ffffffff61202b16565b6020830152610f13565b610edf8160a001516109d9565b825101825260c08101516080820151610f0d91610efc91016109d9565b60208401519063ffffffff61204716565b60208301525b80606001516001600160a01b031682604001516001600160a01b0316141561103e578060400151156110155760208101516040517ff30dba930000000000000000000000000000000000000000000000000000000081526000916001600160a01b038f169163f30dba9391610f8a916004016132a2565b6101006040518083038186803b158015610fa357600080fd5b505afa158015610fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdb9190612fd8565b5050505050509150508b15610fee576000035b610ffc83608001518261205d565b6fffffffffffffffffffffffffffffffff166080840152505b8a61102457806020015161102d565b60018160200151035b600290810b900b6060830152611079565b80600001516001600160a01b031682604001516001600160a01b0316146110795761106c8260400151612137565b600290810b900b60608301525b50610d0f565b8315158a15151461109857602081015181518a036110a5565b8060000151890381602001515b909c909b509950505050505050505050565b60606000835b8360010b8160010b13611195576040517f5339c2960000000000000000000000000000000000000000000000000000000081526000906001600160a01b03881690635339c29690611112908590600401613294565b60206040518083038186803b15801561112a57600080fd5b505afa15801561113e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111629190613136565b905060005b61010081101561118b576001811b821615611183576001909301925b600101611167565b50506001016110bd565b506000856001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111d157600080fd5b505afa1580156111e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112099190612f2e565b90508167ffffffffffffffff8111801561122257600080fd5b5060405190808252806020026020018201604052801561125c57816020015b611249612cd8565b8152602001906001900390816112415790505b509250845b8460010b8160010b1361143c576040517f5339c2960000000000000000000000000000000000000000000000000000000081526000906001600160a01b03891690635339c296906112b6908590600401613294565b60206040518083038186803b1580156112ce57600080fd5b505afa1580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113069190613136565b905060005b610100811015611432576001811b82161561142a576040517ff30dba93000000000000000000000000000000000000000000000000000000008152600184900b60020b60081b820185029060009081906001600160a01b038d169063f30dba939061137a9086906004016132a2565b6101006040518083038186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190612fd8565b5050505050509150915060405180606001604052808460020b815260200182600f0b8152602001836fffffffffffffffffffffffffffffffff168152508989600190039950898151811061141b57fe5b60200260200101819052505050505b60010161130b565b5050600101611261565b5050509392505050565b600080600080846001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561148557600080fd5b505afa158015611499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bd9190613080565b5050604080517f1a6865020000000000000000000000000000000000000000000000000000000081529051959950939650506001600160a01b03891693631a68650293600480820194506020935090829003018186803b15801561152057600080fd5b505afa158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190612fbd565b92506000856001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159557600080fd5b505afa1580156115a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cd9190612f2e565b905060008160020b8460020b816115e057fe5b05905060008460020b12801561160757508160020b8460020b8161160057fe5b0760020b15155b1561161157600019015b60088160020b901d925050509193509193565b60606000836001600160a01b0316635339c296846040518263ffffffff1660e01b81526004016116549190613294565b60206040518083038186803b15801561166c57600080fd5b505afa158015611680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a49190613136565b90506000805b6101008110156116ce576001811b8316156116c6576001909101905b6001016116aa565b506000856001600160a01b031663d0c93a7c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561170a57600080fd5b505afa15801561171e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117429190612f2e565b90508167ffffffffffffffff8111801561175b57600080fd5b5060405190808252806020026020018201604052801561179557816020015b611782612cd8565b81526020019060019003908161177a5790505b50935060005b6101008110156118c2576001811b8416156118ba576040517ff30dba93000000000000000000000000000000000000000000000000000000008152600187900b60020b60081b820183029060009081906001600160a01b038b169063f30dba939061180a9086906004016132a2565b6101006040518083038186803b15801561182357600080fd5b505afa158015611837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185b9190612fd8565b5050505050509150915060405180606001604052808460020b815260200182600f0b8152602001836fffffffffffffffffffffffffffffffff16815250888760019003975087815181106118ab57fe5b60200260200101819052505050505b60010161179b565b5050505092915050565b60008060008460020b8660020b816118e057fe5b05905060008660020b12801561190757508460020b8660020b8161190057fe5b0760020b15155b1561191157600019015b8315611a0d576000806119238361249a565b6040517f5339c2960000000000000000000000000000000000000000000000000000000081529193509150600160ff8084169190911b800160001901169060009082906001600160a01b038d1690635339c29690611985908890600401613294565b60206040518083038186803b15801561199d57600080fd5b505afa1580156119b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d59190613136565b1680151596509050856119ef57888360ff16860302611a02565b886119f9826124ac565b840360ff168603025b965050505050611aef565b600080611a1c8360010161249a565b91509150600060018260ff166001901b031960ff1690506000818b6001600160a01b0316635339c296866040518263ffffffff1660e01b8152600401611a629190613294565b60206040518083038186803b158015611a7a57600080fd5b505afa158015611a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab29190613136565b168015159650905085611ad257888360ff0360ff16866001010102611ae8565b8883611add8361255a565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12611b10578260020b611b18565b8260020b6000035b9050620d89e8811115611b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098390613355565b600060018216611b7857700100000000000000000000000000000000611b8a565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611bbe576ffff97272373d413259a46990580e213a0260801c5b6004821615611bdd576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615611bfc576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615611c1b576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615611c3a576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615611c59576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615611c78576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615611c98576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615611cb8576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615611cd8576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615611cf8576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615611d18576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615611d38576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615611d58576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615611d78576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615611d99576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615611db9576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615611dd8576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615611df5576b048a170391f7dc42444e8fa20260801c5b60008460020b1315611e10578060001981611e0c57fe5b0490505b640100000000810615611e24576001611e27565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a161015818712801590611ebe576000611e728989620f42400362ffffff16620f424061271f565b905082611e8b57611e868c8c8c60016127ce565b611e98565b611e988b8d8c600161286d565b9550858110611ea9578a9650611eb8565b611eb58c8b838661292a565b96505b50611f08565b81611ed557611ed08b8b8b600061286d565b611ee2565b611ee28a8c8b60006127ce565b9350838860000310611ef657899550611f08565b611f058b8a8a6000038561297f565b95505b6001600160a01b038a8116908716148215611f6b57808015611f275750815b611f3d57611f38878d8c600161286d565b611f3f565b855b9550808015611f4c575081155b611f6257611f5d878d8c60006127ce565b611f64565b845b9450611fb5565b808015611f755750815b611f8b57611f868c888c60016127ce565b611f8d565b855b9550808015611f9a575081155b611fb057611fab8c888c600061286d565b611fb2565b845b94505b81158015611fc557508860000385115b15611fd1578860000394505b818015611ff057508a6001600160a01b0316876001600160a01b031614155b15611fff57858903935061201c565b612019868962ffffff168a620f42400362ffffff166129d4565b93505b50505095509550955095915050565b8082038281131560008312151461204157600080fd5b92915050565b8181018281121560008312151461204157600080fd5b60008082600f0b12156120d457826fffffffffffffffffffffffffffffffff168260000384039150816fffffffffffffffffffffffffffffffff16106120cf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906132b0565b612041565b826fffffffffffffffffffffffffffffffff168284019150816fffffffffffffffffffffffffffffffff161015612041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906133c3565b60006401000276a36001600160a01b03831610801590612173575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b6121a9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610983906133fa565b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166fffffffffffffffffffffffffffffffff811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c9790881196179094179092171790911717176080811061225357607f810383901c915061225d565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c670100000000000000161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581027ffffffffffffffffffffffffffffffffffd709b7e5480fba5a50fed5e62ffc5568101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b1461248b57886001600160a01b031661246f82611af9565b6001600160a01b031611156124845781612486565b805b61248d565b815b9998505050505050505050565b60020b600881901d9161010090910790565b60008082116124ba57600080fd5b70010000000000000000000000000000000082106124da57608091821c91015b6801000000000000000082106124f257604091821c91015b640100000000821061250657602091821c91015b62010000821061251857601091821c91015b610100821061252957600891821c91015b6010821061253957600491821c91015b6004821061254957600291821c91015b60028210612555576001015b919050565b600080821161256857600080fd5b5060ff6fffffffffffffffffffffffffffffffff8216156125aa577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80016125b2565b608082901c91505b67ffffffffffffffff8216156125e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0016125f1565b604082901c91505b63ffffffff821615612624577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00161262c565b602082901c91505b61ffff82161561265d577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001612665565b601082901c91505b60ff821615612695577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80161269d565b600882901c91505b600f8216156126cd577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc016126d5565b600482901c91505b6003821615612705577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0161270d565b600282901c91505b60018216156125555760001901919050565b6000808060001985870986860292508281109083900303905080612755576000841161274a57600080fd5b5082900490506105fb565b80841161276157600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000836001600160a01b0316856001600160a01b031611156127ee579293925b8161282d57612828836fffffffffffffffffffffffffffffffff168686036001600160a01b03166c0100000000000000000000000061271f565b612862565b612862836fffffffffffffffffffffffffffffffff168686036001600160a01b03166c010000000000000000000000006129d4565b90505b949350505050565b6000836001600160a01b0316856001600160a01b0316111561288d579293925b7bffffffffffffffffffffffffffffffff000000000000000000000000606084901b166001600160a01b0386860381169087166128c957600080fd5b836128f957866001600160a01b03166128ec8383896001600160a01b031661271f565b816128f357fe5b0461291f565b61291f6129108383896001600160a01b03166129d4565b886001600160a01b0316612a0e565b979650505050505050565b600080856001600160a01b03161161294157600080fd5b6000846fffffffffffffffffffffffffffffffff161161296057600080fd5b81612972576128288585856001612a19565b6128628585856001612b36565b600080856001600160a01b03161161299657600080fd5b6000846fffffffffffffffffffffffffffffffff16116129b557600080fd5b816129c7576128288585856000612b36565b6128628585856000612a19565b60006129e184848461271f565b9050600082806129ed57fe5b84860911156105fb576000198110612a0457600080fd5b6001019392505050565b808204910615150190565b60008115612aad5760006001600160a01b03841115612a6157612a5c846c01000000000000000000000000876fffffffffffffffffffffffffffffffff1661271f565b612a82565b6fffffffffffffffffffffffffffffffff8516606085901b81612a8057fe5b045b9050612aa5612aa06001600160a01b0388168363ffffffff612c3116565b612c41565b915050612865565b60006001600160a01b03841115612aed57612ae8846c01000000000000000000000000876fffffffffffffffffffffffffffffffff166129d4565b612b0d565b612b0d606085901b6fffffffffffffffffffffffffffffffff8716612a0e565b905080866001600160a01b031611612b2457600080fd5b6001600160a01b038616039050612865565b600082612b44575083612865565b7bffffffffffffffffffffffffffffffff000000000000000000000000606085901b168215612bea576001600160a01b03861684810290858281612b8457fe5b041415612bb557818101828110612bb357612ba983896001600160a01b0316836129d4565b9350505050612865565b505b612be182612bdc878a6001600160a01b03168681612bcf57fe5b049063ffffffff612c3116565b612a0e565b92505050612865565b6001600160a01b03861684810290858281612c0157fe5b04148015612c0e57508082115b612c1757600080fd5b808203612ba9612aa0846001600160a01b038b16846129d4565b8082018281101561204157600080fd5b806001600160a01b038116811461255557600080fd5b604080518082019091526000808252602082015290565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b604080516060810182526000808252602082018190529181019190915290565b8051801515811461204157600080fd5b60008083601f840112612d19578182fd5b50813567ffffffffffffffff811115612d30578182fd5b602083019150836020828501011115612d4857600080fd5b9250929050565b8051600281900b811461204157600080fd5b80516fffffffffffffffffffffffffffffffff8116811461204157600080fd5b805161ffff8116811461204157600080fd5b600060208284031215612da4578081fd5b81516105fb81613486565b600080600080600060808688031215612dc6578081fd5b8535612dd181613486565b94506020860135612de181613486565b93506040860135612df181613486565b9250606086013567ffffffffffffffff811115612e0c578182fd5b612e1888828901612d08565b969995985093965092949392505050565b600080600080600060808688031215612e40578081fd5b8535612e4b81613486565b94506020860135612e5b81613486565b935060408601359250606086013567ffffffffffffffff811115612e0c578182fd5b600060208284031215612e8e578081fd5b815180151581146105fb578182fd5b600060208284031215612eae578081fd5b81356105fb81613486565b600080600060608486031215612ecd578283fd5b8335612ed881613486565b92506020840135612ee88161349e565b91506040840135612ef88161349e565b809150509250925092565b60008060408385031215612f15578182fd5b8235612f2081613486565b946020939093013593505050565b600060208284031215612f3f578081fd5b6105fb8383612d4f565b60008060408385031215612f5b578182fd5b505080516020909101519092909150565b60008060008060608587031215612f81578182fd5b8435935060208501359250604085013567ffffffffffffffff811115612fa5578283fd5b612fb187828801612d08565b95989497509550505050565b600060208284031215612fce578081fd5b6105fb8383612d61565b600080600080600080600080610100898b031215612ff4578586fd5b612ffe8a8a612d61565b9750602089015180600f0b8114613013578687fd5b80975050604089015195506060890151945060808901518060060b8114613038578384fd5b60a08a015190945061304981613486565b60c08a015190935063ffffffff81168114613062578283fd5b91506130718a60e08b01612cf8565b90509295985092959890939650565b600080600080600080600060e0888a03121561309a578081fd5b87516130a581613486565b96506130b48960208a01612d4f565b95506130c38960408a01612d81565b94506130d28960608a01612d81565b93506130e18960808a01612d81565b925060a088015160ff811681146130f6578182fd5b91506131058960c08a01612cf8565b905092959891949750929550565b600060208284031215613124578081fd5b815162ffffff811681146105fb578182fd5b600060208284031215613147578081fd5b5051919050565b6000815180845260208085019450808401835b838110156131ab578151805160020b885283810151600f0b848901526040908101516fffffffffffffffffffffffffffffffff169088015260609096019590820190600101613161565b509495945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b60006001600160a01b038088168352602087151581850152866040850152818616606085015260a06080850152845191508160a0850152825b828110156132385785810182015185820160c00152810161321c565b82811115613249578360c084870101525b5050601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160c0019695505050505050565b6000602082526105fb602083018461314e565b60019190910b815260200190565b60029190910b815260200190565b60208082526002908201527f4c53000000000000000000000000000000000000000000000000000000000000604082015260600190565b6020808252601c908201527f50616972556e697377617056333a20696e76616c696420646174612100000000604082015260600190565b6020808252601f908201527f50616972556e697377617056333a207472616e73666572206661696c65642100604082015260600190565b60208082526001908201527f5400000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526003908201527f53504c0000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526002908201527f4c41000000000000000000000000000000000000000000000000000000000000604082015260600190565b60208082526001908201527f5200000000000000000000000000000000000000000000000000000000000000604082015260600190565b60006001600160a01b03871682526fffffffffffffffffffffffffffffffff861660208301528460020b60408301528360010b606083015260a0608083015261291f60a083018461314e565b90815260200190565b6001600160a01b038116811461349b57600080fd5b50565b8060010b811461349b57600080fdfea2646970667358221220e817ae9ec3b90d3c3840d8d9a2a105b2d7a2f1808db3c35597975ead83336acd64736f6c63430006080033