Token Dopex V2 Option Market V2

 

Overview ERC-721

Total Supply:
0 DPX-V2-OM-V2

Holders:
192 addresses

Transfers:
-

Contract:
0x501B03BdB431154b8Df17BF1c00756E3a8F217440x501B03BdB431154b8Df17BF1c00756E3a8F21744

Social Profiles:
Not Available, Update ?

Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

Click here to update the token ICO / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DopexV2OptionMarketV2

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 0 runs

Other Settings:
london EvmVersion
File 1 of 28 : DopexV2OptionMarketV2.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0 <0.9.0;

import {IDopexV2PositionManager} from "./interfaces/IDopexV2PositionManager.sol";

import {IOptionPricingV2} from "./pricing/IOptionPricingV2.sol";
import {IHandler} from "./interfaces/IHandler.sol";
import {IDopexV2ClammFeeStrategyV2} from "./pricing/fees/IDopexV2ClammFeeStrategyV2.sol";
import {ISwapper} from "./interfaces/ISwapper.sol";
import {ITokenURIFetcher} from "./interfaces/ITokenURIFetcher.sol";

import {ERC721} from "./libraries/tokens/ERC721.sol";
import {ERC20} from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol";
import {Multicall} from "openzeppelin-contracts/contracts/utils/Multicall.sol";

import {IUniswapV3Pool} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import {LiquidityAmounts} from "v3-periphery/libraries/LiquidityAmounts.sol";
import {TickMath} from "@uniswap/v3-core/contracts/libraries/TickMath.sol";
import {FullMath} from "@uniswap/v3-core/contracts/libraries/FullMath.sol";

/**
 * @title DopexV2OptionMarketV2
 * @author 0xcarrot
 * @dev Allow traders to buy CALL and PUT options using CLAMM liquidity, which can be
 * exercised at any time ITM. Supports Hooks for additional functionality.
 */
contract DopexV2OptionMarketV2 is ReentrancyGuard, Multicall, Ownable, ERC721 {
    using TickMath for int24;

    struct OptionData {
        uint256 opTickArrayLen;
        int24 tickLower;
        int24 tickUpper;
        uint256 expiry;
        bool isCall;
    }

    struct OptionTicks {
        IHandler _handler;
        IUniswapV3Pool pool;
        address hook;
        int24 tickLower;
        int24 tickUpper;
        uint256 liquidityToUse;
    }

    struct OptionParams {
        OptionTicks[] optionTicks;
        int24 tickLower;
        int24 tickUpper;
        uint256 ttl;
        bool isCall;
        uint256 maxCostAllowance;
    }

    struct ExerciseOptionParams {
        uint256 optionId;
        ISwapper[] swapper;
        bytes[] swapData;
        uint256[] liquidityToExercise;
    }

    struct SettleOptionParams {
        uint256 optionId;
        ISwapper[] swapper;
        bytes[] swapData;
        uint256[] liquidityToSettle;
    }

    struct PositionSplitterParams {
        uint256 optionId;
        address to;
        uint256[] liquidityToSplit;
    }

    // events
    event LogMintOption(
        address user,
        uint256 tokenId,
        bool isCall,
        uint256 premiumAmount,
        uint256 totalAssetWithdrawn,
        uint256 protocolFees
    );
    event LogExerciseOption(
        address user,
        uint256 tokenId,
        uint256 totalProfit,
        uint256 totalAssetRelocked
    );
    event LogSettleOption(address user, uint256 tokenId);
    event LogSplitOption(
        address user,
        uint256 tokenId,
        uint256 newTokenId,
        address to
    );

    event LogUpdateExerciseDelegate(
        address owner,
        address delegate,
        bool status
    );
    event LogOptionsMarketInitialized(
        address primePool,
        address optionPricing,
        address dpFee,
        address callAsset,
        address putAsset
    );
    event LogUpdateAddress(
        address tokeURIFetcher,
        address dpFee,
        address optionPricing
    );

    // errors
    error DopexV2OptionMarket__MaxOptionBuyReached();
    error DopexV2OptionMarket__IVNotSet();
    error DopexV2OptionMarket__NotValidStrikeTick();
    error DopexV2OptionMarket__PoolNotApproved();
    error DopexV2OptionMarket__MaxCostAllowanceExceeded();
    error DopexV2OptionMarket__NotOwnerOrDelegator();
    error DopexV2OptionMarket__EmptyOption();
    error DopexV2OptionMarket__ArrayLenMismatch();
    error DopexV2OptionMarket__OptionExpired();
    error DopexV2OptionMarket__OptionNotExpired();
    error DopexV2OptionMarket__NotEnoughAfterSwap();
    error DopexV2OptionMarket__NotApprovedSettler();
    error DopexV2OptionMarket__NotIVSetter();
    error DopexV2OptionMarket__InvalidPool();

    IDopexV2ClammFeeStrategyV2 public dpFee;
    IOptionPricingV2 public optionPricing;

    IDopexV2PositionManager public immutable positionManager;
    IUniswapV3Pool public immutable primePool;
    address public immutable callAsset;
    address public immutable putAsset;
    uint8 public immutable callAssetDecimals;
    uint8 public immutable putAssetDecimals;

    address public feeTo;
    address public tokenURIFetcher;

    mapping(uint256 => OptionData) public opData;
    mapping(uint256 => OptionTicks[]) public opTickMap;
    mapping(address => mapping(address => bool)) public exerciseDelegator;
    mapping(address => bool) public approvedPools;
    mapping(address => bool) public settlers;

    uint256 public optionIds;

    constructor(
        address _pm,
        address _optionPricing,
        address _dpFee,
        address _callAsset,
        address _putAsset,
        address _primePool
    ) {
        positionManager = IDopexV2PositionManager(_pm);
        callAsset = _callAsset;
        putAsset = _putAsset;

        dpFee = IDopexV2ClammFeeStrategyV2(_dpFee);

        optionPricing = IOptionPricingV2(_optionPricing);

        primePool = IUniswapV3Pool(_primePool);

        if (
            primePool.token0() != _callAsset && primePool.token1() != _callAsset
        ) revert DopexV2OptionMarket__InvalidPool();
        if (primePool.token0() != _putAsset && primePool.token1() != _putAsset)
            revert DopexV2OptionMarket__InvalidPool();

        callAssetDecimals = ERC20(_callAsset).decimals();
        putAssetDecimals = ERC20(_putAsset).decimals();

        emit LogOptionsMarketInitialized(
            _primePool,
            _optionPricing,
            _dpFee,
            _callAsset,
            _putAsset
        );
    }

    /**
     * @notice Provides the name of the token
     * @return The name of the token
     */
    function name() public view override returns (string memory) {
        return "Dopex V2 Option Market V2";
    }

    /**
     * @notice Provides the symbol of the token
     * @return The symbol of the token
     */
    function symbol() public view override returns (string memory) {
        return "DPX-V2-OM-V2";
    }

    /**
     * @notice Provides the tokenURI for each token
     * @param id The token Id.
     * @return The tokenURI string data
     */
    function tokenURI(uint256 id) public view override returns (string memory) {
        return ITokenURIFetcher(tokenURIFetcher).onFetchTokenURIData(id);
    }

    /**
     * @notice Mints an option for the given strike and expiry.
     * @param _params The option  parameters.
     */
    function mintOption(OptionParams calldata _params) external nonReentrant {
        optionIds += 1;

        if (_params.optionTicks.length > 20)
            revert DopexV2OptionMarket__MaxOptionBuyReached();

        uint256[] memory amountsPerOptionTicks = new uint256[](
            _params.optionTicks.length
        );
        uint256 totalAssetWithdrawn;

        bool isAmount0;

        address assetToUse = _params.isCall ? callAsset : putAsset;

        OptionTicks memory opTick;

        for (uint256 i; i < _params.optionTicks.length; i++) {
            opTick = _params.optionTicks[i];
            if (
                _params.isCall
                    ? _params.tickUpper != opTick.tickUpper
                    : _params.tickLower != opTick.tickLower
            ) revert DopexV2OptionMarket__NotValidStrikeTick();

            opTickMap[optionIds].push(
                OptionTicks({
                    _handler: opTick._handler,
                    pool: opTick.pool,
                    hook: opTick.hook,
                    tickLower: opTick.tickLower,
                    tickUpper: opTick.tickUpper,
                    liquidityToUse: opTick.liquidityToUse
                })
            );

            if (!approvedPools[address(opTick.pool)])
                revert DopexV2OptionMarket__PoolNotApproved();

            bytes memory usePositionData = abi.encode(
                opTick.pool,
                opTick.hook,
                opTick.tickLower,
                opTick.tickUpper,
                opTick.liquidityToUse,
                abi.encode(
                    address(this),
                    _params.ttl,
                    _params.isCall,
                    opTick.pool,
                    opTick.tickLower,
                    opTick.tickUpper
                )
            );

            (
                address[] memory tokens,
                uint256[] memory amounts,

            ) = positionManager.usePosition(opTick._handler, usePositionData);

            if (tokens[0] == assetToUse) {
                require(amounts[0] > 0 && amounts[1] == 0);
                amountsPerOptionTicks[i] = (amounts[0]);
                totalAssetWithdrawn += amounts[0];
                isAmount0 = true;
            } else {
                require(amounts[1] > 0 && amounts[0] == 0);
                amountsPerOptionTicks[i] = (amounts[1]);
                totalAssetWithdrawn += amounts[1];
                isAmount0 = false;
            }
        }

        uint256 strike = getPricePerCallAssetViaTick(
            primePool,
            _params.isCall ? _params.tickUpper : _params.tickLower
        );

        uint256 premiumAmount = _getPremiumAmount(
            _params.isCall ? false : true, // isPut
            block.timestamp + _params.ttl, // expiry
            strike, // Strike
            getCurrentPricePerCallAsset(primePool), // Current price
            _params.isCall
                ? totalAssetWithdrawn
                : (totalAssetWithdrawn * (10 ** putAssetDecimals)) / strike
        );

        if (premiumAmount == 0) revert DopexV2OptionMarket__IVNotSet();

        uint256 protocolFees;
        if (feeTo != address(0)) {
            protocolFees = getFee(totalAssetWithdrawn, premiumAmount);
            ERC20(assetToUse).transferFrom(msg.sender, feeTo, protocolFees);
        }

        if (premiumAmount + protocolFees > _params.maxCostAllowance)
            revert DopexV2OptionMarket__MaxCostAllowanceExceeded();

        ERC20(assetToUse).transferFrom(
            msg.sender,
            address(this),
            premiumAmount
        );
        ERC20(assetToUse).approve(address(positionManager), premiumAmount);

        for (uint i; i < _params.optionTicks.length; i++) {
            opTick = _params.optionTicks[i];
            uint256 premiumAmountEarned = (amountsPerOptionTicks[i] *
                premiumAmount) / totalAssetWithdrawn;

            uint128 liquidityToDonate = LiquidityAmounts.getLiquidityForAmounts(
                _getCurrentSqrtPriceX96(opTick.pool),
                opTick.tickLower.getSqrtRatioAtTick(),
                opTick.tickUpper.getSqrtRatioAtTick(),
                isAmount0 ? premiumAmountEarned : 0,
                isAmount0 ? 0 : premiumAmountEarned
            );

            bytes memory donatePositionData = abi.encode(
                opTick.pool,
                opTick.hook,
                opTick.tickLower,
                opTick.tickUpper,
                liquidityToDonate
            );
            positionManager.donateToPosition(
                opTick._handler,
                donatePositionData
            );
        }

        opData[optionIds] = OptionData({
            opTickArrayLen: _params.optionTicks.length,
            tickLower: _params.tickLower,
            tickUpper: _params.tickUpper,
            expiry: block.timestamp + _params.ttl,
            isCall: _params.isCall
        });

        _safeMint(msg.sender, optionIds);

        emit LogMintOption(
            msg.sender,
            optionIds,
            _params.isCall,
            premiumAmount,
            totalAssetWithdrawn,
            protocolFees
        );
    }

    struct AssetsCache {
        ERC20 assetToUse;
        ERC20 assetToGet;
        uint256 totalProfit;
        uint256 totalAssetRelocked;
    }

    /**
     * @notice Exercises the given option .
     * @param _params The exercise option  parameters.
     */
    function exerciseOption(
        ExerciseOptionParams calldata _params
    ) external nonReentrant returns (AssetsCache memory ac) {
        if (
            ownerOf(_params.optionId) != msg.sender &&
            exerciseDelegator[ownerOf(_params.optionId)][msg.sender] == false
        ) revert DopexV2OptionMarket__NotOwnerOrDelegator();

        OptionData memory oData = opData[_params.optionId];

        if (oData.opTickArrayLen != _params.liquidityToExercise.length)
            revert DopexV2OptionMarket__ArrayLenMismatch();

        if (oData.expiry < block.timestamp)
            revert DopexV2OptionMarket__OptionExpired();

        bool isAmount0 = oData.isCall
            ? primePool.token0() == callAsset
            : primePool.token0() == putAsset;

        ac.assetToUse = ERC20(oData.isCall ? callAsset : putAsset);
        ac.assetToGet = ERC20(oData.isCall ? putAsset : callAsset);

        for (uint256 i; i < oData.opTickArrayLen; i++) {
            if (_params.liquidityToExercise[i] == 0) continue;

            OptionTicks storage opTick = opTickMap[_params.optionId][i];

            uint256 amountToSwap = isAmount0
                ? LiquidityAmounts.getAmount0ForLiquidity(
                    opTick.tickLower.getSqrtRatioAtTick(),
                    opTick.tickUpper.getSqrtRatioAtTick(),
                    uint128(_params.liquidityToExercise[i])
                )
                : LiquidityAmounts.getAmount1ForLiquidity(
                    opTick.tickLower.getSqrtRatioAtTick(),
                    opTick.tickUpper.getSqrtRatioAtTick(),
                    uint128(_params.liquidityToExercise[i])
                );

            ac.totalAssetRelocked += amountToSwap;

            uint256 prevBalance = ac.assetToGet.balanceOf(address(this));

            ac.assetToUse.transfer(address(_params.swapper[i]), amountToSwap);

            _params.swapper[i].onSwapReceived(
                address(ac.assetToUse),
                address(ac.assetToGet),
                amountToSwap,
                _params.swapData[i]
            );

            uint256 amountReq = isAmount0
                ? LiquidityAmounts.getAmount1ForLiquidity(
                    opTick.tickLower.getSqrtRatioAtTick(),
                    opTick.tickUpper.getSqrtRatioAtTick(),
                    uint128(_params.liquidityToExercise[i])
                )
                : LiquidityAmounts.getAmount0ForLiquidity(
                    opTick.tickLower.getSqrtRatioAtTick(),
                    opTick.tickUpper.getSqrtRatioAtTick(),
                    uint128(_params.liquidityToExercise[i])
                );

            uint256 currentBalance = ac.assetToGet.balanceOf(address(this));

            if (currentBalance < prevBalance + amountReq)
                revert DopexV2OptionMarket__NotEnoughAfterSwap();

            ac.assetToGet.approve(address(positionManager), amountReq);

            bytes memory unusePositionData = abi.encode(
                opTick.pool,
                opTick.hook,
                opTick.tickLower,
                opTick.tickUpper,
                _params.liquidityToExercise[i],
                abi.encode("")
            );

            positionManager.unusePosition(opTick._handler, unusePositionData);

            opTick.liquidityToUse -= _params.liquidityToExercise[i];

            ac.totalProfit += currentBalance - (prevBalance + amountReq);
        }

        ac.assetToGet.transfer(msg.sender, ac.totalProfit);

        emit LogExerciseOption(
            ownerOf(_params.optionId),
            _params.optionId,
            ac.totalProfit,
            ac.totalAssetRelocked
        );
    }

    /**
     * @notice Settles the given option .
     * @param _params The settle option  parameters.
     */
    function settleOption(
        SettleOptionParams calldata _params
    ) external nonReentrant {
        if (!settlers[msg.sender])
            revert DopexV2OptionMarket__NotApprovedSettler();
        OptionData memory oData = opData[_params.optionId];

        if (oData.opTickArrayLen != _params.liquidityToSettle.length)
            revert DopexV2OptionMarket__ArrayLenMismatch();

        if (block.timestamp <= oData.expiry)
            revert DopexV2OptionMarket__OptionNotExpired();

        bool isAmount0 = oData.isCall
            ? primePool.token0() == callAsset
            : primePool.token0() == putAsset;

        AssetsCache memory ac;

        ac.assetToUse = ERC20(oData.isCall ? callAsset : putAsset);
        ac.assetToGet = ERC20(oData.isCall ? putAsset : callAsset);

        for (uint256 i; i < oData.opTickArrayLen; i++) {
            if (_params.liquidityToSettle[i] == 0) continue;

            OptionTicks storage opTick = opTickMap[_params.optionId][i];

            uint256 liquidityToSettle = _params.liquidityToSettle[i];

            (uint256 amount0, uint256 amount1) = LiquidityAmounts
                .getAmountsForLiquidity(
                    _getCurrentSqrtPriceX96(opTick.pool),
                    opTick.tickLower.getSqrtRatioAtTick(),
                    opTick.tickUpper.getSqrtRatioAtTick(),
                    uint128(liquidityToSettle)
                );

            if (
                (amount0 > 0 && amount1 == 0) || (amount1 > 0 && amount0 == 0)
            ) {
                if (isAmount0 && amount0 > 0) {
                    ac.assetToUse.approve(address(positionManager), amount0);
                } else if (!isAmount0 && amount1 > 0) {
                    ac.assetToUse.approve(address(positionManager), amount1);
                } else {
                    uint256 amountToSwap = isAmount0
                        ? LiquidityAmounts.getAmount0ForLiquidity(
                            opTick.tickLower.getSqrtRatioAtTick(),
                            opTick.tickUpper.getSqrtRatioAtTick(),
                            uint128(liquidityToSettle)
                        )
                        : LiquidityAmounts.getAmount1ForLiquidity(
                            opTick.tickLower.getSqrtRatioAtTick(),
                            opTick.tickUpper.getSqrtRatioAtTick(),
                            uint128(liquidityToSettle)
                        );

                    uint256 prevBalance = ac.assetToGet.balanceOf(
                        address(this)
                    );

                    ac.assetToUse.transfer(
                        address(_params.swapper[i]),
                        amountToSwap
                    );

                    _params.swapper[i].onSwapReceived(
                        address(ac.assetToUse),
                        address(ac.assetToGet),
                        amountToSwap,
                        _params.swapData[i]
                    );

                    uint256 amountReq = isAmount0
                        ? LiquidityAmounts.getAmount1ForLiquidity(
                            opTick.tickLower.getSqrtRatioAtTick(),
                            opTick.tickUpper.getSqrtRatioAtTick(),
                            uint128(liquidityToSettle)
                        )
                        : LiquidityAmounts.getAmount0ForLiquidity(
                            opTick.tickLower.getSqrtRatioAtTick(),
                            opTick.tickUpper.getSqrtRatioAtTick(),
                            uint128(liquidityToSettle)
                        );

                    uint256 currentBalance = ac.assetToGet.balanceOf(
                        address(this)
                    );

                    if (currentBalance < prevBalance + amountReq)
                        revert DopexV2OptionMarket__NotEnoughAfterSwap();

                    ac.assetToGet.approve(address(positionManager), amountReq);

                    ac.assetToGet.transfer(
                        msg.sender,
                        currentBalance - (prevBalance + amountReq)
                    );
                }
            } else {
                if (isAmount0) {
                    ac.assetToUse.approve(address(positionManager), amount0);
                    ac.assetToGet.approve(address(positionManager), amount1);

                    uint256 actualAmount0 = LiquidityAmounts
                        .getAmount0ForLiquidity(
                            opTick.tickLower.getSqrtRatioAtTick(),
                            opTick.tickUpper.getSqrtRatioAtTick(),
                            uint128(liquidityToSettle)
                        );

                    ac.assetToGet.transferFrom(
                        msg.sender,
                        address(this),
                        amount1
                    );

                    ac.assetToUse.transfer(msg.sender, actualAmount0 - amount0);
                } else {
                    ac.assetToUse.approve(address(positionManager), amount1);
                    ac.assetToGet.approve(address(positionManager), amount0);

                    uint256 actualAmount1 = LiquidityAmounts
                        .getAmount1ForLiquidity(
                            opTick.tickLower.getSqrtRatioAtTick(),
                            opTick.tickUpper.getSqrtRatioAtTick(),
                            uint128(liquidityToSettle)
                        );

                    ac.assetToGet.transferFrom(
                        msg.sender,
                        address(this),
                        amount0
                    );

                    ac.assetToUse.transfer(msg.sender, actualAmount1 - amount1);
                }
            }

            bytes memory unusePositionData = abi.encode(
                opTick.pool,
                opTick.hook,
                opTick.tickLower,
                opTick.tickUpper,
                liquidityToSettle,
                abi.encode("")
            );

            positionManager.unusePosition(opTick._handler, unusePositionData);

            opTick.liquidityToUse -= liquidityToSettle;
        }

        emit LogSettleOption(ownerOf(_params.optionId), _params.optionId);
    }

    /**
     * @notice Splits the given option into a new option.
     * @param _params The position splitter parameters.
     */
    function positionSplitter(
        PositionSplitterParams calldata _params
    ) external nonReentrant {
        optionIds += 1;

        if (ownerOf(_params.optionId) != msg.sender)
            revert DopexV2OptionMarket__NotOwnerOrDelegator();
        OptionData memory oData = opData[_params.optionId];

        if (oData.opTickArrayLen != _params.liquidityToSplit.length)
            revert DopexV2OptionMarket__ArrayLenMismatch();

        for (uint256 i; i < _params.liquidityToSplit.length; i++) {
            if (_params.liquidityToSplit[i] == 0)
                revert DopexV2OptionMarket__EmptyOption();
            OptionTicks storage opTick = opTickMap[_params.optionId][i];
            opTick.liquidityToUse -= _params.liquidityToSplit[i];

            opTickMap[optionIds].push(
                OptionTicks({
                    _handler: opTick._handler,
                    pool: opTick.pool,
                    hook: opTick.hook,
                    tickLower: opTick.tickLower,
                    tickUpper: opTick.tickUpper,
                    liquidityToUse: _params.liquidityToSplit[i]
                })
            );
        }

        opData[optionIds] = OptionData({
            opTickArrayLen: _params.liquidityToSplit.length,
            tickLower: oData.tickLower,
            tickUpper: oData.tickUpper,
            expiry: oData.expiry,
            isCall: oData.isCall
        });

        _safeMint(_params.to, optionIds);

        emit LogSplitOption(
            ownerOf(_params.optionId),
            _params.optionId,
            optionIds,
            _params.to
        );
    }

    /**
     * @notice Updates the exercise delegate for the caller's option.
     * @param _delegateTo The address of the new exercise delegate.
     * @param _status The status of the exercise delegate (true to enable, false to disable).
     */
    function updateExerciseDelegate(
        address _delegateTo,
        bool _status
    ) external {
        exerciseDelegator[msg.sender][_delegateTo] = _status;
        emit LogUpdateExerciseDelegate(msg.sender, _delegateTo, _status);
    }

    // internal
    /**
     * @notice Calculates the price per call asset for the given tick.
     * @param _pool The UniswapV3 pool.
     * @param _tick The tick.
     * @return The price per call asset.
     */
    function getPricePerCallAssetViaTick(
        IUniswapV3Pool _pool,
        int24 _tick
    ) public view returns (uint256) {
        uint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(_tick);
        return _getPrice(_pool, sqrtPriceX96);
    }

    /**
     * @notice Calculates the current price per call asset.
     * @param _pool The UniswapV3 pool.
     * @return The current price per call asset.
     */
    function getCurrentPricePerCallAsset(
        IUniswapV3Pool _pool
    ) public view returns (uint256) {
        (, bytes memory result) = address(_pool).staticcall(
            abi.encodeWithSignature("slot0()")
        );
        uint160 sqrtPriceX96 = abi.decode(result, (uint160));
        return _getPrice(_pool, sqrtPriceX96);
    }

    /**
     * @notice Calculates the premium amount for the given option parameters.
     * @param isPut Whether the option is a put or call.
     * @param expiry The expiry of the option.
     * @param strike The strike price of the option.
     * @param lastPrice The last price of the underlying asset.
     * @param amount The amount of the underlying asset.
     * @return The premium amount.
     */
    function getPremiumAmount(
        bool isPut,
        uint expiry,
        uint strike,
        uint lastPrice,
        uint amount
    ) external view returns (uint256) {
        return _getPremiumAmount(isPut, expiry, strike, lastPrice, amount);
    }

    /**
     * @notice Gets the current sqrt price.
     * @param pool The UniswapV3 pool.
     * @return sqrtPriceX96 The current sqrt price.
     */
    function _getCurrentSqrtPriceX96(
        IUniswapV3Pool pool
    ) internal view returns (uint160 sqrtPriceX96) {
        (, bytes memory result) = address(pool).staticcall(
            abi.encodeWithSignature("slot0()")
        );
        sqrtPriceX96 = abi.decode(result, (uint160));
    }

    /**
     * @notice Calculates the premium amount for the given option parameters.
     * @param isPut Whether the option is a put or call.
     * @param expiry The expiry of the option.
     * @param strike The strike price of the option.
     * @param lastPrice The last price of the underlying asset.
     * @param amount The amount of the underlying asset.
     * @return premiumAmount The premium amount.
     */
    function _getPremiumAmount(
        bool isPut,
        uint expiry,
        uint strike,
        uint lastPrice,
        uint amount
    ) internal view returns (uint256 premiumAmount) {
        uint premiumInQuote = (amount *
            optionPricing.getOptionPrice(isPut, expiry, strike, lastPrice)) /
            (isPut ? 10 ** putAssetDecimals : 10 ** callAssetDecimals);

        if (isPut) {
            return premiumInQuote;
        }
        return (premiumInQuote * (10 ** callAssetDecimals)) / lastPrice;
    }

    /**
     * @notice Gets the price per call asset in quote asset units.
     * @param _pool The UniswapV3 pool instance.
     * @param sqrtPriceX96 The sqrt price of the pool.
     * @return price The price per call asset in quote asset units.
     */
    function _getPrice(
        IUniswapV3Pool _pool,
        uint160 sqrtPriceX96
    ) internal view returns (uint256 price) {
        if (sqrtPriceX96 <= type(uint128).max) {
            uint256 priceX192 = uint256(sqrtPriceX96) * sqrtPriceX96;
            price = callAsset == _pool.token0()
                ? FullMath.mulDiv(priceX192, 10 ** callAssetDecimals, 1 << 192)
                : FullMath.mulDiv(1 << 192, 10 ** callAssetDecimals, priceX192);
        } else {
            uint256 priceX128 = FullMath.mulDiv(
                sqrtPriceX96,
                sqrtPriceX96,
                1 << 64
            );

            price = callAsset == _pool.token0()
                ? FullMath.mulDiv(priceX128, 10 ** callAssetDecimals, 1 << 128)
                : FullMath.mulDiv(1 << 128, 10 ** callAssetDecimals, priceX128);
        }
    }

    /**
     * @notice Gets the fee for the option
     * @param amount Amount being withdrawn
     * @param premium Premium being paid for the position
     * @return fee for the option
     */
    function getFee(
        uint256 amount,
        uint256 premium
    ) public view returns (uint256) {
        return dpFee.onFeeReqReceive(address(this), amount, premium);
    }

    // admin

    /**
     * @notice Updates the addresses of the various components of the contract.
     * @param _feeTo The address of the fee recipient.
     * @param _tokeURIFetcher The address of the token URI fetcher.
     * @param _dpFee The address of the Dopex fee contract.
     * @param _optionPricing The address of the option pricing contract.
     * @param _settler The address of the settler.
     * @param _statusSettler Whether the settler is enabled.
     * @param _pool The address of the UniswapV3 pool.
     * @param _statusPools Whether the UniswapV3 pool is enabled.
     * @dev Only the owner can call this function.
     */
    function updateAddress(
        address _feeTo,
        address _tokeURIFetcher,
        address _dpFee,
        address _optionPricing,
        address _settler,
        bool _statusSettler,
        address _pool,
        bool _statusPools
    ) external onlyOwner {
        feeTo = _feeTo;
        tokenURIFetcher = _tokeURIFetcher;
        dpFee = IDopexV2ClammFeeStrategyV2(_dpFee);
        optionPricing = IOptionPricingV2(_optionPricing);
        settlers[_settler] = _statusSettler;
        approvedPools[_pool] = _statusPools;

        IUniswapV3Pool pool = IUniswapV3Pool(_pool);
        if (pool.token0() != callAsset && pool.token1() != callAsset)
            revert DopexV2OptionMarket__InvalidPool();
        if (pool.token0() != putAsset && pool.token1() != putAsset)
            revert DopexV2OptionMarket__InvalidPool();

        emit LogUpdateAddress(_tokeURIFetcher, _dpFee, _optionPricing);
    }

    // SOS admin functions
    /**
     * @notice Performs an emergency withdraw of all tokens from the contract.
     * @param token The address of the token to withdraw.
     * @dev Only the owner can call this function.
     */
    function emergencyWithdraw(address token) external onlyOwner {
        ERC20(token).transfer(
            msg.sender,
            ERC20(token).balanceOf(address(this))
        );
    }
}

File 2 of 28 : IDopexV2PositionManager.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {IHandler} from "./IHandler.sol";

interface IDopexV2PositionManager {
    function mintPosition(
        IHandler _handler,
        bytes calldata _mintPositionData
    ) external returns (uint256 sharesMinted);

    function burnPosition(
        IHandler _handler,
        bytes calldata _burnPositionData
    ) external returns (uint256 sharesBurned);

    function usePosition(
        IHandler _handler,
        bytes calldata _usePositionData
    )
        external
        returns (
            address[] memory tokens,
            uint256[] memory amounts,
            uint256 liquidityUsed
        );

    function unusePosition(
        IHandler _handler,
        bytes calldata _unusePositionData
    ) external returns (uint256[] memory amounts, uint256 liquidity);

    function donateToPosition(
        IHandler _handler,
        bytes calldata _donatePosition
    ) external returns (uint256[] memory amounts, uint256 liquidity);
}

File 3 of 28 : IOptionPricingV2.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IOptionPricingV2 {
    function getOptionPrice(
        bool isPut,
        uint256 expiry,
        uint256 strike,
        uint256 lastPrice
    ) external view returns (uint256);
}

File 4 of 28 : IHandler.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IHandler {
    function getHandlerIdentifier(
        bytes calldata _data
    ) external view returns (uint256 handlerIdentifierId);

    function tokensToPullForMint(
        bytes calldata _mintPositionData
    ) external view returns (address[] memory tokens, uint256[] memory amounts);

    function mintPositionHandler(
        address context,
        bytes calldata _mintPositionData
    ) external returns (uint256 sharesMinted);

    function burnPositionHandler(
        address context,
        bytes calldata _burnPositionData
    ) external returns (uint256 sharesBurned);

    function usePositionHandler(
        bytes calldata _usePositionData
    )
        external
        returns (
            address[] memory tokens,
            uint256[] memory amounts,
            uint256 liquidityUsed
        );

    function tokensToPullForUnUse(
        bytes calldata _unusePositionData
    ) external view returns (address[] memory tokens, uint256[] memory amounts);

    function unusePositionHandler(
        bytes calldata _unusePositionData
    ) external returns (uint256[] memory amounts, uint256 liquidity);

    function donateToPosition(
        bytes calldata _donatePosition
    ) external returns (uint256[] memory amounts, uint256 liquidity);

    function tokensToPullForDonate(
        bytes calldata _donatePosition
    ) external view returns (address[] memory tokens, uint256[] memory amounts);
}

File 5 of 28 : IDopexV2ClammFeeStrategyV2.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface IDopexV2ClammFeeStrategyV2 {
    /// @notice Computes the fee for an option purchase on Dopex V2 CLAMM
    /// @param _optionMarket Address of the option market
    /// @param _amount Notional Amount
    /// @param _premium Total premium being charged for the option purchase
    /// @return fee the computed fee
    function onFeeReqReceive(
        address _optionMarket,
        uint256 _amount,
        uint256 _premium
    ) external view returns (uint256 fee);
}

File 6 of 28 : ISwapper.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface ISwapper {
    function onSwapReceived(
        address _tokenIn,
        address _tokenOut,
        uint256 _amountIn,
        bytes calldata _swapData
    ) external returns (uint256 amountOut);
}

File 7 of 28 : ITokenURIFetcher.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

interface ITokenURIFetcher {
    function onFetchTokenURIData(
        uint256 id
    ) external view returns (string memory);
}

File 8 of 28 : ERC721.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

/// @notice Simple ERC721 implementation with storage hitchhiking.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC721.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC721/ERC721.sol)
///
/// @dev Note:
/// - The ERC721 standard allows for self-approvals.
///   For performance, this implementation WILL NOT revert for such actions.
///   Please add any checks with overrides if desired.
/// - For performance, methods are made payable where permitted by the ERC721 standard.
/// - The `safeTransfer` functions use the identity precompile (0x4)
///   to copy memory internally.
///
/// If you are overriding:
/// - NEVER violate the ERC721 invariant:
///   the balance of an owner MUST always be equal to their number of ownership slots.
///   The transfer functions do not have an underflow guard for user token balances.
/// - Make sure all variables written to storage are properly cleaned
//    (e.g. the bool value for `isApprovedForAll` MUST be either 1 or 0 under the hood).
/// - Check that the overridden function is actually used in the function you want to
///   change the behavior of. Much of the code has been manually inlined for performance.
abstract contract ERC721 {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev An account can hold up to 4294967295 tokens.
    uint256 internal constant _MAX_ACCOUNT_BALANCE = 0xffffffff;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Only the token owner or an approved account can manage the token.
    error NotOwnerNorApproved();

    /// @dev The token does not exist.
    error TokenDoesNotExist();

    /// @dev The token already exists.
    error TokenAlreadyExists();

    /// @dev Cannot query the balance for the zero address.
    error BalanceQueryForZeroAddress();

    /// @dev Cannot mint or transfer to the zero address.
    error TransferToZeroAddress();

    /// @dev The token must be owned by `from`.
    error TransferFromIncorrectOwner();

    /// @dev The recipient's balance has overflowed.
    error AccountBalanceOverflow();

    /// @dev Cannot safely transfer to a contract that does not implement
    /// the ERC721Receiver interface.
    error TransferToNonERC721ReceiverImplementer();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                           EVENTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Emitted when token `id` is transferred from `from` to `to`.
    event Transfer(
        address indexed from,
        address indexed to,
        uint256 indexed id
    );

    /// @dev Emitted when `owner` enables `account` to manage the `id` token.
    event Approval(
        address indexed owner,
        address indexed account,
        uint256 indexed id
    );

    /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool isApproved
    );

    /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`.
    uint256 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`.
    uint256 private constant _APPROVAL_EVENT_SIGNATURE =
        0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;

    /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`.
    uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =
        0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ownership data slot of `id` is given by:
    /// ```
    ///     mstore(0x00, id)
    ///     mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
    ///     let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
    /// ```
    /// Bits Layout:
    /// - [0..159]   `addr`
    /// - [160..255] `extraData`
    ///
    /// The approved address slot is given by: `add(1, ownershipSlot)`.
    ///
    /// See: https://notes.ethereum.org/%40vbuterin/verkle_tree_eip
    ///
    /// The balance slot of `owner` is given by:
    /// ```
    ///     mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
    ///     mstore(0x00, owner)
    ///     let balanceSlot := keccak256(0x0c, 0x1c)
    /// ```
    /// Bits Layout:
    /// - [0..31]   `balance`
    /// - [32..255] `aux`
    ///
    /// The `operator` approval slot of `owner` is given by:
    /// ```
    ///     mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, operator))
    ///     mstore(0x00, owner)
    ///     let operatorApprovalSlot := keccak256(0x0c, 0x30)
    /// ```
    uint256 private constant _ERC721_MASTER_SLOT_SEED =
        0x7d8825530a5a2e7a << 192;

    /// @dev Pre-shifted and pre-masked constant.
    uint256 private constant _ERC721_MASTER_SLOT_SEED_MASKED =
        0x0a5a2e7a00000000;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                      ERC721 METADATA                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the token collection name.
    function name() public view virtual returns (string memory);

    /// @dev Returns the token collection symbol.
    function symbol() public view virtual returns (string memory);

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id`.
    function tokenURI(uint256 id) public view virtual returns (string memory);

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                           ERC721                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the owner of token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function ownerOf(uint256 id) public view virtual returns (address result) {
        result = _ownerOf(id);
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(result) {
                mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Returns the number of tokens owned by `owner`.
    ///
    /// Requirements:
    /// - `owner` must not be the zero address.
    function balanceOf(
        address owner
    ) public view virtual returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            // Revert if the `owner` is the zero address.
            if iszero(owner) {
                mstore(0x00, 0x8f4eb604) // `BalanceQueryForZeroAddress()`.
                revert(0x1c, 0x04)
            }
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            mstore(0x00, owner)
            result := and(sload(keccak256(0x0c, 0x1c)), _MAX_ACCOUNT_BALANCE)
        }
    }

    /// @dev Returns the account approved to manage token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function getApproved(
        uint256 id
    ) public view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            if iszero(shl(96, sload(ownershipSlot))) {
                mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                revert(0x1c, 0x04)
            }
            result := sload(add(1, ownershipSlot))
        }
    }

    /// @dev Sets `account` as the approved account to manage token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    /// - The caller must be the owner of the token,
    ///   or an approved operator for the token owner.
    ///
    /// Emits an {Approval} event.
    function approve(address account, uint256 id) public payable virtual {
        _approve(msg.sender, account, id);
    }

    /// @dev Returns whether `operator` is approved to manage the tokens of `owner`.
    function isApprovedForAll(
        address owner,
        address operator
    ) public view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x1c, operator)
            mstore(0x08, _ERC721_MASTER_SLOT_SEED_MASKED)
            mstore(0x00, owner)
            result := sload(keccak256(0x0c, 0x30))
        }
    }

    /// @dev Sets whether `operator` is approved to manage the tokens of the caller.
    ///
    /// Emits an {ApprovalForAll} event.
    function setApprovalForAll(
        address operator,
        bool isApproved
    ) public virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Convert to 0 or 1.
            isApproved := iszero(iszero(isApproved))
            // Update the `isApproved` for (`msg.sender`, `operator`).
            mstore(0x1c, operator)
            mstore(0x08, _ERC721_MASTER_SLOT_SEED_MASKED)
            mstore(0x00, caller())
            sstore(keccak256(0x0c, 0x30), isApproved)
            // Emit the {ApprovalForAll} event.
            mstore(0x00, isApproved)
            // forgefmt: disable-next-item
            log3(
                0x00,
                0x20,
                _APPROVAL_FOR_ALL_EVENT_SIGNATURE,
                caller(),
                shr(96, shl(96, operator))
            )
        }
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function transferFrom(
        address from,
        address to,
        uint256 id
    ) public payable virtual {
        _beforeTokenTransfer(from, to, id);
        /// @solidity memory-safe-assembly
        assembly {
            // Clear the upper 96 bits.
            let bitmaskAddress := shr(96, not(0))
            from := and(bitmaskAddress, from)
            to := and(bitmaskAddress, to)
            // Load the ownership data.
            mstore(0x00, id)
            mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, caller()))
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let ownershipPacked := sload(ownershipSlot)
            let owner := and(bitmaskAddress, ownershipPacked)
            // Revert if `from` is not the owner, or does not exist.
            if iszero(mul(owner, eq(owner, from))) {
                if iszero(owner) {
                    mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                    revert(0x1c, 0x04)
                }
                mstore(0x00, 0xa1148100) // `TransferFromIncorrectOwner()`.
                revert(0x1c, 0x04)
            }
            // Revert if `to` is the zero address.
            if iszero(to) {
                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.
                revert(0x1c, 0x04)
            }
            // Load, check, and update the token approval.
            {
                mstore(0x00, from)
                let approvedAddress := sload(add(1, ownershipSlot))
                // Revert if the caller is not the owner, nor approved.
                if iszero(
                    or(eq(caller(), from), eq(caller(), approvedAddress))
                ) {
                    if iszero(sload(keccak256(0x0c, 0x30))) {
                        mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.
                        revert(0x1c, 0x04)
                    }
                }
                // Delete the approved address if any.
                if approvedAddress {
                    sstore(add(1, ownershipSlot), 0)
                }
            }
            // Update with the new owner.
            sstore(ownershipSlot, xor(ownershipPacked, xor(from, to)))
            // Decrement the balance of `from`.
            {
                let fromBalanceSlot := keccak256(0x0c, 0x1c)
                sstore(fromBalanceSlot, sub(sload(fromBalanceSlot), 1))
            }
            // Increment the balance of `to`.
            {
                mstore(0x00, to)
                let toBalanceSlot := keccak256(0x0c, 0x1c)
                let toBalanceSlotPacked := add(sload(toBalanceSlot), 1)
                if iszero(and(toBalanceSlotPacked, _MAX_ACCOUNT_BALANCE)) {
                    mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.
                    revert(0x1c, 0x04)
                }
                sstore(toBalanceSlot, toBalanceSlotPacked)
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)
        }
        _afterTokenTransfer(from, to, id);
    }

    /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`.
    function safeTransferFrom(
        address from,
        address to,
        uint256 id
    ) public payable virtual {
        transferFrom(from, to, id);
        if (_hasCode(to)) _checkOnERC721Received(from, to, id, "");
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    /// - If `to` refers to a smart contract, it must implement
    ///   {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
    ///
    /// Emits a {Transfer} event.
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        bytes calldata data
    ) public payable virtual {
        transferFrom(from, to, id);
        if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);
    }

    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.
    /// See: https://eips.ethereum.org/EIPS/eip-165
    /// This function call must use less than 30000 gas.
    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f.
            result := or(
                or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)),
                eq(s, 0x5b5e139f)
            )
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  INTERNAL QUERY FUNCTIONS                  */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns if token `id` exists.
    function _exists(uint256 id) internal view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            result := iszero(
                iszero(shl(96, sload(add(id, add(id, keccak256(0x00, 0x20))))))
            )
        }
    }

    /// @dev Returns the owner of token `id`.
    /// Returns the zero address instead of reverting if the token does not exist.
    function _ownerOf(
        uint256 id
    ) internal view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            result := shr(
                96,
                shl(96, sload(add(id, add(id, keccak256(0x00, 0x20)))))
            )
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*            INTERNAL DATA HITCHHIKING FUNCTIONS             */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // For performance, no events are emitted for the hitchhiking setters.
    // Please emit your own events if required.

    /// @dev Returns the auxiliary data for `owner`.
    /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.
    /// Auxiliary data can be set for any address, even if it does not have any tokens.
    function _getAux(
        address owner
    ) internal view virtual returns (uint224 result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            mstore(0x00, owner)
            result := shr(32, sload(keccak256(0x0c, 0x1c)))
        }
    }

    /// @dev Set the auxiliary data for `owner` to `value`.
    /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.
    /// Auxiliary data can be set for any address, even if it does not have any tokens.
    function _setAux(address owner, uint224 value) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            mstore(0x00, owner)
            let balanceSlot := keccak256(0x0c, 0x1c)
            let packed := sload(balanceSlot)
            sstore(
                balanceSlot,
                xor(packed, shl(32, xor(value, shr(32, packed))))
            )
        }
    }

    /// @dev Returns the extra data for token `id`.
    /// Minting, transferring, burning a token will not change the extra data.
    /// The extra data can be set on a non-existent token.
    function _getExtraData(
        uint256 id
    ) internal view virtual returns (uint96 result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            result := shr(160, sload(add(id, add(id, keccak256(0x00, 0x20)))))
        }
    }

    /// @dev Sets the extra data for token `id` to `value`.
    /// Minting, transferring, burning a token will not change the extra data.
    /// The extra data can be set on a non-existent token.
    function _setExtraData(uint256 id, uint96 value) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let packed := sload(ownershipSlot)
            sstore(
                ownershipSlot,
                xor(packed, shl(160, xor(value, shr(160, packed))))
            )
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  INTERNAL MINT FUNCTIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Mints token `id` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must not exist.
    /// - `to` cannot be the zero address.
    ///
    /// Emits a {Transfer} event.
    function _mint(address to, uint256 id) internal virtual {
        _beforeTokenTransfer(address(0), to, id);
        /// @solidity memory-safe-assembly
        assembly {
            // Clear the upper 96 bits.
            to := shr(96, shl(96, to))
            // Revert if `to` is the zero address.
            if iszero(to) {
                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.
                revert(0x1c, 0x04)
            }
            // Load the ownership data.
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let ownershipPacked := sload(ownershipSlot)
            // Revert if the token already exists.
            if shl(96, ownershipPacked) {
                mstore(0x00, 0xc991cbb1) // `TokenAlreadyExists()`.
                revert(0x1c, 0x04)
            }
            // Update with the owner.
            sstore(ownershipSlot, or(ownershipPacked, to))
            // Increment the balance of the owner.
            {
                mstore(0x00, to)
                let balanceSlot := keccak256(0x0c, 0x1c)
                let balanceSlotPacked := add(sload(balanceSlot), 1)
                if iszero(and(balanceSlotPacked, _MAX_ACCOUNT_BALANCE)) {
                    mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.
                    revert(0x1c, 0x04)
                }
                sstore(balanceSlot, balanceSlotPacked)
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, 0, to, id)
        }
        _afterTokenTransfer(address(0), to, id);
    }

    /// @dev Equivalent to `_safeMint(to, id, "")`.
    function _safeMint(address to, uint256 id) internal virtual {
        _safeMint(to, id, "");
    }

    /// @dev Mints token `id` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must not exist.
    /// - `to` cannot be the zero address.
    /// - If `to` refers to a smart contract, it must implement
    ///   {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
    ///
    /// Emits a {Transfer} event.
    function _safeMint(
        address to,
        uint256 id,
        bytes memory data
    ) internal virtual {
        _mint(to, id);
        if (_hasCode(to)) _checkOnERC721Received(address(0), to, id, data);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  INTERNAL BURN FUNCTIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Equivalent to `_burn(address(0), id)`.
    function _burn(uint256 id) internal virtual {
        _burn(address(0), id);
    }

    /// @dev Destroys token `id`, using `by`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - If `by` is not the zero address,
    ///   it must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function _burn(address by, uint256 id) internal virtual {
        address owner = ownerOf(id);
        _beforeTokenTransfer(owner, address(0), id);
        /// @solidity memory-safe-assembly
        assembly {
            // Clear the upper 96 bits.
            by := shr(96, shl(96, by))
            // Load the ownership data.
            mstore(0x00, id)
            mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, by))
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let ownershipPacked := sload(ownershipSlot)
            // Reload the owner in case it is changed in `_beforeTokenTransfer`.
            owner := shr(96, shl(96, ownershipPacked))
            // Revert if the token does not exist.
            if iszero(owner) {
                mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                revert(0x1c, 0x04)
            }
            // Load and check the token approval.
            {
                mstore(0x00, owner)
                let approvedAddress := sload(add(1, ownershipSlot))
                // If `by` is not the zero address, do the authorization check.
                // Revert if the `by` is not the owner, nor approved.
                if iszero(
                    or(iszero(by), or(eq(by, owner), eq(by, approvedAddress)))
                ) {
                    if iszero(sload(keccak256(0x0c, 0x30))) {
                        mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.
                        revert(0x1c, 0x04)
                    }
                }
                // Delete the approved address if any.
                if approvedAddress {
                    sstore(add(1, ownershipSlot), 0)
                }
            }
            // Clear the owner.
            sstore(ownershipSlot, xor(ownershipPacked, owner))
            // Decrement the balance of `owner`.
            {
                let balanceSlot := keccak256(0x0c, 0x1c)
                sstore(balanceSlot, sub(sload(balanceSlot), 1))
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, owner, 0, id)
        }
        _afterTokenTransfer(owner, address(0), id);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                INTERNAL APPROVAL FUNCTIONS                 */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns whether `account` is the owner of token `id`, or is approved to manage it.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function _isApprovedOrOwner(
        address account,
        uint256 id
    ) internal view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            // Clear the upper 96 bits.
            account := shr(96, shl(96, account))
            // Load the ownership data.
            mstore(0x00, id)
            mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, account))
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let owner := shr(96, shl(96, sload(ownershipSlot)))
            // Revert if the token does not exist.
            if iszero(owner) {
                mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                revert(0x1c, 0x04)
            }
            // Check if `account` is the `owner`.
            if iszero(eq(account, owner)) {
                mstore(0x00, owner)
                // Check if `account` is approved to manage the token.
                if iszero(sload(keccak256(0x0c, 0x30))) {
                    result := eq(account, sload(add(1, ownershipSlot)))
                }
            }
        }
    }

    /// @dev Returns the account approved to manage token `id`.
    /// Returns the zero address instead of reverting if the token does not exist.
    function _getApproved(
        uint256 id
    ) internal view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, id)
            mstore(0x1c, _ERC721_MASTER_SLOT_SEED)
            result := sload(add(1, add(id, add(id, keccak256(0x00, 0x20)))))
        }
    }

    /// @dev Equivalent to `_approve(address(0), account, id)`.
    function _approve(address account, uint256 id) internal virtual {
        _approve(address(0), account, id);
    }

    /// @dev Sets `account` as the approved account to manage token `id`, using `by`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    /// - If `by` is not the zero address, `by` must be the owner
    ///   or an approved operator for the token owner.
    ///
    /// Emits a {Transfer} event.
    function _approve(
        address by,
        address account,
        uint256 id
    ) internal virtual {
        assembly {
            // Clear the upper 96 bits.
            let bitmaskAddress := shr(96, not(0))
            account := and(bitmaskAddress, account)
            by := and(bitmaskAddress, by)
            // Load the owner of the token.
            mstore(0x00, id)
            mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, by))
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let owner := and(bitmaskAddress, sload(ownershipSlot))
            // Revert if the token does not exist.
            if iszero(owner) {
                mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                revert(0x1c, 0x04)
            }
            // If `by` is not the zero address, do the authorization check.
            // Revert if `by` is not the owner, nor approved.
            if iszero(or(iszero(by), eq(by, owner))) {
                mstore(0x00, owner)
                if iszero(sload(keccak256(0x0c, 0x30))) {
                    mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.
                    revert(0x1c, 0x04)
                }
            }
            // Sets `account` as the approved account to manage `id`.
            sstore(add(1, ownershipSlot), account)
            // Emit the {Approval} event.
            log4(
                codesize(),
                0x00,
                _APPROVAL_EVENT_SIGNATURE,
                owner,
                account,
                id
            )
        }
    }

    /// @dev Approve or remove the `operator` as an operator for `by`,
    /// without authorization checks.
    ///
    /// Emits an {ApprovalForAll} event.
    function _setApprovalForAll(
        address by,
        address operator,
        bool isApproved
    ) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Clear the upper 96 bits.
            by := shr(96, shl(96, by))
            operator := shr(96, shl(96, operator))
            // Convert to 0 or 1.
            isApproved := iszero(iszero(isApproved))
            // Update the `isApproved` for (`by`, `operator`).
            mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, operator))
            mstore(0x00, by)
            sstore(keccak256(0x0c, 0x30), isApproved)
            // Emit the {ApprovalForAll} event.
            mstore(0x00, isApproved)
            log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, by, operator)
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                INTERNAL TRANSFER FUNCTIONS                 */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Equivalent to `_transfer(address(0), from, to, id)`.
    function _transfer(address from, address to, uint256 id) internal virtual {
        _transfer(address(0), from, to, id);
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - If `by` is not the zero address,
    ///   it must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function _transfer(
        address by,
        address from,
        address to,
        uint256 id
    ) internal virtual {
        _beforeTokenTransfer(from, to, id);
        /// @solidity memory-safe-assembly
        assembly {
            // Clear the upper 96 bits.
            let bitmaskAddress := shr(96, not(0))
            from := and(bitmaskAddress, from)
            to := and(bitmaskAddress, to)
            by := and(bitmaskAddress, by)
            // Load the ownership data.
            mstore(0x00, id)
            mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, by))
            let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))
            let ownershipPacked := sload(ownershipSlot)
            let owner := and(bitmaskAddress, ownershipPacked)
            // Revert if `from` is not the owner, or does not exist.
            if iszero(mul(owner, eq(owner, from))) {
                if iszero(owner) {
                    mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.
                    revert(0x1c, 0x04)
                }
                mstore(0x00, 0xa1148100) // `TransferFromIncorrectOwner()`.
                revert(0x1c, 0x04)
            }
            // Revert if `to` is the zero address.
            if iszero(to) {
                mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.
                revert(0x1c, 0x04)
            }
            // Load, check, and update the token approval.
            {
                mstore(0x00, from)
                let approvedAddress := sload(add(1, ownershipSlot))
                // If `by` is not the zero address, do the authorization check.
                // Revert if the `by` is not the owner, nor approved.
                if iszero(
                    or(iszero(by), or(eq(by, from), eq(by, approvedAddress)))
                ) {
                    if iszero(sload(keccak256(0x0c, 0x30))) {
                        mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.
                        revert(0x1c, 0x04)
                    }
                }
                // Delete the approved address if any.
                if approvedAddress {
                    sstore(add(1, ownershipSlot), 0)
                }
            }
            // Update with the new owner.
            sstore(ownershipSlot, xor(ownershipPacked, xor(from, to)))
            // Decrement the balance of `from`.
            {
                let fromBalanceSlot := keccak256(0x0c, 0x1c)
                sstore(fromBalanceSlot, sub(sload(fromBalanceSlot), 1))
            }
            // Increment the balance of `to`.
            {
                mstore(0x00, to)
                let toBalanceSlot := keccak256(0x0c, 0x1c)
                let toBalanceSlotPacked := add(sload(toBalanceSlot), 1)
                if iszero(and(toBalanceSlotPacked, _MAX_ACCOUNT_BALANCE)) {
                    mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.
                    revert(0x1c, 0x04)
                }
                sstore(toBalanceSlot, toBalanceSlotPacked)
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)
        }
        _afterTokenTransfer(from, to, id);
    }

    /// @dev Equivalent to `_safeTransfer(from, to, id, "")`.
    function _safeTransfer(
        address from,
        address to,
        uint256 id
    ) internal virtual {
        _safeTransfer(from, to, id, "");
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    /// - If `to` refers to a smart contract, it must implement
    ///   {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
    ///
    /// Emits a {Transfer} event.
    function _safeTransfer(
        address from,
        address to,
        uint256 id,
        bytes memory data
    ) internal virtual {
        _transfer(address(0), from, to, id);
        if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);
    }

    /// @dev Equivalent to `_safeTransfer(by, from, to, id, "")`.
    function _safeTransfer(
        address by,
        address from,
        address to,
        uint256 id
    ) internal virtual {
        _safeTransfer(by, from, to, id, "");
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - If `by` is not the zero address,
    ///   it must be the owner of the token, or be approved to manage the token.
    /// - If `to` refers to a smart contract, it must implement
    ///   {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
    ///
    /// Emits a {Transfer} event.
    function _safeTransfer(
        address by,
        address from,
        address to,
        uint256 id,
        bytes memory data
    ) internal virtual {
        _transfer(by, from, to, id);
        if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                    HOOKS FOR OVERRIDING                    */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Hook that is called before any token transfers, including minting and burning.
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 id
    ) internal virtual {}

    /// @dev Hook that is called after any token transfers, including minting and burning.
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 id
    ) internal virtual {}

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                      PRIVATE HELPERS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns if `a` has bytecode of non-zero length.
    function _hasCode(address a) private view returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := extcodesize(a) // Can handle dirty upper bits.
        }
    }

    /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`.
    /// Reverts if the target does not support the function correctly.
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 id,
        bytes memory data
    ) private {
        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the calldata.
            let m := mload(0x40)
            let onERC721ReceivedSelector := 0x150b7a02
            mstore(m, onERC721ReceivedSelector)
            mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`.
            mstore(add(m, 0x40), shr(96, shl(96, from)))
            mstore(add(m, 0x60), id)
            mstore(add(m, 0x80), 0x80)
            let n := mload(data)
            mstore(add(m, 0xa0), n)
            if n {
                pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n))
            }
            // Revert if the call reverts.
            if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) {
                if returndatasize() {
                    // Bubble up the revert if the call reverts.
                    returndatacopy(m, 0x00, returndatasize())
                    revert(m, returndatasize())
                }
            }
            // Load the returndata and compare it.
            if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) {
                mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`.
                revert(0x1c, 0x04)
            }
        }
    }
}

File 9 of 28 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead 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, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override 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 default value returned by this function, unless
     * it's overridden.
     *
     * 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 virtual override returns (uint8) {
        return 18;
    }

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

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

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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:
     *
     * - `account` 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 += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(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);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @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 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 {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}

File 10 of 28 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 11 of 28 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 12 of 28 : Multicall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

import "./Address.sol";

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
abstract contract Multicall {
    /**
     * @dev Receives and executes a batch of function calls on this contract.
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            results[i] = Address.functionDelegateCall(address(this), data[i]);
        }
        return results;
    }
}

File 13 of 28 : IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {IUniswapV3PoolImmutables} from './pool/IUniswapV3PoolImmutables.sol';
import {IUniswapV3PoolState} from './pool/IUniswapV3PoolState.sol';
import {IUniswapV3PoolDerivedState} from './pool/IUniswapV3PoolDerivedState.sol';
import {IUniswapV3PoolActions} from './pool/IUniswapV3PoolActions.sol';
import {IUniswapV3PoolOwnerActions} from './pool/IUniswapV3PoolOwnerActions.sol';
import {IUniswapV3PoolErrors} from './pool/IUniswapV3PoolErrors.sol';
import {IUniswapV3PoolEvents} from './pool/IUniswapV3PoolEvents.sol';

/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
    IUniswapV3PoolImmutables,
    IUniswapV3PoolState,
    IUniswapV3PoolDerivedState,
    IUniswapV3PoolActions,
    IUniswapV3PoolOwnerActions,
    IUniswapV3PoolErrors,
    IUniswapV3PoolEvents
{

}

File 14 of 28 : LiquidityAmounts.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import '@uniswap/v3-core/contracts/libraries/FullMath.sol';
import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol';

/// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices
library LiquidityAmounts {
    /// @notice Downcasts uint256 to uint128
    /// @param x The uint258 to be downcasted
    /// @return y The passed value, downcasted to uint128
    function toUint128(uint256 x) private pure returns (uint128 y) {
        require((y = uint128(x)) == x);
    }

    /// @notice Computes the amount of liquidity received for a given amount of token0 and price range
    /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower))
    /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
    /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
    /// @param amount0 The amount0 being sent in
    /// @return liquidity The amount of returned liquidity
    function getLiquidityForAmount0(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount0
    ) internal pure returns (uint128 liquidity) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
        uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);
        unchecked {
            return toUint128(FullMath.mulDiv(amount0, intermediate, sqrtRatioBX96 - sqrtRatioAX96));
        }
    }

    /// @notice Computes the amount of liquidity received for a given amount of token1 and price range
    /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).
    /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
    /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
    /// @param amount1 The amount1 being sent in
    /// @return liquidity The amount of returned liquidity
    function getLiquidityForAmount1(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount1
    ) internal pure returns (uint128 liquidity) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
        unchecked {
            return toUint128(FullMath.mulDiv(amount1, FixedPoint96.Q96, sqrtRatioBX96 - sqrtRatioAX96));
        }
    }

    /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current
    /// pool prices and the prices at the tick boundaries
    /// @param sqrtRatioX96 A sqrt price representing the current pool prices
    /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
    /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
    /// @param amount0 The amount of token0 being sent in
    /// @param amount1 The amount of token1 being sent in
    /// @return liquidity The maximum amount of liquidity received
    function getLiquidityForAmounts(
        uint160 sqrtRatioX96,
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount0,
        uint256 amount1
    ) internal pure returns (uint128 liquidity) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        if (sqrtRatioX96 <= sqrtRatioAX96) {
            liquidity = getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0);
        } else if (sqrtRatioX96 < sqrtRatioBX96) {
            uint128 liquidity0 = getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);
            uint128 liquidity1 = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);

            liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;
        } else {
            liquidity = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1);
        }
    }

    /// @notice Computes the amount of token0 for a given amount of liquidity and a price range
    /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
    /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
    /// @param liquidity The liquidity being valued
    /// @return amount0 The amount of token0
    function getAmount0ForLiquidity(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity
    ) internal pure returns (uint256 amount0) {
        unchecked {
            if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

            return
                FullMath.mulDiv(
                    uint256(liquidity) << FixedPoint96.RESOLUTION,
                    sqrtRatioBX96 - sqrtRatioAX96,
                    sqrtRatioBX96
                ) / sqrtRatioAX96;
        }
    }

    /// @notice Computes the amount of token1 for a given amount of liquidity and a price range
    /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
    /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
    /// @param liquidity The liquidity being valued
    /// @return amount1 The amount of token1
    function getAmount1ForLiquidity(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity
    ) internal pure returns (uint256 amount1) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        unchecked {
            return FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96);
        }
    }

    /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current
    /// pool prices and the prices at the tick boundaries
    /// @param sqrtRatioX96 A sqrt price representing the current pool prices
    /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary
    /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary
    /// @param liquidity The liquidity being valued
    /// @return amount0 The amount of token0
    /// @return amount1 The amount of token1
    function getAmountsForLiquidity(
        uint160 sqrtRatioX96,
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity
    ) internal pure returns (uint256 amount0, uint256 amount1) {
        if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        if (sqrtRatioX96 <= sqrtRatioAX96) {
            amount0 = getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity);
        } else if (sqrtRatioX96 < sqrtRatioBX96) {
            amount0 = getAmount0ForLiquidity(sqrtRatioX96, sqrtRatioBX96, liquidity);
            amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioX96, liquidity);
        } else {
            amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity);
        }
    }
}

File 15 of 28 : TickMath.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^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 {
    error T();
    error R();

    /// @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) {
        unchecked {
            uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
            if (absTick > uint256(int256(MAX_TICK))) revert 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) {
        unchecked {
            // second inequality must be < because the price can never reach the price at the max tick
            if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert 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;
        }
    }
}

File 16 of 28 : FullMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^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) {
        unchecked {
            // 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 = (0 - 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) {
        unchecked {
            result = mulDiv(a, b, denominator);
            if (mulmod(a, b, denominator) > 0) {
                require(result < type(uint256).max);
                result++;
            }
        }
    }
}

File 17 of 28 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

File 18 of 28 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 19 of 28 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.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 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 20 of 28 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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");

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 21 of 28 : 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);
}

File 22 of 28 : 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
    /// @return 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.
    /// @return observationIndex The index of the last oracle observation that was written,
    /// @return observationCardinality The current maximum number of observations stored in the pool,
    /// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// @return 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
    /// @return The liquidity at the current price of the pool
    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
    /// @return liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// @return feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// @return feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// @return tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// @return secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// @return 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,
    /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// @return 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,
    /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// @return 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
        );
}

File 23 of 28 : IUniswapV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
    /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
    /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
    /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
    /// you must call it with secondsAgos = [3600, 0].
    /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
    /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
    /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
    /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
    /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
    /// timestamp
    function observe(uint32[] calldata secondsAgos)
        external
        view
        returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);

    /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
    /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
    /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
    /// snapshot is taken and the second snapshot is taken.
    /// @param tickLower The lower tick of the range
    /// @param tickUpper The upper tick of the range
    /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
    /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
    /// @return secondsInside The snapshot of seconds per liquidity for the range
    function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
        external
        view
        returns (
            int56 tickCumulativeInside,
            uint160 secondsPerLiquidityInsideX128,
            uint32 secondsInside
        );
}

File 24 of 28 : 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;
}

File 25 of 28 : IUniswapV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
    /// @notice Set the denominator of the protocol's % share of the fees
    /// @param feeProtocol0 new protocol fee for token0 of the pool
    /// @param feeProtocol1 new protocol fee for token1 of the pool
    function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;

    /// @notice Collect the protocol fee accrued to the pool
    /// @param recipient The address to which collected protocol fees should be sent
    /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
    /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
    /// @return amount0 The protocol fee collected in token0
    /// @return amount1 The protocol fee collected in token1
    function collectProtocol(
        address recipient,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);
}

File 26 of 28 : IUniswapV3PoolErrors.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Errors emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolErrors {
    error LOK();
    error TLU();
    error TLM();
    error TUM();
    error AI();
    error M0();
    error M1();
    error AS();
    error IIA();
    error L();
    error F0();
    error F1();
}

File 27 of 28 : IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
    /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
    /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
    /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
    /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
    event Initialize(uint160 sqrtPriceX96, int24 tick);

    /// @notice Emitted when liquidity is minted for a given position
    /// @param sender The address that minted the liquidity
    /// @param owner The owner of the position and recipient of any minted liquidity
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity minted to the position range
    /// @param amount0 How much token0 was required for the minted liquidity
    /// @param amount1 How much token1 was required for the minted liquidity
    event Mint(
        address sender,
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted when fees are collected by the owner of a position
    /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
    /// @param owner The owner of the position for which fees are collected
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount0 The amount of token0 fees collected
    /// @param amount1 The amount of token1 fees collected
    event Collect(
        address indexed owner,
        address recipient,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount0,
        uint128 amount1
    );

    /// @notice Emitted when a position's liquidity is removed
    /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
    /// @param owner The owner of the position for which liquidity is removed
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity to remove
    /// @param amount0 The amount of token0 withdrawn
    /// @param amount1 The amount of token1 withdrawn
    event Burn(
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted by the pool for any swaps between token0 and token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the output of the swap
    /// @param amount0 The delta of the token0 balance of the pool
    /// @param amount1 The delta of the token1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of price of the pool after the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );

    /// @notice Emitted by the pool for any flashes of token0/token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the tokens from flash
    /// @param amount0 The amount of token0 that was flashed
    /// @param amount1 The amount of token1 that was flashed
    /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
    /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
    event Flash(
        address indexed sender,
        address indexed recipient,
        uint256 amount0,
        uint256 amount1,
        uint256 paid0,
        uint256 paid1
    );

    /// @notice Emitted by the pool for increases to the number of observations that can be stored
    /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
    /// just before a mint/swap/burn.
    /// @param observationCardinalityNextOld The previous value of the next observation cardinality
    /// @param observationCardinalityNextNew The updated value of the next observation cardinality
    event IncreaseObservationCardinalityNext(
        uint16 observationCardinalityNextOld,
        uint16 observationCardinalityNextNew
    );

    /// @notice Emitted when the protocol fee is changed by the pool
    /// @param feeProtocol0Old The previous value of the token0 protocol fee
    /// @param feeProtocol1Old The previous value of the token1 protocol fee
    /// @param feeProtocol0New The updated value of the token0 protocol fee
    /// @param feeProtocol1New The updated value of the token1 protocol fee
    event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);

    /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
    /// @param sender The address that collects the protocol fees
    /// @param recipient The address that receives the collected protocol fees
    /// @param amount0 The amount of token0 protocol fees that is withdrawn
    /// @param amount0 The amount of token1 protocol fees that is withdrawn
    event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}

File 28 of 28 : 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;
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "v3-core/=lib/v3-core/",
    "v3-periphery/=lib/v3-periphery/contracts/",
    "@uniswap/v3-core/=lib/v3-core/",
    "base64-sol/=lib/openzeppelin-contracts/contracts/utils/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 0
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_pm","type":"address"},{"internalType":"address","name":"_optionPricing","type":"address"},{"internalType":"address","name":"_dpFee","type":"address"},{"internalType":"address","name":"_callAsset","type":"address"},{"internalType":"address","name":"_putAsset","type":"address"},{"internalType":"address","name":"_primePool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccountBalanceOverflow","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__ArrayLenMismatch","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__EmptyOption","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__IVNotSet","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__InvalidPool","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__MaxCostAllowanceExceeded","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__MaxOptionBuyReached","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__NotApprovedSettler","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__NotEnoughAfterSwap","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__NotIVSetter","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__NotOwnerOrDelegator","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__NotValidStrikeTick","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__OptionExpired","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__OptionNotExpired","type":"error"},{"inputs":[],"name":"DopexV2OptionMarket__PoolNotApproved","type":"error"},{"inputs":[],"name":"NotOwnerNorApproved","type":"error"},{"inputs":[],"name":"T","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"isApproved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalProfit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAssetRelocked","type":"uint256"}],"name":"LogExerciseOption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isCall","type":"bool"},{"indexed":false,"internalType":"uint256","name":"premiumAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAssetWithdrawn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFees","type":"uint256"}],"name":"LogMintOption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"primePool","type":"address"},{"indexed":false,"internalType":"address","name":"optionPricing","type":"address"},{"indexed":false,"internalType":"address","name":"dpFee","type":"address"},{"indexed":false,"internalType":"address","name":"callAsset","type":"address"},{"indexed":false,"internalType":"address","name":"putAsset","type":"address"}],"name":"LogOptionsMarketInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"LogSettleOption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"LogSplitOption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokeURIFetcher","type":"address"},{"indexed":false,"internalType":"address","name":"dpFee","type":"address"},{"indexed":false,"internalType":"address","name":"optionPricing","type":"address"}],"name":"LogUpdateAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"LogUpdateExerciseDelegate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedPools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callAssetDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dpFee","outputs":[{"internalType":"contract IDopexV2ClammFeeStrategyV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"exerciseDelegator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"optionId","type":"uint256"},{"internalType":"contract ISwapper[]","name":"swapper","type":"address[]"},{"internalType":"bytes[]","name":"swapData","type":"bytes[]"},{"internalType":"uint256[]","name":"liquidityToExercise","type":"uint256[]"}],"internalType":"struct DopexV2OptionMarketV2.ExerciseOptionParams","name":"_params","type":"tuple"}],"name":"exerciseOption","outputs":[{"components":[{"internalType":"contract ERC20","name":"assetToUse","type":"address"},{"internalType":"contract ERC20","name":"assetToGet","type":"address"},{"internalType":"uint256","name":"totalProfit","type":"uint256"},{"internalType":"uint256","name":"totalAssetRelocked","type":"uint256"}],"internalType":"struct DopexV2OptionMarketV2.AssetsCache","name":"ac","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IUniswapV3Pool","name":"_pool","type":"address"}],"name":"getCurrentPricePerCallAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"premium","type":"uint256"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isPut","type":"bool"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"strike","type":"uint256"},{"internalType":"uint256","name":"lastPrice","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getPremiumAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IUniswapV3Pool","name":"_pool","type":"address"},{"internalType":"int24","name":"_tick","type":"int24"}],"name":"getPricePerCallAssetViaTick","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"contract IHandler","name":"_handler","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"address","name":"hook","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"liquidityToUse","type":"uint256"}],"internalType":"struct DopexV2OptionMarketV2.OptionTicks[]","name":"optionTicks","type":"tuple[]"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"ttl","type":"uint256"},{"internalType":"bool","name":"isCall","type":"bool"},{"internalType":"uint256","name":"maxCostAllowance","type":"uint256"}],"internalType":"struct DopexV2OptionMarketV2.OptionParams","name":"_params","type":"tuple"}],"name":"mintOption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"opData","outputs":[{"internalType":"uint256","name":"opTickArrayLen","type":"uint256"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bool","name":"isCall","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"opTickMap","outputs":[{"internalType":"contract IHandler","name":"_handler","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"address","name":"hook","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"liquidityToUse","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optionIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optionPricing","outputs":[{"internalType":"contract IOptionPricingV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"positionManager","outputs":[{"internalType":"contract IDopexV2PositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"optionId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"liquidityToSplit","type":"uint256[]"}],"internalType":"struct DopexV2OptionMarketV2.PositionSplitterParams","name":"_params","type":"tuple"}],"name":"positionSplitter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"primePool","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"putAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"putAssetDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"isApproved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"optionId","type":"uint256"},{"internalType":"contract ISwapper[]","name":"swapper","type":"address[]"},{"internalType":"bytes[]","name":"swapData","type":"bytes[]"},{"internalType":"uint256[]","name":"liquidityToSettle","type":"uint256[]"}],"internalType":"struct DopexV2OptionMarketV2.SettleOptionParams","name":"_params","type":"tuple"}],"name":"settleOption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"settlers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIFetcher","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeTo","type":"address"},{"internalType":"address","name":"_tokeURIFetcher","type":"address"},{"internalType":"address","name":"_dpFee","type":"address"},{"internalType":"address","name":"_optionPricing","type":"address"},{"internalType":"address","name":"_settler","type":"address"},{"internalType":"bool","name":"_statusSettler","type":"bool"},{"internalType":"address","name":"_pool","type":"address"},{"internalType":"bool","name":"_statusPools","type":"bool"}],"name":"updateAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegateTo","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"updateExerciseDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101406040523480156200001257600080fd5b506040516200650038038062006500833981016040819052620000359162000473565b6001600055620000453362000404565b6001600160a01b0386811660805283811660c081905283821660e052600280546001600160a01b0319908116888516179091556003805490911688841617905590821660a081905260408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015620000c9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ef9190620004f4565b6001600160a01b0316141580156200017f5750826001600160a01b031660a0516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200014d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001739190620004f4565b6001600160a01b031614155b156200019e57604051630d49cdf160e31b815260040160405180910390fd5b816001600160a01b031660a0516001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020f9190620004f4565b6001600160a01b0316141580156200029f5750816001600160a01b031660a0516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002939190620004f4565b6001600160a01b031614155b15620002be57604051630d49cdf160e31b815260040160405180910390fd5b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000323919062000519565b60ff166101008160ff1681525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000370573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000396919062000519565b60ff1661012052604080516001600160a01b03838116825287811660208301528681168284015285811660608301528416608082015290517ff432a680e02fd7036a5fd19b4cc769273e33297dfb07a00278dd8f5bfa3fb67d9181900360a00190a15050505050506200053e565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200046e57600080fd5b919050565b60008060008060008060c087890312156200048d57600080fd5b620004988762000456565b9550620004a86020880162000456565b9450620004b86040880162000456565b9350620004c86060880162000456565b9250620004d86080880162000456565b9150620004e860a0880162000456565b90509295509295509295565b6000602082840312156200050757600080fd5b620005128262000456565b9392505050565b6000602082840312156200052c57600080fd5b815160ff811681146200051257600080fd5b60805160a05160c05160e0516101005161012051615e29620006d760003960008181610331015281816136dc01526147080152600081816104b1015281816146d8015281816147da01528181614af801528181614b3201528181614c2d0152614c6101526000818161088401528181610c2101528181610d9e01528181610e2001528181611e8201528181612007015281816120890152818161309701528181613e580152613ef601526000818161058901528181610cdc01528181610dc401528181610dfa01528181611f3d0152818161202d01528181612063015281816130bd01528181613d2001528181613da201528181614abe0152614bf30152600081816103ce01528181610c4b01528181610d0601528181611eac01528181611f6701528181613612015261369e015260008181610652015281816112f90152818161145e0152818161220a015281816122b701528181612698015281816127d80152818161285b01528181612a2001528181612aa301528181612cda015281816133d6015281816138a30152613a6f0152615e296000f3fe6080604052600436106101f75760003560e01c8063017e7e58146101fc57806301ffc9a71461023257806306fdde031461027f57806307d88aad146102ca578063081812fc146102ea578063095ea7b31461030a5780630d51249b1461031f5780631508b8e2146103655780631e3394fb1461038957806323b872dd146103a9578063271ab517146103bc57806332f530a7146103f05780633b2b46031461045157806342842e0e1461048c578063503732761461049f5780635673a221146104d3578063600b584b1461055757806361f812a4146105775780636352211e146105ab5780636c808df2146105cb5780636ff1c9bc146105eb57806370a082311461060b578063715018a61461062b578063791b98bc146106405780638da5cb5b1461067457806395d89b41146106895780639d98f412146106be578063a22cb465146106de578063a2b15e4c146106fe578063aad2402a14610762578063ab89fbaf14610782578063ac9650d8146107a2578063b88d4fde146107cf578063bde0a7df146107e2578063c35ca61214610802578063c70a900f14610822578063c87b56dd14610852578063c8de6e8314610872578063d250185c146108a6578063d302f2b8146108c6578063e985e9c5146108e6578063eb22eccb1461091b578063f0bbcec41461093b578063f2fde38b1461096b575b600080fd5b34801561020857600080fd5b5060045461021c906001600160a01b031681565b60405161022991906150e5565b60405180910390f35b34801561023e57600080fd5b5061026f61024d3660046150f9565b6301ffc9a760e09190911c9081146380ac58cd821417635b5e139f9091141790565b6040519015158152602001610229565b34801561028b57600080fd5b506040805180820190915260198152782237b832bc102b191027b83a34b7b71026b0b935b2ba102b1960391b60208201525b604051610229919061517f565b3480156102d657600080fd5b5060055461021c906001600160a01b031681565b3480156102f657600080fd5b5061021c610305366004615192565b61098b565b61031d6103183660046151c0565b6109ca565b005b34801561032b57600080fd5b506103537f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610229565b34801561037157600080fd5b5061037b600b5481565b604051908152602001610229565b34801561039557600080fd5b5060035461021c906001600160a01b031681565b61031d6103b73660046151ec565b6109d9565b3480156103c857600080fd5b5061021c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103fc57600080fd5b5061041061040b366004615245565b610ade565b604051610229919081516001600160a01b03908116825260208084015190911690820152604080830151908201526060918201519181019190915260800190565b34801561045d57600080fd5b5061026f61046c366004615279565b600860209081526000928352604080842090915290825290205460ff1681565b61031d61049a3660046151ec565b61164c565b3480156104ab57600080fd5b506103537f000000000000000000000000000000000000000000000000000000000000000081565b3480156104df57600080fd5b506105276104ee366004615192565b600660205260009081526040902080546001820154600280840154600390940154929382820b93630100000090930490910b9160ff1685565b60408051958652600294850b60208701529290930b9184019190915260608301521515608082015260a001610229565b34801561056357600080fd5b5061031d6105723660046152c0565b611679565b34801561058357600080fd5b5061021c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105b757600080fd5b5061021c6105c6366004615192565b6116ef565b3480156105d757600080fd5b5061037b6105e63660046152ee565b611728565b3480156105f757600080fd5b5061031d610606366004615332565b611743565b34801561061757600080fd5b5061037b610626366004615332565b611822565b34801561063757600080fd5b5061031d61185d565b34801561064c57600080fd5b5061021c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561068057600080fd5b5061021c611871565b34801561069557600080fd5b5060408051808201909152600c81526b22282c16ab1916a7a696ab1960a11b60208201526102bd565b3480156106ca57600080fd5b5061031d6106d936600461534f565b611880565b3480156106ea57600080fd5b5061031d6106f93660046152c0565b611ccb565b34801561070a57600080fd5b5061071e610719366004615389565b611d20565b604080516001600160a01b03978816815295871660208701529390951692840192909252600290810b60608401520b608082015260a081019190915260c001610229565b34801561076e57600080fd5b5061031d61077d366004615245565b611d8d565b34801561078e57600080fd5b5061037b61079d366004615332565b612ddd565b3480156107ae57600080fd5b506107c26107bd3660046153ab565b612e8e565b604051610229919061541f565b61031d6107dd366004615481565b612f83565b3480156107ee57600080fd5b5061031d6107fd36600461551f565b612fde565b34801561080e57600080fd5b5061031d61081d366004615559565b613c83565b34801561082e57600080fd5b5061026f61083d366004615332565b600a6020526000908152604090205460ff1681565b34801561085e57600080fd5b506102bd61086d366004615192565b614000565b34801561087e57600080fd5b5061021c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156108b257600080fd5b5061037b6108c1366004615389565b614072565b3480156108d257600080fd5b5060025461021c906001600160a01b031681565b3480156108f257600080fd5b5061026f610901366004615279565b601c5263052d173d60211b6008526000526030600c205490565b34801561092757600080fd5b5061037b610936366004615614565b6140f4565b34801561094757600080fd5b5061026f610956366004615332565b60096020526000908152604090205460ff1681565b34801561097757600080fd5b5061031d610986366004615332565b614100565b600081600052673ec412a9852d173d60c11b601c52602060002082018201805460601b6109c05763ceea21b66000526004601cfd5b6001015492915050565b6109d533838361417b565b5050565b6000818152673ec412a9852d173d60c11b3317601c52602090208101810180546001600160a01b039485169493841693811691908286148302610a375782610a295763ceea21b66000526004601cfd5b63a11481006000526004601cfd5b84610a4a5763ea553b346000526004601cfd5b856000528160010154925082331486331417610a78576030600c2054610a7857634b6e7f186000526004601cfd5b8215610a8657600082600101555b85851818905550601c600c8181208054600019019055600084905220805460010163ffffffff8116610ac0576301336cea6000526004601cfd5b9055808284600080516020615dd4833981519152600038a45b505050565b610ae66150ab565b610aee61421c565b33610af983356116ef565b6001600160a01b031614158015610b45575060086000610b1984356116ef565b6001600160a01b031681526020808201929092526040908101600090812033825290925290205460ff16155b15610b635760405163011eafbb60e11b815260040160405180910390fd5b8135600090815260066020908152604091829020825160a081018452815481526001820154600281810b9483019490945263010000009004830b938101939093529081015460608084019190915260039091015460ff1615156080830152610bcd90840184615649565b8251149050610bef5760405163ce2bc55960e01b815260040160405180910390fd5b4281606001511015610c145760405163285d8b0f60e11b815260040160405180910390fd5b60008160800151610cda577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ca7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb9190615699565b6001600160a01b031614610d91565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190615699565b6001600160a01b0316145b90508160800151610dc2577f0000000000000000000000000000000000000000000000000000000000000000610de4565b7f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b031683526080820151610e1e577f0000000000000000000000000000000000000000000000000000000000000000610e40565b7f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b0316602084015260005b825181101561155e57610e676060860186615649565b82818110610e7757610e776156b6565b905060200201356000031561154c5784356000908152600760205260408120805483908110610ea857610ea86156b6565b90600052602060002090600402019050600083610f2257600280830154610f1d91610edb91600160a01b9004900b614275565b600280850154610ef491600160b81b909104900b614275565b610f0160608b018b615649565b87818110610f1157610f116156b6565b9050602002013561458d565b610f80565b600280830154610f8091610f3e91600160a01b9004900b614275565b600280850154610f5791600160b81b909104900b614275565b610f6460608b018b615649565b87818110610f7457610f746156b6565b905060200201356145d0565b90508086606001818151610f9491906156e2565b90525060208601516040516370a0823160e01b81526000916001600160a01b0316906370a0823190610fca9030906004016150e5565b602060405180830381865afa158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b91906156fa565b87519091506001600160a01b031663a9059cbb61102b60208b018b615649565b8781811061103b5761103b6156b6565b90506020020160208101906110509190615332565b846040518363ffffffff1660e01b815260040161106e929190615713565b6020604051808303816000875af115801561108d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b1919061572c565b506110bf6020890189615649565b858181106110cf576110cf6156b6565b90506020020160208101906110e49190615332565b6001600160a01b031663f3be6fc288600001518960200151858c806040019061110d9190615649565b8a81811061111d5761111d6156b6565b905060200281019061112f9190615749565b6040518663ffffffff1660e01b815260040161114f95949392919061578f565b6020604051808303816000875af115801561116e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119291906156fa565b506000856111f1576002808501546111ec916111b691600160a01b9004900b614275565b6002808701546111cf91600160b81b909104900b614275565b6111dc60608d018d615649565b89818110610f7457610f746156b6565b611243565b6002808501546112439161120d91600160a01b9004900b614275565b60028087015461122691600160b81b909104900b614275565b61123360608d018d615649565b89818110610f1157610f116156b6565b9050600088602001516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161127791906150e5565b602060405180830381865afa158015611294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b891906156fa565b90506112c482846156e2565b8110156112e457604051635232fe3f60e11b815260040160405180910390fd5b88602001516001600160a01b031663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000846040518363ffffffff1660e01b8152600401611336929190615713565b6020604051808303816000875af1158015611355573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611379919061572c565b5060008560010160009054906101000a90046001600160a01b03168660020160009054906101000a90046001600160a01b03168760020160149054906101000a900460020b8860020160179054906101000a900460020b8e80606001906113e09190615649565b8c8181106113f0576113f06156b6565b9050602002013560405160200161141290602080825260009082015260400190565b60408051601f19818403018152908290526114349695949392916020016157e3565b60408051601f1981840301815290829052875463d5256ca360e01b83529092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169263d5256ca3926114969216908590600401615834565b6000604051808303816000875af11580156114b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114dd919081019061592c565b506114ed905060608c018c615649565b888181106114fd576114fd6156b6565b905060200201358660030160008282546115179190615972565b90915550611527905083856156e2565b6115319083615972565b8a60400181815161154291906156e2565b9052505050505050505b8061155681615989565b915050610e51565b5082602001516001600160a01b031663a9059cbb3385604001516040518363ffffffff1660e01b8152600401611595929190615713565b6020604051808303816000875af11580156115b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d8919061572c565b507f47283bcc199cd4d1c53508922f5a4d8a832a4fdf09854c82acf3ae49da4d446f61160485356116ef565b60408581015160608088015183516001600160a01b039095168552893560208601529284019190915282015260800160405180910390a150506116476001600055565b919050565b6116578383836109d9565b813b15610ad957610ad98383836040518060200160405280600081525061463f565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815194855291840192909252908201527f4ee86bb98ad0d189c6475dd48829e8525e468f3721ab971f0c0914e6693c8da69060600160405180910390a15050565b6000818152673ec412a9852d173d60c11b601c526020902081018101546001600160a01b0316806116475763ceea21b66000526004601cfd5b600061173786868686866146cb565b90505b95945050505050565b61174b61481f565b6040516370a0823160e01b81526001600160a01b0382169063a9059cbb90339083906370a08231906117819030906004016150e5565b602060405180830381865afa15801561179e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c291906156fa565b6040518363ffffffff1660e01b81526004016117df929190615713565b6020604051808303816000875af11580156117fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d5919061572c565b60008161183757638f4eb6046000526004601cfd5b673ec412a9852d173d60c11b601c528160005263ffffffff601c600c2054169050919050565b61186561481f565b61186f600061487e565b565b6001546001600160a01b031690565b61188861421c565b6001600b600082825461189b91906156e2565b909155503390506118ac82356116ef565b6001600160a01b0316146118d35760405163011eafbb60e11b815260040160405180910390fd5b8035600090815260066020908152604091829020825160a081018452815481526001820154600281810b9483019490945263010000009004830b818501529181015460608301526003015460ff16151560808201529061193590830183615649565b82511490506119575760405163ce2bc55960e01b815260040160405180910390fd5b60005b6119676040840184615649565b9050811015611b705761197d6040840184615649565b8281811061198d5761198d6156b6565b905060200201356000036119b4576040516334b52e6b60e21b815260040160405180910390fd5b823560009081526007602052604081208054839081106119d6576119d66156b6565b906000526020600020906004020190508380604001906119f69190615649565b83818110611a0657611a066156b6565b90506020020135816003016000828254611a209190615972565b9091555050600b54600090815260076020908152604091829020825160c08101845284546001600160a01b039081168252600186015481169382019390935260028086015493841682860152600160a01b8404810b6060830152600160b81b90930490920b60808301529160a0820190611a9c90880188615649565b86818110611aac57611aac6156b6565b60209081029290920135909252835460018082018655600095865294829020845160049092020180546001600160a01b03199081166001600160a01b0393841617825592850151958101805490931695821695909517909155604083015160028501805460608601516080870151939094166001600160b81b031990911617600160a01b62ffffff948516021762ffffff60b81b1916600160b81b93909216929092021790555060a001516003909101555080611b6881615989565b91505061195a565b506040518060a00160405280838060400190611b8c9190615649565b825250602083810151600290810b82840152604080860151820b8185015260608087015181860152608080880151151595810195909552600b5460009081526006855282902086518155868501516001820180548986015162ffffff90811663010000000265ffffffffffff19909216931692909217919091179055908601519281019290925593909201516003909201805492151560ff1990931692909217909155611c4a91611c4291908501908501615332565b600b546148d0565b7f3779f4b7536f6b691eedf9d61bc0de6479c985968b9589d147af2169b9d5789c611c7583356116ef565b600b54843590611c8b6040870160208801615332565b604080516001600160a01b0395861681526020810194909452830191909152909116606082015260800160405180910390a150611cc86001600055565b50565b801515905081601c5263052d173d60211b60085233600052806030600c2055806000528160601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a35050565b60076020528160005260406000208181548110611d3c57600080fd5b60009182526020909120600490910201805460018201546002808401546003909401546001600160a01b039384169650918316945091831692600160a01b8104830b92600160b81b909104900b9086565b611d9561421c565b336000908152600a602052604090205460ff16611dc55760405163a971c8f560e01b815260040160405180910390fd5b8035600090815260066020908152604091829020825160a081018452815481526001820154600281810b9483019490945263010000009004830b938101939093529081015460608084019190915260039091015460ff1615156080830152611e2f90830183615649565b8251149050611e515760405163ce2bc55960e01b815260040160405180910390fd5b80606001514211611e755760405163a3980a9d60e01b815260040160405180910390fd5b60008160800151611f3b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2c9190615699565b6001600160a01b031614611ff2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe79190615699565b6001600160a01b0316145b9050611ffc6150ab565b826080015161202b577f000000000000000000000000000000000000000000000000000000000000000061204d565b7f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b031681526080830151612087577f00000000000000000000000000000000000000000000000000000000000000006120a9565b7f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b0316602082015260005b8351811015612d8c576120d06060860186615649565b828181106120e0576120e06156b6565b9050602002013560000315612d7a5784356000908152600760205260408120805483908110612111576121116156b6565b600091825260208220600490910201915061212f6060880188615649565b8481811061213f5761213f6156b6565b9050602002013590506000806121a661216e8560010160009054906101000a90046001600160a01b03166148ea565b60028087015461218791600160a01b909104900b614275565b6002808801546121a091600160b81b909104900b614275565b86614985565b915091506000821180156121b8575080155b806121cc57506000811180156121cc575081155b156127ab578680156121de5750600082115b1561227d57855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612234907f0000000000000000000000000000000000000000000000000000000000000000908690600401615713565b6020604051808303816000875af1158015612253573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612277919061572c565b50612c3d565b8615801561228b5750600081115b156122e157855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612234907f0000000000000000000000000000000000000000000000000000000000000000908590600401615713565b600087612328576002808601546123239161230491600160a01b9004900b614275565b60028088015461231d91600160b81b909104900b614275565b8661458d565b612363565b6002808601546123639161234491600160a01b9004900b614275565b60028088015461235d91600160b81b909104900b614275565b866145d0565b9050600087602001516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161239791906150e5565b602060405180830381865afa1580156123b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d891906156fa565b88519091506001600160a01b031663a9059cbb6123f860208e018e615649565b8a818110612408576124086156b6565b905060200201602081019061241d9190615332565b846040518363ffffffff1660e01b815260040161243b929190615713565b6020604051808303816000875af115801561245a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061247e919061572c565b5061248c60208c018c615649565b8881811061249c5761249c6156b6565b90506020020160208101906124b19190615332565b6001600160a01b031663f3be6fc289600001518a60200151858f80604001906124da9190615649565b8d8181106124ea576124ea6156b6565b90506020028101906124fc9190615749565b6040518663ffffffff1660e01b815260040161251c95949392919061578f565b6020604051808303816000875af115801561253b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061255f91906156fa565b506000896125a7576002808801546125a29161258391600160a01b9004900b614275565b6002808a015461259c91600160b81b909104900b614275565b886145d0565b6125e2565b6002808801546125e2916125c391600160a01b9004900b614275565b6002808a01546125dc91600160b81b909104900b614275565b8861458d565b9050600089602001516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161261691906150e5565b602060405180830381865afa158015612633573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265791906156fa565b905061266382846156e2565b81101561268357604051635232fe3f60e11b815260040160405180910390fd5b89602001516001600160a01b031663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000846040518363ffffffff1660e01b81526004016126d5929190615713565b6020604051808303816000875af11580156126f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612718919061572c565b5060208a01516001600160a01b031663a9059cbb3361273785876156e2565b6127419085615972565b6040518363ffffffff1660e01b815260040161275e929190615713565b6020604051808303816000875af115801561277d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a1919061572c565b5050505050612c3d565b86156129f957855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612802907f0000000000000000000000000000000000000000000000000000000000000000908690600401615713565b6020604051808303816000875af1158015612821573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612845919061572c565b5085602001516001600160a01b031663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000836040518363ffffffff1660e01b8152600401612898929190615713565b6020604051808303816000875af11580156128b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128db919061572c565b506002808501546000916128fc9161234491600160a01b909104900b614275565b60208801516040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90612933903390309087906004016159a2565b6020604051808303816000875af1158015612952573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612976919061572c565b5086516001600160a01b031663a9059cbb336129928685615972565b6040518363ffffffff1660e01b81526004016129af929190615713565b6020604051808303816000875af11580156129ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f2919061572c565b5050612c3d565b855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612a4a907f0000000000000000000000000000000000000000000000000000000000000000908590600401615713565b6020604051808303816000875af1158015612a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8d919061572c565b5085602001516001600160a01b031663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000846040518363ffffffff1660e01b8152600401612ae0929190615713565b6020604051808303816000875af1158015612aff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b23919061572c565b50600280850154600091612b449161230491600160a01b909104900b614275565b60208801516040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90612b7b903390309088906004016159a2565b6020604051808303816000875af1158015612b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbe919061572c565b5086516001600160a01b031663a9059cbb33612bda8585615972565b6040518363ffffffff1660e01b8152600401612bf7929190615713565b6020604051808303816000875af1158015612c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c3a919061572c565b50505b60018401546002808601546040516000936001600160a01b039081169390831692600160a01b8104820b92600160b81b90910490910b908890612c8e90602001602080825260009082015260400190565b60408051601f1981840301815290829052612cb09695949392916020016157e3565b60408051601f1981840301815290829052865463d5256ca360e01b83529092506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169263d5256ca392612d129216908590600401615834565b6000604051808303816000875af1158015612d31573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612d59919081019061592c565b505083856003016000828254612d6f9190615972565b909155505050505050505b80612d8481615989565b9150506120ba565b507f7568c76a44dadb68dbdbad5bcddec77a5d51c6b64188a85a58d5d54182d89d88612db885356116ef565b604051612dc89190873590615713565b60405180910390a1505050611cc86001600055565b60408051600481526024810182526020810180516001600160e01b0316633850c7bd60e01b179052905160009182916001600160a01b03851691612e20916159c6565b600060405180830381855afa9150503d8060008114612e5b576040519150601f19603f3d011682016040523d82523d6000602084013e612e60565b606091505b50915050600081806020019051810190612e7a9190615699565b9050612e868482614a21565b949350505050565b6060816001600160401b03811115612ea857612ea8615858565b604051908082528060200260200182016040528015612edb57816020015b6060815260200190600190039081612ec65790505b50905060005b82811015612f7b57612f4b30858584818110612eff57612eff6156b6565b9050602002810190612f119190615749565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250614c9192505050565b828281518110612f5d57612f5d6156b6565b60200260200101819052508080612f7390615989565b915050612ee1565b505b92915050565b612f8e8585856109d9565b833b15612fd757612fd785858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061463f92505050565b5050505050565b612fe661421c565b6001600b6000828254612ff991906156e2565b909155506014905061300b82806159e2565b9050111561302c576040516366870dd560e11b815260040160405180910390fd5b600061303882806159e2565b90506001600160401b0381111561305157613051615858565b60405190808252806020026020018201604052801561307a578160200160208202803683370190505b5090506000808061309160a0860160808701615a2a565b6130bb577f00000000000000000000000000000000000000000000000000000000000000006130dd565b7f00000000000000000000000000000000000000000000000000000000000000005b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529192505b61311c87806159e2565b905081101561360a5761312f87806159e2565b8281811061313f5761313f6156b6565b905060c002018036038101906131559190615a47565b915061316760a0880160808901615a2a565b61318d57606082015160020b6131836040890160208a01615ae7565b60020b14156131ab565b608082015160020b6131a56060890160408a01615ae7565b60020b14155b156131c9576040516372aa62b960e11b815260040160405180910390fd5b600b546000908152600760209081526040808320815160c08101835286516001600160a01b039081168252878501805182168387019081528986015183168487019081526060808c0151600290810b9187019182526080808e0151820b90880190815260a0808f0151908901908152895460018082018c559a8e528c8e209951600490910290990180546001600160a01b03199081169a8a169a909a178155955199860180549099169988169990991790975591519183018054915196519286166001600160b81b031990921691909117600160a01b62ffffff978816021762ffffff60b81b1916600160b81b96909216959095021790935592516003909201919091559051168352600990915290205460ff166132fa57604051635c3f6e2760e11b815260040160405180910390fd5b600082602001518360400151846060015185608001518660a00151308d606001358e608001602081019061332e9190615a2a565b6020808c015160608d015160808e015160405161338597969594016001600160a01b0396871681526020810195909552921515604085015293166060830152600292830b608083015290910b60a082015260c00190565b60408051601f19818403018152908290526133a79695949392916020016157e3565b60408051601f198184030181529082905284516339ef369360e21b835290925060009182916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163e7bcda4c9161340b918790600401615834565b6000604051808303816000875af115801561342a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134529190810190615b02565b5091509150856001600160a01b031682600081518110613474576134746156b6565b60200260200101516001600160a01b0316036135415760008160008151811061349f5761349f6156b6565b60200260200101511180156134ce5750806001815181106134c2576134c26156b6565b60200260200101516000145b6134d757600080fd5b806000815181106134ea576134ea6156b6565b6020026020010151898581518110613504576135046156b6565b60200260200101818152505080600081518110613523576135236156b6565b60200260200101518861353691906156e2565b9750600196506135f4565b600081600181518110613556576135566156b6565b6020026020010151118015613585575080600081518110613579576135796156b6565b60200260200101516000145b61358e57600080fd5b806001815181106135a1576135a16156b6565b60200260200101518985815181106135bb576135bb6156b6565b602002602001018181525050806001815181106135da576135da6156b6565b6020026020010151886135ed91906156e2565b9750600096505b505050808061360290615989565b915050613112565b5060006136657f000000000000000000000000000000000000000000000000000000000000000061364160a08a0160808b01615a2a565b6136555761093660408a0160208b01615ae7565b61093660608a0160408b01615ae7565b9050600061372161367c60a08a0160808b01615a2a565b61368757600161368a565b60005b61369860608b0135426156e2565b846136c27f0000000000000000000000000000000000000000000000000000000000000000612ddd565b6136d260a08e0160808f01615a2a565b61371b57866137027f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b61370c908d615cc2565b6137169190615cf7565b6146cb565b8a6146cb565b905080600003613744576040516319a509f960e01b815260040160405180910390fd5b6004546000906001600160a01b0316156137dd576137628783614072565b600480546040516323b872dd60e01b81529293506001600160a01b03808916936323b872dd9361379893339316918791016159a2565b6020604051808303816000875af11580156137b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137db919061572c565b505b60a08901356137ec82846156e2565b111561380b57604051632a0c1a9760e01b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b038616906323b872dd9061383b903390309087906004016159a2565b6020604051808303816000875af115801561385a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061387e919061572c565b5060405163095ea7b360e01b81526001600160a01b0386169063095ea7b3906138cd907f0000000000000000000000000000000000000000000000000000000000000000908690600401615713565b6020604051808303816000875af11580156138ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613910919061572c565b5060005b61391e8a806159e2565b9050811015613b03576139318a806159e2565b82818110613941576139416156b6565b905060c002018036038101906139579190615a47565b9450600088848b848151811061396f5761396f6156b6565b60200260200101516139819190615cc2565b61398b9190615cf7565b905060006139df61399f88602001516148ea565b6139af896060015160020b614275565b6139bf8a6080015160020b614275565b8c6139cb5760006139cd565b855b8d6139d85786614cb6565b6000614cb6565b905060008760200151886040015189606001518a6080015185604051602001613a459594939291906001600160a01b039586168152939094166020840152600291820b6040840152900b60608201526001600160801b0391909116608082015260a00190565b60408051601f198184030181529082905289516304e94bdb60e51b83529092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691639d297b6091613aa4918590600401615834565b6000604051808303816000875af1158015613ac3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613aeb919081019061592c565b50505050508080613afb90615989565b915050613914565b506040805160a0810190915280613b1a8b806159e2565b905081526020018a6020016020810190613b349190615ae7565b60020b8152602001613b4c60608c0160408d01615ae7565b60020b8152602001613b6260608c0135426156e2565b8152602001613b7760a08c0160808d01615a2a565b15159052600b805460009081526006602090815260409182902084518155908401516001820180549386015162ffffff90811663010000000265ffffffffffff1990951692169190911792909217909155606083015160028201556080909201516003909201805492151560ff199093169290921790915554613bfb9033906148d0565b600b547f733a06dcc0387bf816c34d99f254ceb937558fe9d4df66bbe70efa1b2aa1021f903390613c3260a08d0160808e01615a2a565b604080516001600160a01b0390941684526020840192909252151590820152606081018490526080810189905260a0810183905260c00160405180910390a15050505050505050611cc86001600055565b613c8b61481f565b600480546001600160a01b03199081166001600160a01b038b81169190911783556005805483168b83161790556002805483168a831617905560038054909216888216179091558581166000908152600a60209081526040808320805460ff199081168a151517909155878516808552600984529382902080549091168715151790558051630dfe168160e01b8152905187957f000000000000000000000000000000000000000000000000000000000000000090951694630dfe16819383820193909291908290030181865afa158015613d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d8e9190615699565b6001600160a01b031614158015613e3857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613e08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e2c9190615699565b6001600160a01b031614155b15613e5657604051630d49cdf160e31b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ee29190615699565b6001600160a01b031614158015613f8c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f809190615699565b6001600160a01b031614155b15613faa57604051630d49cdf160e31b815260040160405180910390fd5b604080516001600160a01b038a81168252898116602083015288168183015290517f318be759e0d069183ded0831e6c2119c16ced81a05e6da31c19c8c53d01bb9e29181900360600190a1505050505050505050565b6005546040516373ea766160e01b8152600481018390526060916001600160a01b0316906373ea766190602401600060405180830381865afa15801561404a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612f7d9190810190615d19565b600254604051637669909560e01b815230600482015260248101849052604481018390526000916001600160a01b031690637669909590606401602060405180830381865afa1580156140c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140ed91906156fa565b9392505050565b600080612e7a83614275565b61410861481f565b6001600160a01b0381166141725760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b611cc88161487e565b60001960601c828116925083811693508160005283673ec412a9852d173d60c11b17601c52602060002082018201805482169150816141c25763ceea21b66000526004601cfd5b8185148515176141e857816000526030600c20546141e857634b6e7f186000526004601cfd5b6001018390558183827f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a450505050565b60026000540361426e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401614169565b6002600055565b60008060008360020b1261428c578260020b614294565b8260020b6000035b9050620d89e88111156142ba576040516315e4079d60e11b815260040160405180910390fd5b6000816001166000036142d157600160801b6142e3565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561430d576ffff97272373d413259a46990580e213a0260801c5b600482161561432c576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b600882161561434b576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b601082161561436a576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615614389576fff973b41fa98c081472e6896dfb254c00260801c5b60408216156143a8576fff2ea16466c96a3843ec78b326b528610260801c5b60808216156143c7576ffe5dee046a99a2a811c461f1969c30530260801c5b6101008216156143e7576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615614407576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615614427576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615614447576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615614467576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615614487576fa9f746462d870fdf8a65dc1f90e061e50260801c5b6140008216156144a7576f70d869a156d2a1b890bb3df62baf32f70260801c5b6180008216156144c7576f31be135f97d08fd981231505542fcfa60260801c5b620100008216156144e8576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615614508576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615614527576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615614544576b048a170391f7dc42444e8fa20260801c5b60008460020b131561456557806000198161456157614561615ce1565b0490505b600160201b81061561457857600161457b565b60005b60ff16602082901c0192505050919050565b6000826001600160a01b0316846001600160a01b031611156145ad579192915b612e86826001600160801b03168585036001600160a01b0316600160601b614d6e565b6000826001600160a01b0316846001600160a01b031611156145f0579192915b836001600160a01b0316614629606060ff16846001600160801b0316901b8686036001600160a01b0316866001600160a01b0316614d6e565b8161463657614636615ce1565b04949350505050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a08401528015614686578060c08401826020870160045afa505b60208360a48301601c860160008a5af16146a9573d156146a9573d6000843e3d83fd5b508060e01b8251146146c35763d1a57ed66000526004601cfd5b505050505050565b60008086614703576146fe7f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b61472e565b61472e7f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b600354604051635b7f6d7760e01b815289151560048201526024810189905260448101889052606481018790526001600160a01b0390911690635b7f6d7790608401602060405180830381865afa15801561478d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b191906156fa565b6147bb9085615cc2565b6147c59190615cf7565b905086156147d457905061173a565b836148007f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b61480a9083615cc2565b6148149190615cf7565b979650505050505050565b33614828611871565b6001600160a01b03161461186f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401614169565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6109d5828260405180602001604052806000815250614e20565b60408051600481526024810182526020810180516001600160e01b0316633850c7bd60e01b179052905160009182916001600160a01b0385169161492d916159c6565b600060405180830381855afa9150503d8060008114614968576040519150601f19603f3d011682016040523d82523d6000602084013e61496d565b606091505b50915050808060200190518101906140ed9190615699565b600080836001600160a01b0316856001600160a01b031611156149a6579293925b846001600160a01b0316866001600160a01b0316116149d1576149ca8585856145d0565b9150614a18565b836001600160a01b0316866001600160a01b03161015614a0a576149f68685856145d0565b9150614a0385878561458d565b9050614a18565b614a1585858561458d565b90505b94509492505050565b60006001600160801b036001600160a01b03831611614b6a576000614a4f6001600160a01b03841680615cc2565b9050836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015614a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab39190615699565b6001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614614b2957614b24600160c01b614b1e7f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b83614d6e565b614b62565b614b6281614b587f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b600160c01b614d6e565b915050612f7d565b6000614b846001600160a01b03841680600160401b614d6e565b9050836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015614bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614be89190615699565b6001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614614c5857614c53600160801b614b1e7f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b612e86565b612e8681614c877f0000000000000000000000000000000000000000000000000000000000000000600a615cb3565b600160801b614d6e565b60606140ed8383604051806060016040528060278152602001615dad60279139614e3e565b6000836001600160a01b0316856001600160a01b03161115614cd6579293925b846001600160a01b0316866001600160a01b031611614d0157614cfa858585614eb6565b905061173a565b836001600160a01b0316866001600160a01b03161015614d63576000614d28878686614eb6565b90506000614d37878986614f19565b9050806001600160801b0316826001600160801b031610614d585780614d5a565b815b9250505061173a565b611737858584614f19565b6000808060001985870985870292508281108382030391505080600003614da75760008411614d9c57600080fd5b5082900490506140ed565b808411614db357600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b614e2a8383614f56565b823b15610ad957610ad9600084848461463f565b6060600080856001600160a01b031685604051614e5b91906159c6565b600060405180830381855af49150503d8060008114614e96576040519150601f19603f3d011682016040523d82523d6000602084013e614e9b565b606091505b5091509150614eac86838387614ff2565b9695505050505050565b6000826001600160a01b0316846001600160a01b03161115614ed6579192915b6000614ef9856001600160a01b0316856001600160a01b0316600160601b614d6e565b905061173a614f1484838888036001600160a01b0316614d6e565b61506b565b6000826001600160a01b0316846001600160a01b03161115614f39579192915b612e86614f1483600160601b8787036001600160a01b0316614d6e565b6001600160a01b039091169081614f755763ea553b346000526004601cfd5b80600052673ec412a9852d173d60c11b601c5260206000208101810180548060601b15614faa5763c991cbb16000526004601cfd5b831790556000829052601c600c20805460010163ffffffff8116614fd6576301336cea6000526004601cfd5b905580826000600080516020615dd48339815191528138a45050565b6060831561506157825160000361505a576001600160a01b0385163b61505a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401614169565b5081612e86565b612e868383615081565b806001600160801b038116811461164757600080fd5b8151156150915781518083602001fd5b8060405162461bcd60e51b8152600401614169919061517f565b604051806080016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081525090565b6001600160a01b0391909116815260200190565b60006020828403121561510b57600080fd5b81356001600160e01b0319811681146140ed57600080fd5b60005b8381101561513e578181015183820152602001615126565b8381111561514d576000848401525b50505050565b6000815180845261516b816020860160208601615123565b601f01601f19169290920160200192915050565b6020815260006140ed6020830184615153565b6000602082840312156151a457600080fd5b5035919050565b6001600160a01b0381168114611cc857600080fd5b600080604083850312156151d357600080fd5b82356151de816151ab565b946020939093013593505050565b60008060006060848603121561520157600080fd5b833561520c816151ab565b9250602084013561521c816151ab565b929592945050506040919091013590565b60006080828403121561523f57600080fd5b50919050565b60006020828403121561525757600080fd5b81356001600160401b0381111561526d57600080fd5b612e868482850161522d565b6000806040838503121561528c57600080fd5b8235615297816151ab565b915060208301356152a7816151ab565b809150509250929050565b8015158114611cc857600080fd5b600080604083850312156152d357600080fd5b82356152de816151ab565b915060208301356152a7816152b2565b600080600080600060a0868803121561530657600080fd5b8535615311816152b2565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561534457600080fd5b81356140ed816151ab565b60006020828403121561536157600080fd5b81356001600160401b0381111561537757600080fd5b8201606081850312156140ed57600080fd5b6000806040838503121561539c57600080fd5b50508035926020909101359150565b600080602083850312156153be57600080fd5b82356001600160401b03808211156153d557600080fd5b818501915085601f8301126153e957600080fd5b8135818111156153f857600080fd5b8660208260051b850101111561540d57600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561547457603f19888603018452615462858351615153565b94509285019290850190600101615446565b5092979650505050505050565b60008060008060006080868803121561549957600080fd5b85356154a4816151ab565b945060208601356154b4816151ab565b93506040860135925060608601356001600160401b03808211156154d757600080fd5b818801915088601f8301126154eb57600080fd5b8135818111156154fa57600080fd5b89602082850101111561550c57600080fd5b9699959850939650602001949392505050565b60006020828403121561553157600080fd5b81356001600160401b0381111561554757600080fd5b820160c081850312156140ed57600080fd5b600080600080600080600080610100898b03121561557657600080fd5b8835615581816151ab565b97506020890135615591816151ab565b965060408901356155a1816151ab565b955060608901356155b1816151ab565b945060808901356155c1816151ab565b935060a08901356155d1816152b2565b925060c08901356155e1816151ab565b915060e08901356155f1816152b2565b809150509295985092959890939650565b8035600281900b811461164757600080fd5b6000806040838503121561562757600080fd5b8235615632816151ab565b915061564060208401615602565b90509250929050565b6000808335601e1984360301811261566057600080fd5b8301803591506001600160401b0382111561567a57600080fd5b6020019150600581901b360382131561569257600080fd5b9250929050565b6000602082840312156156ab57600080fd5b81516140ed816151ab565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156156f5576156f56156cc565b500190565b60006020828403121561570c57600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561573e57600080fd5b81516140ed816152b2565b6000808335601e1984360301811261576057600080fd5b8301803591506001600160401b0382111561577a57600080fd5b60200191503681900382131561569257600080fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b6001600160a01b03878116825286166020820152600285810b604083015284900b60608201526080810183905260c060a0820181905260009061582890830184615153565b98975050505050505050565b6001600160a01b0383168152604060208201819052600090612e8690830184615153565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561589657615896615858565b604052919050565b60006001600160401b038211156158b7576158b7615858565b5060051b60200190565b600082601f8301126158d257600080fd5b815160206158e76158e28361589e565b61586e565b82815260059290921b8401810191818101908684111561590657600080fd5b8286015b84811015615921578051835291830191830161590a565b509695505050505050565b6000806040838503121561593f57600080fd5b82516001600160401b0381111561595557600080fd5b615961858286016158c1565b925050602083015190509250929050565b600082821015615984576159846156cc565b500390565b60006001820161599b5761599b6156cc565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600082516159d8818460208701615123565b9190910192915050565b6000808335601e198436030181126159f957600080fd5b8301803591506001600160401b03821115615a1357600080fd5b602001915060c08102360382131561569257600080fd5b600060208284031215615a3c57600080fd5b81356140ed816152b2565b600060c08284031215615a5957600080fd5b60405160c081016001600160401b0381118282101715615a7b57615a7b615858565b6040528235615a89816151ab565b81526020830135615a99816151ab565b60208201526040830135615aac816151ab565b6040820152615abd60608401615602565b6060820152615ace60808401615602565b608082015260a083013560a08201528091505092915050565b600060208284031215615af957600080fd5b6140ed82615602565b600080600060608486031215615b1757600080fd5b83516001600160401b0380821115615b2e57600080fd5b818601915086601f830112615b4257600080fd5b81516020615b526158e28361589e565b82815260059290921b8401810191818101908a841115615b7157600080fd5b948201945b83861015615b98578551615b89816151ab565b82529482019490820190615b76565b91890151919750909350505080821115615bb157600080fd5b50615bbe868287016158c1565b925050604084015190509250925092565b600181815b80851115615c0a578160001904821115615bf057615bf06156cc565b80851615615bfd57918102915b93841c9390800290615bd4565b509250929050565b600082615c2157506001612f7d565b81615c2e57506000612f7d565b8160018114615c445760028114615c4e57615c6a565b6001915050612f7d565b60ff841115615c5f57615c5f6156cc565b50506001821b612f7d565b5060208310610133831016604e8410600b8410161715615c8d575081810a612f7d565b615c978383615bcf565b8060001904821115615cab57615cab6156cc565b029392505050565b60006140ed60ff841683615c12565b6000816000190483118215151615615cdc57615cdc6156cc565b500290565b634e487b7160e01b600052601260045260246000fd5b600082615d1457634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215615d2b57600080fd5b81516001600160401b0380821115615d4257600080fd5b818401915084601f830112615d5657600080fd5b815181811115615d6857615d68615858565b615d7b601f8201601f191660200161586e565b9150808252856020828501011115615d9257600080fd5b615da3816020840160208601615123565b5094935050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204c0139263b5cd1dbdd1eeaaab7286d3f9955fbb99b0dcd75bfb29f8f62395e2664736f6c634300080f0033000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc0000000000000000000000000fd9874a8902772c3573c11e8162f78cc96940b5000000000000000000000000c808acb06077174333b31ae123c33c655973003500000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d0

Deployed Bytecode

0x6080604052600436106101f75760003560e01c8063017e7e58146101fc57806301ffc9a71461023257806306fdde031461027f57806307d88aad146102ca578063081812fc146102ea578063095ea7b31461030a5780630d51249b1461031f5780631508b8e2146103655780631e3394fb1461038957806323b872dd146103a9578063271ab517146103bc57806332f530a7146103f05780633b2b46031461045157806342842e0e1461048c578063503732761461049f5780635673a221146104d3578063600b584b1461055757806361f812a4146105775780636352211e146105ab5780636c808df2146105cb5780636ff1c9bc146105eb57806370a082311461060b578063715018a61461062b578063791b98bc146106405780638da5cb5b1461067457806395d89b41146106895780639d98f412146106be578063a22cb465146106de578063a2b15e4c146106fe578063aad2402a14610762578063ab89fbaf14610782578063ac9650d8146107a2578063b88d4fde146107cf578063bde0a7df146107e2578063c35ca61214610802578063c70a900f14610822578063c87b56dd14610852578063c8de6e8314610872578063d250185c146108a6578063d302f2b8146108c6578063e985e9c5146108e6578063eb22eccb1461091b578063f0bbcec41461093b578063f2fde38b1461096b575b600080fd5b34801561020857600080fd5b5060045461021c906001600160a01b031681565b60405161022991906150e5565b60405180910390f35b34801561023e57600080fd5b5061026f61024d3660046150f9565b6301ffc9a760e09190911c9081146380ac58cd821417635b5e139f9091141790565b6040519015158152602001610229565b34801561028b57600080fd5b506040805180820190915260198152782237b832bc102b191027b83a34b7b71026b0b935b2ba102b1960391b60208201525b604051610229919061517f565b3480156102d657600080fd5b5060055461021c906001600160a01b031681565b3480156102f657600080fd5b5061021c610305366004615192565b61098b565b61031d6103183660046151c0565b6109ca565b005b34801561032b57600080fd5b506103537f000000000000000000000000000000000000000000000000000000000000000681565b60405160ff9091168152602001610229565b34801561037157600080fd5b5061037b600b5481565b604051908152602001610229565b34801561039557600080fd5b5060035461021c906001600160a01b031681565b61031d6103b73660046151ec565b6109d9565b3480156103c857600080fd5b5061021c7f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d081565b3480156103fc57600080fd5b5061041061040b366004615245565b610ade565b604051610229919081516001600160a01b03908116825260208084015190911690820152604080830151908201526060918201519181019190915260800190565b34801561045d57600080fd5b5061026f61046c366004615279565b600860209081526000928352604080842090915290825290205460ff1681565b61031d61049a3660046151ec565b61164c565b3480156104ab57600080fd5b506103537f000000000000000000000000000000000000000000000000000000000000001281565b3480156104df57600080fd5b506105276104ee366004615192565b600660205260009081526040902080546001820154600280840154600390940154929382820b93630100000090930490910b9160ff1685565b60408051958652600294850b60208701529290930b9184019190915260608301521515608082015260a001610229565b34801561056357600080fd5b5061031d6105723660046152c0565b611679565b34801561058357600080fd5b5061021c7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab181565b3480156105b757600080fd5b5061021c6105c6366004615192565b6116ef565b3480156105d757600080fd5b5061037b6105e63660046152ee565b611728565b3480156105f757600080fd5b5061031d610606366004615332565b611743565b34801561061757600080fd5b5061037b610626366004615332565b611822565b34801561063757600080fd5b5061031d61185d565b34801561064c57600080fd5b5061021c7f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc81565b34801561068057600080fd5b5061021c611871565b34801561069557600080fd5b5060408051808201909152600c81526b22282c16ab1916a7a696ab1960a11b60208201526102bd565b3480156106ca57600080fd5b5061031d6106d936600461534f565b611880565b3480156106ea57600080fd5b5061031d6106f93660046152c0565b611ccb565b34801561070a57600080fd5b5061071e610719366004615389565b611d20565b604080516001600160a01b03978816815295871660208701529390951692840192909252600290810b60608401520b608082015260a081019190915260c001610229565b34801561076e57600080fd5b5061031d61077d366004615245565b611d8d565b34801561078e57600080fd5b5061037b61079d366004615332565b612ddd565b3480156107ae57600080fd5b506107c26107bd3660046153ab565b612e8e565b604051610229919061541f565b61031d6107dd366004615481565b612f83565b3480156107ee57600080fd5b5061031d6107fd36600461551f565b612fde565b34801561080e57600080fd5b5061031d61081d366004615559565b613c83565b34801561082e57600080fd5b5061026f61083d366004615332565b600a6020526000908152604090205460ff1681565b34801561085e57600080fd5b506102bd61086d366004615192565b614000565b34801561087e57600080fd5b5061021c7f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583181565b3480156108b257600080fd5b5061037b6108c1366004615389565b614072565b3480156108d257600080fd5b5060025461021c906001600160a01b031681565b3480156108f257600080fd5b5061026f610901366004615279565b601c5263052d173d60211b6008526000526030600c205490565b34801561092757600080fd5b5061037b610936366004615614565b6140f4565b34801561094757600080fd5b5061026f610956366004615332565b60096020526000908152604090205460ff1681565b34801561097757600080fd5b5061031d610986366004615332565b614100565b600081600052673ec412a9852d173d60c11b601c52602060002082018201805460601b6109c05763ceea21b66000526004601cfd5b6001015492915050565b6109d533838361417b565b5050565b6000818152673ec412a9852d173d60c11b3317601c52602090208101810180546001600160a01b039485169493841693811691908286148302610a375782610a295763ceea21b66000526004601cfd5b63a11481006000526004601cfd5b84610a4a5763ea553b346000526004601cfd5b856000528160010154925082331486331417610a78576030600c2054610a7857634b6e7f186000526004601cfd5b8215610a8657600082600101555b85851818905550601c600c8181208054600019019055600084905220805460010163ffffffff8116610ac0576301336cea6000526004601cfd5b9055808284600080516020615dd4833981519152600038a45b505050565b610ae66150ab565b610aee61421c565b33610af983356116ef565b6001600160a01b031614158015610b45575060086000610b1984356116ef565b6001600160a01b031681526020808201929092526040908101600090812033825290925290205460ff16155b15610b635760405163011eafbb60e11b815260040160405180910390fd5b8135600090815260066020908152604091829020825160a081018452815481526001820154600281810b9483019490945263010000009004830b938101939093529081015460608084019190915260039091015460ff1615156080830152610bcd90840184615649565b8251149050610bef5760405163ce2bc55960e01b815260040160405180910390fd5b4281606001511015610c145760405163285d8b0f60e11b815260040160405180910390fd5b60008160800151610cda577f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58316001600160a01b03167f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d06001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ca7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccb9190615699565b6001600160a01b031614610d91565b7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16001600160a01b03167f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d06001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d869190615699565b6001600160a01b0316145b90508160800151610dc2577f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831610de4565b7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab15b6001600160a01b031683526080820151610e1e577f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1610e40565b7f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58315b6001600160a01b0316602084015260005b825181101561155e57610e676060860186615649565b82818110610e7757610e776156b6565b905060200201356000031561154c5784356000908152600760205260408120805483908110610ea857610ea86156b6565b90600052602060002090600402019050600083610f2257600280830154610f1d91610edb91600160a01b9004900b614275565b600280850154610ef491600160b81b909104900b614275565b610f0160608b018b615649565b87818110610f1157610f116156b6565b9050602002013561458d565b610f80565b600280830154610f8091610f3e91600160a01b9004900b614275565b600280850154610f5791600160b81b909104900b614275565b610f6460608b018b615649565b87818110610f7457610f746156b6565b905060200201356145d0565b90508086606001818151610f9491906156e2565b90525060208601516040516370a0823160e01b81526000916001600160a01b0316906370a0823190610fca9030906004016150e5565b602060405180830381865afa158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b91906156fa565b87519091506001600160a01b031663a9059cbb61102b60208b018b615649565b8781811061103b5761103b6156b6565b90506020020160208101906110509190615332565b846040518363ffffffff1660e01b815260040161106e929190615713565b6020604051808303816000875af115801561108d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b1919061572c565b506110bf6020890189615649565b858181106110cf576110cf6156b6565b90506020020160208101906110e49190615332565b6001600160a01b031663f3be6fc288600001518960200151858c806040019061110d9190615649565b8a81811061111d5761111d6156b6565b905060200281019061112f9190615749565b6040518663ffffffff1660e01b815260040161114f95949392919061578f565b6020604051808303816000875af115801561116e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119291906156fa565b506000856111f1576002808501546111ec916111b691600160a01b9004900b614275565b6002808701546111cf91600160b81b909104900b614275565b6111dc60608d018d615649565b89818110610f7457610f746156b6565b611243565b6002808501546112439161120d91600160a01b9004900b614275565b60028087015461122691600160b81b909104900b614275565b61123360608d018d615649565b89818110610f1157610f116156b6565b9050600088602001516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161127791906150e5565b602060405180830381865afa158015611294573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b891906156fa565b90506112c482846156e2565b8110156112e457604051635232fe3f60e11b815260040160405180910390fd5b88602001516001600160a01b031663095ea7b37f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc846040518363ffffffff1660e01b8152600401611336929190615713565b6020604051808303816000875af1158015611355573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611379919061572c565b5060008560010160009054906101000a90046001600160a01b03168660020160009054906101000a90046001600160a01b03168760020160149054906101000a900460020b8860020160179054906101000a900460020b8e80606001906113e09190615649565b8c8181106113f0576113f06156b6565b9050602002013560405160200161141290602080825260009082015260400190565b60408051601f19818403018152908290526114349695949392916020016157e3565b60408051601f1981840301815290829052875463d5256ca360e01b83529092506001600160a01b037f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc81169263d5256ca3926114969216908590600401615834565b6000604051808303816000875af11580156114b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526114dd919081019061592c565b506114ed905060608c018c615649565b888181106114fd576114fd6156b6565b905060200201358660030160008282546115179190615972565b90915550611527905083856156e2565b6115319083615972565b8a60400181815161154291906156e2565b9052505050505050505b8061155681615989565b915050610e51565b5082602001516001600160a01b031663a9059cbb3385604001516040518363ffffffff1660e01b8152600401611595929190615713565b6020604051808303816000875af11580156115b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d8919061572c565b507f47283bcc199cd4d1c53508922f5a4d8a832a4fdf09854c82acf3ae49da4d446f61160485356116ef565b60408581015160608088015183516001600160a01b039095168552893560208601529284019190915282015260800160405180910390a150506116476001600055565b919050565b6116578383836109d9565b813b15610ad957610ad98383836040518060200160405280600081525061463f565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815194855291840192909252908201527f4ee86bb98ad0d189c6475dd48829e8525e468f3721ab971f0c0914e6693c8da69060600160405180910390a15050565b6000818152673ec412a9852d173d60c11b601c526020902081018101546001600160a01b0316806116475763ceea21b66000526004601cfd5b600061173786868686866146cb565b90505b95945050505050565b61174b61481f565b6040516370a0823160e01b81526001600160a01b0382169063a9059cbb90339083906370a08231906117819030906004016150e5565b602060405180830381865afa15801561179e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c291906156fa565b6040518363ffffffff1660e01b81526004016117df929190615713565b6020604051808303816000875af11580156117fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d5919061572c565b60008161183757638f4eb6046000526004601cfd5b673ec412a9852d173d60c11b601c528160005263ffffffff601c600c2054169050919050565b61186561481f565b61186f600061487e565b565b6001546001600160a01b031690565b61188861421c565b6001600b600082825461189b91906156e2565b909155503390506118ac82356116ef565b6001600160a01b0316146118d35760405163011eafbb60e11b815260040160405180910390fd5b8035600090815260066020908152604091829020825160a081018452815481526001820154600281810b9483019490945263010000009004830b818501529181015460608301526003015460ff16151560808201529061193590830183615649565b82511490506119575760405163ce2bc55960e01b815260040160405180910390fd5b60005b6119676040840184615649565b9050811015611b705761197d6040840184615649565b8281811061198d5761198d6156b6565b905060200201356000036119b4576040516334b52e6b60e21b815260040160405180910390fd5b823560009081526007602052604081208054839081106119d6576119d66156b6565b906000526020600020906004020190508380604001906119f69190615649565b83818110611a0657611a066156b6565b90506020020135816003016000828254611a209190615972565b9091555050600b54600090815260076020908152604091829020825160c08101845284546001600160a01b039081168252600186015481169382019390935260028086015493841682860152600160a01b8404810b6060830152600160b81b90930490920b60808301529160a0820190611a9c90880188615649565b86818110611aac57611aac6156b6565b60209081029290920135909252835460018082018655600095865294829020845160049092020180546001600160a01b03199081166001600160a01b0393841617825592850151958101805490931695821695909517909155604083015160028501805460608601516080870151939094166001600160b81b031990911617600160a01b62ffffff948516021762ffffff60b81b1916600160b81b93909216929092021790555060a001516003909101555080611b6881615989565b91505061195a565b506040518060a00160405280838060400190611b8c9190615649565b825250602083810151600290810b82840152604080860151820b8185015260608087015181860152608080880151151595810195909552600b5460009081526006855282902086518155868501516001820180548986015162ffffff90811663010000000265ffffffffffff19909216931692909217919091179055908601519281019290925593909201516003909201805492151560ff1990931692909217909155611c4a91611c4291908501908501615332565b600b546148d0565b7f3779f4b7536f6b691eedf9d61bc0de6479c985968b9589d147af2169b9d5789c611c7583356116ef565b600b54843590611c8b6040870160208801615332565b604080516001600160a01b0395861681526020810194909452830191909152909116606082015260800160405180910390a150611cc86001600055565b50565b801515905081601c5263052d173d60211b60085233600052806030600c2055806000528160601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a35050565b60076020528160005260406000208181548110611d3c57600080fd5b60009182526020909120600490910201805460018201546002808401546003909401546001600160a01b039384169650918316945091831692600160a01b8104830b92600160b81b909104900b9086565b611d9561421c565b336000908152600a602052604090205460ff16611dc55760405163a971c8f560e01b815260040160405180910390fd5b8035600090815260066020908152604091829020825160a081018452815481526001820154600281810b9483019490945263010000009004830b938101939093529081015460608084019190915260039091015460ff1615156080830152611e2f90830183615649565b8251149050611e515760405163ce2bc55960e01b815260040160405180910390fd5b80606001514211611e755760405163a3980a9d60e01b815260040160405180910390fd5b60008160800151611f3b577f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58316001600160a01b03167f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d06001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2c9190615699565b6001600160a01b031614611ff2565b7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16001600160a01b03167f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d06001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe79190615699565b6001600160a01b0316145b9050611ffc6150ab565b826080015161202b577f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583161204d565b7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab15b6001600160a01b031681526080830151612087577f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16120a9565b7f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58315b6001600160a01b0316602082015260005b8351811015612d8c576120d06060860186615649565b828181106120e0576120e06156b6565b9050602002013560000315612d7a5784356000908152600760205260408120805483908110612111576121116156b6565b600091825260208220600490910201915061212f6060880188615649565b8481811061213f5761213f6156b6565b9050602002013590506000806121a661216e8560010160009054906101000a90046001600160a01b03166148ea565b60028087015461218791600160a01b909104900b614275565b6002808801546121a091600160b81b909104900b614275565b86614985565b915091506000821180156121b8575080155b806121cc57506000811180156121cc575081155b156127ab578680156121de5750600082115b1561227d57855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612234907f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc908690600401615713565b6020604051808303816000875af1158015612253573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612277919061572c565b50612c3d565b8615801561228b5750600081115b156122e157855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612234907f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc908590600401615713565b600087612328576002808601546123239161230491600160a01b9004900b614275565b60028088015461231d91600160b81b909104900b614275565b8661458d565b612363565b6002808601546123639161234491600160a01b9004900b614275565b60028088015461235d91600160b81b909104900b614275565b866145d0565b9050600087602001516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161239791906150e5565b602060405180830381865afa1580156123b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d891906156fa565b88519091506001600160a01b031663a9059cbb6123f860208e018e615649565b8a818110612408576124086156b6565b905060200201602081019061241d9190615332565b846040518363ffffffff1660e01b815260040161243b929190615713565b6020604051808303816000875af115801561245a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061247e919061572c565b5061248c60208c018c615649565b8881811061249c5761249c6156b6565b90506020020160208101906124b19190615332565b6001600160a01b031663f3be6fc289600001518a60200151858f80604001906124da9190615649565b8d8181106124ea576124ea6156b6565b90506020028101906124fc9190615749565b6040518663ffffffff1660e01b815260040161251c95949392919061578f565b6020604051808303816000875af115801561253b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061255f91906156fa565b506000896125a7576002808801546125a29161258391600160a01b9004900b614275565b6002808a015461259c91600160b81b909104900b614275565b886145d0565b6125e2565b6002808801546125e2916125c391600160a01b9004900b614275565b6002808a01546125dc91600160b81b909104900b614275565b8861458d565b9050600089602001516001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161261691906150e5565b602060405180830381865afa158015612633573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265791906156fa565b905061266382846156e2565b81101561268357604051635232fe3f60e11b815260040160405180910390fd5b89602001516001600160a01b031663095ea7b37f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc846040518363ffffffff1660e01b81526004016126d5929190615713565b6020604051808303816000875af11580156126f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612718919061572c565b5060208a01516001600160a01b031663a9059cbb3361273785876156e2565b6127419085615972565b6040518363ffffffff1660e01b815260040161275e929190615713565b6020604051808303816000875af115801561277d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a1919061572c565b5050505050612c3d565b86156129f957855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612802907f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc908690600401615713565b6020604051808303816000875af1158015612821573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612845919061572c565b5085602001516001600160a01b031663095ea7b37f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc836040518363ffffffff1660e01b8152600401612898929190615713565b6020604051808303816000875af11580156128b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128db919061572c565b506002808501546000916128fc9161234491600160a01b909104900b614275565b60208801516040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90612933903390309087906004016159a2565b6020604051808303816000875af1158015612952573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612976919061572c565b5086516001600160a01b031663a9059cbb336129928685615972565b6040518363ffffffff1660e01b81526004016129af929190615713565b6020604051808303816000875af11580156129ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f2919061572c565b5050612c3d565b855160405163095ea7b360e01b81526001600160a01b039091169063095ea7b390612a4a907f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc908590600401615713565b6020604051808303816000875af1158015612a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8d919061572c565b5085602001516001600160a01b031663095ea7b37f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc846040518363ffffffff1660e01b8152600401612ae0929190615713565b6020604051808303816000875af1158015612aff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b23919061572c565b50600280850154600091612b449161230491600160a01b909104900b614275565b60208801516040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90612b7b903390309088906004016159a2565b6020604051808303816000875af1158015612b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbe919061572c565b5086516001600160a01b031663a9059cbb33612bda8585615972565b6040518363ffffffff1660e01b8152600401612bf7929190615713565b6020604051808303816000875af1158015612c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c3a919061572c565b50505b60018401546002808601546040516000936001600160a01b039081169390831692600160a01b8104820b92600160b81b90910490910b908890612c8e90602001602080825260009082015260400190565b60408051601f1981840301815290829052612cb09695949392916020016157e3565b60408051601f1981840301815290829052865463d5256ca360e01b83529092506001600160a01b037f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc81169263d5256ca392612d129216908590600401615834565b6000604051808303816000875af1158015612d31573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612d59919081019061592c565b505083856003016000828254612d6f9190615972565b909155505050505050505b80612d8481615989565b9150506120ba565b507f7568c76a44dadb68dbdbad5bcddec77a5d51c6b64188a85a58d5d54182d89d88612db885356116ef565b604051612dc89190873590615713565b60405180910390a1505050611cc86001600055565b60408051600481526024810182526020810180516001600160e01b0316633850c7bd60e01b179052905160009182916001600160a01b03851691612e20916159c6565b600060405180830381855afa9150503d8060008114612e5b576040519150601f19603f3d011682016040523d82523d6000602084013e612e60565b606091505b50915050600081806020019051810190612e7a9190615699565b9050612e868482614a21565b949350505050565b6060816001600160401b03811115612ea857612ea8615858565b604051908082528060200260200182016040528015612edb57816020015b6060815260200190600190039081612ec65790505b50905060005b82811015612f7b57612f4b30858584818110612eff57612eff6156b6565b9050602002810190612f119190615749565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250614c9192505050565b828281518110612f5d57612f5d6156b6565b60200260200101819052508080612f7390615989565b915050612ee1565b505b92915050565b612f8e8585856109d9565b833b15612fd757612fd785858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061463f92505050565b5050505050565b612fe661421c565b6001600b6000828254612ff991906156e2565b909155506014905061300b82806159e2565b9050111561302c576040516366870dd560e11b815260040160405180910390fd5b600061303882806159e2565b90506001600160401b0381111561305157613051615858565b60405190808252806020026020018201604052801561307a578160200160208202803683370190505b5090506000808061309160a0860160808701615a2a565b6130bb577f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58316130dd565b7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab15b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081018290529192505b61311c87806159e2565b905081101561360a5761312f87806159e2565b8281811061313f5761313f6156b6565b905060c002018036038101906131559190615a47565b915061316760a0880160808901615a2a565b61318d57606082015160020b6131836040890160208a01615ae7565b60020b14156131ab565b608082015160020b6131a56060890160408a01615ae7565b60020b14155b156131c9576040516372aa62b960e11b815260040160405180910390fd5b600b546000908152600760209081526040808320815160c08101835286516001600160a01b039081168252878501805182168387019081528986015183168487019081526060808c0151600290810b9187019182526080808e0151820b90880190815260a0808f0151908901908152895460018082018c559a8e528c8e209951600490910290990180546001600160a01b03199081169a8a169a909a178155955199860180549099169988169990991790975591519183018054915196519286166001600160b81b031990921691909117600160a01b62ffffff978816021762ffffff60b81b1916600160b81b96909216959095021790935592516003909201919091559051168352600990915290205460ff166132fa57604051635c3f6e2760e11b815260040160405180910390fd5b600082602001518360400151846060015185608001518660a00151308d606001358e608001602081019061332e9190615a2a565b6020808c015160608d015160808e015160405161338597969594016001600160a01b0396871681526020810195909552921515604085015293166060830152600292830b608083015290910b60a082015260c00190565b60408051601f19818403018152908290526133a79695949392916020016157e3565b60408051601f198184030181529082905284516339ef369360e21b835290925060009182916001600160a01b037f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc169163e7bcda4c9161340b918790600401615834565b6000604051808303816000875af115801561342a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134529190810190615b02565b5091509150856001600160a01b031682600081518110613474576134746156b6565b60200260200101516001600160a01b0316036135415760008160008151811061349f5761349f6156b6565b60200260200101511180156134ce5750806001815181106134c2576134c26156b6565b60200260200101516000145b6134d757600080fd5b806000815181106134ea576134ea6156b6565b6020026020010151898581518110613504576135046156b6565b60200260200101818152505080600081518110613523576135236156b6565b60200260200101518861353691906156e2565b9750600196506135f4565b600081600181518110613556576135566156b6565b6020026020010151118015613585575080600081518110613579576135796156b6565b60200260200101516000145b61358e57600080fd5b806001815181106135a1576135a16156b6565b60200260200101518985815181106135bb576135bb6156b6565b602002602001018181525050806001815181106135da576135da6156b6565b6020026020010151886135ed91906156e2565b9750600096505b505050808061360290615989565b915050613112565b5060006136657f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d061364160a08a0160808b01615a2a565b6136555761093660408a0160208b01615ae7565b61093660608a0160408b01615ae7565b9050600061372161367c60a08a0160808b01615a2a565b61368757600161368a565b60005b61369860608b0135426156e2565b846136c27f000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d0612ddd565b6136d260a08e0160808f01615a2a565b61371b57866137027f0000000000000000000000000000000000000000000000000000000000000006600a615cb3565b61370c908d615cc2565b6137169190615cf7565b6146cb565b8a6146cb565b905080600003613744576040516319a509f960e01b815260040160405180910390fd5b6004546000906001600160a01b0316156137dd576137628783614072565b600480546040516323b872dd60e01b81529293506001600160a01b03808916936323b872dd9361379893339316918791016159a2565b6020604051808303816000875af11580156137b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137db919061572c565b505b60a08901356137ec82846156e2565b111561380b57604051632a0c1a9760e01b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b038616906323b872dd9061383b903390309087906004016159a2565b6020604051808303816000875af115801561385a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061387e919061572c565b5060405163095ea7b360e01b81526001600160a01b0386169063095ea7b3906138cd907f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc908690600401615713565b6020604051808303816000875af11580156138ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613910919061572c565b5060005b61391e8a806159e2565b9050811015613b03576139318a806159e2565b82818110613941576139416156b6565b905060c002018036038101906139579190615a47565b9450600088848b848151811061396f5761396f6156b6565b60200260200101516139819190615cc2565b61398b9190615cf7565b905060006139df61399f88602001516148ea565b6139af896060015160020b614275565b6139bf8a6080015160020b614275565b8c6139cb5760006139cd565b855b8d6139d85786614cb6565b6000614cb6565b905060008760200151886040015189606001518a6080015185604051602001613a459594939291906001600160a01b039586168152939094166020840152600291820b6040840152900b60608201526001600160801b0391909116608082015260a00190565b60408051601f198184030181529082905289516304e94bdb60e51b83529092506001600160a01b037f000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc1691639d297b6091613aa4918590600401615834565b6000604051808303816000875af1158015613ac3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613aeb919081019061592c565b50505050508080613afb90615989565b915050613914565b506040805160a0810190915280613b1a8b806159e2565b905081526020018a6020016020810190613b349190615ae7565b60020b8152602001613b4c60608c0160408d01615ae7565b60020b8152602001613b6260608c0135426156e2565b8152602001613b7760a08c0160808d01615a2a565b15159052600b805460009081526006602090815260409182902084518155908401516001820180549386015162ffffff90811663010000000265ffffffffffff1990951692169190911792909217909155606083015160028201556080909201516003909201805492151560ff199093169290921790915554613bfb9033906148d0565b600b547f733a06dcc0387bf816c34d99f254ceb937558fe9d4df66bbe70efa1b2aa1021f903390613c3260a08d0160808e01615a2a565b604080516001600160a01b0390941684526020840192909252151590820152606081018490526080810189905260a0810183905260c00160405180910390a15050505050505050611cc86001600055565b613c8b61481f565b600480546001600160a01b03199081166001600160a01b038b81169190911783556005805483168b83161790556002805483168a831617905560038054909216888216179091558581166000908152600a60209081526040808320805460ff199081168a151517909155878516808552600984529382902080549091168715151790558051630dfe168160e01b8152905187957f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab190951694630dfe16819383820193909291908290030181865afa158015613d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d8e9190615699565b6001600160a01b031614158015613e3857507f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16001600160a01b0316816001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613e08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e2c9190615699565b6001600160a01b031614155b15613e5657604051630d49cdf160e31b815260040160405180910390fd5b7f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58316001600160a01b0316816001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ee29190615699565b6001600160a01b031614158015613f8c57507f000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58316001600160a01b0316816001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f809190615699565b6001600160a01b031614155b15613faa57604051630d49cdf160e31b815260040160405180910390fd5b604080516001600160a01b038a81168252898116602083015288168183015290517f318be759e0d069183ded0831e6c2119c16ced81a05e6da31c19c8c53d01bb9e29181900360600190a1505050505050505050565b6005546040516373ea766160e01b8152600481018390526060916001600160a01b0316906373ea766190602401600060405180830381865afa15801561404a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612f7d9190810190615d19565b600254604051637669909560e01b815230600482015260248101849052604481018390526000916001600160a01b031690637669909590606401602060405180830381865afa1580156140c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140ed91906156fa565b9392505050565b600080612e7a83614275565b61410861481f565b6001600160a01b0381166141725760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b611cc88161487e565b60001960601c828116925083811693508160005283673ec412a9852d173d60c11b17601c52602060002082018201805482169150816141c25763ceea21b66000526004601cfd5b8185148515176141e857816000526030600c20546141e857634b6e7f186000526004601cfd5b6001018390558183827f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a450505050565b60026000540361426e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401614169565b6002600055565b60008060008360020b1261428c578260020b614294565b8260020b6000035b9050620d89e88111156142ba576040516315e4079d60e11b815260040160405180910390fd5b6000816001166000036142d157600160801b6142e3565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561430d576ffff97272373d413259a46990580e213a0260801c5b600482161561432c576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b600882161561434b576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b601082161561436a576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615614389576fff973b41fa98c081472e6896dfb254c00260801c5b60408216156143a8576fff2ea16466c96a3843ec78b326b528610260801c5b60808216156143c7576ffe5dee046a99a2a811c461f1969c30530260801c5b6101008216156143e7576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615614407576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615614427576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615614447576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615614467576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615614487576fa9f746462d870fdf8a65dc1f90e061e50260801c5b6140008216156144a7576f70d869a156d2a1b890bb3df62baf32f70260801c5b6180008216156144c7576f31be135f97d08fd981231505542fcfa60260801c5b620100008216156144e8576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615614508576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615614527576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615614544576b048a170391f7dc42444e8fa20260801c5b60008460020b131561456557806000198161456157614561615ce1565b0490505b600160201b81061561457857600161457b565b60005b60ff16602082901c0192505050919050565b6000826001600160a01b0316846001600160a01b031611156145ad579192915b612e86826001600160801b03168585036001600160a01b0316600160601b614d6e565b6000826001600160a01b0316846001600160a01b031611156145f0579192915b836001600160a01b0316614629606060ff16846001600160801b0316901b8686036001600160a01b0316866001600160a01b0316614d6e565b8161463657614636615ce1565b04949350505050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a08401528015614686578060c08401826020870160045afa505b60208360a48301601c860160008a5af16146a9573d156146a9573d6000843e3d83fd5b508060e01b8251146146c35763d1a57ed66000526004601cfd5b505050505050565b60008086614703576146fe7f0000000000000000000000000000000000000000000000000000000000000012600a615cb3565b61472e565b61472e7f0000000000000000000000000000000000000000000000000000000000000006600a615cb3565b600354604051635b7f6d7760e01b815289151560048201526024810189905260448101889052606481018790526001600160a01b0390911690635b7f6d7790608401602060405180830381865afa15801561478d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147b191906156fa565b6147bb9085615cc2565b6147c59190615cf7565b905086156147d457905061173a565b836148007f0000000000000000000000000000000000000000000000000000000000000012600a615cb3565b61480a9083615cc2565b6148149190615cf7565b979650505050505050565b33614828611871565b6001600160a01b03161461186f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401614169565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6109d5828260405180602001604052806000815250614e20565b60408051600481526024810182526020810180516001600160e01b0316633850c7bd60e01b179052905160009182916001600160a01b0385169161492d916159c6565b600060405180830381855afa9150503d8060008114614968576040519150601f19603f3d011682016040523d82523d6000602084013e61496d565b606091505b50915050808060200190518101906140ed9190615699565b600080836001600160a01b0316856001600160a01b031611156149a6579293925b846001600160a01b0316866001600160a01b0316116149d1576149ca8585856145d0565b9150614a18565b836001600160a01b0316866001600160a01b03161015614a0a576149f68685856145d0565b9150614a0385878561458d565b9050614a18565b614a1585858561458d565b90505b94509492505050565b60006001600160801b036001600160a01b03831611614b6a576000614a4f6001600160a01b03841680615cc2565b9050836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015614a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab39190615699565b6001600160a01b03167f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16001600160a01b031614614b2957614b24600160c01b614b1e7f0000000000000000000000000000000000000000000000000000000000000012600a615cb3565b83614d6e565b614b62565b614b6281614b587f0000000000000000000000000000000000000000000000000000000000000012600a615cb3565b600160c01b614d6e565b915050612f7d565b6000614b846001600160a01b03841680600160401b614d6e565b9050836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015614bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614be89190615699565b6001600160a01b03167f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16001600160a01b031614614c5857614c53600160801b614b1e7f0000000000000000000000000000000000000000000000000000000000000012600a615cb3565b612e86565b612e8681614c877f0000000000000000000000000000000000000000000000000000000000000012600a615cb3565b600160801b614d6e565b60606140ed8383604051806060016040528060278152602001615dad60279139614e3e565b6000836001600160a01b0316856001600160a01b03161115614cd6579293925b846001600160a01b0316866001600160a01b031611614d0157614cfa858585614eb6565b905061173a565b836001600160a01b0316866001600160a01b03161015614d63576000614d28878686614eb6565b90506000614d37878986614f19565b9050806001600160801b0316826001600160801b031610614d585780614d5a565b815b9250505061173a565b611737858584614f19565b6000808060001985870985870292508281108382030391505080600003614da75760008411614d9c57600080fd5b5082900490506140ed565b808411614db357600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b614e2a8383614f56565b823b15610ad957610ad9600084848461463f565b6060600080856001600160a01b031685604051614e5b91906159c6565b600060405180830381855af49150503d8060008114614e96576040519150601f19603f3d011682016040523d82523d6000602084013e614e9b565b606091505b5091509150614eac86838387614ff2565b9695505050505050565b6000826001600160a01b0316846001600160a01b03161115614ed6579192915b6000614ef9856001600160a01b0316856001600160a01b0316600160601b614d6e565b905061173a614f1484838888036001600160a01b0316614d6e565b61506b565b6000826001600160a01b0316846001600160a01b03161115614f39579192915b612e86614f1483600160601b8787036001600160a01b0316614d6e565b6001600160a01b039091169081614f755763ea553b346000526004601cfd5b80600052673ec412a9852d173d60c11b601c5260206000208101810180548060601b15614faa5763c991cbb16000526004601cfd5b831790556000829052601c600c20805460010163ffffffff8116614fd6576301336cea6000526004601cfd5b905580826000600080516020615dd48339815191528138a45050565b6060831561506157825160000361505a576001600160a01b0385163b61505a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401614169565b5081612e86565b612e868383615081565b806001600160801b038116811461164757600080fd5b8151156150915781518083602001fd5b8060405162461bcd60e51b8152600401614169919061517f565b604051806080016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081525090565b6001600160a01b0391909116815260200190565b60006020828403121561510b57600080fd5b81356001600160e01b0319811681146140ed57600080fd5b60005b8381101561513e578181015183820152602001615126565b8381111561514d576000848401525b50505050565b6000815180845261516b816020860160208601615123565b601f01601f19169290920160200192915050565b6020815260006140ed6020830184615153565b6000602082840312156151a457600080fd5b5035919050565b6001600160a01b0381168114611cc857600080fd5b600080604083850312156151d357600080fd5b82356151de816151ab565b946020939093013593505050565b60008060006060848603121561520157600080fd5b833561520c816151ab565b9250602084013561521c816151ab565b929592945050506040919091013590565b60006080828403121561523f57600080fd5b50919050565b60006020828403121561525757600080fd5b81356001600160401b0381111561526d57600080fd5b612e868482850161522d565b6000806040838503121561528c57600080fd5b8235615297816151ab565b915060208301356152a7816151ab565b809150509250929050565b8015158114611cc857600080fd5b600080604083850312156152d357600080fd5b82356152de816151ab565b915060208301356152a7816152b2565b600080600080600060a0868803121561530657600080fd5b8535615311816152b2565b97602087013597506040870135966060810135965060800135945092505050565b60006020828403121561534457600080fd5b81356140ed816151ab565b60006020828403121561536157600080fd5b81356001600160401b0381111561537757600080fd5b8201606081850312156140ed57600080fd5b6000806040838503121561539c57600080fd5b50508035926020909101359150565b600080602083850312156153be57600080fd5b82356001600160401b03808211156153d557600080fd5b818501915085601f8301126153e957600080fd5b8135818111156153f857600080fd5b8660208260051b850101111561540d57600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561547457603f19888603018452615462858351615153565b94509285019290850190600101615446565b5092979650505050505050565b60008060008060006080868803121561549957600080fd5b85356154a4816151ab565b945060208601356154b4816151ab565b93506040860135925060608601356001600160401b03808211156154d757600080fd5b818801915088601f8301126154eb57600080fd5b8135818111156154fa57600080fd5b89602082850101111561550c57600080fd5b9699959850939650602001949392505050565b60006020828403121561553157600080fd5b81356001600160401b0381111561554757600080fd5b820160c081850312156140ed57600080fd5b600080600080600080600080610100898b03121561557657600080fd5b8835615581816151ab565b97506020890135615591816151ab565b965060408901356155a1816151ab565b955060608901356155b1816151ab565b945060808901356155c1816151ab565b935060a08901356155d1816152b2565b925060c08901356155e1816151ab565b915060e08901356155f1816152b2565b809150509295985092959890939650565b8035600281900b811461164757600080fd5b6000806040838503121561562757600080fd5b8235615632816151ab565b915061564060208401615602565b90509250929050565b6000808335601e1984360301811261566057600080fd5b8301803591506001600160401b0382111561567a57600080fd5b6020019150600581901b360382131561569257600080fd5b9250929050565b6000602082840312156156ab57600080fd5b81516140ed816151ab565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156156f5576156f56156cc565b500190565b60006020828403121561570c57600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561573e57600080fd5b81516140ed816152b2565b6000808335601e1984360301811261576057600080fd5b8301803591506001600160401b0382111561577a57600080fd5b60200191503681900382131561569257600080fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b6001600160a01b03878116825286166020820152600285810b604083015284900b60608201526080810183905260c060a0820181905260009061582890830184615153565b98975050505050505050565b6001600160a01b0383168152604060208201819052600090612e8690830184615153565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561589657615896615858565b604052919050565b60006001600160401b038211156158b7576158b7615858565b5060051b60200190565b600082601f8301126158d257600080fd5b815160206158e76158e28361589e565b61586e565b82815260059290921b8401810191818101908684111561590657600080fd5b8286015b84811015615921578051835291830191830161590a565b509695505050505050565b6000806040838503121561593f57600080fd5b82516001600160401b0381111561595557600080fd5b615961858286016158c1565b925050602083015190509250929050565b600082821015615984576159846156cc565b500390565b60006001820161599b5761599b6156cc565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600082516159d8818460208701615123565b9190910192915050565b6000808335601e198436030181126159f957600080fd5b8301803591506001600160401b03821115615a1357600080fd5b602001915060c08102360382131561569257600080fd5b600060208284031215615a3c57600080fd5b81356140ed816152b2565b600060c08284031215615a5957600080fd5b60405160c081016001600160401b0381118282101715615a7b57615a7b615858565b6040528235615a89816151ab565b81526020830135615a99816151ab565b60208201526040830135615aac816151ab565b6040820152615abd60608401615602565b6060820152615ace60808401615602565b608082015260a083013560a08201528091505092915050565b600060208284031215615af957600080fd5b6140ed82615602565b600080600060608486031215615b1757600080fd5b83516001600160401b0380821115615b2e57600080fd5b818601915086601f830112615b4257600080fd5b81516020615b526158e28361589e565b82815260059290921b8401810191818101908a841115615b7157600080fd5b948201945b83861015615b98578551615b89816151ab565b82529482019490820190615b76565b91890151919750909350505080821115615bb157600080fd5b50615bbe868287016158c1565b925050604084015190509250925092565b600181815b80851115615c0a578160001904821115615bf057615bf06156cc565b80851615615bfd57918102915b93841c9390800290615bd4565b509250929050565b600082615c2157506001612f7d565b81615c2e57506000612f7d565b8160018114615c445760028114615c4e57615c6a565b6001915050612f7d565b60ff841115615c5f57615c5f6156cc565b50506001821b612f7d565b5060208310610133831016604e8410600b8410161715615c8d575081810a612f7d565b615c978383615bcf565b8060001904821115615cab57615cab6156cc565b029392505050565b60006140ed60ff841683615c12565b6000816000190483118215151615615cdc57615cdc6156cc565b500290565b634e487b7160e01b600052601260045260246000fd5b600082615d1457634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215615d2b57600080fd5b81516001600160401b0380821115615d4257600080fd5b818401915084601f830112615d5657600080fd5b815181811115615d6857615d68615858565b615d7b601f8201601f191660200161586e565b9150808252856020828501011115615d9257600080fd5b615da3816020840160208601615123565b5094935050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204c0139263b5cd1dbdd1eeaaab7286d3f9955fbb99b0dcd75bfb29f8f62395e2664736f6c634300080f0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc0000000000000000000000000fd9874a8902772c3573c11e8162f78cc96940b5000000000000000000000000c808acb06077174333b31ae123c33c655973003500000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d0

-----Decoded View---------------
Arg [0] : _pm (address): 0xE4bA6740aF4c666325D49B3112E4758371386aDc
Arg [1] : _optionPricing (address): 0x0Fd9874A8902772c3573C11E8162F78cC96940B5
Arg [2] : _dpFee (address): 0xC808AcB06077174333b31Ae123C33c6559730035
Arg [3] : _callAsset (address): 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1
Arg [4] : _putAsset (address): 0xaf88d065e77c8cC2239327C5EDb3A432268e5831
Arg [5] : _primePool (address): 0xC6962004f452bE9203591991D15f6b388e09E8D0

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000e4ba6740af4c666325d49b3112e4758371386adc
Arg [1] : 0000000000000000000000000fd9874a8902772c3573c11e8162f78cc96940b5
Arg [2] : 000000000000000000000000c808acb06077174333b31ae123c33c6559730035
Arg [3] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [4] : 000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831
Arg [5] : 000000000000000000000000c6962004f452be9203591991d15f6b388e09e8d0


Loading