Sepolia Testnet

Contract

0x838f0d9f6aA587917B681334Dc2ed37065D363a8

Overview

ETH Balance

0.4256203643208 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Approve62713852024-07-08 17:28:3610 days ago1720459716IN
0x838f0d9f...065D363a8
0 ETH0.000272685.92313135
Approve62713812024-07-08 17:27:3610 days ago1720459656IN
0x838f0d9f...065D363a8
0 ETH0.000228784.93852568

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
63357792024-07-18 23:09:002 hrs ago1721344140
0x838f0d9f...065D363a8
0.012 ETH
63296982024-07-17 21:54:2428 hrs ago1721253264
0x838f0d9f...065D363a8
0.012 ETH
63296922024-07-17 21:53:0028 hrs ago1721253180
0x838f0d9f...065D363a8
0.012 ETH
63237392024-07-16 22:25:242 days ago1721168724
0x838f0d9f...065D363a8
0.012 ETH
63142362024-07-15 9:33:363 days ago1721036016
0x838f0d9f...065D363a8
0.012 ETH
63142262024-07-15 9:31:363 days ago1721035896
0x838f0d9f...065D363a8
0.012 ETH
63111982024-07-14 21:38:484 days ago1720993128
0x838f0d9f...065D363a8
0.012 ETH
63111712024-07-14 21:32:124 days ago1720992732
0x838f0d9f...065D363a8
0.012 ETH
62930012024-07-12 0:38:007 days ago1720744680
0x838f0d9f...065D363a8
0.012 ETH
62929692024-07-12 0:31:007 days ago1720744260
0x838f0d9f...065D363a8
0.012 ETH
62901192024-07-11 14:05:247 days ago1720706724
0x838f0d9f...065D363a8
0.012 ETH
62803222024-07-10 2:16:488 days ago1720577808
0x838f0d9f...065D363a8
0.012 ETH
62794972024-07-09 23:15:489 days ago1720566948
0x838f0d9f...065D363a8
0.012 ETH
62786352024-07-09 20:04:489 days ago1720555488
0x838f0d9f...065D363a8
0.012 ETH
62785852024-07-09 19:54:369 days ago1720554876
0x838f0d9f...065D363a8
0.012 ETH
62783342024-07-09 18:59:009 days ago1720551540
0x838f0d9f...065D363a8
0.012 ETH
62770872024-07-09 14:27:489 days ago1720535268
0x838f0d9f...065D363a8
0.012 ETH
62757702024-07-09 9:40:249 days ago1720518024
0x838f0d9f...065D363a8
0.012 ETH
62733382024-07-09 0:44:0010 days ago1720485840
0x838f0d9f...065D363a8
0.012 ETH
62732492024-07-09 0:24:1210 days ago1720484652
0x838f0d9f...065D363a8
0.012 ETH
62732202024-07-09 0:18:0010 days ago1720484280
0x838f0d9f...065D363a8
0.012 ETH
62731912024-07-09 0:11:2410 days ago1720483884
0x838f0d9f...065D363a8
0.012 ETH
62729952024-07-08 23:26:3610 days ago1720481196
0x838f0d9f...065D363a8
0.012 ETH
62724392024-07-08 21:22:4810 days ago1720473768
0x838f0d9f...065D363a8
0.012 ETH
62719972024-07-08 19:43:1210 days ago1720467792
0x838f0d9f...065D363a8
0.012 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MarginalV1Pool

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 36 : MarginalV1Pool.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.17;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";

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

import {LiquidityMath} from "./libraries/LiquidityMath.sol";
import {OracleLibrary} from "./libraries/OracleLibrary.sol";
import {Position} from "./libraries/Position.sol";
import {SqrtPriceMath} from "./libraries/SqrtPriceMath.sol";
import {SwapMath} from "./libraries/SwapMath.sol";
import {TransferHelper} from "./libraries/TransferHelper.sol";

import {IMarginalV1AdjustCallback} from "./interfaces/callback/IMarginalV1AdjustCallback.sol";
import {IMarginalV1MintCallback} from "./interfaces/callback/IMarginalV1MintCallback.sol";
import {IMarginalV1OpenCallback} from "./interfaces/callback/IMarginalV1OpenCallback.sol";
import {IMarginalV1SettleCallback} from "./interfaces/callback/IMarginalV1SettleCallback.sol";
import {IMarginalV1SwapCallback} from "./interfaces/callback/IMarginalV1SwapCallback.sol";

import {IMarginalV1Factory} from "./interfaces/IMarginalV1Factory.sol";
import {IMarginalV1Pool} from "./interfaces/IMarginalV1Pool.sol";

contract MarginalV1Pool is IMarginalV1Pool, ERC20 {
    using Position for mapping(bytes32 => Position.Info);
    using Position for Position.Info;
    using SafeCast for uint256;

    /// @inheritdoc IMarginalV1Pool
    address public immutable factory;
    /// @inheritdoc IMarginalV1Pool
    address public immutable oracle;

    /// @inheritdoc IMarginalV1Pool
    address public immutable token0;
    /// @inheritdoc IMarginalV1Pool
    address public immutable token1;
    /// @inheritdoc IMarginalV1Pool
    uint24 public immutable maintenance;

    /// @inheritdoc IMarginalV1Pool
    uint24 public constant fee = 1000; // 10 bps across all pools
    /// @inheritdoc IMarginalV1Pool
    uint24 public constant rewardPremium = 2000000; // 2x base fee as liquidation rewards
    /// @inheritdoc IMarginalV1Pool
    uint24 public constant tickCumulativeRateMax = 920; // bound on funding rate of ~10% per funding period

    /// @inheritdoc IMarginalV1Pool
    uint32 public constant secondsAgo = 43200; // 12 hr TWAP for oracle price
    /// @inheritdoc IMarginalV1Pool
    uint32 public constant fundingPeriod = 604800; // 7 day funding period

    // @dev varies for different chains
    uint256 internal constant blockBaseFeeMin = 40e9; // min base fee for liquidation rewards
    uint256 internal constant gasLiquidate = 150000; // gas required to call liquidate

    uint128 internal constant MINIMUM_LIQUIDITY = 10000; // liquidity locked on initial mint always available for swaps
    uint128 internal constant MINIMUM_SIZE = 10000; // minimum position size, debt, insurance amounts to prevent dust sizes

    struct State {
        uint160 sqrtPriceX96;
        uint96 totalPositions; // > ~ 2e20 years at max per block to fill on mainnet
        uint128 liquidity;
        int24 tick;
        uint32 blockTimestamp;
        int56 tickCumulative;
        uint8 feeProtocol;
        bool initialized;
    }
    /// @inheritdoc IMarginalV1Pool
    State public state;

    /// @inheritdoc IMarginalV1Pool
    uint128 public liquidityLocked;

    struct ProtocolFees {
        uint128 token0;
        uint128 token1;
    }
    /// @inheritdoc IMarginalV1Pool
    ProtocolFees public protocolFees;

    /// @inheritdoc IMarginalV1Pool
    mapping(bytes32 => Position.Info) public positions;

    uint256 private unlocked = 2; // uses OZ convention of 1 for false and 2 for true
    modifier lock() {
        if (unlocked == 1) revert Locked();
        unlocked = 1;
        _;
        unlocked = 2;
    }

    modifier onlyFactoryOwner() {
        if (msg.sender != IMarginalV1Factory(factory).owner())
            revert Unauthorized();
        _;
    }

    event Initialize(uint160 sqrtPriceX96, int24 tick);
    event Open(
        address sender,
        address indexed owner,
        uint256 indexed id,
        uint128 liquidityAfter,
        uint160 sqrtPriceX96After,
        uint128 margin
    );
    event Adjust(
        address indexed owner,
        uint256 indexed id,
        address recipient,
        uint256 marginAfter
    );
    event Settle(
        address indexed owner,
        uint256 indexed id,
        address recipient,
        uint128 liquidityAfter,
        uint160 sqrtPriceX96After,
        int256 amount0,
        int256 amount1,
        uint256 rewards
    );
    event Liquidate(
        address indexed owner,
        uint256 indexed id,
        address recipient,
        uint128 liquidityAfter,
        uint160 sqrtPriceX96After,
        uint256 rewards
    );
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );
    event Mint(
        address sender,
        address indexed owner,
        uint128 liquidityDelta,
        uint256 amount0,
        uint256 amount1
    );
    event Burn(
        address indexed owner,
        address recipient,
        uint128 liquidityDelta,
        uint256 amount0,
        uint256 amount1
    );
    event SetFeeProtocol(uint8 oldFeeProtocol, uint8 newFeeProtocol);
    event CollectProtocol(
        address sender,
        address indexed recipient,
        uint128 amount0,
        uint128 amount1
    );

    error Locked();
    error Unauthorized();
    error InvalidLiquidityDelta();
    error InvalidSqrtPriceLimitX96();
    error SqrtPriceX96ExceedsLimit();
    error MarginLessThanMin();
    error RewardsLessThanMin();
    error Amount0LessThanMin();
    error Amount1LessThanMin();
    error InvalidPosition();
    error PositionSafe();
    error InvalidAmountSpecified();
    error InvalidFeeProtocol();

    constructor(
        address _factory,
        address _token0,
        address _token1,
        uint24 _maintenance,
        address _oracle
    ) ERC20("Marginal V1 LP Token", "MARGV1-LP") {
        factory = _factory;
        token0 = _token0;
        token1 = _token1;
        maintenance = _maintenance;
        oracle = _oracle;
    }

    function initialize() private {
        // reverts if not enough historical observations
        uint32[] memory secondsAgos = new uint32[](2);
        secondsAgos[0] = secondsAgo;
        int56[] memory oracleTickCumulativesLast = oracleTickCumulatives(
            secondsAgos
        );

        // use oracle price to initialize
        uint160 _sqrtPriceX96 = OracleLibrary.oracleSqrtPriceX96(
            OracleLibrary.oracleTickCumulativeDelta(
                oracleTickCumulativesLast[0],
                oracleTickCumulativesLast[1]
            ),
            secondsAgo
        );
        int24 tick = TickMath.getTickAtSqrtRatio(_sqrtPriceX96);

        state = State({
            sqrtPriceX96: _sqrtPriceX96,
            totalPositions: 0,
            liquidity: 0,
            tick: tick,
            blockTimestamp: _blockTimestamp(),
            tickCumulative: 0,
            feeProtocol: 0,
            initialized: true
        });
        emit Initialize(_sqrtPriceX96, tick);
    }

    function _blockTimestamp() internal view virtual returns (uint32) {
        return uint32(block.timestamp);
    }

    function balance0() private view returns (uint256) {
        return IERC20(token0).balanceOf(address(this));
    }

    function balance1() private view returns (uint256) {
        return IERC20(token1).balanceOf(address(this));
    }

    function oracleTickCumulatives(
        uint32[] memory secondsAgos
    ) private view returns (int56[] memory) {
        (int56[] memory tickCumulatives, ) = IUniswapV3Pool(oracle).observe(
            secondsAgos
        );
        return tickCumulatives;
    }

    function stateSynced() private view returns (State memory) {
        State memory _state = state;
        // oracle update
        unchecked {
            uint32 delta = _blockTimestamp() - _state.blockTimestamp;
            if (delta == 0) return _state; // early exit if nothing to update
            _state.tickCumulative += int56(_state.tick) * int56(uint56(delta)); // overflow desired
            _state.blockTimestamp = _blockTimestamp();
        }
        return _state;
    }

    /// @inheritdoc IMarginalV1Pool
    function open(
        address recipient,
        bool zeroForOne,
        uint128 liquidityDelta,
        uint160 sqrtPriceLimitX96,
        uint128 margin,
        bytes calldata data
    )
        external
        payable
        lock
        returns (
            uint256 id,
            uint256 size,
            uint256 debt,
            uint256 amount0,
            uint256 amount1
        )
    {
        State memory _state = stateSynced();
        if (
            liquidityDelta == 0 ||
            liquidityDelta + MINIMUM_LIQUIDITY >= _state.liquidity
        ) revert InvalidLiquidityDelta();
        if (
            zeroForOne
                ? !(sqrtPriceLimitX96 < _state.sqrtPriceX96 &&
                    sqrtPriceLimitX96 > SqrtPriceMath.MIN_SQRT_RATIO)
                : !(sqrtPriceLimitX96 > _state.sqrtPriceX96 &&
                    sqrtPriceLimitX96 < SqrtPriceMath.MAX_SQRT_RATIO)
        ) revert InvalidSqrtPriceLimitX96();

        uint160 sqrtPriceX96Next = SqrtPriceMath.sqrtPriceX96NextOpen(
            _state.liquidity,
            _state.sqrtPriceX96,
            liquidityDelta,
            zeroForOne,
            maintenance
        );
        if (
            zeroForOne
                ? sqrtPriceX96Next < sqrtPriceLimitX96
                : sqrtPriceX96Next > sqrtPriceLimitX96
        ) revert SqrtPriceX96ExceedsLimit();

        // zero seconds ago for oracle tickCumulative
        int56 oracleTickCumulative = oracleTickCumulatives(new uint32[](1))[0];

        Position.Info memory position = Position.assemble(
            _state.liquidity,
            _state.sqrtPriceX96,
            sqrtPriceX96Next,
            liquidityDelta,
            zeroForOne,
            _state.tick,
            _state.blockTimestamp,
            _state.tickCumulative,
            oracleTickCumulative
        );
        if (
            position.size < MINIMUM_SIZE ||
            position.debt0 < MINIMUM_SIZE ||
            position.debt1 < MINIMUM_SIZE ||
            position.insurance0 < MINIMUM_SIZE ||
            position.insurance1 < MINIMUM_SIZE
        ) revert InvalidPosition();

        uint128 marginMinimum = position.marginMinimum(maintenance);
        if (marginMinimum == 0 || margin < marginMinimum)
            revert MarginLessThanMin();
        position.margin = margin;

        uint256 rewardsMinimum = Position.liquidationRewards(
            block.basefee,
            blockBaseFeeMin,
            gasLiquidate,
            rewardPremium
        );
        if (msg.value < rewardsMinimum) revert RewardsLessThanMin();
        position.rewards = msg.value;

        _state.liquidity -= liquidityDelta;
        _state.sqrtPriceX96 = sqrtPriceX96Next;

        liquidityLocked += liquidityDelta;

        // callback for margin amount
        if (!zeroForOne) {
            // long token0 (out) relative to token1 (in); margin in token0
            uint256 fees0 = Position.fees(position.size, fee);
            amount0 = uint256(margin) + fees0;

            uint256 balance0Before = balance0();
            IMarginalV1OpenCallback(msg.sender).marginalV1OpenCallback(
                amount0,
                0,
                data
            );
            if (balance0Before + amount0 > balance0())
                revert Amount0LessThanMin();

            // account for protocol fees if fee on
            if (_state.feeProtocol > 0) {
                uint256 delta = fees0 / _state.feeProtocol;
                fees0 -= delta;
                protocolFees.token0 += uint128(delta);
            }

            // fees added to available liquidity
            (uint128 liquidityAfter, uint160 sqrtPriceX96After) = LiquidityMath
                .liquiditySqrtPriceX96Next(
                    _state.liquidity,
                    _state.sqrtPriceX96,
                    int256(fees0),
                    0
                );
            _state.liquidity = liquidityAfter;
            _state.sqrtPriceX96 = sqrtPriceX96After;
            _state.tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96After);
        } else {
            // long token1 (out) relative to token0 (in); margin in token1
            uint256 fees1 = Position.fees(position.size, fee);
            amount1 = uint256(margin) + fees1;

            uint256 balance1Before = balance1();
            IMarginalV1OpenCallback(msg.sender).marginalV1OpenCallback(
                0,
                amount1,
                data
            );
            if (balance1Before + amount1 > balance1())
                revert Amount1LessThanMin();

            // account for protocol fees if fee on
            if (_state.feeProtocol > 0) {
                uint256 delta = fees1 / _state.feeProtocol;
                fees1 -= delta;
                protocolFees.token1 += uint128(delta);
            }

            // fees added to available liquidity
            (uint128 liquidityAfter, uint160 sqrtPriceX96After) = LiquidityMath
                .liquiditySqrtPriceX96Next(
                    _state.liquidity,
                    _state.sqrtPriceX96,
                    0,
                    int256(fees1)
                );
            _state.liquidity = liquidityAfter;
            _state.sqrtPriceX96 = sqrtPriceX96After;
            _state.tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96After);
        }

        id = _state.totalPositions;
        size = position.size;
        debt = zeroForOne ? position.debt0 : position.debt1;

        positions.set(recipient, _state.totalPositions, position);
        _state.totalPositions++;

        // update pool state to latest
        state = _state;

        emit Open(
            msg.sender,
            recipient,
            id,
            _state.liquidity,
            _state.sqrtPriceX96,
            margin
        );
    }

    /// @inheritdoc IMarginalV1Pool
    function adjust(
        address recipient,
        uint96 id,
        int128 marginDelta,
        bytes calldata data
    ) external lock returns (uint256 margin0, uint256 margin1) {
        State memory _state = stateSynced();
        Position.Info memory position = positions.get(msg.sender, id);
        if (position.size == 0) revert InvalidPosition();

        // don't update position stored debts for funding to avoid short circuiting and min margin zero issues
        uint128 marginMinimum = position.marginMinimum(maintenance);
        if (
            int256(uint256(position.margin)) + int256(marginDelta) <
            int256(uint256(marginMinimum))
        ) revert MarginLessThanMin();

        // flash margin out then callback for margin in
        if (!position.zeroForOne) {
            margin0 = uint256(
                int256(uint256(position.margin)) + int256(marginDelta)
            ); // position margin after
            TransferHelper.safeTransfer(token0, recipient, position.margin);

            uint256 balance0Before = balance0();
            IMarginalV1AdjustCallback(msg.sender).marginalV1AdjustCallback(
                margin0,
                0,
                data
            );
            if (balance0Before + margin0 > balance0())
                revert Amount0LessThanMin();

            position.margin = margin0.toUint128();
        } else {
            margin1 = uint256(
                int256(uint256(position.margin)) + int256(marginDelta)
            ); // position margin after
            TransferHelper.safeTransfer(token1, recipient, position.margin);

            uint256 balance1Before = balance1();
            IMarginalV1AdjustCallback(msg.sender).marginalV1AdjustCallback(
                0,
                margin1,
                data
            );
            if (balance1Before + margin1 > balance1())
                revert Amount1LessThanMin();

            position.margin = margin1.toUint128();
        }

        positions.set(msg.sender, id, position);

        // update pool state to latest
        state = _state;

        emit Adjust(msg.sender, uint256(id), recipient, position.margin);
    }

    /// @inheritdoc IMarginalV1Pool
    function settle(
        address recipient,
        uint96 id,
        bytes calldata data
    ) external lock returns (int256 amount0, int256 amount1, uint256 rewards) {
        State memory _state = stateSynced();
        Position.Info memory position = positions.get(msg.sender, id);
        if (position.size == 0) revert InvalidPosition();

        // zero seconds ago for oracle tickCumulative
        int56 oracleTickCumulative = oracleTickCumulatives(new uint32[](1))[0];

        // update debts for funding
        position = position.sync(
            _state.blockTimestamp,
            _state.tickCumulative,
            oracleTickCumulative,
            tickCumulativeRateMax,
            fundingPeriod
        );

        liquidityLocked -= position.liquidityLocked;
        (uint256 amount0Unlocked, uint256 amount1Unlocked) = position
            .amountsLocked();

        // flash size + margin + rewards out then callback for debt owed in
        rewards = position.rewards;
        TransferHelper.safeTransferETH(recipient, rewards); // ok given lock

        if (!position.zeroForOne) {
            amount0 = -int256(
                uint256(position.size) + uint256(position.margin)
            ); // size + margin out
            amount1 = int256(uint256(position.debt1)); // debt in

            if (amount0 < 0)
                TransferHelper.safeTransfer(
                    token0,
                    recipient,
                    uint256(-amount0)
                );

            (uint128 liquidityNext, uint160 sqrtPriceX96Next) = LiquidityMath
                .liquiditySqrtPriceX96Next(
                    _state.liquidity,
                    _state.sqrtPriceX96,
                    int256(
                        amount0Unlocked -
                            uint256(position.size) -
                            uint256(position.margin)
                    ), // insurance0 + debt0
                    int256(amount1Unlocked) + amount1 // insurance1 + debt1
                );
            _state.liquidity = liquidityNext;
            _state.sqrtPriceX96 = sqrtPriceX96Next;
            _state.tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96Next);

            uint256 balance1Before = balance1();
            IMarginalV1SettleCallback(msg.sender).marginalV1SettleCallback(
                amount0,
                amount1,
                data
            );
            if (balance1Before + uint256(amount1) > balance1())
                revert Amount1LessThanMin();
        } else {
            amount0 = int256(uint256(position.debt0)); // debt in
            amount1 = -int256(
                uint256(position.size) + uint256(position.margin)
            ); // size + margin out

            if (amount1 < 0)
                TransferHelper.safeTransfer(
                    token1,
                    recipient,
                    uint256(-amount1)
                );

            (uint128 liquidityNext, uint160 sqrtPriceX96Next) = LiquidityMath
                .liquiditySqrtPriceX96Next(
                    _state.liquidity,
                    _state.sqrtPriceX96,
                    int256(amount0Unlocked) + amount0, // insurance0 + debt0
                    int256(
                        amount1Unlocked -
                            uint256(position.size) -
                            uint256(position.margin)
                    ) // insurance1 + debt1
                );
            _state.liquidity = liquidityNext;
            _state.sqrtPriceX96 = sqrtPriceX96Next;
            _state.tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96Next);

            uint256 balance0Before = balance0();
            IMarginalV1SettleCallback(msg.sender).marginalV1SettleCallback(
                amount0,
                amount1,
                data
            );
            if (balance0Before + uint256(amount0) > balance0())
                revert Amount0LessThanMin();
        }

        positions.set(msg.sender, id, position.settle());

        // update pool state to latest
        state = _state;

        emit Settle(
            msg.sender,
            uint256(id),
            recipient,
            _state.liquidity,
            _state.sqrtPriceX96,
            amount0,
            amount1,
            rewards
        );
    }

    /// @inheritdoc IMarginalV1Pool
    function liquidate(
        address recipient,
        address owner,
        uint96 id
    ) external lock returns (uint256 rewards) {
        State memory _state = stateSynced();
        Position.Info memory position = positions.get(owner, id);
        if (position.size == 0) revert InvalidPosition();

        // oracle price averaged over seconds ago for liquidation calc
        uint32[] memory secondsAgos = new uint32[](2);
        secondsAgos[0] = secondsAgo;

        int56[] memory oracleTickCumulativesLast = oracleTickCumulatives(
            secondsAgos
        );
        uint160 oracleSqrtPriceX96 = OracleLibrary.oracleSqrtPriceX96(
            OracleLibrary.oracleTickCumulativeDelta(
                oracleTickCumulativesLast[0],
                oracleTickCumulativesLast[1]
            ),
            secondsAgo
        );

        // update debts for funding
        position = position.sync(
            _state.blockTimestamp,
            _state.tickCumulative,
            oracleTickCumulativesLast[1], // zero seconds ago
            tickCumulativeRateMax,
            fundingPeriod
        );
        if (position.safe(oracleSqrtPriceX96, maintenance))
            revert PositionSafe();

        liquidityLocked -= position.liquidityLocked;
        (uint256 amount0, uint256 amount1) = position.amountsLocked();

        (_state.liquidity, _state.sqrtPriceX96) = LiquidityMath
            .liquiditySqrtPriceX96Next(
                _state.liquidity,
                _state.sqrtPriceX96,
                int256(amount0),
                int256(amount1)
            );
        _state.tick = TickMath.getTickAtSqrtRatio(_state.sqrtPriceX96);

        rewards = position.rewards;
        TransferHelper.safeTransferETH(recipient, rewards); // ok given lock

        positions.set(owner, id, position.liquidate());

        // update pool state to latest
        state = _state;

        emit Liquidate(
            owner,
            uint256(id),
            recipient,
            _state.liquidity,
            _state.sqrtPriceX96,
            rewards
        );
    }

    /// @inheritdoc IMarginalV1Pool
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external lock returns (int256 amount0, int256 amount1) {
        State memory _state = stateSynced();
        if (amountSpecified == 0) revert InvalidAmountSpecified();
        if (
            zeroForOne
                ? !(sqrtPriceLimitX96 < _state.sqrtPriceX96 &&
                    sqrtPriceLimitX96 > SqrtPriceMath.MIN_SQRT_RATIO)
                : !(sqrtPriceLimitX96 > _state.sqrtPriceX96 &&
                    sqrtPriceLimitX96 < SqrtPriceMath.MAX_SQRT_RATIO)
        ) revert InvalidSqrtPriceLimitX96();

        // add fees back in after swap calcs if exact input
        bool exactInput = amountSpecified > 0;
        int256 amountSpecifiedLessFee = exactInput
            ? amountSpecified -
                int256(SwapMath.swapFees(uint256(amountSpecified), fee, false))
            : amountSpecified;

        uint160 sqrtPriceX96Next = SqrtPriceMath.sqrtPriceX96NextSwap(
            _state.liquidity,
            _state.sqrtPriceX96,
            zeroForOne,
            amountSpecifiedLessFee
        );
        if (
            zeroForOne
                ? sqrtPriceX96Next < sqrtPriceLimitX96
                : sqrtPriceX96Next > sqrtPriceLimitX96
        ) revert SqrtPriceX96ExceedsLimit();

        // amounts without fees
        (amount0, amount1) = SwapMath.swapAmounts(
            _state.liquidity,
            _state.sqrtPriceX96,
            sqrtPriceX96Next
        );

        // optimistic amount out with callback for amount in
        if (!zeroForOne) {
            amount0 = !exactInput ? amountSpecified : amount0; // in case of rounding issues
            if (amount0 < 0)
                TransferHelper.safeTransfer(
                    token0,
                    recipient,
                    uint256(-amount0)
                );

            uint256 fees1 = exactInput
                ? uint256(amountSpecified) - uint256(amount1)
                : SwapMath.swapFees(uint256(amount1), fee, true);
            amount1 += int256(fees1);

            uint256 balance1Before = balance1();
            IMarginalV1SwapCallback(msg.sender).marginalV1SwapCallback(
                amount0,
                amount1,
                data
            );
            if (amount1 == 0 || balance1Before + uint256(amount1) > balance1())
                revert Amount1LessThanMin();

            // account for protocol fees if fee on
            uint256 delta = _state.feeProtocol > 0
                ? fees1 / _state.feeProtocol
                : 0;
            if (delta > 0) protocolFees.token1 += uint128(delta);

            // update state liquidity, sqrt price accounting for fee growth
            (uint128 liquidityAfter, uint160 sqrtPriceX96After) = LiquidityMath
                .liquiditySqrtPriceX96Next(
                    _state.liquidity,
                    _state.sqrtPriceX96,
                    amount0,
                    amount1 - int256(delta) // exclude protocol fees if any
                );
            _state.liquidity = liquidityAfter;
            _state.sqrtPriceX96 = sqrtPriceX96After;
            _state.tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96After);
        } else {
            amount1 = !exactInput ? amountSpecified : amount1; // in case of rounding issues
            if (amount1 < 0)
                TransferHelper.safeTransfer(
                    token1,
                    recipient,
                    uint256(-amount1)
                );

            uint256 fees0 = exactInput
                ? uint256(amountSpecified) - uint256(amount0)
                : SwapMath.swapFees(uint256(amount0), fee, true);
            amount0 += int256(fees0);

            uint256 balance0Before = balance0();
            IMarginalV1SwapCallback(msg.sender).marginalV1SwapCallback(
                amount0,
                amount1,
                data
            );
            if (amount0 == 0 || balance0Before + uint256(amount0) > balance0())
                revert Amount0LessThanMin();

            // account for protocol fees if fee on
            uint256 delta = _state.feeProtocol > 0
                ? fees0 / _state.feeProtocol
                : 0;
            if (delta > 0) protocolFees.token0 += uint128(delta);

            // update state liquidity, sqrt price accounting for fee growth
            (uint128 liquidityAfter, uint160 sqrtPriceX96After) = LiquidityMath
                .liquiditySqrtPriceX96Next(
                    _state.liquidity,
                    _state.sqrtPriceX96,
                    amount0 - int256(delta), // exclude protocol fees if any
                    amount1
                );
            _state.liquidity = liquidityAfter;
            _state.sqrtPriceX96 = sqrtPriceX96After;
            _state.tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96After);
        }

        // update pool state to latest
        state = _state;

        emit Swap(
            msg.sender,
            recipient,
            amount0,
            amount1,
            _state.sqrtPriceX96,
            _state.liquidity,
            _state.tick
        );
    }

    /// @inheritdoc IMarginalV1Pool
    function mint(
        address recipient,
        uint128 liquidityDelta,
        bytes calldata data
    ) external lock returns (uint256 shares, uint256 amount0, uint256 amount1) {
        uint256 _totalSupply = totalSupply();

        bool initializing = (_totalSupply == 0);
        if (initializing) initialize();

        State memory _state = stateSynced();
        uint128 liquidityDeltaMinimum = (initializing ? MINIMUM_LIQUIDITY : 0);
        if (liquidityDelta <= liquidityDeltaMinimum)
            revert InvalidLiquidityDelta();

        (amount0, amount1) = LiquidityMath.toAmounts(
            liquidityDelta,
            _state.sqrtPriceX96
        );
        amount0 += 1; // rough round up on amounts in when add liquidity
        amount1 += 1;

        // total liquidity is available liquidity if all locked liquidity was returned to pool
        uint128 totalLiquidityAfter = _state.liquidity +
            liquidityLocked +
            liquidityDelta;
        shares = initializing
            ? totalLiquidityAfter
            : Math.mulDiv(
                _totalSupply,
                liquidityDelta,
                totalLiquidityAfter - liquidityDelta
            );

        _state.liquidity += liquidityDelta;

        // callback for amounts owed
        uint256 balance0Before = balance0();
        uint256 balance1Before = balance1();
        IMarginalV1MintCallback(msg.sender).marginalV1MintCallback(
            amount0,
            amount1,
            data
        );
        if (balance0Before + amount0 > balance0()) revert Amount0LessThanMin();
        if (balance1Before + amount1 > balance1()) revert Amount1LessThanMin();

        // update pool state to latest
        state = _state;

        // lock min liquidity on initial mint to avoid stuck states with price
        if (initializing) {
            shares -= uint256(MINIMUM_LIQUIDITY);
            _mint(address(this), MINIMUM_LIQUIDITY);
        }

        _mint(recipient, shares);

        emit Mint(msg.sender, recipient, liquidityDelta, amount0, amount1);
    }

    /// @inheritdoc IMarginalV1Pool
    function burn(
        address recipient,
        uint256 shares
    )
        external
        lock
        returns (uint128 liquidityDelta, uint256 amount0, uint256 amount1)
    {
        State memory _state = stateSynced();
        uint256 _totalSupply = totalSupply();

        // total liquidity is available liquidity if all locked liquidity were returned to pool
        uint128 totalLiquidityBefore = _state.liquidity + liquidityLocked;
        liquidityDelta = uint128(
            Math.mulDiv(totalLiquidityBefore, shares, _totalSupply)
        );
        if (liquidityDelta > _state.liquidity) revert InvalidLiquidityDelta();

        (amount0, amount1) = LiquidityMath.toAmounts(
            liquidityDelta,
            _state.sqrtPriceX96
        );
        _state.liquidity -= liquidityDelta;

        if (amount0 > 0)
            TransferHelper.safeTransfer(token0, recipient, amount0);
        if (amount1 > 0)
            TransferHelper.safeTransfer(token1, recipient, amount1);

        // update pool state to latest
        state = _state;

        _burn(msg.sender, shares);

        emit Burn(msg.sender, recipient, liquidityDelta, amount0, amount1);
    }

    /// @inheritdoc IMarginalV1Pool
    function setFeeProtocol(uint8 feeProtocol) external lock onlyFactoryOwner {
        if (!(feeProtocol == 0 || (feeProtocol >= 4 && feeProtocol <= 10)))
            revert InvalidFeeProtocol();
        emit SetFeeProtocol(state.feeProtocol, feeProtocol);
        state.feeProtocol = feeProtocol;
    }

    /// @inheritdoc IMarginalV1Pool
    function collectProtocol(
        address recipient
    )
        external
        lock
        onlyFactoryOwner
        returns (uint128 amount0, uint128 amount1)
    {
        // no zero check on protocolFees as will revert in amounts calculation
        amount0 = protocolFees.token0 - 1; // ensure slot not cleared for gas savings
        amount1 = protocolFees.token1 - 1;

        protocolFees.token0 = 1;
        TransferHelper.safeTransfer(token0, recipient, amount0);

        protocolFees.token1 = 1;
        TransferHelper.safeTransfer(token1, recipient, amount1);

        emit CollectProtocol(msg.sender, recipient, amount0, amount1);
    }
}

File 2 of 36 : OracleLibrary.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {TickMath} from "@uniswap/v3-core/contracts/libraries/TickMath.sol";

/// @title Oracle library
/// @notice Enables calculation of the geometric time weighted average price
library OracleLibrary {
    /// @notice Returns the geometric time weighted average sqrtP
    /// @dev Rounds toward zero for both positive and negative tick delta
    /// @param tickCumulativeDelta The delta in tick cumulative over the averaging interval
    /// @param timeDelta The time to average over
    /// @return The geometric time weighted average price
    function oracleSqrtPriceX96(
        int56 tickCumulativeDelta,
        uint32 timeDelta
    ) internal pure returns (uint160) {
        // @uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol#L35
        int24 arithmeticMeanTick = int24(
            tickCumulativeDelta / int56(uint56(timeDelta))
        );
        return TickMath.getSqrtRatioAtTick(arithmeticMeanTick);
    }

    /// @notice Returns the tick cumulative delta over an interval
    /// @dev Allows for tick cumulative overflow
    /// @param tickCumulativeStart The tick cumulative value at the start of the interval
    /// @param tickCumulativeEnd The tick cumulative value at the end of the interval
    /// @return The delta in tick cumulative over the averaging interval
    function oracleTickCumulativeDelta(
        int56 tickCumulativeStart,
        int56 tickCumulativeEnd
    ) internal pure returns (int56) {
        unchecked {
            return tickCumulativeEnd - tickCumulativeStart;
        }
    }
}

File 3 of 36 : 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 4 of 36 : TransferHelper.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/// @title Transfer library
/// @notice Facilitates safe transfers of ERC20 tokens and native chain token
library TransferHelper {
    using SafeERC20 for IERC20;

    /// @notice Transfers an ERC20 token amount from this address
    /// @dev If value > balance, transfers balance of this address
    /// @param token The address of the ERC20 to transfer
    /// @param to The address of the recipient
    /// @param value The desired amount of tokens to transfer
    function safeTransfer(address token, address to, uint256 value) internal {
        // in case of dust errors due to (L, sqrtP) <=> (x, y) transforms
        uint256 balance = IERC20(token).balanceOf(address(this));
        uint256 amount = value <= balance ? value : balance;
        IERC20(token).safeTransfer(to, amount);
    }

    /// @notice Transfers an amount of native (gas) token from this address
    /// @dev Ref @uniswap/v3-periphery/contracts/libraries/TransferHelper.sol#L56
    /// @param to The address of the recipient
    /// @param value The amount of ETH to transfer
    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}("");
        require(success, "STE");
    }
}

File 5 of 36 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 36 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
     * ====
     *
     * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (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 7 of 36 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 8 of 36 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 9 of 36 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // 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(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // 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].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            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 for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the 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.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // 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 preconditions 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 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 10 of 36 : LiquidityMath.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";

import {FixedPoint96} from "./FixedPoint96.sol";
import {SqrtPriceMath} from "./SqrtPriceMath.sol";

/// @title Math library for liquidity
/// @notice Facilitates transformations between (L, sqrtP) space and (x, y) token reserves
library LiquidityMath {
    using SafeCast for uint256;

    /// @notice Transforms (L, sqrtP) values into (x, y) reserve amounts
    /// @param liquidity Pool liquidity in (L, sqrtP) space
    /// @param sqrtPriceX96 Pool price in (L, sqrtP) space
    /// @return amount0 The amount of token0 associated with the given (L, sqrtP) values
    /// @return amount1 The amount of token1 associated with the given (L, sqrtP) values
    function toAmounts(
        uint128 liquidity,
        uint160 sqrtPriceX96
    ) internal pure returns (uint256 amount0, uint256 amount1) {
        // x = L / sqrt(P); y = L * sqrt(P)
        amount0 =
            (uint256(liquidity) << FixedPoint96.RESOLUTION) /
            sqrtPriceX96;
        amount1 = Math.mulDiv(liquidity, sqrtPriceX96, FixedPoint96.Q96);
    }

    /// @notice Transforms (x, y) reserve amounts into (L, sqrtP) values
    /// @dev Reverts on overflow if reserve0 * reserve1 > type(uint256).max as liquidity must fit into uint128
    /// @param reserve0 The amount of token0 in reserves
    /// @param reserve1 The amount of token1 in reserves
    /// @return liquidity Pool liquidity associated with reserve amounts
    /// @return sqrtPriceX96 Pool price associated with reserve amounts
    function toLiquiditySqrtPriceX96(
        uint256 reserve0,
        uint256 reserve1
    ) internal pure returns (uint128 liquidity, uint160 sqrtPriceX96) {
        // L = sqrt(x * y); sqrt(P) = sqrt(y / x)
        liquidity = Math.sqrt(reserve0 * reserve1).toUint128();

        uint256 _sqrtPriceX96 = (uint256(liquidity) <<
            FixedPoint96.RESOLUTION) / reserve0;
        if (
            !(_sqrtPriceX96 >= SqrtPriceMath.MIN_SQRT_RATIO &&
                _sqrtPriceX96 < SqrtPriceMath.MAX_SQRT_RATIO)
        ) revert SqrtPriceMath.InvalidSqrtPriceX96();
        sqrtPriceX96 = uint160(_sqrtPriceX96);
    }

    /// @notice Calculates (L, sqrtP) after adding/removing amounts to/from pool reserves
    /// @param liquidity Pool liquidity before adding/removing reserves
    /// @param sqrtPriceX96 Pool price before adding/removing reserves
    /// @param amount0 The amount of token0 to add (positive) or remove (negative)
    /// @param amount1 The amount of token1 to add (positive) or remove (negative)
    /// @return liquidityNext Pool liquidity after adding/removing reserves
    /// @return sqrtPriceX96Next Pool price after adding/removing reserves
    function liquiditySqrtPriceX96Next(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        int256 amount0,
        int256 amount1
    ) internal pure returns (uint128 liquidityNext, uint160 sqrtPriceX96Next) {
        (uint256 reserve0, uint256 reserve1) = toAmounts(
            liquidity,
            sqrtPriceX96
        );

        if (amount0 < 0 && uint256(-amount0) >= reserve0)
            revert SqrtPriceMath.Amount0ExceedsReserve0();
        if (amount1 < 0 && uint256(-amount1) >= reserve1)
            revert SqrtPriceMath.Amount1ExceedsReserve1();

        uint256 reserve0Next = amount0 >= 0
            ? reserve0 + uint256(amount0)
            : reserve0 - uint256(-amount0);
        uint256 reserve1Next = amount1 >= 0
            ? reserve1 + uint256(amount1)
            : reserve1 - uint256(-amount1);

        (liquidityNext, sqrtPriceX96Next) = toLiquiditySqrtPriceX96(
            reserve0Next,
            reserve1Next
        );
    }
}

File 11 of 36 : SqrtPriceMath.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";

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

/// @title Math library for sqrt price changes
/// @notice Determines sqrt price changes after a opening leverage position and swapping on the pool
library SqrtPriceMath {
    /// @dev Adopts Uni V3 tick limits of (-887272, 887272)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    uint160 internal constant MAX_SQRT_RATIO =
        1461446703485210103287273052203988822378723970342;

    error InvalidSqrtPriceX96();
    error Amount0ExceedsReserve0();
    error Amount1ExceedsReserve1();

    /// @notice Calculates sqrtP after opening a leverage position
    /// @dev Choice of insurance function made in this function
    /// @param liquidity Pool liquidity before opening the position
    /// @param sqrtPriceX96 Pool price before opening the position
    /// @param liquidityDelta Liquidity removed from pool to collateralize position
    /// @param zeroForOne Whether long token1 and short token0 (true), or long token0 and short token1 (false)
    /// @param maintenance Minimum maintenance margin for the pool
    /// @return The price after opening the position
    function sqrtPriceX96NextOpen(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        uint128 liquidityDelta,
        bool zeroForOne,
        uint24 maintenance
    ) internal pure returns (uint160) {
        uint256 prod = uint256(liquidityDelta) *
            uint256(liquidity - liquidityDelta);
        prod = Math.mulDiv(prod, 1e6, 1e6 + uint256(maintenance));

        // root round down ensures no free size but can have nextX96 go opposite of intended direction
        // as liquidityDelta -> 0. position.assemble will revert tho if so
        uint256 under = uint256(liquidity) ** 2 - 4 * prod;
        uint256 root = Math.sqrt(under);

        uint256 nextX96 = !zeroForOne
            ? Math.mulDiv(
                sqrtPriceX96,
                uint256(liquidity) + root,
                2 * uint256(liquidity - liquidityDelta)
            )
            : Math.mulDiv(
                sqrtPriceX96,
                2 * uint256(liquidity - liquidityDelta),
                uint256(liquidity) + root
            );
        if (!(nextX96 >= MIN_SQRT_RATIO && nextX96 < MAX_SQRT_RATIO))
            revert InvalidSqrtPriceX96();

        return uint160(nextX96);
    }

    /// @notice Calculates sqrtP after swapping tokens
    /// @dev Assumes amountSpecified != 0
    /// @param liquidity Pool liquidity before swapping
    /// @param sqrtPriceX96 Pool price before swapping
    /// @param zeroForOne Whether swapping token0 for token1 (true), or token1 for token0 (false)
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @return The price after swapping
    function sqrtPriceX96NextSwap(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        bool zeroForOne,
        int256 amountSpecified
    ) internal pure returns (uint160) {
        bool exactInput = amountSpecified > 0;

        uint256 nextX96;
        if (exactInput) {
            if (!zeroForOne) {
                // 1 is known
                // sqrt(P') = sqrt(P) + del y / L
                uint256 prod = (
                    uint256(amountSpecified) <= type(uint160).max
                        ? (uint256(amountSpecified) <<
                            FixedPoint96.RESOLUTION) / liquidity
                        : Math.mulDiv(
                            uint256(amountSpecified),
                            FixedPoint96.Q96,
                            liquidity
                        )
                );
                nextX96 = uint256(sqrtPriceX96) + prod;
            } else {
                // 0 is known
                // sqrt(P') = sqrt(P) - (del x * sqrt(P)) / (L / sqrt(P) + del x)
                uint256 reserve0 = (uint256(liquidity) <<
                    FixedPoint96.RESOLUTION) / sqrtPriceX96;
                uint256 prod = (
                    uint256(amountSpecified) <= type(uint96).max
                        ? (uint256(amountSpecified) * uint256(sqrtPriceX96)) /
                            (reserve0 + uint256(amountSpecified))
                        : Math.mulDiv(
                            uint256(amountSpecified),
                            sqrtPriceX96,
                            reserve0 + uint256(amountSpecified)
                        )
                );
                nextX96 = uint256(sqrtPriceX96) - prod;
            }
        } else {
            if (!zeroForOne) {
                // 0 is known
                // sqrt(P') = sqrt(P) - (del x * sqrt(P)) / (L / sqrt(P) + del x)
                uint256 reserve0 = (uint256(liquidity) <<
                    FixedPoint96.RESOLUTION) / sqrtPriceX96;
                if (reserve0 <= uint256(-amountSpecified))
                    revert Amount0ExceedsReserve0();

                uint256 prod = (
                    uint256(-amountSpecified) <= type(uint96).max
                        ? (uint256(-amountSpecified) * uint256(sqrtPriceX96)) /
                            (reserve0 - uint256(-amountSpecified))
                        : Math.mulDiv(
                            uint256(-amountSpecified),
                            sqrtPriceX96,
                            reserve0 - uint256(-amountSpecified)
                        )
                );
                nextX96 = uint256(sqrtPriceX96) + prod;
            } else {
                // 1 is known
                // sqrt(P') = sqrt(P) + del y / L
                uint256 reserve1 = Math.mulDiv(
                    liquidity,
                    sqrtPriceX96,
                    FixedPoint96.Q96
                );
                if (reserve1 <= uint256(-amountSpecified))
                    revert Amount1ExceedsReserve1();

                uint256 prod = (
                    uint256(-amountSpecified) <= type(uint160).max
                        ? (uint256(-amountSpecified) <<
                            FixedPoint96.RESOLUTION) / liquidity
                        : Math.mulDiv(
                            uint256(-amountSpecified),
                            FixedPoint96.Q96,
                            liquidity
                        )
                );
                nextX96 = uint256(sqrtPriceX96) - prod;
            }
        }
        if (!(nextX96 >= MIN_SQRT_RATIO && nextX96 < MAX_SQRT_RATIO))
            revert InvalidSqrtPriceX96();
        return uint160(nextX96);
    }
}

File 12 of 36 : FixedPoint96.sol
// SPDX-License-Identifier: AGPL-3.0
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)
library FixedPoint96 {
    uint8 internal constant RESOLUTION = 96;
    uint256 internal constant Q96 = 0x1000000000000000000000000;
}

File 13 of 36 : SafeCast.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.2._
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v2.5._
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.2._
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
        return uint72(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v2.5._
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint56 from uint256, reverting on
     * overflow (when the input is greater than largest uint56).
     *
     * Counterpart to Solidity's `uint56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toUint56(uint256 value) internal pure returns (uint56) {
        require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
        return uint56(value);
    }

    /**
     * @dev Returns the downcasted uint48 from uint256, reverting on
     * overflow (when the input is greater than largest uint48).
     *
     * Counterpart to Solidity's `uint48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toUint48(uint256 value) internal pure returns (uint48) {
        require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
        return uint48(value);
    }

    /**
     * @dev Returns the downcasted uint40 from uint256, reverting on
     * overflow (when the input is greater than largest uint40).
     *
     * Counterpart to Solidity's `uint40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toUint40(uint256 value) internal pure returns (uint40) {
        require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
        return uint40(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v2.5._
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint24 from uint256, reverting on
     * overflow (when the input is greater than largest uint24).
     *
     * Counterpart to Solidity's `uint24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toUint24(uint256 value) internal pure returns (uint24) {
        require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
        return uint24(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v2.5._
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v2.5._
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     *
     * _Available since v3.0._
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int248 from int256, reverting on
     * overflow (when the input is less than smallest int248 or
     * greater than largest int248).
     *
     * Counterpart to Solidity's `int248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     *
     * _Available since v4.7._
     */
    function toInt248(int256 value) internal pure returns (int248 downcasted) {
        downcasted = int248(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 248 bits");
    }

    /**
     * @dev Returns the downcasted int240 from int256, reverting on
     * overflow (when the input is less than smallest int240 or
     * greater than largest int240).
     *
     * Counterpart to Solidity's `int240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     *
     * _Available since v4.7._
     */
    function toInt240(int256 value) internal pure returns (int240 downcasted) {
        downcasted = int240(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 240 bits");
    }

    /**
     * @dev Returns the downcasted int232 from int256, reverting on
     * overflow (when the input is less than smallest int232 or
     * greater than largest int232).
     *
     * Counterpart to Solidity's `int232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     *
     * _Available since v4.7._
     */
    function toInt232(int256 value) internal pure returns (int232 downcasted) {
        downcasted = int232(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 232 bits");
    }

    /**
     * @dev Returns the downcasted int224 from int256, reverting on
     * overflow (when the input is less than smallest int224 or
     * greater than largest int224).
     *
     * Counterpart to Solidity's `int224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     *
     * _Available since v4.7._
     */
    function toInt224(int256 value) internal pure returns (int224 downcasted) {
        downcasted = int224(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 224 bits");
    }

    /**
     * @dev Returns the downcasted int216 from int256, reverting on
     * overflow (when the input is less than smallest int216 or
     * greater than largest int216).
     *
     * Counterpart to Solidity's `int216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     *
     * _Available since v4.7._
     */
    function toInt216(int256 value) internal pure returns (int216 downcasted) {
        downcasted = int216(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 216 bits");
    }

    /**
     * @dev Returns the downcasted int208 from int256, reverting on
     * overflow (when the input is less than smallest int208 or
     * greater than largest int208).
     *
     * Counterpart to Solidity's `int208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     *
     * _Available since v4.7._
     */
    function toInt208(int256 value) internal pure returns (int208 downcasted) {
        downcasted = int208(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 208 bits");
    }

    /**
     * @dev Returns the downcasted int200 from int256, reverting on
     * overflow (when the input is less than smallest int200 or
     * greater than largest int200).
     *
     * Counterpart to Solidity's `int200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     *
     * _Available since v4.7._
     */
    function toInt200(int256 value) internal pure returns (int200 downcasted) {
        downcasted = int200(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 200 bits");
    }

    /**
     * @dev Returns the downcasted int192 from int256, reverting on
     * overflow (when the input is less than smallest int192 or
     * greater than largest int192).
     *
     * Counterpart to Solidity's `int192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     *
     * _Available since v4.7._
     */
    function toInt192(int256 value) internal pure returns (int192 downcasted) {
        downcasted = int192(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 192 bits");
    }

    /**
     * @dev Returns the downcasted int184 from int256, reverting on
     * overflow (when the input is less than smallest int184 or
     * greater than largest int184).
     *
     * Counterpart to Solidity's `int184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     *
     * _Available since v4.7._
     */
    function toInt184(int256 value) internal pure returns (int184 downcasted) {
        downcasted = int184(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 184 bits");
    }

    /**
     * @dev Returns the downcasted int176 from int256, reverting on
     * overflow (when the input is less than smallest int176 or
     * greater than largest int176).
     *
     * Counterpart to Solidity's `int176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     *
     * _Available since v4.7._
     */
    function toInt176(int256 value) internal pure returns (int176 downcasted) {
        downcasted = int176(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 176 bits");
    }

    /**
     * @dev Returns the downcasted int168 from int256, reverting on
     * overflow (when the input is less than smallest int168 or
     * greater than largest int168).
     *
     * Counterpart to Solidity's `int168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     *
     * _Available since v4.7._
     */
    function toInt168(int256 value) internal pure returns (int168 downcasted) {
        downcasted = int168(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 168 bits");
    }

    /**
     * @dev Returns the downcasted int160 from int256, reverting on
     * overflow (when the input is less than smallest int160 or
     * greater than largest int160).
     *
     * Counterpart to Solidity's `int160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     *
     * _Available since v4.7._
     */
    function toInt160(int256 value) internal pure returns (int160 downcasted) {
        downcasted = int160(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 160 bits");
    }

    /**
     * @dev Returns the downcasted int152 from int256, reverting on
     * overflow (when the input is less than smallest int152 or
     * greater than largest int152).
     *
     * Counterpart to Solidity's `int152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     *
     * _Available since v4.7._
     */
    function toInt152(int256 value) internal pure returns (int152 downcasted) {
        downcasted = int152(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 152 bits");
    }

    /**
     * @dev Returns the downcasted int144 from int256, reverting on
     * overflow (when the input is less than smallest int144 or
     * greater than largest int144).
     *
     * Counterpart to Solidity's `int144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     *
     * _Available since v4.7._
     */
    function toInt144(int256 value) internal pure returns (int144 downcasted) {
        downcasted = int144(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 144 bits");
    }

    /**
     * @dev Returns the downcasted int136 from int256, reverting on
     * overflow (when the input is less than smallest int136 or
     * greater than largest int136).
     *
     * Counterpart to Solidity's `int136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     *
     * _Available since v4.7._
     */
    function toInt136(int256 value) internal pure returns (int136 downcasted) {
        downcasted = int136(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 136 bits");
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128 downcasted) {
        downcasted = int128(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 128 bits");
    }

    /**
     * @dev Returns the downcasted int120 from int256, reverting on
     * overflow (when the input is less than smallest int120 or
     * greater than largest int120).
     *
     * Counterpart to Solidity's `int120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     *
     * _Available since v4.7._
     */
    function toInt120(int256 value) internal pure returns (int120 downcasted) {
        downcasted = int120(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 120 bits");
    }

    /**
     * @dev Returns the downcasted int112 from int256, reverting on
     * overflow (when the input is less than smallest int112 or
     * greater than largest int112).
     *
     * Counterpart to Solidity's `int112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     *
     * _Available since v4.7._
     */
    function toInt112(int256 value) internal pure returns (int112 downcasted) {
        downcasted = int112(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 112 bits");
    }

    /**
     * @dev Returns the downcasted int104 from int256, reverting on
     * overflow (when the input is less than smallest int104 or
     * greater than largest int104).
     *
     * Counterpart to Solidity's `int104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     *
     * _Available since v4.7._
     */
    function toInt104(int256 value) internal pure returns (int104 downcasted) {
        downcasted = int104(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 104 bits");
    }

    /**
     * @dev Returns the downcasted int96 from int256, reverting on
     * overflow (when the input is less than smallest int96 or
     * greater than largest int96).
     *
     * Counterpart to Solidity's `int96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     *
     * _Available since v4.7._
     */
    function toInt96(int256 value) internal pure returns (int96 downcasted) {
        downcasted = int96(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 96 bits");
    }

    /**
     * @dev Returns the downcasted int88 from int256, reverting on
     * overflow (when the input is less than smallest int88 or
     * greater than largest int88).
     *
     * Counterpart to Solidity's `int88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     *
     * _Available since v4.7._
     */
    function toInt88(int256 value) internal pure returns (int88 downcasted) {
        downcasted = int88(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 88 bits");
    }

    /**
     * @dev Returns the downcasted int80 from int256, reverting on
     * overflow (when the input is less than smallest int80 or
     * greater than largest int80).
     *
     * Counterpart to Solidity's `int80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     *
     * _Available since v4.7._
     */
    function toInt80(int256 value) internal pure returns (int80 downcasted) {
        downcasted = int80(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 80 bits");
    }

    /**
     * @dev Returns the downcasted int72 from int256, reverting on
     * overflow (when the input is less than smallest int72 or
     * greater than largest int72).
     *
     * Counterpart to Solidity's `int72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     *
     * _Available since v4.7._
     */
    function toInt72(int256 value) internal pure returns (int72 downcasted) {
        downcasted = int72(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 72 bits");
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64 downcasted) {
        downcasted = int64(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 64 bits");
    }

    /**
     * @dev Returns the downcasted int56 from int256, reverting on
     * overflow (when the input is less than smallest int56 or
     * greater than largest int56).
     *
     * Counterpart to Solidity's `int56` operator.
     *
     * Requirements:
     *
     * - input must fit into 56 bits
     *
     * _Available since v4.7._
     */
    function toInt56(int256 value) internal pure returns (int56 downcasted) {
        downcasted = int56(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 56 bits");
    }

    /**
     * @dev Returns the downcasted int48 from int256, reverting on
     * overflow (when the input is less than smallest int48 or
     * greater than largest int48).
     *
     * Counterpart to Solidity's `int48` operator.
     *
     * Requirements:
     *
     * - input must fit into 48 bits
     *
     * _Available since v4.7._
     */
    function toInt48(int256 value) internal pure returns (int48 downcasted) {
        downcasted = int48(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 48 bits");
    }

    /**
     * @dev Returns the downcasted int40 from int256, reverting on
     * overflow (when the input is less than smallest int40 or
     * greater than largest int40).
     *
     * Counterpart to Solidity's `int40` operator.
     *
     * Requirements:
     *
     * - input must fit into 40 bits
     *
     * _Available since v4.7._
     */
    function toInt40(int256 value) internal pure returns (int40 downcasted) {
        downcasted = int40(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 40 bits");
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32 downcasted) {
        downcasted = int32(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 32 bits");
    }

    /**
     * @dev Returns the downcasted int24 from int256, reverting on
     * overflow (when the input is less than smallest int24 or
     * greater than largest int24).
     *
     * Counterpart to Solidity's `int24` operator.
     *
     * Requirements:
     *
     * - input must fit into 24 bits
     *
     * _Available since v4.7._
     */
    function toInt24(int256 value) internal pure returns (int24 downcasted) {
        downcasted = int24(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 24 bits");
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16 downcasted) {
        downcasted = int16(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 16 bits");
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8 downcasted) {
        downcasted = int8(value);
        require(downcasted == value, "SafeCast: value doesn't fit in 8 bits");
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     *
     * _Available since v3.0._
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 14 of 36 : IMarginalV1AdjustCallback.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 adjust callback
/// @notice Callbacks called by Marginal v1 pools when adjusting the margin backing a position
/// @dev Any contract that calls IMarginalV1Pool#adjust must implement this interface
interface IMarginalV1AdjustCallback {
    /// @notice Called to `msg.sender` after adjusting the margin backing a position via IMarginalV1Pool#adjust
    /// @dev In the implementation you must pay the pool tokens owed to adjust the margin backing a position. The tokens owed
    /// is the new position margin, as the original margin is flashed out to `recipient` in the IMarginalV1Pool#adjust call.
    /// The caller of this method must be checked to be a MarginalV1Pool deployed by the canonical MarginalV1Factory.
    /// @param amount0Owed The amount of token0 that must be payed to pool to successfully adjust the margin backing a position
    /// @param amount1Owed The amount of token1 that must be payed to pool to successfully adjust the margin backing a position
    /// @param data Any data passed through by the caller via the IMarginalV1Pool#adjust call
    function marginalV1AdjustCallback(
        uint256 amount0Owed,
        uint256 amount1Owed,
        bytes calldata data
    ) external;
}

File 15 of 36 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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].
 *
 * 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}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * 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 value {ERC20} uses, unless this function is
     * 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 16 of 36 : 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 17 of 36 : 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 18 of 36 : IMarginalV1MintCallback.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 mint callback
/// @notice Callbacks called by Marginal v1 pools when adding liquidity
/// @dev Any contract that calls IMarginalV1Pool#mint must implement this interface
interface IMarginalV1MintCallback {
    /// @notice Called to `msg.sender` after adding liquidity via IMarginalV1Pool#mint
    /// @dev In the implementation you must pay the pool tokens owed to add liquidity to the pool and mint LP tokens.
    /// The caller of this method must be checked to be a MarginalV1Pool deployed by the canonical MarginalV1Factory.
    /// @param amount0Owed The amount of token0 that must be payed to pool to successfully mint LP tokens
    /// @param amount1Owed The amount of token1 that must be payed to pool to successfully mint LP tokens
    /// @param data Any data passed through by the caller via the IMarginalV1Pool#mint call
    function marginalV1MintCallback(
        uint256 amount0Owed,
        uint256 amount1Owed,
        bytes calldata data
    ) external;
}

File 19 of 36 : Position.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";

import {TickMath} from "@uniswap/v3-core/contracts/libraries/TickMath.sol";

import {FixedPoint64} from "./FixedPoint64.sol";
import {FixedPoint96} from "./FixedPoint96.sol";
import {FixedPoint128} from "./FixedPoint128.sol";
import {FixedPoint192} from "./FixedPoint192.sol";

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

/// @title Position library
/// @notice Facilitates calculations, updates, and retrieval of leverage position info
/// @dev Positions are represented in (x, y) space
library Position {
    using SafeCast for uint256;

    // info stored for each trader's leverage position
    struct Info {
        // size of position in token1 if zeroForOne = true or token0 if zeroForOne = false
        uint128 size;
        // debt owed by trader at settlement if zeroForOne = true, otherwise used for internal accounting only
        uint128 debt0;
        // debt owed by trader at settlement if zeroForOne = false, otherwise used for internal accounting only
        uint128 debt1;
        // insurance balances set aside by LPs to prevent liquidity shortfall in case of late liquidation
        uint128 insurance0;
        uint128 insurance1;
        // whether the position is long token1 and short token0 (true), or long token0 and short token1 (false)
        bool zeroForOne;
        // whether the position has been liquidated
        bool liquidated;
        // tick before position was opened, used in maintenance margin requirements
        int24 tick;
        // timestamp when position was last synced for funding payments
        uint32 blockTimestamp;
        // delta between oracle and pool tick cumulatives at last funding sync (bar{a}_t - a_t)
        int56 tickCumulativeDelta;
        // margin backing position in token1 if zeroForOne = true or token0 if zeroForOne = false
        uint128 margin;
        // liquidity locked by LPs to collateralize the position. liability owed to pool
        uint128 liquidityLocked;
        // liquidation rewards escrowed with position in the native (gas) token to incentivize liquidations
        uint256 rewards;
    }

    /// @notice Gets a position from positions mapping
    /// @param positions The pool mapping that stores the leverage positions
    /// @param owner The owner of the position
    /// @param id The ID of the position
    /// @return The position info associated with the (owner, ID) key
    function get(
        mapping(bytes32 => Info) storage positions,
        address owner,
        uint96 id
    ) internal view returns (Info memory) {
        return positions[keccak256(abi.encodePacked(owner, id))];
    }

    /// @notice Stores the given position in positions mapping
    /// @dev Used to create a new position or to update existing positions
    /// @param positions The pool mapping that stores the leverage positions
    /// @param owner The owner of the position
    /// @param id The ID of the position
    /// @param position The position information to store
    function set(
        mapping(bytes32 => Info) storage positions,
        address owner,
        uint96 id,
        Info memory position
    ) internal {
        positions[keccak256(abi.encodePacked(owner, id))] = position;
    }

    /// @notice Realizes funding payments via updates to position debt amounts
    /// @param position The position to sync
    /// @param blockTimestampLast The latest `block.timestamp` to sync to
    /// @param tickCumulativeLast The `tickCumulative` from the pool at `blockTimestampLast`
    /// @param oracleTickCumulativeLast The `tickCumulative` from the oracle at `blockTimestampLast`
    /// @param tickCumulativeRateMax The maximum rate of change in tick cumulative between the oracle and pool `tickCumulative` values
    /// @param fundingPeriod The pool funding period to benchmark funding payments to
    /// @return The synced position
    function sync(
        Info memory position,
        uint32 blockTimestampLast,
        int56 tickCumulativeLast,
        int56 oracleTickCumulativeLast,
        uint24 tickCumulativeRateMax,
        uint32 fundingPeriod
    ) internal pure returns (Info memory) {
        // early exit if nothing to update
        if (blockTimestampLast == position.blockTimestamp) return position;

        // oracle tick - marginal tick (bar{a}_t - a_t)
        int56 tickCumulativeDeltaLast = OracleLibrary.oracleTickCumulativeDelta(
            tickCumulativeLast,
            oracleTickCumulativeLast
        );
        (uint128 debt0, uint128 debt1) = debtsAfterFunding(
            position,
            blockTimestampLast,
            tickCumulativeDeltaLast,
            tickCumulativeRateMax,
            fundingPeriod
        );

        position.debt0 = debt0;
        position.debt1 = debt1;
        position.blockTimestamp = blockTimestampLast;
        position.tickCumulativeDelta = tickCumulativeDeltaLast;
        return position;
    }

    /// @notice Liquidates an existing position
    /// @param position The position to liquidate
    /// @return positionAfter The liquidated position info
    function liquidate(
        Info memory position
    ) internal pure returns (Info memory positionAfter) {
        positionAfter.zeroForOne = position.zeroForOne;
        positionAfter.liquidated = true;
        positionAfter.tick = position.tick;
        positionAfter.blockTimestamp = position.blockTimestamp;
        positionAfter.tickCumulativeDelta = position.tickCumulativeDelta;
    }

    /// @notice Settles existing position
    /// @param position The position to settle
    /// @return positionAfter The settled position info
    function settle(
        Info memory position
    ) internal pure returns (Info memory positionAfter) {
        positionAfter.zeroForOne = position.zeroForOne;
        positionAfter.liquidated = position.liquidated;
        positionAfter.tick = position.tick;
        positionAfter.blockTimestamp = position.blockTimestamp;
        positionAfter.tickCumulativeDelta = position.tickCumulativeDelta;
    }

    /// @notice Assembles a new position from pool state
    /// @dev zeroForOne = true means short position (long token1, short token0)
    /// @param liquidity The pool liquidity before opening the position
    /// @param sqrtPriceX96 The pool sqrt price before opening the position
    /// @param sqrtPriceX96Next The pool sqrt price after opening the position
    /// @param liquidityDelta The delta in pool liquidity used to collateralize the position
    /// @param zeroForOne Whether the position is long token1 and short token0 (true), or long token0 and short token1 (false)
    /// @param tick The pool tick before opening the position
    /// @param blockTimestampStart The timestamp at which the pool state was last synced before opening the position
    /// @param tickCumulativeStart The tick cumulative value from the pool at `blockTimestampStart`
    /// @param oracleTickCumulativeStart The tick cumulative value from the oracle at `blockTimestampStart`
    /// @return position The assembled position info
    function assemble(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        uint160 sqrtPriceX96Next,
        uint128 liquidityDelta,
        bool zeroForOne,
        int24 tick,
        uint32 blockTimestampStart,
        int56 tickCumulativeStart,
        int56 oracleTickCumulativeStart
    ) internal pure returns (Info memory position) {
        position.zeroForOne = zeroForOne;
        position.tick = tick;
        position.blockTimestamp = blockTimestampStart;
        position.tickCumulativeDelta =
            oracleTickCumulativeStart -
            tickCumulativeStart;
        position.liquidityLocked = liquidityDelta;

        position.size = size(
            liquidity,
            sqrtPriceX96,
            sqrtPriceX96Next,
            zeroForOne
        );
        (position.insurance0, position.insurance1) = insurances(
            liquidity,
            sqrtPriceX96,
            sqrtPriceX96Next,
            liquidityDelta,
            zeroForOne
        );
        (position.debt0, position.debt1) = debts(
            sqrtPriceX96Next,
            liquidityDelta,
            position.insurance0,
            position.insurance1
        );
    }

    /// @notice Size of position in (x, y) amounts
    /// @dev Size amount in token1 if zeroForOne = true, or in token0 if zeroForOne = false
    /// @param liquidity The pool liquidity before opening the position
    /// @param sqrtPriceX96 The pool sqrt price before opening the position
    /// @param sqrtPriceX96Next The pool sqrt price after opening the position
    /// @param zeroForOne Whether the position is long token1 and short token0 (true), or long token0 and short token1 (false)
    /// @return The position size
    function size(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        uint160 sqrtPriceX96Next,
        bool zeroForOne
    ) internal pure returns (uint128) {
        if (!zeroForOne) {
            // L / sqrt(P) - L / sqrt(P')
            return
                ((uint256(liquidity) << FixedPoint96.RESOLUTION) /
                    sqrtPriceX96 -
                    (uint256(liquidity) << FixedPoint96.RESOLUTION) /
                    sqrtPriceX96Next).toUint128();
        } else {
            // L * sqrt(P) - L * sqrt(P')
            return
                (
                    Math.mulDiv(
                        liquidity,
                        sqrtPriceX96 - sqrtPriceX96Next,
                        FixedPoint96.Q96
                    )
                ).toUint128();
        }
    }

    /// @notice Insurance balances to back position in (x, y) amounts
    /// @param liquidity The pool liquidity before opening the position
    /// @param sqrtPriceX96 The pool sqrt price before opening the position
    /// @param sqrtPriceX96Next The pool sqrt price after opening the position
    /// @param liquidityDelta The delta in pool liquidity used to collateralize the position
    /// @param zeroForOne Whether the position is long token1 and short token0 (true), or long token0 and short token1 (false)
    /// @return insurance0 The insurance reserves in token0 needed to prevent liquidity shortfall for late liquidations
    /// @return insurance1 The insurance reserves in token1 needed to prevent liquidity shortfall for late liquidations
    function insurances(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        uint160 sqrtPriceX96Next,
        uint128 liquidityDelta,
        bool zeroForOne
    ) internal pure returns (uint128 insurance0, uint128 insurance1) {
        uint256 prod = !zeroForOne
            ? Math.mulDiv(
                liquidity - liquidityDelta,
                sqrtPriceX96Next,
                sqrtPriceX96
            ) // iy / y = 1 - sqrt(P'/P) * (1 - del L / L)
            : Math.mulDiv(
                liquidity - liquidityDelta,
                sqrtPriceX96,
                sqrtPriceX96Next
            ); // iy / y = 1 - sqrt(P/P') * (1 - del L / L)

        insurance0 = (((uint256(liquidity) - prod) << FixedPoint96.RESOLUTION) /
            sqrtPriceX96).toUint128();
        insurance1 = (
            Math.mulDiv(
                uint256(liquidity) - prod,
                sqrtPriceX96,
                FixedPoint96.Q96
            )
        ).toUint128();
    }

    /// @notice Debts owed by position in (x, y) amounts
    /// @dev Uses invariant (insurance0 + debt0) * (insurance1 + debt1) = liquidityDelta * sqrtPriceNext
    /// @param sqrtPriceX96Next The pool sqrt price after opening the position
    /// @param liquidityDelta The delta in pool liquidity used to collateralize the position
    /// @param insurance0 The position insurance reserves in token0
    /// @param insurance1 The position insurance reserves in token1
    /// @return debt0 The debt in token0 the position owes to the pool
    /// @return debt1 The debt in token1 the position owes to the pool
    function debts(
        uint160 sqrtPriceX96Next,
        uint128 liquidityDelta,
        uint128 insurance0,
        uint128 insurance1
    ) internal pure returns (uint128 debt0, uint128 debt1) {
        // ix + dx = del L / sqrt(P'); iy + dy = del L * sqrt(P')
        debt0 = ((uint256(liquidityDelta) << FixedPoint96.RESOLUTION) /
            sqrtPriceX96Next -
            uint256(insurance0)).toUint128();
        debt1 = (Math.mulDiv(
            liquidityDelta,
            sqrtPriceX96Next,
            FixedPoint96.Q96
        ) - uint256(insurance1)).toUint128();
    }

    /// @notice Fees owed when opening the position in (x, y) amounts
    /// @dev Fees taken proportional to size
    /// @param size The position size
    /// @param fee The fee rate charged on position size
    /// @return The amount of fees charged to open the position
    function fees(uint128 size, uint24 fee) internal pure returns (uint256) {
        return (uint256(size) * fee) / 1e6;
    }

    /// @notice Liquidation rewards required to set aside for liquidator in native (gas) token amount
    /// @dev Returned on settle to position owner or used as incentive for liquidator to liquidate position when unsafe
    /// @param blockBaseFee Current block base fee
    /// @param blockBaseFeeMin Minimum block base fee to use in calculating cost to execute call to liquidate
    /// @param gas Estimated gas required to execute call to liquidate
    /// @param premium Liquidation premium to incentivize potential liquidators with
    /// @return The liquidation rewards to set aside for liquidator if position unsafe
    function liquidationRewards(
        uint256 blockBaseFee,
        uint256 blockBaseFeeMin,
        uint256 gas,
        uint24 premium
    ) internal pure returns (uint256) {
        uint256 baseFee = (
            blockBaseFee > blockBaseFeeMin ? blockBaseFee : blockBaseFeeMin
        );
        // need base fee of ~4e62 for possible overflow with gas limit of 30e6
        return (baseFee * gas * uint256(premium)) / 1e6;
    }

    /// @notice Absolute minimum margin amount required to be held in position
    /// @dev Uses `position.tick` prior to position open (alongside insurance balances) to ensure repayment to pool of at least liquidityDelta liability if ignore funding
    /// @param position The position to check minimum margin amounts for
    /// @param maintenance The minimum maintenance margin requirement for the pool
    /// @return The minimum amount of margin the position must hold
    function marginMinimum(
        Info memory position,
        uint24 maintenance
    ) internal pure returns (uint128) {
        uint160 sqrtPriceX96 = TickMath.getSqrtRatioAtTick(position.tick); // price before open
        if (!position.zeroForOne) {
            // cx >= (1+M) * dy / P - sx
            uint256 debt1Adjusted = (uint256(position.debt1) *
                (1e6 + uint256(maintenance))) / 1e6;

            uint256 prod = sqrtPriceX96 <= type(uint128).max
                ? Math.mulDiv(
                    debt1Adjusted,
                    FixedPoint192.Q192,
                    uint256(sqrtPriceX96) * uint256(sqrtPriceX96)
                )
                : Math.mulDiv(
                    debt1Adjusted,
                    FixedPoint128.Q128,
                    Math.mulDiv(sqrtPriceX96, sqrtPriceX96, FixedPoint64.Q64)
                );
            return
                prod > uint256(position.size)
                    ? (prod - uint256(position.size)).toUint128()
                    : 0; // check necessary due to funding
        } else {
            // cy >= (1+M) * dx * P - sy
            uint256 debt0Adjusted = (uint256(position.debt0) *
                (1e6 + uint256(maintenance))) / 1e6;

            uint256 prod = sqrtPriceX96 <= type(uint128).max
                ? Math.mulDiv(
                    debt0Adjusted,
                    uint256(sqrtPriceX96) * uint256(sqrtPriceX96),
                    FixedPoint192.Q192
                )
                : Math.mulDiv(
                    debt0Adjusted,
                    Math.mulDiv(sqrtPriceX96, sqrtPriceX96, FixedPoint64.Q64),
                    FixedPoint128.Q128
                );
            return
                prod > uint256(position.size)
                    ? (prod - uint256(position.size)).toUint128()
                    : 0; // check necessary due to funding
        }
    }

    /// @notice Amounts (x, y) of pool reserves locked in position
    /// @dev Includes margin in the event position were to be liquidated
    /// @param position The position
    /// @return amount0 The amount of token0 set aside for the position
    /// @return amount1 The amount of token1 set aside for the position
    function amountsLocked(
        Info memory position
    ) internal pure returns (uint256 amount0, uint256 amount1) {
        if (!position.zeroForOne) {
            amount0 =
                uint256(position.size) +
                uint256(position.margin) +
                uint256(position.debt0) +
                uint256(position.insurance0);
            amount1 = position.insurance1;
        } else {
            amount0 = position.insurance0;
            amount1 =
                uint256(position.size) +
                uint256(position.margin) +
                uint256(position.debt1) +
                uint256(position.insurance1);
        }
    }

    /// @notice Debt adjusted for funding
    /// @dev Ref @with-backed/papr/src/UniswapOracleFundingRateController.sol#L156
    /// Follows debt0Next = debt0 * (oracleTwap / poolTwap) ** (dt / fundingPeriod) if zeroForOne = true
    //  or debt1Next = debt1 * (poolTwap / oracleTwap) ** (dt / fundingPeriod) if zeroForOne = false
    /// @param position The position to update debts for funding
    /// @param blockTimestampLast The block timestamp at the last pool state sync
    /// @param tickCumulativeDeltaLast The delta in oracle tick cumulative minus pool tick cumulative values at `blockTimestampLast`
    /// @param tickCumulativeRateMax The maximum rate of change in tick cumulative between the oracle and pool `tickCumulative` values
    /// @param fundingPeriod The pool funding period to benchmark funding payments to
    /// @return debt0 The position debt in token0 after funding
    /// @return debt1 The position debt in token1 after funding
    function debtsAfterFunding(
        Info memory position,
        uint32 blockTimestampLast,
        int56 tickCumulativeDeltaLast,
        uint24 tickCumulativeRateMax,
        uint32 fundingPeriod
    ) internal pure returns (uint128 debt0, uint128 debt1) {
        int56 deltaMax;
        unchecked {
            deltaMax =
                int56(uint56(tickCumulativeRateMax)) *
                int56(uint56(blockTimestampLast - position.blockTimestamp));
        }
        if (!position.zeroForOne) {
            // debt1Now = debt1Start * (P / bar{P}) ** (now - start) / fundingPeriod
            // delta = (a_t - bar{a}_t) - (a_0 - bar{a}_0), clamped by funding rate bounds
            int56 delta = OracleLibrary.oracleTickCumulativeDelta(
                tickCumulativeDeltaLast,
                position.tickCumulativeDelta
            );
            if (delta > deltaMax) delta = deltaMax;
            else if (delta < -deltaMax) delta = -deltaMax;

            // @dev ok as position is unsafe well before arithmeticMeanTick reaches min/max tick given fundingPeriod, tickCumulativeRateMax values
            uint160 numeratorX96 = OracleLibrary.oracleSqrtPriceX96(
                delta,
                fundingPeriod / 2 // div by 2 given sqrt price result
            );
            debt0 = position.debt0;
            debt1 = Math
                .mulDiv(position.debt1, numeratorX96, FixedPoint96.Q96)
                .toUint128();
        } else {
            // debt0Now = debt0Start * (bar{P} / P) ** (now - start) / fundingPeriod
            // delta = (bar{a}_t - a_t) - (bar{a}_0 - a_0), clamped by funding rate bounds
            int56 delta = OracleLibrary.oracleTickCumulativeDelta(
                position.tickCumulativeDelta,
                tickCumulativeDeltaLast
            );
            if (delta > deltaMax) delta = deltaMax;
            else if (delta < -deltaMax) delta = -deltaMax;

            // @dev ok as position is unsafe well before arithmeticMeanTick reaches min/max tick given fundingPeriod, tickCumulativeRateMax values
            uint160 numeratorX96 = OracleLibrary.oracleSqrtPriceX96(
                delta,
                fundingPeriod / 2 // div by 2 given sqrt price result
            );
            debt0 = Math
                .mulDiv(position.debt0, numeratorX96, FixedPoint96.Q96)
                .toUint128();
            debt1 = position.debt1;
        }
    }

    /// @notice Whether the position is safe from liquidation
    /// @dev If not safe, position can be liquidated
    /// Considered safe if (`position.margin` + `position.size`) / oracleTwap >= (1 + `maintenance`) * `position.debt0` when position.zeroForOne = true
    /// or (`position.margin` + `position.size`) * oracleTwap >= (1 + `maintenance`) * `position.debt1` when position.zeroForOne = false
    /// @param position The position to check safety of
    /// @param sqrtPriceX96 The oracle time weighted average sqrt price
    /// @param maintenance The minimum maintenance margin requirement for the pool
    /// @return true if safe and false if not safe
    function safe(
        Info memory position,
        uint160 sqrtPriceX96,
        uint24 maintenance
    ) internal pure returns (bool) {
        if (!position.zeroForOne) {
            uint256 debt1Adjusted = (uint256(position.debt1) *
                (1e6 + uint256(maintenance))) / 1e6;
            uint256 liquidityCollateral = Math.mulDiv(
                uint256(position.margin) + uint256(position.size),
                sqrtPriceX96,
                FixedPoint96.Q96
            );
            uint256 liquidityDebt = (debt1Adjusted << FixedPoint96.RESOLUTION) /
                sqrtPriceX96;
            return liquidityCollateral >= liquidityDebt;
        } else {
            uint256 debt0Adjusted = (uint256(position.debt0) *
                (1e6 + uint256(maintenance))) / 1e6;
            uint256 liquidityCollateral = ((uint256(position.margin) +
                uint256(position.size)) << FixedPoint96.RESOLUTION) /
                sqrtPriceX96;
            uint256 liquidityDebt = Math.mulDiv(
                debt0Adjusted,
                sqrtPriceX96,
                FixedPoint96.Q96
            );
            return liquidityCollateral >= liquidityDebt;
        }
    }
}

File 20 of 36 : FixedPoint192.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.4.0;

/// @title FixedPoint192
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
library FixedPoint192 {
    uint8 internal constant RESOLUTION = 192;
    uint256 internal constant Q192 =
        0x1000000000000000000000000000000000000000000000000;
}

File 21 of 36 : FixedPoint64.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.4.0;

/// @title FixedPoint64
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
library FixedPoint64 {
    uint8 internal constant RESOLUTION = 64;
    uint256 internal constant Q64 = 0x10000000000000000;
}

File 22 of 36 : FixedPoint128.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.4.0;

/// @title FixedPoint128
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
library FixedPoint128 {
    uint8 internal constant RESOLUTION = 128;
    uint256 internal constant Q128 = 0x100000000000000000000000000000000;
}

File 23 of 36 : IMarginalV1SwapCallback.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 swap callback
/// @notice Callbacks called by Marginal v1 pools when executing a swap
/// @dev Any contract that calls IMarginalV1Pool#swap must implement this interface
interface IMarginalV1SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IMarginalV1Pool#swap
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a MarginalV1Pool deployed by the canonical MarginalV1Factory.
    /// Amount that must be payed to pool is > 0 as IMarginalV1Pool#swap reverts otherwise.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IMarginalV1Pool#swap call
    function marginalV1SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

File 24 of 36 : IMarginalV1Factory.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 factory
/// @notice The Marginal v1 factory creates pools and enables leverage tiers
interface IMarginalV1Factory {
    /// @notice Returns the Marginal v1 pool deployer to use when creating pools
    /// @return The address of the Marginal v1 pool deployer
    function marginalV1Deployer() external view returns (address);

    /// @notice Returns the Uniswap v3 factory to reference for pool oracles
    /// @return The address of the Uniswap v3 factory
    function uniswapV3Factory() external view returns (address);

    /// @notice Returns the minimum observation cardinality the Uniswap v3 oracle must have
    /// @dev Used as a check that averaging over `secondsAgo` in the Marginal v1 pool is likely to succeed
    /// @return The minimum observation cardinality the Uniswap v3 oracle must have
    function observationCardinalityMinimum() external view returns (uint16);

    /// @notice Returns the current owner of the Marginal v1 factory contract
    /// @dev Changed via permissioned `setOwner` function on the factory
    /// @return The address of the current owner of the Marginal v1 factory
    function owner() external view returns (address);

    /// @notice Returns the pool address for the given unique Marginal v1 pool key
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The address of either token0/token1
    /// @param tokenB The address of the other token token1/token0
    /// @param maintenance The minimum maintenance requirement for the pool
    /// @param oracle The address of the Uniswap v3 oracle used by the pool
    /// @return The address of the Marginal v1 pool
    function getPool(
        address tokenA,
        address tokenB,
        uint24 maintenance,
        address oracle
    ) external view returns (address);

    /// @notice Returns whether given address is a Marginal v1 pool deployed by the factory
    /// @return Whether address is a pool
    function isPool(address pool) external view returns (bool);

    /// @notice Returns the maximum leverage associated with the pool maintenance if pool exists
    /// @param maintenance The minimum maintenance margin requirement for the pool
    /// @return The maximum leverage for the pool maintenance if pool exists
    function getLeverage(uint24 maintenance) external view returns (uint256);

    /// @notice Creates a new Marginal v1 pool for the given unique pool key
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The address of either token0/token1
    /// @param tokenB The address of the other token token1/token0
    /// @param maintenance The minimum maintenance requirement for the pool
    /// @param uniswapV3Fee The fee tier of the Uniswap v3 oracle used by the Marginal v1 pool
    /// @return pool The address of the created Marginal v1 pool
    function createPool(
        address tokenA,
        address tokenB,
        uint24 maintenance,
        uint24 uniswapV3Fee
    ) external returns (address pool);

    /// @notice Sets the owner of the Marginal v1 factory contract
    /// @dev Can only be called by the current factory owner
    /// @param _owner The new owner of the factory
    function setOwner(address _owner) external;

    /// @notice Enables a new leverage tier for Marginal v1 pool deployments
    /// @dev Can only be called by the current factory owner
    /// @dev Set leverage tier obeys: l = 1 + 1/M; M = maintenance
    /// @param maintenance The minimum maintenance requirement associated with the leverage tier
    function enableLeverage(uint24 maintenance) external;
}

File 25 of 36 : IMarginalV1Pool.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/// @title The interface for a Marginal v1 pool
/// @notice A Marginal v1 pool facilitates leverage trading, swapping, and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev Inherits from IERC20 as liquidity providers are minted fungible pool tokens
interface IMarginalV1Pool is IERC20 {
    /// @notice The Marginal v1 factory that created the pool
    /// @return The address of the Marginal v1 factory
    function factory() external view returns (address);

    /// @notice The Uniswap v3 oracle referenced by the pool for funding and position safety
    /// @return The address of the Uniswap v3 oracle referenced by the pool
    function oracle() external view returns (address);

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

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

    /// @notice The minimum maintenance requirement for leverage positions on the pool
    /// @return The minimum maintenance requirement
    function maintenance() external view returns (uint24);

    /// @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 premium multiplier on liquidation rewards in hundredths of a bip, i.e. 1e-6
    /// @dev Liquidation rewards set aside in native (gas) token.
    /// Premium acts as an incentive above the expected gas cost to call IMarginalV1Pool#liquidate.
    /// @return The premium multiplier
    function rewardPremium() external view returns (uint24);

    /// @notice The maximum rate of change in tick cumulative between the Marginal v1 pool and the Uniswap v3 oracle
    /// @dev Puts a ceiling on funding paid per second
    /// @return The maximum tick cumulative rate per second
    function tickCumulativeRateMax() external view returns (uint24);

    /// @notice The amount of time in seconds to average the Uniswap v3 oracle TWAP over to assess position safety
    /// @return The averaging time for the Uniswap v3 oracle TWAP in seconds
    function secondsAgo() external view returns (uint32);

    /// @notice The period in seconds to benchmark funding payments with respect to
    /// @dev Acts as an averaging period on tick cumulative changes between the Marginal v1 pool and the Uniswap v3 oracle
    /// @return The funding period in seconds
    function fundingPeriod() external view returns (uint32);

    /// @notice The pool state represented in (L, sqrt(P)) space
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// totalPositions The total number of leverage positions that have ever been taken out on the pool
    /// liquidity The currently available liquidity offered by the pool for swaps and leverage positions
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// blockTimestamp The last `block.timestamp` at which state was synced
    /// tickCumulative The tick cumulative running sum of the pool, used in funding calculations
    /// feeProtocol The protocol fee for both tokens of the pool
    /// initialized Whether the pool has been initialized
    function state()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            uint96 totalPositions,
            uint128 liquidity,
            int24 tick,
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint8 feeProtocol,
            bool initialized
        );

    /// @notice The liquidity used to capitalize outstanding leverage positions
    /// @return The liquidity locked for outstanding leverage positions
    function liquidityLocked() external view returns (uint128);

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

    /// @notice Returns information about a leverage position by the position's key
    /// @dev Either debt0 (zeroForOne = true) or debt1 (zeroForOne = false) will be updated each funding sync
    /// @param key The position's key is a hash of the packed encoding of the owner and the position ID
    /// @return size The position size in the token the owner is long
    /// debt0 The position debt in token0 owed to the pool at settlement. If long token1 (zeroForOne = true), this is the debt to be repaid at settlement by owner. Otherwise, simply used for internal accounting
    /// debt1 The position debt in token1 owed to the pool at settlement. If long token0 (zeroForOne = false), this is the debt to be repaid at settlement by owner. Otherwise, simply used for internal accounting
    /// insurance0 The insurance in token0 set aside to backstop the position in case of late liquidations
    /// insurance1 The insurance in token1 set aside to backstop the position in case of late liquidations
    /// zeroForOne Whether the position is long token1 and short token0 (true) or long token0 and short token1 (false)
    /// liquidated Whether the position has been liquidated
    /// tick The pool tick prior to opening the position
    /// blockTimestamp The `block.timestamp` at which the position was last synced for funding
    /// tickCumulativeDelta The difference in the Uniswap v3 oracle tick cumulative and the Marginal v1 pool tick cumulative at the last funding sync
    /// margin The position margin in the token the owner is long
    /// liquidityLocked The liquidity locked by the pool to collateralize the position
    /// rewards The liquidation rewards in the native (gas) token received by liquidator if position becomes unsafe
    function positions(
        bytes32 key
    )
        external
        view
        returns (
            uint128 size,
            uint128 debt0,
            uint128 debt1,
            uint128 insurance0,
            uint128 insurance1,
            bool zeroForOne,
            bool liquidated,
            int24 tick,
            uint32 blockTimestamp,
            int56 tickCumulativeDelta,
            uint128 margin,
            uint128 liquidityLocked,
            uint256 rewards
        );

    /// @notice Opens a leverage position on the pool
    /// @dev The caller of this method receives a callback in the form of IMarginalV1OpenCallback#marginalV1OpenCallback.
    /// The caller must forward liquidation rewards in the native (gas) token to be escrowed by the pool contract
    /// Rewards determined by current `block.basefee` * estimated gas cost to call IMarginalV1Pool#liquidate * rewardPremium
    /// @param recipient The address of the owner of the opened position
    /// @param zeroForOne Whether long token1 and short token0 (true), or long token0 and short token1 (false)
    /// @param liquidityDelta The amount of liquidity for the pool to lock to capitalize the position
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after opening the position otherwise the call reverts. If one for zero, the price cannot be greater than this value after opening
    /// @param margin The amount of margin used to back the position in the token the position is long
    /// @param data Any data to be passed through to the callback
    /// @return id The ID of the opened position
    /// @return size The size of the opened position in the token the position is long. Excludes margin amount provided by caller
    /// @return debt The debt of the opened position in the token the position is short
    /// @return amount0 The amount of token0 caller must send to pool to open the position
    /// @return amount1 The amount of token1 caller must send to pool to open the position
    function open(
        address recipient,
        bool zeroForOne,
        uint128 liquidityDelta,
        uint160 sqrtPriceLimitX96,
        uint128 margin,
        bytes calldata data
    )
        external
        payable
        returns (
            uint256 id,
            uint256 size,
            uint256 debt,
            uint256 amount0,
            uint256 amount1
        );

    /// @notice Adjusts the margin used to back a position on the pool
    /// @dev The caller of this method receives a callback in the form of IMarginalV1AdjustCallback#marginalV1AdjustCallback
    /// Old position margin is flashed out to recipient prior to the callback
    /// @param recipient The address to receive the old position margin
    /// @param id The ID of the position to adjust
    /// @param marginDelta The delta of the margin backing the position on the pool. Adding margin to the position when positive, removing margin when negative
    /// @param data Any data to be passed through to the callback
    /// @return margin0 The amount of token0 to be used as the new margin backing the position
    /// @return margin1 The amount of token1 to be used as the new margin backing the position
    function adjust(
        address recipient,
        uint96 id,
        int128 marginDelta,
        bytes calldata data
    ) external returns (uint256 margin0, uint256 margin1);

    /// @notice Settles a position on the pool
    /// @dev The caller of this method receives a callback in the form of IMarginalV1SettleCallback#marginalV1SettleCallback.
    /// If a contract, `recipient` must implement a `receive()` function to receive the escrowed liquidation rewards in the native (gas) token from the pool.
    /// Position size, margin, and liquidation rewards are flashed out before the callback to allow the caller to swap to repay the debt to the pool
    /// @param recipient The address to receive the size, margin, and liquidation rewards of the settled position
    /// @param id The ID of the position to settle
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool. Position debt into the pool (> 0) if long token1 (zeroForOne = true), or position size and margin out of the pool (< 0) if long token0 (zeroForOne = false)
    /// @return amount1 The delta of the balance of token1 of the pool. Position size and margin out of the pool (< 0) if long token1 (zeroForOne = true), or position debt into the pool (> 0) if long token0 (zeroForOne = false)
    /// @return rewards The amount of escrowed native (gas) token sent to `recipient`
    function settle(
        address recipient,
        uint96 id,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1, uint256 rewards);

    /// @notice Liquidates a position on the pool
    /// @dev Reverts if position is safe from liquidation. Position is considered safe if
    /// (`position.margin` + `position.size`) / oracleTwap >= (1 + `maintenance`) * `position.debt0` when position.zeroForOne = true
    /// (`position.margin` + `position.size`) * oracleTwap >= (1 + `maintenance`) * `position.debt1` when position.zeroForOne = false
    /// Safety checks are performed after syncing the position debts for funding payments
    /// If a contract, `recipient` must implement a `receive()` function to receive the escrowed liquidation rewards in the native (gas) token from the pool.
    /// @param recipient The address to receive liquidation rewards escrowed with the position
    /// @param owner The address of the owner of the position to liquidate
    /// @param id The ID of the position to liquidate
    /// @return rewards The amount of escrowed native (gas) token sent to `recipient`
    function liquidate(
        address recipient,
        address owner,
        uint96 id
    ) external returns (uint256 rewards);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IMarginalV1SwapCallback#marginalV1SwapCallback
    /// @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 otherwise the call reverts. 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 Adds liquidity to the pool
    /// @dev The caller of this method receives a callback in the form of IMarginalV1MintCallback#marginalV1MintCallback.
    /// The pool is initialized through the first call to mint
    /// @param recipient The address to mint LP tokens to after adding liquidity to the pool
    /// @param liquidityDelta The liquidity added to the pool
    /// @param data Any data to be passed through to the callback
    /// @return shares The amount of LP token shares minted to recipient
    /// @return amount0 The amount of token0 added to the pool reserves
    /// @return amount1 The amount of token1 added to the pool reserves
    function mint(
        address recipient,
        uint128 liquidityDelta,
        bytes calldata data
    ) external returns (uint256 shares, uint256 amount0, uint256 amount1);

    /// @notice Removes liquidity from the pool
    /// @dev Reverts if not enough liquidity available to exit due to outstanding leverage positions
    /// @param recipient The address to send token amounts to after removing liquidity from the pool
    /// @param shares The amount of LP token shares to burn
    /// @return liquidityDelta The liquidity removed from the pool
    /// @return amount0 The amount of token0 removed from pool reserves
    /// @return amount1 The amount of token1 removed from pool reserves
    function burn(
        address recipient,
        uint256 shares
    )
        external
        returns (uint128 liquidityDelta, uint256 amount0, uint256 amount1);

    /// @notice Set the denominator of the protocol's % share of the fees
    /// @param feeProtocol new protocol fee denominator for the pool
    function setFeeProtocol(uint8 feeProtocol) external;

    /// @notice Collect the protocol fee accrued to the pool
    /// @param recipient The address to which collected protocol fees should be sent
    /// @return amount0 The protocol fee collected in token0
    /// @return amount1 The protocol fee collected in token1
    function collectProtocol(
        address recipient
    ) external returns (uint128 amount0, uint128 amount1);
}

File 26 of 36 : IMarginalV1OpenCallback.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 open callback
/// @notice Callbacks called by Marginal v1 pools when opening a position
/// @dev Any contract that calls IMarginalV1Pool#open must implement this interface
interface IMarginalV1OpenCallback {
    /// @notice Called to `msg.sender` after opening a position via IMarginalV1Pool#open
    /// @dev In the implementation you must pay the pool tokens owed to open a position.
    /// The pool tokens owed are the margin and fees required to open the position.
    /// The caller of this method must be checked to be a MarginalV1Pool deployed by the canonical MarginalV1Factory.
    /// @param amount0Owed The amount of token0 that must be payed to pool to successfully open a position
    /// @param amount1Owed The amount of token1 that must be payed to pool to successfully open a position
    /// @param data Any data passed through by the caller via the IMarginalV1Pool#open call
    function marginalV1OpenCallback(
        uint256 amount0Owed,
        uint256 amount1Owed,
        bytes calldata data
    ) external;
}

File 27 of 36 : SwapMath.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";

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

/// @title Math library for swaps
/// @notice Determines amounts involved in swaps
library SwapMath {
    /// @notice Computes amounts in and out on swap without fees
    /// @dev amount > 0 is amountIn, amount < 0 is amountOut
    /// @param liquidity Pool liquidity before the swap
    /// @param sqrtPriceX96 Pool price at the start of the swap
    /// @param sqrtPriceX96Next Pool price at the end of the swap
    /// @return amount0Delta The delta in token0 balance for the pool
    /// @return amount1Delta The delta in token1 balance for the pool
    function swapAmounts(
        uint128 liquidity,
        uint160 sqrtPriceX96,
        uint160 sqrtPriceX96Next
    ) internal pure returns (int256 amount0Delta, int256 amount1Delta) {
        // del x = L * del (1 / sqrt(P)); del y = L * del sqrt(P)
        bool zeroForOne = sqrtPriceX96Next < sqrtPriceX96;
        amount0Delta =
            int256(
                (uint256(liquidity) << FixedPoint96.RESOLUTION) /
                    sqrtPriceX96Next
            ) -
            int256(
                (uint256(liquidity) << FixedPoint96.RESOLUTION) / sqrtPriceX96
            );
        amount1Delta = zeroForOne
            ? -int256(
                Math.mulDiv(
                    liquidity,
                    sqrtPriceX96 - sqrtPriceX96Next,
                    FixedPoint96.Q96
                )
            )
            : int256(
                Math.mulDiv(
                    liquidity,
                    sqrtPriceX96Next - sqrtPriceX96,
                    FixedPoint96.Q96
                )
            );
    }

    /// @notice Computes swap fee on amount in
    /// @dev Can revert when amount > type(uint232).max, but irrelevant for SwapMath.sol::swapAmounts output and pool fee rate constant
    /// @param amount Amount in to calculate swap fees off of
    /// @param fee Fee rate applied on amount in to pool
    /// @param lessFee Whether `amount` excludes swap fee amount
    /// @return Total swap fees taken from amount in to pool
    function swapFees(
        uint256 amount,
        uint24 fee,
        bool lessFee
    ) internal pure returns (uint256) {
        return (!lessFee ? (amount * fee) / 1e6 : (amount * fee) / (1e6 - fee));
    }
}

File 28 of 36 : 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 29 of 36 : 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 30 of 36 : 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 31 of 36 : 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 32 of 36 : 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 33 of 36 : 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 34 of 36 : 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 35 of 36 : 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 36 of 36 : IMarginalV1SettleCallback.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 settle callback
/// @notice Callbacks called by Marginal v1 pools when settling the debt owed by a position to the pool
/// @dev Any contract that calls IMarginalV1Pool#settle must implement this interface
interface IMarginalV1SettleCallback {
    /// @notice Called to `msg.sender` after settling a position via IMarginalV1Pool#settle
    /// @dev In the implementation you must pay the pool tokens owed to settle the debt owed by a position to the pool.
    /// Position size and margin are flashed out to `recipient` in the IMarginalV1Pool#settle call prior to enable debt repayment via swaps.
    /// The caller of this method must be checked to be a MarginalV1Pool deployed by the canonical MarginalV1Factory.
    /// Amount that must be payed to pool is > 0 as IMarginalV1Pool#open would have reverted otherwise.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of position settlement. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of position settlement. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IMarginalV1Pool#settle call
    function marginalV1SettleCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "remappings": [
    "@openzeppelin/contracts=.cache/openzeppelin/v4.8.3",
    "@uniswap/v3-core/contracts=.cache/uniswap-v3-core/v0.8"
  ],
  "viaIR": true
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"},{"internalType":"uint24","name":"_maintenance","type":"uint24"},{"internalType":"address","name":"_oracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Amount0ExceedsReserve0","type":"error"},{"inputs":[],"name":"Amount0LessThanMin","type":"error"},{"inputs":[],"name":"Amount1ExceedsReserve1","type":"error"},{"inputs":[],"name":"Amount1LessThanMin","type":"error"},{"inputs":[],"name":"InvalidAmountSpecified","type":"error"},{"inputs":[],"name":"InvalidFeeProtocol","type":"error"},{"inputs":[],"name":"InvalidLiquidityDelta","type":"error"},{"inputs":[],"name":"InvalidPosition","type":"error"},{"inputs":[],"name":"InvalidSqrtPriceLimitX96","type":"error"},{"inputs":[],"name":"InvalidSqrtPriceX96","type":"error"},{"inputs":[],"name":"Locked","type":"error"},{"inputs":[],"name":"MarginLessThanMin","type":"error"},{"inputs":[],"name":"PositionSafe","type":"error"},{"inputs":[],"name":"R","type":"error"},{"inputs":[],"name":"RewardsLessThanMin","type":"error"},{"inputs":[],"name":"SqrtPriceX96ExceedsLimit","type":"error"},{"inputs":[],"name":"T","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"marginAfter","type":"uint256"}],"name":"Adjust","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"liquidityDelta","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"CollectProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"liquidityAfter","type":"uint128"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"Liquidate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint128","name":"liquidityDelta","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidityAfter","type":"uint128"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"indexed":false,"internalType":"uint128","name":"margin","type":"uint128"}],"name":"Open","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"oldFeeProtocol","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"newFeeProtocol","type":"uint8"}],"name":"SetFeeProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"liquidityAfter","type":"uint128"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96After","type":"uint160"},{"indexed":false,"internalType":"int256","name":"amount0","type":"int256"},{"indexed":false,"internalType":"int256","name":"amount1","type":"int256"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"Settle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"int256","name":"amount0","type":"int256"},{"indexed":false,"internalType":"int256","name":"amount1","type":"int256"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint96","name":"id","type":"uint96"},{"internalType":"int128","name":"marginDelta","type":"int128"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"adjust","outputs":[{"internalType":"uint256","name":"margin0","type":"uint256"},{"internalType":"uint256","name":"margin1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"burn","outputs":[{"internalType":"uint128","name":"liquidityDelta","type":"uint128"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"collectProtocol","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundingPeriod","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint96","name":"id","type":"uint96"}],"name":"liquidate","outputs":[{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityLocked","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maintenance","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint128","name":"liquidityDelta","type":"uint128"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"uint128","name":"liquidityDelta","type":"uint128"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"},{"internalType":"uint128","name":"margin","type":"uint128"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"open","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"debt","type":"uint256"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"positions","outputs":[{"internalType":"uint128","name":"size","type":"uint128"},{"internalType":"uint128","name":"debt0","type":"uint128"},{"internalType":"uint128","name":"debt1","type":"uint128"},{"internalType":"uint128","name":"insurance0","type":"uint128"},{"internalType":"uint128","name":"insurance1","type":"uint128"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"bool","name":"liquidated","type":"bool"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"int56","name":"tickCumulativeDelta","type":"int56"},{"internalType":"uint128","name":"margin","type":"uint128"},{"internalType":"uint128","name":"liquidityLocked","type":"uint128"},{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFees","outputs":[{"internalType":"uint128","name":"token0","type":"uint128"},{"internalType":"uint128","name":"token1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPremium","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondsAgo","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"feeProtocol","type":"uint8"}],"name":"setFeeProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint96","name":"id","type":"uint96"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"settle","outputs":[{"internalType":"int256","name":"amount0","type":"int256"},{"internalType":"int256","name":"amount1","type":"int256"},{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"uint96","name":"totalPositions","type":"uint96"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"int56","name":"tickCumulative","type":"int56"},{"internalType":"uint8","name":"feeProtocol","type":"uint8"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"int256","name":"amountSpecified","type":"int256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[{"internalType":"int256","name":"amount0","type":"int256"},{"internalType":"int256","name":"amount1","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tickCumulativeRateMax","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

610120346200045657601f6001600160401b03601f1962005d5a38819003848101831686019190848311878410176200035a5780879260a094604052833981010312620004565762000051846200047b565b6020620000608187016200047b565b926200006f604088016200047b565b9460608801519762ffffff89168903620004565760806200009191016200047b565b966200009c6200045b565b601481527f4d617267696e616c205631204c5020546f6b656e00000000000000000000000085820152620000cf6200045b565b91600983526804d41524756312d4c560bc1b868401528151928484116200035a5760039384546001948582811c921680156200044b575b8a83101462000435578185849311620003df575b5089908583116001146200037c5760009262000370575b505060001982871b1c191690841b1784555b80519485116200035a5760049687548481811c911680156200034f575b828210146200033a57838111620002ef575b50809286116001146200028357508495509084929160009562000277575b50501b92600019911b1c19161790555b6002600a5560805260c05260e05261010091825260a0526040516158c99182620004918339608051828181610fe90152818161165a0152612d2f015260a05182818161227901526144b1015260c05182818161149601528181611b44015281816128a901528181612dcd0152818161336801528181613730015261439c015260e051828181610fa4015281816115e201528181611b1401528181612ab001528181612e08015281816134f7015261442d0152518181816102ab015281816105740152818161231a0152818161244f01526128460152f35b01519350388062000190565b939295859081168860005285600020956000905b89838310620002d45750505010620002b9575b50505050811b019055620001a0565b01519060f884600019921b161c1916905538808080620002aa565b85870151895590970196948501948893509081019062000297565b88600052816000208480890160051c820192848a1062000330575b0160051c019085905b8281106200032357505062000172565b6000815501859062000313565b925081926200030a565b602289634e487b7160e01b6000525260246000fd5b90607f169062000160565b634e487b7160e01b600052604160045260246000fd5b01519050388062000131565b908987941691886000528b6000209260005b8d828210620003c85750508411620003af575b505050811b01845562000143565b015160001983891b60f8161c19169055388080620003a1565b8385015186558a979095019493840193016200038e565b90915086600052896000208580850160051c8201928c86106200042b575b918891869594930160051c01915b8281106200041b5750506200011a565b600081558594508891016200040b565b92508192620003fd565b634e487b7160e01b600052602260045260246000fd5b91607f169162000106565b600080fd5b60408051919082016001600160401b038111838210176200035a57604052565b51906001600160a01b0382168203620004565756fe60a080604052600436101561001357600080fd5b60008091813560e01c90816306fdde031461378657508063095ea7b31461375f5780630dfe16811461371a578063128acb0814612edc57806318160ddd14612ebe5780631ad8b03b14612e8c5780631d76982814612ce757806323b872dd14612c2a578063313ce56714612c0e5780633950935114612bbe5780634003d58114612ba1578063426ccdea14612b83578063462278df146127b5578063514ea4bf146126ea57806357976fb4146126c35780635b1a9a271461235b578063633dd1451461233e5780636c376cc5146122fe57806370a08231146122c657806374d7c62b146122a85780637dc0d1d01461226357806392f026ad14611c6f57806395d89b4114611b6d5780639dc29fac14611846578063a457c2d7146117a4578063a9059cbb14611772578063b613a1411461160c578063bf25901d14611097578063c19d93fb14611018578063c45a015514610fd3578063d21220a714610f8e578063dd62ed3e14610f42578063ddca3f4314610f225763f6b9a6011461019857600080fd5b60c0366003190112610aa4576101ac613888565b906101b56138b9565b916001600160801b036044351660443503610aa4576101d26138c8565b92608435936001600160801b0385168503610f1e5760a4356001600160401b038111610f1a576102069036906004016138de565b9490936001600a5414610f08576001600a5587918896610224614613565b936001600160801b0360443516158015610eb6575b610ea4578615610e655784516001600160a01b039081169087169081109081610e56575b50155b610e44576001600160801b0360408601511660018060a01b038651166102a56001600160801b0361029360443585613cd8565b166001600160801b0360443516614c6c565b62ffffff7f000000000000000000000000000000000000000000000000000000000000000016620f4240019081620f424011610e3057906102e59161488a565b6102ee83615520565b906001600160fe1b0381168103610e3057610315916103109160021b90613d4e565b614c7f565b89610dfc57906002600160811b0361033c610332859489966139d9565b9360443590613cd8565b60011b1692610de857906103509291614ad3565b955b6401000276a387101580610dcb575b156109a7578715610db7576001600160a01b03908116908716105b610da55786956103a96103a46040516103948161399d565b6001815260203681830137614469565b613c8c565b516001600160801b036040880151169060018060a01b0388511690606089015160020b63ffffffff60808b01511660a08b01519160e06103e7614dbd565b9e8f90151560a082015201526101008d0152667fffffffffffff8160060b8360060b0313667fffffffffffff198260060b8460060b031217610d90578f6104c26001600160801b038e96818f6104c2896104cd8d859c6104d2958f9b6105049c61051c9f6104c29f60060b9060060b0360060b610120820152896044351661016082015289610481848d8760018060a01b038a16916151f4565b16905250610d6f576104a9916001600160a01b0316876104a36044358b613cd8565b16614ad3565b6104c76104c2846104ba848b613d4e565b60601b613d2e565b61470c565b96613d4e565b6147bb565b16978860808201526060838316910152166104ff60018060a01b0389168760601b60443560601b16613d2e565b613d4e565b936104ff6001600160a01b03871660443586166147bb565b168060408b01526001600160801b03821660208b015261271090816001600160801b038c511610928315610d5c575b508215610d51575b508115610d39575b8115610d22575b50610d10576001600160801b036105997f00000000000000000000000000000000000000000000000000000000000000008a61528f565b168015908115610cfd575b50610cec576001600160801b038b166101408901526409502f9000804811600014610ce75750485b620249f090818102918183041481151715610cd3576445d964b8000290808204621e84801490151715610cbf57620f424090043410610cad57346101808901526001600160801b036106266044358260408a015116613cd8565b1660408701526001600160a01b031685526007546001600160801b03610650604435828416613c5a565b16906001600160801b031916176007558515600014610aa8575061067d6001600160801b03875116615269565b90610691826001600160801b038c166139d9565b978b61069b614381565b92333b15610aa45781908b6106d7604051958693849363010f40c760e51b85526004850152856024850152606060448501526064840191613d0d565b038183335af1918215610a97578a92610a7c575b50506106f6916139d9565b6106fe614381565b10610a6a5760ff60c08501511680610a26575b506107336001600160801b0360408601511660018060a01b0386511690614b68565b91838112918280610a14575b610a025784926109ea5790610753916139d9565b925b6109d6575061076d6104c26103106107849385614c6c565b91606083901b600160601b600160e01b0316613d2e565b906401000276a3821015806109b9575b156109a7576001600160801b031660408401526001600160a01b03168083526107bc90613d5b565b60020b60608301525b6001600160601b03602083015116966001600160801b0385511693600014610990576108016001600160801b03602087015116955b8984614f36565b6001600160601b036020840151166001600160601b03811461097c57608089936001600160801b03809897969460a09d60017f89bcac1da4b278a0db5d1d3519fe8a1da3da85526eb45ea0fec4194867d0146d96016001600160601b03811660208901528f600180911b0388511680926005549260a06001600160601b03901b9060a01b169216171760055560e083604089015116976108a089613cf1565b606081015160065463ffffffff60981b8984015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff8b1b908b1b16906001600160701b038b1b191617171760065561091260ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b03191691909117905560408051338152602081019890985287015216606085015260001960018d1b011692a36002600a55604051958652602086015216604084015260608301526080820152f35b634e487b7160e01b8a52601160045260248afd5b6108016001600160801b03604087015116956107fa565b6040516312c2cab560e11b8152600490fd5b5073fffd8963efd1fc6a506488495d951d5263988d268210610794565b634e487b7160e01b81526011600452602490fd5b6109f66109fc92614775565b90613d4e565b92610755565b6040516315f919ff60e11b8152600490fd5b5080610a1f83614775565b101561073f565b610a33610a3a9183613d2e565b8092613d4e565b906001600160801b03610a54816008549316828416613c5a565b16906001600160801b0319161760085538610711565b6040516314e6bc3960e21b8152600490fd5b610a87919250613921565b610a9357878b386106eb565b8a80fd5b50604051903d90823e3d90fd5b5080fd5b969750610abe6001600160801b03875116615269565b90610ad2826001600160801b038c166139d9565b988b610adc614412565b92333b15610aa45781908c610b18604051958693849363010f40c760e51b85528660048601526024850152606060448501526064840191613d0d565b038183335af1918215610a97578b92610c96575b5050610b37916139d9565b610b3f614412565b10610c845760ff60c08501511680610c49575b50610b746001600160801b0360408601511660018060a01b0386511690614b68565b9092808312908180610c37575b610c2557806109d65750610310610bb29361076d936104c29315600014610c145790610bac916139d9565b85614c6c565b906401000276a382101580610bf7575b156109a7576001600160801b031660408401526001600160a01b0316808352610bea90613d5b565b60020b60608301526107c5565b5073fffd8963efd1fc6a506488495d951d5263988d268210610bc2565b6109f6610c2092614775565b610bac565b604051631c6656d960e21b8152600490fd5b5082610c4285614775565b1015610b81565b610a33610c569183613d2e565b906001600160801b0360085491610c7482801992168460801c613c5a565b60801b1691161760085538610b52565b604051631eaaddbf60e21b8152600490fd5b610ca1919250613921565b610a9357888b38610b2c565b604051630c7cef8f60e31b8152600490fd5b634e487b7160e01b85526011600452602485fd5b634e487b7160e01b86526011600452602486fd5b6105cc565b604051626f995960e41b8152600490fd5b90506001600160801b038c1610386105a4565b60405163673f032f60e11b8152600490fd5b90506001600160801b0360808a0151161038610562565b8091506001600160801b0360608b015116109061055b565b819250109038610553565b6001600160801b0316821192503861054b565b50610d8b906001600160a01b031683876104a36044358b613cd8565b6104a9565b50634e487b7160e01b8f52601160045260248ffd5b60405163168ee7dd60e31b8152600490fd5b6001600160a01b039081169087161161037c565b5073fffd8963efd1fc6a506488495d951d5263988d268710610361565b634e487b7160e01b8e52601160045260248efd5b94610e24610e2a93966002600160811b03610e196044358a613cd8565b60011b1692976139d9565b91614ad3565b95610352565b634e487b7160e01b8f52601160045260248ffd5b604051638582dc3d60e01b8152600490fd5b6401000276a39150113861025d565b84516001600160a01b039081169087169081119081610e86575b5015610260565b73fffd8963efd1fc6a506488495d951d5263988d2691501038610e7f565b604051633145587f60e01b8152600490fd5b506001600160801b0361271081604435160111610ef4576001600160801b036040860151166001600160801b03612710816044351601161015610239565b634e487b7160e01b83526011600452602483fd5b6040516303cb96db60e21b8152600490fd5b8680fd5b8380fd5b8234610f3f5780600319360112610f3f5760206040516103e88152f35b80fd5b5034610aa4576040366003190112610aa457604090602092610f62613888565b83610f6b6138a3565b6001600160a01b0392831684526001875292209116825283522054604051908152f35b8234610f3f5780600319360112610f3f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8234610f3f5780600319360112610f3f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8234610f3f5780600319360112610f3f576101006005546006546040519160018060a01b038116835260a01c60208301526001600160801b03811660408301528060801c60020b606083015263ffffffff8160981c1660808301528060b81c60060b60a083015260ff8160f01c1660c083015260f81c151560e0820152f35b8234610f3f576060366003190112610f3f576110b1613888565b6110b961390b565b916044356001600160401b038111610aa4576110d99036906004016138de565b926001600a5414610f08576001600a55826080526110f5614613565b946111008133614e1e565b6001600160801b0381511615610d1057611146906111266103a46040516103948161399d565b519063ffffffff60808a0151169160060b9160a08a015160060b91615086565b936001600160801b03610160860151166001600160801b0361116d60075492828416613cd8565b16906001600160801b031916176007556111868561539e565b9490966101808701519561119a878761582f565b8960a0890151156000146114c1579088999189979899516001600160801b03166101408901516001600160801b03166111d2916139d9565b6111db90614775565b91826080528960408a01516001600160801b03169c8d92898612966001600160801b03966112519461125e99611487575b505061124b604087019561124589885116958a61014061123b60018060a01b03809d5116978385511690613d4e565b9201511690613d4e565b936146f0565b92614ba0565b9316905281168b52613d5b565b60020b60608a015261126e614412565b91333b15610f1e5761129b918491604051938492839263512727bd60e11b84528d60805160048601614786565b038183335af1801561147c5788918491611465575b50506112bb916139d9565b6112c3614412565b10610c845760609661132c6001600160601b03945b6112e0614dbd565b9060a0810151151560a083015260c0810151151560c083015260e081015160020b60e083015261010063ffffffff8183015116908301526101208091015160060b908201528433614f36565b60018060a01b03808251169283600554918760a01b602086015160a01b169216171760055560e06001600160801b036040840151169261136b84613cf1565b8a81015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b19161717176006556113e060ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b015115156006549060ff60f81b9060f81b169060018060f81b0316176006556040519516855260208501526040840152608051868401528460808401528360a084015216907f7fde555340816f34d18fff6958410123881fba3c912007f90d0260ff5f7e829860c03392a36002600a5560405191608051835260208301526040820152f35b611470919250613921565b610aa45786828a6112b0565b6040513d85823e3d90fd5b6114936114ba92614775565b907f00000000000000000000000000000000000000000000000000000000000000006155d7565b388e61120c565b6001600160801b039061153f928260208c9a9b9c0151166080526112516114fc6114f78b866101408183511692015116906139d9565b614775565b9c8d8981126115d3575b506040840192858451169161124b8d8861014061123b61153460018060a01b03809c511696608051906146f0565b968385511690613d4e565b60020b60608a015261154f614381565b91333b15610f1e5761157c918491604051938492839263512727bd60e11b84528d60805160048601614786565b038183335af1801561147c579083916115bf575b505060805161159e916139d9565b6115a6614381565b10610a6a5760609661132c6001600160601b03946112d8565b6115c890613921565b610aa4578189611590565b6115df61160691614775565b8d7f00000000000000000000000000000000000000000000000000000000000000006155d7565b8d611506565b8234610f3f576020366003190112610f3f5760043560ff81169081810361176e576001600a5414610f08576001600a55604051638da5cb5b60e01b81526001600160a01b03906020816004817f000000000000000000000000000000000000000000000000000000000000000086165afa908115611763578591611735575b50163303611724578115801561170d575b156116fb577f7a8f5b6a3fe6312faf94330e829a331301dbd2ce6947e915be63bf67b473ed5f60406006549381519060ff8660f01c1682526020820152a160ff60f01b1990911660f09190911b60ff60f01b16176006556002600a5580f35b6040516301f0799b60e31b8152600490fd5b506004821015801561169c5750600a82111561169c565b6040516282b42960e81b8152600490fd5b611756915060203d811161175c575b61174e81836139b8565b810190614b49565b8561168b565b503d611744565b6040513d87823e3d90fd5b8280fd5b8234610f3f576040366003190112610f3f5761179961178f613888565b60243590336139fc565b602060405160018152f35b5034610aa4576040366003190112610aa45760406117c0613888565b91816024359433815260016020522060018060a01b03841682526020522054918083106117f35761179992039033613b58565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b8234610f3f576040366003190112610f3f57611860613888565b90602435916001600a5414610f08576118a9906001600a55611880614613565b906002549060408301916001600160801b0394859188836104a381885116826007541690613c5a565b1694848351168611610ea45783516001600160a01b039460e09161191f906118d39088168a614b68565b989097816118e48c828b5116613cd8565b16885288611b3d575b89611b0d575b83511696600554602098876001600160601b0360a01b8b88015160a01b16921617176005555116613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b191617171760065561199560ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b0319169190911790553315611abe57338152808352604081205496808810611a6e57806060983384528386520360408320558060025403600255604051908152600080516020615874833981519152843392a3604080516001600160a01b039290921682526001600160801b038616602083015281018390526060810184905233907f39f142b439851b17eca4e40ba0dce1431af85e536a869a8585bc2298fdb8b77490608090a26002600a556040519384528301526040820152f35b60405162461bcd60e51b815260048101859052602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260048101849052602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b611b388a887f00000000000000000000000000000000000000000000000000000000000000006155d7565b6118f3565b611b6889887f00000000000000000000000000000000000000000000000000000000000000006155d7565b6118ed565b8234610f3f5780600319360112610f3f576040518160045490600182811c91818416938415611c65575b6020948585108114611c5157848752908115611c2f5750600114611bd6575b611bd285611bc6818903826139b8565b6040519182918261383f565b0390f35b929450600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410611c1c5750505081611bd293611bc6928201019385611bb6565b8054858501870152928501928101611bff565b60ff191686860152505050151560051b8201019150611bc681611bd285611bb6565b634e487b7160e01b83526022600452602483fd5b92607f1692611b97565b5034610aa4576060366003190112610aa457611c89613888565b6001600160801b036024351660243503610aa4576044356001600160401b038111610f1e57611cbc9036906004016138de565b926001600a5414610f08576001600a55600254928315612109575b611cdf614613565b92846120fb576001600160801b036127105b166001600160801b03602435161115610ea4578351611d1b906001600160a01b0316602435614b68565b9590946001860186116120e7576001870187116120e757611d616001600160801b03604083015116611d5c602435916001600160801b036007541690613c5a565b613c5a565b826120b6576001600160801b0316925b83986001600160801b03611d8d60243582604087015116613c5a565b1660408401528a611d9c614381565b91611da5614412565b93333b1561176e57604051632aa35ecb60e01b815260018c810160048301528d0160248201526060604482015291839183918291611de7916064840191613d0d565b038183335af180156120ab57612097575b5050611e089060018901906139d9565b611e10614381565b10610a6a57611e239060018901906139d9565b611e2b614412565b10610c845760e09060018060a01b038151166005549060209b6001600160601b0360a01b8d85015160a01b1692161717600555611e746001600160801b03604083015116613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b1916171717600655611eea60ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b03191691909117905515612014575b506001600160a01b0316908115611fcf576001939282606097938693611f3d896002546139d9565b60025581815280865260408120898154019055600080516020615874833981519152866040518b8152a3604080513381526024356001600160801b031660208201528484019181019190915285840160608201527f011d4be6213866bff035f68967364cf69c5c01ff5bc23ff0a275f08a04381e6a90608090a26002600a556040519586520190840152016040820152f35b60405162461bcd60e51b815260048101879052601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b90945061270f19810190811161208357933015611fcf576002546127109081810180911161206f576002553083528287526040832081815401905560405190815282600080516020615874833981519152883093a338611f15565b634e487b7160e01b84526011600452602484fd5b634e487b7160e01b82526011600452602482fd5b6120a090613921565b610a93578a38611df8565b6040513d84823e3d90fd5b6001600160801b036120ce6120e19260243590613cd8565b166001600160801b036024351684614ad3565b92611d71565b634e487b7160e01b89526011600452602489fd5b6001600160801b0387611cf1565b7f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c956040805161213781613982565b60028152813660208301378861218661215d61a8c0938461215782613c8c565b52614469565b9261216784613c8c565b5193612177600695860b91613caf565b51850b03840b0560020b614010565b9161219083613d5b565b600160e08651956121a08761394a565b828060a01b03169586815285602082015285888201528360020b9586606083015263ffffffff421660808301528060a083015260c08201520152838c60055416176005556121ed8c613cf1565b81544260981b63ffffffff60981b166dffffffffffffffffffffffffffff60801b1990911660809290921b62ffffff60801b16919091171781556006805460ff60f01b191660f08d901b60ff60f01b1617905580546001600160f81b0316600160f81b17905582519182526020820152a1611cd7565b8234610f3f5780600319360112610f3f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8234610f3f5780600319360112610f3f57602060405162093a808152f35b8234610f3f576020366003190112610f3f576020906040906001600160a01b036122ee613888565b1681528083522054604051908152f35b8234610f3f5780600319360112610f3f57602060405162ffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b8234610f3f5780600319360112610f3f57602060405161a8c08152f35b509034610f3f576060366003190112610f3f57612376613888565b9161237f6138a3565b906001600160601b036044351660443503610f3f57506001600a5414610f08576001600a556123ac614613565b926123b960443583614e1e565b926001600160801b0384511615610d105761247561244c604051956123dd87613982565b6002875260403660208901376124256123fd61a8c0988961215782613c8c565b9761240789613c8c565b5160060b6124148a613caf565b5160060b0360060b0560020b614010565b9663ffffffff60808a01511661244260a08b015160060b92613caf565b5160060b92615086565b947f0000000000000000000000000000000000000000000000000000000000000000908661544f565b6126b1576020946001600160801b03610160860151166001600160801b036124a260075492828416613cd8565b16906001600160801b031916176007556124fc6001600160801b036124e46124c98861539e565b604086015186519192916001600160a01b0316908516614ba0565b6001600160a01b031680855291166040840152613d5b565b60020b606082015261256961018086015195612518878661582f565b612520614dbd565b9060a0810151151560a0830152600160c083015260e081015160020b60e083015261010063ffffffff8183015116908301526101208091015160060b9082015260443586614f36565b60018060a01b038151169182600554916001600160601b0360a01b8985015160a01b169216171760055560e06001600160801b03604083015116916125ad83613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b191617171760065561262360ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b031916919091179055604080516001600160a01b03948516815287810192909252810191909152606081018490526044356001600160601b031692909116907fe79231b2121f3b0a34317face6f7754ddee5144ce7d0700b3bb67f796a5d776090608090a36002600a55604051908152f35b60405163ac1724fb60e01b8152600490fd5b8234610f3f5780600319360112610f3f5760206001600160801b0360075416604051908152f35b8234610f3f576020366003190112610f3f5760406101a091600435815260096020522080546001820154916002810154916004600383015492015492604051946001600160801b0392838116875260801c6020870152828116604087015260801c6060860152818116608086015260ff8160801c16151560a086015260ff8160881c16151560c08601528060901c60020b60e086015263ffffffff8160a81c1661010086015260c81d60060b610120850152811661014084015260801c610160830152610180820152f35b8234610f3f576080366003190112610f3f576127cf613888565b6127d761390b565b906044359081600f0b809203610f1e576064356001600160401b038111612b7f576128069036906004016138de565b9490936001600a5414610f08576001600a55818094612823614613565b9361282e8433614e1e565b986001600160801b0392838b511615610d105761286b7f00000000000000000000000000000000000000000000000000000000000000008c61528f565b926101408c01938561288084828851166146f0565b911613610cec5760a08c0151612a95575061289e90848451166146f0565b986128cd84845116897f00000000000000000000000000000000000000000000000000000000000000006155d7565b6128d5614381565b91333b15612a915785908b61291160405194859384936317c713f760e21b85526004850152856024850152606060448501526064840191613d0d565b038183335af18015611763578a918691612a7a575b5050612931916139d9565b612939614381565b10610a6a5760e06001600160601b039561296460409b856129598d61470c565b1685525b8733614f36565b60018060a01b039485825116600554918960a01b602085015160a01b1692161717600555612996848c83015116613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b1916171717600655612a0c60ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b031916919091179055518851959092168552166020840152169033907fa703a2c22bbc13b44c069d15db2894529fae4779b607bcd82003e78c7aaf6c19908690a36002600a5582519182526020820152f35b612a85919250613921565b610f1e5788848c612926565b8580fd5b999850612aa590848451166146f0565b97612ad484845116897f00000000000000000000000000000000000000000000000000000000000000006155d7565b612adc614412565b91333b15612a915785908a612b1860405194859384936317c713f760e21b85528660048601526024850152606060448501526064840191613d0d565b038183335af180156117635789918691612b68575b5050612b38916139d9565b612b40614412565b10610c845760e06001600160601b039561296460409b85612b608c61470c565b16855261295d565b612b73919250613921565b610f1e5787848c612b2d565b8480fd5b8234610f3f5780600319360112610f3f576020604051621e84808152f35b8234610f3f5780600319360112610f3f5760206040516103988152f35b5034610aa4576040366003190112610aa45790612c07611799926040612be2613888565b9333815260016020522060018060a01b038416825260205260406024359120546139d9565b9033613b58565b8234610f3f5780600319360112610f3f57602060405160128152f35b509034610f3f576060366003190112610f3f57612c45613888565b916040612c506138a3565b6001600160a01b0385168452600160208181529483902033855290945291205492604435928401612c86575b61179993506139fc565b828410612ca257612c9d8361179995033383613b58565b612c7c565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b8234610f3f576020366003190112610f3f57612d01613888565b6001600a5414610f08576001600a55604051638da5cb5b60e01b81526001600160a01b0392906020816004817f000000000000000000000000000000000000000000000000000000000000000088165afa918215612e8057908492612e62575b5016330361172457600854917f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b15160606001600160801b0392612da4848716613cbf565b946001612db38860801c613cbf565b976001600160801b0319161760085584861694612df186837f00000000000000000000000000000000000000000000000000000000000000006155d7565b600880548216600160801b1790558716612e2c81837f00000000000000000000000000000000000000000000000000000000000000006155d7565b60405195338752602087015260408601521692a26002600a55604080516001600160801b03928316815292909116602083015290f35b612e7a915060203d811161175c5761174e81836139b8565b84612d61565b604051903d90823e3d90fd5b8234610f3f5780600319360112610f3f57600854604080516001600160801b038316815260809290921c602083015290f35b8234610f3f5780600319360112610f3f576020600254604051908152f35b509034610aa45760a0366003190112610aa457612ef7613888565b91612f006138b9565b9160443593612f0d6138c8565b936084356001600160401b038111612b7f57612f2d9036906004016138de565b6001600a9692965414610f08576001600a55612f47614613565b9288156137085780156136c95783516001600160a01b0390811690891690811090816136ba575b50155b610e44578289139788156136b4576103e88a026103e7198b820401610cbf57620f4240612f9f91048b6147a2565b6040860151865190916001600160a01b03909116906001600160801b038316878213156135d8578561357957612ff093506001600160a01b03821161357057612fea9160601b613d2e565b906139d9565b6401000276a381101580613553575b156109a7576001600160a01b0316908215613543576001600160a01b031681105b610da557604085015185516001600160a01b0316906001600160801b0381169061306d9060601b600160601b600160e01b0316613067846130618784613d2e565b92613d2e565b906147a2565b928281101561352657613099926114f792916001600160a01b039161309291906151db565b16906147bb565b935b8482931560001461339757505050829088156000146133915750885b8998878b12613359575b1561334c576130da916130d391613d4e565b80936146f0565b956130e3614412565b91333b15610f1a57604051633a69946960e11b81529187918391829161310e918c8f60048601614786565b038183335af180156133415790869161332d575b5050858015918215613313575b5050610c84576001600160801b0361318560409861319c9360ff60c08701511680151560001461330a5761316291613d2e565b905b816132e6575b838b870151169161124b60018060a01b03885116918b6147a2565b9116838901526001600160a01b0381168352613d5b565b60020b60608201525b60018060a01b038151169283600554916001600160601b0360a01b602085015160a01b16921617176005556001600160801b0386820151166131e681613cf1565b60608201516006805460808086015160a087015160c08801516effffffffffffffffffffffffffffff60801b199094169286901b62ffffff60801b169290921760989190911b63ffffffff60981b161766ffffffffffffff60b81b60b89290921b919091161760f09190911b60ff60f01b161790559160e00151600680546001600160f81b031691151560f81b6001600160f81b03191691909117905586518681526020810186905280880194909452606084015260020b60808301526001600160a01b03169033907fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679060a090a36002600a5582519182526020820152f35b6008548480196132fb8286168460801c613c5a565b60801b1691161760085561316a565b50508690613164565b61331d92506139d9565b613325614412565b10853861312f565b61333690613921565b612b7f578438613122565b6040513d88823e3d90fd5b506130d36130da916155ba565b61338c6133658c614775565b887f00000000000000000000000000000000000000000000000000000000000000006155d7565b6130c1565b986130b7565b98999891945091508390886135205750895b8a98838c126134e8575b156134db576133cc916133c591613d4e565b80946146f0565b976133d5614381565b92333b1561176e57604051633a69946960e11b815291839183918291613400918f8f60048601614786565b038183335af180156120ab576134c7575b50508680159182156134ad575b5050610a6a576001600160801b036131856040986134789360ff60c0870151168015156000146134a55761345191613d2e565b80613485575b838b870151169061347260018060a01b03885116918c6147a2565b91614ba0565b60020b60608201526131a5565b60085484613497818416828416613c5a565b169085191617600855613457565b505086613451565b6134b792506139d9565b6134bf614381565b10863861341e565b6134d391929650613921565b933880613411565b506133c56133cc916155ba565b61351b6134f48d614775565b897f00000000000000000000000000000000000000000000000000000000000000006155d7565b6133b3565b996133a9565b61353d926001600160a01b039161309291906151db565b9361309b565b6001600160a01b03168111613020565b5073fffd8963efd1fc6a506488495d951d5263988d268110612fff565b612fea91614800565b506135c69261359890839060601b600160601b600160e01b0316613d2e565b90826001600160601b0382116135cb57816135ba6135c0926109f69594614c6c565b926139d9565b90613d2e565b612ff0565b610e24826109f6946139d9565b9092908561366157506135fb90829060601b600160601b600160e01b0316613d2e565b61360483614775565b811115610a025782826001600160601b036136216135c696614775565b1161364857612fea926109f66136426135c09361363d86614775565b614c6c565b93614775565b610e24612fea936109f661365b85614775565b94614775565b92905061366e82846147bb565b61367782614775565b1015610c25576135c6926001600160a01b0361369283614775565b116136a3576104ba6109f692614775565b6136af6109f692614775565b614800565b89612f9f565b6401000276a391501138612f6e565b83516001600160a01b0390811690891690811190816136ea575b5015612f71565b73fffd8963efd1fc6a506488495d951d5263988d26915010386136e3565b604051638713cd5760e01b8152600490fd5b5034610f3f5780600319360112610f3f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5034610f3f576040366003190112610f3f5761179961377c613888565b6024359033613b58565b905034610aa45781600319360112610aa4578160035490600182811c91818416938415613835575b6020948585108114611c5157848752908115611c2f57506001146137dc57611bd285611bc6818903826139b8565b929450600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106138225750505081611bd293611bc6928201019385611bb6565b8054858501870152928501928101613805565b92607f16926137ae565b6020808252825181830181905290939260005b82811061387457505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501613852565b600435906001600160a01b038216820361389e57565b600080fd5b602435906001600160a01b038216820361389e57565b60243590811515820361389e57565b606435906001600160a01b038216820361389e57565b9181601f8401121561389e578235916001600160401b03831161389e576020838186019501011161389e57565b602435906001600160601b038216820361389e57565b6001600160401b03811161393457604052565b634e487b7160e01b600052604160045260246000fd5b61010081019081106001600160401b0382111761393457604052565b6101a081019081106001600160401b0382111761393457604052565b606081019081106001600160401b0382111761393457604052565b604081019081106001600160401b0382111761393457604052565b90601f801991011681019081106001600160401b0382111761393457604052565b919082018092116139e657565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03908116918215613b055716918215613ab457600082815280602052604081205491808310613a605760408282600080516020615874833981519152958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b03908116918215613c095716918215613bb95760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9190916001600160801b03808094169116019182116139e657565b6001600160401b0381116139345760051b60200190565b805115613c995760200190565b634e487b7160e01b600052603260045260246000fd5b805160011015613c995760400190565b6001600160801b0390811660001901919082116139e657565b6001600160801b0391821690821603919082116139e657565b6001600160801b03166001600160801b03196006541617600655565b908060209392818452848401376000828201840152601f01601f1916010190565b8115613d38570490565b634e487b7160e01b600052601260045260246000fd5b919082039182116139e657565b6001600160a01b03818116916401000276a383101580613ff3575b15613fe157640100000000600160c01b039060201b16806001600160801b03811160071b9181831c926001600160401b03841160061b93841c9363ffffffff851160051b94851c9461ffff861160041b95861c60ff9687821160031b91821c92600f841160021b93841c94600160038711811b96871c119617171717171717916080831015600014613fd55750607e1982011c5b8002607f928392828493841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c80029081881c82881c1c80029283891c84891c1c800294858a1c868a1c1c800296878b1c888b1c1c800298898c1c8a8c1c1c80029a8b8d1c8c821c1c8002809d1c8d821c1c8002809e81901c90821c1c80029e8f80911c911c1c800260cd1c6604000000000000169d60cc1c6608000000000000169c60cb1c6610000000000000169b60ca1c6620000000000000169a60c91c6640000000000000169960c81c6680000000000000169860c71c670100000000000000169760c61c670200000000000000169660c51c670400000000000000169560c41c670800000000000000169460c31c671000000000000000169360c21c672000000000000000169260c11c674000000000000000169160c01c6780000000000000001690607f190160401b1717171717171717171717171717693627a301d71055774c8502906f028f6481ab7f045a5af012a19d003aa919820160801d60020b916fdb2df09e81959a81455e260799a0632f0160801d60020b92600091848414600014613fbb5750505090505b90565b613fc485614010565b16119050613fd0575090565b905090565b905081607f031b613e0a565b6040516324c070df60e11b8152600490fd5b5073fffd8963efd1fc6a506488495d951d5263988d268310613d76565b60020b600081121561437b5780600003905b620d89e88211614369576001821615614357576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b16916002811661433b575b6004811661431f575b60088116614303575b601081166142e7575b602081166142cb575b604081166142af575b608090818116614294575b6101008116614279575b610200811661425e575b6104008116614243575b6108008116614228575b611000811661420d575b61200081166141f2575b61400081166141d7575b61800081166141bc575b6201000081166141a1575b620200008116614187575b62040000811661416d575b6208000016614152575b50600012614143575b63ffffffff811661413b576000905b60201c60ff91909116016001600160a01b031690565b600190614125565b8015613d385760001904614116565b6b048a170391f7dc42444e8fa26000929302901c919061410d565b6d2216e584f5fa1ea926041bedfe98909302811c92614103565b926e5d6af8dedb81196699c329225ee60402811c926140f8565b926f09aa508b5b7a84e1c677de54f3e99bc902811c926140ed565b926f31be135f97d08fd981231505542fcfa602811c926140e2565b926f70d869a156d2a1b890bb3df62baf32f702811c926140d8565b926fa9f746462d870fdf8a65dc1f90e061e502811c926140ce565b926fd097f3bdfd2022b8845ad8f792aa582502811c926140c4565b926fe7159475a2c29b7443b29c7fa6e889d902811c926140ba565b926ff3392b0822b70005940c7a398e4b70f302811c926140b0565b926ff987a7253ac413176f2b074cf7815e5402811c926140a6565b926ffcbe86c7900a88aedcffc83b479aa3a402811c9261409c565b926ffe5dee046a99a2a811c461f1969c305302811c92614092565b916fff2ea16466c96a3843ec78b326b528610260801c91614087565b916fff973b41fa98c081472e6896dfb254c00260801c9161407e565b916fffcb9843d60f6159c9db58835c9266440260801c91614075565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c9161406c565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91614063565b916ffff97272373d413259a46990580e213a0260801c9161405a565b6001600160881b03600160801b61404f565b6040516315e4079d60e11b8152600490fd5b80614022565b6040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115614406576000916143d8575090565b906020823d82116143fe575b816143f1602093836139b8565b81010312610f3f57505190565b3d91506143e4565b6040513d6000823e3d90fd5b6040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115614406576000916143d8575090565b60405163883bdbfd60e01b8152602060048201819052825160248301819052604483019382019060005b8181106145f957506001600160a01b039460009250849150819003817f000000000000000000000000000000000000000000000000000000000000000087165afa928315614406576000936144e9575b50505090565b9091923d8082863e6144fb81866139b8565b840191604085840312610aa45784516001600160401b0390818111610f1e5786019584601f88011215610f1e5786519661453488613c75565b97614542604051998a6139b8565b80895287808a019160051b83010191878311610f1a578801905b8282106145dc5750505085810151918211610f1e57019183601f84011215610f3f57825192858061458c86613c75565b61459960405191826139b8565b868152019460051b820101948511610aa4578501925b8484106145c4575050505050503880806144e3565b8351838116810361176e5781529285019285016145af565b81518060060b81036145f557815290880190880161455c565b8780fd5b825163ffffffff1686529483019491830191600101614493565b60405161461f8161394a565b60e06000918281528260208201528260408201528260608201528260808201528260a08201528260c082015201526040516146598161394a565b60055460018060a01b038116825260a01c60208201526006546001600160801b03811660408301528060801c60020b80606084015263ffffffff91828160981c169260808501928484528260b81c60060b9160a087019383855260ff8160f01c1660c089015260f81c151560e08801528042169586031680156146e75760060b0260060b0160060b90525290565b50505050505090565b919091600083820193841291129080158216911516176139e657565b6001600160801b0390818111614720571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608490fd5b600160ff1b81146139e65760000390565b613fb89492606092825260208201528160408201520191613d0d565b818103929160001380158285131691841216176139e657565b60001982820990828102928380841093039280840393146147f757600160601b918383111561389e570990828211900360a01b910360601c1790565b50505060601c90565b90600160601b90600019828409928060601b9283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b505090613fb89250613d2e565b90620f424090600019828409928281029283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60001982820990828102928380841093039280840393146149465768010000000000000000918383111561389e570990828211900360c01b910360401c1790565b50505060401c90565b600019828209908281029283808410930392808403931461498b57600160801b918383111561389e570990828211900360801b910360801c1790565b50505060801c90565b60001982820990828102928380841093039280840393146149d057600160c01b918383111561389e570990828211900360401b910360c01c1790565b50505060c01c90565b90600160801b90600019828409928060801b9283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b90600160c01b90600019828409928060c01b9283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b91600019828409928281029283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b9081602091031261389e57516001600160a01b038116810361389e5790565b9190613fb8906001600160a01b03166001600160801b03614b9982606087901b600160601b600160e01b0316613d2e565b94166147bb565b90614baa91614b68565b9190600082128080614c5a575b610a025760008512948580614c48575b610c2557614bf99461076d946104c29461031094614c365790614be9916139d9565b965b610c145790610bac916139d9565b6401000276a381101580614c19575b156109a75760018060a01b03169091565b5073fffd8963efd1fc6a506488495d951d5263988d268110614c08565b6109f6614c4292614775565b96614beb565b5084614c5382614775565b1015614bc7565b5081614c6584614775565b1015614bb7565b818102929181159184041417156139e657565b8015614db757614d4a816000908360801c80614dab575b508060401c80614d9e575b508060201c80614d91575b508060101c80614d84575b508060081c80614d77575b508060041c80614d6a575b508060021c80614d5d575b50600191828092811c614d56575b1c1b614cf28185613d2e565b01811c614cff8185613d2e565b01811c614d0c8185613d2e565b01811c614d198185613d2e565b01811c614d268185613d2e565b01811c614d338185613d2e565b01811c614d408185613d2e565b01901c8092613d2e565b80821015613fd0575090565b0181614ce6565b6002915091019038614cd8565b6004915091019038614ccd565b6008915091019038614cc2565b6010915091019038614cb7565b6020915091019038614cac565b6040915091019038614ca1565b91505060809038614c96565b50600090565b60405190614dca82613966565b816101806000918281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152826101608201520152565b90614e77614e6991614e2e614dbd565b5060405192839160208301958690916020926001600160601b03199060601b1682526001600160601b0360a01b9060a01b1660148201520190565b03601f1981018352826139b8565b51902060005260096020526040600020600460405191614e9683613966565b80546001600160801b0390818116855260801c60208501526001820154818116604086015260801c60608501526002820154818116608086015260ff8160801c16151560a086015260ff8160881c16151560c08601528060901c60020b60e086015263ffffffff8160a81c1661010086015260c81d60060b610120850152600382015490811661014085015260801c610160840152015461018082015290565b6040805160609290921b6bffffffffffffffffffffffff19166020830190815260a09390931b6001600160a01b0319166034830152614f789082908101614e69565b519020600090815260096020908152604091829020835191840151608090811b6fffffffffffffffffffffffffffffffff199081166001600160801b03948516178355938501516060860151908416911b8416176001820155926004926101809261507f91908060808501511660ff60801b60a0860151151560801b169060ff60881b60c0870151151560881b1660e087015160901b9063ffffffff60a81b61010089015160a81b169266ffffffffffffff60c81b6101208a015160c81b169417179062ffffff60901b1617171760028801556003870191816101408601511690835416178255610160840151166001600160801b0382549181199060801b169116179055565b0151910155565b92919091615092614dbd565b5061010084019063ffffffff80835116818616948186146151d15760069303830b950316810b61039802810b60a086015115600014615173576150f79162049d409186610120890151830b03820b8181136000146151475750905b0b0560020b614010565b602085015160408601516001600160801b0391821692615127926104c2926001600160a01b0390921691166147bb565b6001600160801b0380921660208701521660408501525261012082015290565b919061515281615437565b820b8312615161575b506150ed565b61516c919250615437565b903861515b565b61519e9162049d4091610120880151820b8703820b8181136000146151475750900b0560020b614010565b60208501516001600160801b03916151c5916104c2916001600160a01b03169084166147bb565b90604086015116615127565b5050505050505090565b6001600160a01b0391821690821603919082116139e657565b9091921560001461523d57613fb8926104c29290916109f69160609190911b600160601b600160e01b0316906001600160a01b039061523590821683613d2e565b931690613d2e565b613fb8926104c2926001600160801b03916001600160a01b039161526191906151db565b1691166147bb565b6001600160801b03166103e8908181029181830414901517156139e657620f4240900490565b906152a060e083015160020b614010565b60a0830151615338576001600160801b03918260408501511662ffffff620f4240921682018083116139e6576152d591614c6c565b6001600160a01b03909216910482821161531f576152f6826152fc93614c6c565b90614a56565b915b5116906000828211156153195750613fb8916104c291613d4e565b91505090565b61532c8261533293614905565b906149d9565b916152fe565b6001600160801b03918260208501511662ffffff620f4240921682018083116139e65761536491614c6c565b6001600160a01b03909216910482821161538b57615385826152fc93614c6c565b90614994565b6153988261533293614905565b9061494f565b9060a0820151156000146153f2576001600160801b0360806153eb6153de6153d1848751168561014089015116906139d9565b84602088015116906139d9565b83606087015116906139d9565b9301511690565b613fb86001600160801b03928360608201511693608061542d615420838551168461014087015116906139d9565b83604086015116906139d9565b92015116906139d9565b60060b667fffffffffffff1981146139e65760000390565b919060a0830151156000146154cb576001600160801b0392836040820151169062ffffff620f424094168401908185116139e6576154c6946154976154aa936154bd95614c6c565b04958061014083015116915116906139d9565b6001600160a01b039092169182906147bb565b9260601b613d2e565b111590565b6001600160801b0392836020820151169062ffffff620f424094168401908185116139e6576154c6946154976155049361551a95614c6c565b6001600160a01b0390921691829060601b613d2e565b926147bb565b60009080156155b65780806001146155ae576002146155a6576001918261013383101683600b841016176155965760028392935b80821161556d575050826000190482116109d657500290565b909380600019048111610ef45781851661558d575b800293811c90615554565b80930292615582565b929150600283910a926109d65750565b509060049150565b505050600190565b5090565b6103e8908181029181830414901517156139e657620f3e58900490565b6040516370a0823160e01b81523060048201526020936001600160a01b0393928416918581602481865afa9081156144065760009161572e575b5080821161572757505b604051938585019363a9059cbb60e01b855216602485015260448401526044835260808301918383106001600160401b0384111761393457600080916156a595856040526156688661399d565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460a0820152519082855af161569f61575b565b9161579a565b8051806156b157505050565b8183918101031261389e5781015180159081150361389e576156d05750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b905061561b565b908682813d8311615754575b61574481836139b8565b81010312610f3f57505138615611565b503d61573a565b3d15615795573d906001600160401b0382116139345760405191615789601f8201601f1916602001846139b8565b82523d6000602084013e565b606090565b919290156157fc57508151156157ae575090565b3b156157b75790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561580f5750805190602001fd5b60405162461bcd60e51b815290819061582b906004830161383f565b0390fd5b600080809381935af161584061575b565b501561584857565b60405162461bcd60e51b815260206004820152600360248201526253544560e81b6044820152606490fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122082ba88c317067c02e9de94b32a09683cc78a8a4895fe99de0b150608ed761c9664736f6c63430008110033000000000000000000000000a85d1a8f20d1d51612ffa969f8594166a855c3c200000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f32217000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b14000000000000000000000000000000000000000000000000000000000003d090000000000000000000000000733293ca9fd372712f7b6e83ad79087c6a29e266

Deployed Bytecode

0x60a080604052600436101561001357600080fd5b60008091813560e01c90816306fdde031461378657508063095ea7b31461375f5780630dfe16811461371a578063128acb0814612edc57806318160ddd14612ebe5780631ad8b03b14612e8c5780631d76982814612ce757806323b872dd14612c2a578063313ce56714612c0e5780633950935114612bbe5780634003d58114612ba1578063426ccdea14612b83578063462278df146127b5578063514ea4bf146126ea57806357976fb4146126c35780635b1a9a271461235b578063633dd1451461233e5780636c376cc5146122fe57806370a08231146122c657806374d7c62b146122a85780637dc0d1d01461226357806392f026ad14611c6f57806395d89b4114611b6d5780639dc29fac14611846578063a457c2d7146117a4578063a9059cbb14611772578063b613a1411461160c578063bf25901d14611097578063c19d93fb14611018578063c45a015514610fd3578063d21220a714610f8e578063dd62ed3e14610f42578063ddca3f4314610f225763f6b9a6011461019857600080fd5b60c0366003190112610aa4576101ac613888565b906101b56138b9565b916001600160801b036044351660443503610aa4576101d26138c8565b92608435936001600160801b0385168503610f1e5760a4356001600160401b038111610f1a576102069036906004016138de565b9490936001600a5414610f08576001600a5587918896610224614613565b936001600160801b0360443516158015610eb6575b610ea4578615610e655784516001600160a01b039081169087169081109081610e56575b50155b610e44576001600160801b0360408601511660018060a01b038651166102a56001600160801b0361029360443585613cd8565b166001600160801b0360443516614c6c565b62ffffff7f000000000000000000000000000000000000000000000000000000000003d09016620f4240019081620f424011610e3057906102e59161488a565b6102ee83615520565b906001600160fe1b0381168103610e3057610315916103109160021b90613d4e565b614c7f565b89610dfc57906002600160811b0361033c610332859489966139d9565b9360443590613cd8565b60011b1692610de857906103509291614ad3565b955b6401000276a387101580610dcb575b156109a7578715610db7576001600160a01b03908116908716105b610da55786956103a96103a46040516103948161399d565b6001815260203681830137614469565b613c8c565b516001600160801b036040880151169060018060a01b0388511690606089015160020b63ffffffff60808b01511660a08b01519160e06103e7614dbd565b9e8f90151560a082015201526101008d0152667fffffffffffff8160060b8360060b0313667fffffffffffff198260060b8460060b031217610d90578f6104c26001600160801b038e96818f6104c2896104cd8d859c6104d2958f9b6105049c61051c9f6104c29f60060b9060060b0360060b610120820152896044351661016082015289610481848d8760018060a01b038a16916151f4565b16905250610d6f576104a9916001600160a01b0316876104a36044358b613cd8565b16614ad3565b6104c76104c2846104ba848b613d4e565b60601b613d2e565b61470c565b96613d4e565b6147bb565b16978860808201526060838316910152166104ff60018060a01b0389168760601b60443560601b16613d2e565b613d4e565b936104ff6001600160a01b03871660443586166147bb565b168060408b01526001600160801b03821660208b015261271090816001600160801b038c511610928315610d5c575b508215610d51575b508115610d39575b8115610d22575b50610d10576001600160801b036105997f000000000000000000000000000000000000000000000000000000000003d0908a61528f565b168015908115610cfd575b50610cec576001600160801b038b166101408901526409502f9000804811600014610ce75750485b620249f090818102918183041481151715610cd3576445d964b8000290808204621e84801490151715610cbf57620f424090043410610cad57346101808901526001600160801b036106266044358260408a015116613cd8565b1660408701526001600160a01b031685526007546001600160801b03610650604435828416613c5a565b16906001600160801b031916176007558515600014610aa8575061067d6001600160801b03875116615269565b90610691826001600160801b038c166139d9565b978b61069b614381565b92333b15610aa45781908b6106d7604051958693849363010f40c760e51b85526004850152856024850152606060448501526064840191613d0d565b038183335af1918215610a97578a92610a7c575b50506106f6916139d9565b6106fe614381565b10610a6a5760ff60c08501511680610a26575b506107336001600160801b0360408601511660018060a01b0386511690614b68565b91838112918280610a14575b610a025784926109ea5790610753916139d9565b925b6109d6575061076d6104c26103106107849385614c6c565b91606083901b600160601b600160e01b0316613d2e565b906401000276a3821015806109b9575b156109a7576001600160801b031660408401526001600160a01b03168083526107bc90613d5b565b60020b60608301525b6001600160601b03602083015116966001600160801b0385511693600014610990576108016001600160801b03602087015116955b8984614f36565b6001600160601b036020840151166001600160601b03811461097c57608089936001600160801b03809897969460a09d60017f89bcac1da4b278a0db5d1d3519fe8a1da3da85526eb45ea0fec4194867d0146d96016001600160601b03811660208901528f600180911b0388511680926005549260a06001600160601b03901b9060a01b169216171760055560e083604089015116976108a089613cf1565b606081015160065463ffffffff60981b8984015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff8b1b908b1b16906001600160701b038b1b191617171760065561091260ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b03191691909117905560408051338152602081019890985287015216606085015260001960018d1b011692a36002600a55604051958652602086015216604084015260608301526080820152f35b634e487b7160e01b8a52601160045260248afd5b6108016001600160801b03604087015116956107fa565b6040516312c2cab560e11b8152600490fd5b5073fffd8963efd1fc6a506488495d951d5263988d268210610794565b634e487b7160e01b81526011600452602490fd5b6109f66109fc92614775565b90613d4e565b92610755565b6040516315f919ff60e11b8152600490fd5b5080610a1f83614775565b101561073f565b610a33610a3a9183613d2e565b8092613d4e565b906001600160801b03610a54816008549316828416613c5a565b16906001600160801b0319161760085538610711565b6040516314e6bc3960e21b8152600490fd5b610a87919250613921565b610a9357878b386106eb565b8a80fd5b50604051903d90823e3d90fd5b5080fd5b969750610abe6001600160801b03875116615269565b90610ad2826001600160801b038c166139d9565b988b610adc614412565b92333b15610aa45781908c610b18604051958693849363010f40c760e51b85528660048601526024850152606060448501526064840191613d0d565b038183335af1918215610a97578b92610c96575b5050610b37916139d9565b610b3f614412565b10610c845760ff60c08501511680610c49575b50610b746001600160801b0360408601511660018060a01b0386511690614b68565b9092808312908180610c37575b610c2557806109d65750610310610bb29361076d936104c29315600014610c145790610bac916139d9565b85614c6c565b906401000276a382101580610bf7575b156109a7576001600160801b031660408401526001600160a01b0316808352610bea90613d5b565b60020b60608301526107c5565b5073fffd8963efd1fc6a506488495d951d5263988d268210610bc2565b6109f6610c2092614775565b610bac565b604051631c6656d960e21b8152600490fd5b5082610c4285614775565b1015610b81565b610a33610c569183613d2e565b906001600160801b0360085491610c7482801992168460801c613c5a565b60801b1691161760085538610b52565b604051631eaaddbf60e21b8152600490fd5b610ca1919250613921565b610a9357888b38610b2c565b604051630c7cef8f60e31b8152600490fd5b634e487b7160e01b85526011600452602485fd5b634e487b7160e01b86526011600452602486fd5b6105cc565b604051626f995960e41b8152600490fd5b90506001600160801b038c1610386105a4565b60405163673f032f60e11b8152600490fd5b90506001600160801b0360808a0151161038610562565b8091506001600160801b0360608b015116109061055b565b819250109038610553565b6001600160801b0316821192503861054b565b50610d8b906001600160a01b031683876104a36044358b613cd8565b6104a9565b50634e487b7160e01b8f52601160045260248ffd5b60405163168ee7dd60e31b8152600490fd5b6001600160a01b039081169087161161037c565b5073fffd8963efd1fc6a506488495d951d5263988d268710610361565b634e487b7160e01b8e52601160045260248efd5b94610e24610e2a93966002600160811b03610e196044358a613cd8565b60011b1692976139d9565b91614ad3565b95610352565b634e487b7160e01b8f52601160045260248ffd5b604051638582dc3d60e01b8152600490fd5b6401000276a39150113861025d565b84516001600160a01b039081169087169081119081610e86575b5015610260565b73fffd8963efd1fc6a506488495d951d5263988d2691501038610e7f565b604051633145587f60e01b8152600490fd5b506001600160801b0361271081604435160111610ef4576001600160801b036040860151166001600160801b03612710816044351601161015610239565b634e487b7160e01b83526011600452602483fd5b6040516303cb96db60e21b8152600490fd5b8680fd5b8380fd5b8234610f3f5780600319360112610f3f5760206040516103e88152f35b80fd5b5034610aa4576040366003190112610aa457604090602092610f62613888565b83610f6b6138a3565b6001600160a01b0392831684526001875292209116825283522054604051908152f35b8234610f3f5780600319360112610f3f576040517f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146001600160a01b03168152602090f35b8234610f3f5780600319360112610f3f576040517f000000000000000000000000a85d1a8f20d1d51612ffa969f8594166a855c3c26001600160a01b03168152602090f35b8234610f3f5780600319360112610f3f576101006005546006546040519160018060a01b038116835260a01c60208301526001600160801b03811660408301528060801c60020b606083015263ffffffff8160981c1660808301528060b81c60060b60a083015260ff8160f01c1660c083015260f81c151560e0820152f35b8234610f3f576060366003190112610f3f576110b1613888565b6110b961390b565b916044356001600160401b038111610aa4576110d99036906004016138de565b926001600a5414610f08576001600a55826080526110f5614613565b946111008133614e1e565b6001600160801b0381511615610d1057611146906111266103a46040516103948161399d565b519063ffffffff60808a0151169160060b9160a08a015160060b91615086565b936001600160801b03610160860151166001600160801b0361116d60075492828416613cd8565b16906001600160801b031916176007556111868561539e565b9490966101808701519561119a878761582f565b8960a0890151156000146114c1579088999189979899516001600160801b03166101408901516001600160801b03166111d2916139d9565b6111db90614775565b91826080528960408a01516001600160801b03169c8d92898612966001600160801b03966112519461125e99611487575b505061124b604087019561124589885116958a61014061123b60018060a01b03809d5116978385511690613d4e565b9201511690613d4e565b936146f0565b92614ba0565b9316905281168b52613d5b565b60020b60608a015261126e614412565b91333b15610f1e5761129b918491604051938492839263512727bd60e11b84528d60805160048601614786565b038183335af1801561147c5788918491611465575b50506112bb916139d9565b6112c3614412565b10610c845760609661132c6001600160601b03945b6112e0614dbd565b9060a0810151151560a083015260c0810151151560c083015260e081015160020b60e083015261010063ffffffff8183015116908301526101208091015160060b908201528433614f36565b60018060a01b03808251169283600554918760a01b602086015160a01b169216171760055560e06001600160801b036040840151169261136b84613cf1565b8a81015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b19161717176006556113e060ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b015115156006549060ff60f81b9060f81b169060018060f81b0316176006556040519516855260208501526040840152608051868401528460808401528360a084015216907f7fde555340816f34d18fff6958410123881fba3c912007f90d0260ff5f7e829860c03392a36002600a5560405191608051835260208301526040820152f35b611470919250613921565b610aa45786828a6112b0565b6040513d85823e3d90fd5b6114936114ba92614775565b907f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176155d7565b388e61120c565b6001600160801b039061153f928260208c9a9b9c0151166080526112516114fc6114f78b866101408183511692015116906139d9565b614775565b9c8d8981126115d3575b506040840192858451169161124b8d8861014061123b61153460018060a01b03809c511696608051906146f0565b968385511690613d4e565b60020b60608a015261154f614381565b91333b15610f1e5761157c918491604051938492839263512727bd60e11b84528d60805160048601614786565b038183335af1801561147c579083916115bf575b505060805161159e916139d9565b6115a6614381565b10610a6a5760609661132c6001600160601b03946112d8565b6115c890613921565b610aa4578189611590565b6115df61160691614775565b8d7f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146155d7565b8d611506565b8234610f3f576020366003190112610f3f5760043560ff81169081810361176e576001600a5414610f08576001600a55604051638da5cb5b60e01b81526001600160a01b03906020816004817f000000000000000000000000a85d1a8f20d1d51612ffa969f8594166a855c3c286165afa908115611763578591611735575b50163303611724578115801561170d575b156116fb577f7a8f5b6a3fe6312faf94330e829a331301dbd2ce6947e915be63bf67b473ed5f60406006549381519060ff8660f01c1682526020820152a160ff60f01b1990911660f09190911b60ff60f01b16176006556002600a5580f35b6040516301f0799b60e31b8152600490fd5b506004821015801561169c5750600a82111561169c565b6040516282b42960e81b8152600490fd5b611756915060203d811161175c575b61174e81836139b8565b810190614b49565b8561168b565b503d611744565b6040513d87823e3d90fd5b8280fd5b8234610f3f576040366003190112610f3f5761179961178f613888565b60243590336139fc565b602060405160018152f35b5034610aa4576040366003190112610aa45760406117c0613888565b91816024359433815260016020522060018060a01b03841682526020522054918083106117f35761179992039033613b58565b60405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608490fd5b8234610f3f576040366003190112610f3f57611860613888565b90602435916001600a5414610f08576118a9906001600a55611880614613565b906002549060408301916001600160801b0394859188836104a381885116826007541690613c5a565b1694848351168611610ea45783516001600160a01b039460e09161191f906118d39088168a614b68565b989097816118e48c828b5116613cd8565b16885288611b3d575b89611b0d575b83511696600554602098876001600160601b0360a01b8b88015160a01b16921617176005555116613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b191617171760065561199560ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b0319169190911790553315611abe57338152808352604081205496808810611a6e57806060983384528386520360408320558060025403600255604051908152600080516020615874833981519152843392a3604080516001600160a01b039290921682526001600160801b038616602083015281018390526060810184905233907f39f142b439851b17eca4e40ba0dce1431af85e536a869a8585bc2298fdb8b77490608090a26002600a556040519384528301526040820152f35b60405162461bcd60e51b815260048101859052602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260048101849052602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b611b388a887f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146155d7565b6118f3565b611b6889887f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176155d7565b6118ed565b8234610f3f5780600319360112610f3f576040518160045490600182811c91818416938415611c65575b6020948585108114611c5157848752908115611c2f5750600114611bd6575b611bd285611bc6818903826139b8565b6040519182918261383f565b0390f35b929450600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410611c1c5750505081611bd293611bc6928201019385611bb6565b8054858501870152928501928101611bff565b60ff191686860152505050151560051b8201019150611bc681611bd285611bb6565b634e487b7160e01b83526022600452602483fd5b92607f1692611b97565b5034610aa4576060366003190112610aa457611c89613888565b6001600160801b036024351660243503610aa4576044356001600160401b038111610f1e57611cbc9036906004016138de565b926001600a5414610f08576001600a55600254928315612109575b611cdf614613565b92846120fb576001600160801b036127105b166001600160801b03602435161115610ea4578351611d1b906001600160a01b0316602435614b68565b9590946001860186116120e7576001870187116120e757611d616001600160801b03604083015116611d5c602435916001600160801b036007541690613c5a565b613c5a565b826120b6576001600160801b0316925b83986001600160801b03611d8d60243582604087015116613c5a565b1660408401528a611d9c614381565b91611da5614412565b93333b1561176e57604051632aa35ecb60e01b815260018c810160048301528d0160248201526060604482015291839183918291611de7916064840191613d0d565b038183335af180156120ab57612097575b5050611e089060018901906139d9565b611e10614381565b10610a6a57611e239060018901906139d9565b611e2b614412565b10610c845760e09060018060a01b038151166005549060209b6001600160601b0360a01b8d85015160a01b1692161717600555611e746001600160801b03604083015116613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b1916171717600655611eea60ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b03191691909117905515612014575b506001600160a01b0316908115611fcf576001939282606097938693611f3d896002546139d9565b60025581815280865260408120898154019055600080516020615874833981519152866040518b8152a3604080513381526024356001600160801b031660208201528484019181019190915285840160608201527f011d4be6213866bff035f68967364cf69c5c01ff5bc23ff0a275f08a04381e6a90608090a26002600a556040519586520190840152016040820152f35b60405162461bcd60e51b815260048101879052601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b90945061270f19810190811161208357933015611fcf576002546127109081810180911161206f576002553083528287526040832081815401905560405190815282600080516020615874833981519152883093a338611f15565b634e487b7160e01b84526011600452602484fd5b634e487b7160e01b82526011600452602482fd5b6120a090613921565b610a93578a38611df8565b6040513d84823e3d90fd5b6001600160801b036120ce6120e19260243590613cd8565b166001600160801b036024351684614ad3565b92611d71565b634e487b7160e01b89526011600452602489fd5b6001600160801b0387611cf1565b7f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c956040805161213781613982565b60028152813660208301378861218661215d61a8c0938461215782613c8c565b52614469565b9261216784613c8c565b5193612177600695860b91613caf565b51850b03840b0560020b614010565b9161219083613d5b565b600160e08651956121a08761394a565b828060a01b03169586815285602082015285888201528360020b9586606083015263ffffffff421660808301528060a083015260c08201520152838c60055416176005556121ed8c613cf1565b81544260981b63ffffffff60981b166dffffffffffffffffffffffffffff60801b1990911660809290921b62ffffff60801b16919091171781556006805460ff60f01b191660f08d901b60ff60f01b1617905580546001600160f81b0316600160f81b17905582519182526020820152a1611cd7565b8234610f3f5780600319360112610f3f576040517f000000000000000000000000733293ca9fd372712f7b6e83ad79087c6a29e2666001600160a01b03168152602090f35b8234610f3f5780600319360112610f3f57602060405162093a808152f35b8234610f3f576020366003190112610f3f576020906040906001600160a01b036122ee613888565b1681528083522054604051908152f35b8234610f3f5780600319360112610f3f57602060405162ffffff7f000000000000000000000000000000000000000000000000000000000003d090168152f35b8234610f3f5780600319360112610f3f57602060405161a8c08152f35b509034610f3f576060366003190112610f3f57612376613888565b9161237f6138a3565b906001600160601b036044351660443503610f3f57506001600a5414610f08576001600a556123ac614613565b926123b960443583614e1e565b926001600160801b0384511615610d105761247561244c604051956123dd87613982565b6002875260403660208901376124256123fd61a8c0988961215782613c8c565b9761240789613c8c565b5160060b6124148a613caf565b5160060b0360060b0560020b614010565b9663ffffffff60808a01511661244260a08b015160060b92613caf565b5160060b92615086565b947f000000000000000000000000000000000000000000000000000000000003d090908661544f565b6126b1576020946001600160801b03610160860151166001600160801b036124a260075492828416613cd8565b16906001600160801b031916176007556124fc6001600160801b036124e46124c98861539e565b604086015186519192916001600160a01b0316908516614ba0565b6001600160a01b031680855291166040840152613d5b565b60020b606082015261256961018086015195612518878661582f565b612520614dbd565b9060a0810151151560a0830152600160c083015260e081015160020b60e083015261010063ffffffff8183015116908301526101208091015160060b9082015260443586614f36565b60018060a01b038151169182600554916001600160601b0360a01b8985015160a01b169216171760055560e06001600160801b03604083015116916125ad83613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b191617171760065561262360ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b031916919091179055604080516001600160a01b03948516815287810192909252810191909152606081018490526044356001600160601b031692909116907fe79231b2121f3b0a34317face6f7754ddee5144ce7d0700b3bb67f796a5d776090608090a36002600a55604051908152f35b60405163ac1724fb60e01b8152600490fd5b8234610f3f5780600319360112610f3f5760206001600160801b0360075416604051908152f35b8234610f3f576020366003190112610f3f5760406101a091600435815260096020522080546001820154916002810154916004600383015492015492604051946001600160801b0392838116875260801c6020870152828116604087015260801c6060860152818116608086015260ff8160801c16151560a086015260ff8160881c16151560c08601528060901c60020b60e086015263ffffffff8160a81c1661010086015260c81d60060b610120850152811661014084015260801c610160830152610180820152f35b8234610f3f576080366003190112610f3f576127cf613888565b6127d761390b565b906044359081600f0b809203610f1e576064356001600160401b038111612b7f576128069036906004016138de565b9490936001600a5414610f08576001600a55818094612823614613565b9361282e8433614e1e565b986001600160801b0392838b511615610d105761286b7f000000000000000000000000000000000000000000000000000000000003d0908c61528f565b926101408c01938561288084828851166146f0565b911613610cec5760a08c0151612a95575061289e90848451166146f0565b986128cd84845116897f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176155d7565b6128d5614381565b91333b15612a915785908b61291160405194859384936317c713f760e21b85526004850152856024850152606060448501526064840191613d0d565b038183335af18015611763578a918691612a7a575b5050612931916139d9565b612939614381565b10610a6a5760e06001600160601b039561296460409b856129598d61470c565b1685525b8733614f36565b60018060a01b039485825116600554918960a01b602085015160a01b1692161717600555612996848c83015116613cf1565b606081015160065463ffffffff60981b608084015160981b169060a084015160b81b66ffffffffffffff60b81b169262ffffff60801b9060801b16906001600160701b0360801b1916171717600655612a0c60ff60c0830151166006549060ff60f01b9060f01b169060ff60f01b191617600655565b0151600680546001600160f81b031691151560f81b6001600160f81b031916919091179055518851959092168552166020840152169033907fa703a2c22bbc13b44c069d15db2894529fae4779b607bcd82003e78c7aaf6c19908690a36002600a5582519182526020820152f35b612a85919250613921565b610f1e5788848c612926565b8580fd5b999850612aa590848451166146f0565b97612ad484845116897f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146155d7565b612adc614412565b91333b15612a915785908a612b1860405194859384936317c713f760e21b85528660048601526024850152606060448501526064840191613d0d565b038183335af180156117635789918691612b68575b5050612b38916139d9565b612b40614412565b10610c845760e06001600160601b039561296460409b85612b608c61470c565b16855261295d565b612b73919250613921565b610f1e5787848c612b2d565b8480fd5b8234610f3f5780600319360112610f3f576020604051621e84808152f35b8234610f3f5780600319360112610f3f5760206040516103988152f35b5034610aa4576040366003190112610aa45790612c07611799926040612be2613888565b9333815260016020522060018060a01b038416825260205260406024359120546139d9565b9033613b58565b8234610f3f5780600319360112610f3f57602060405160128152f35b509034610f3f576060366003190112610f3f57612c45613888565b916040612c506138a3565b6001600160a01b0385168452600160208181529483902033855290945291205492604435928401612c86575b61179993506139fc565b828410612ca257612c9d8361179995033383613b58565b612c7c565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b8234610f3f576020366003190112610f3f57612d01613888565b6001600a5414610f08576001600a55604051638da5cb5b60e01b81526001600160a01b0392906020816004817f000000000000000000000000a85d1a8f20d1d51612ffa969f8594166a855c3c288165afa918215612e8057908492612e62575b5016330361172457600854917f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b15160606001600160801b0392612da4848716613cbf565b946001612db38860801c613cbf565b976001600160801b0319161760085584861694612df186837f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176155d7565b600880548216600160801b1790558716612e2c81837f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146155d7565b60405195338752602087015260408601521692a26002600a55604080516001600160801b03928316815292909116602083015290f35b612e7a915060203d811161175c5761174e81836139b8565b84612d61565b604051903d90823e3d90fd5b8234610f3f5780600319360112610f3f57600854604080516001600160801b038316815260809290921c602083015290f35b8234610f3f5780600319360112610f3f576020600254604051908152f35b509034610aa45760a0366003190112610aa457612ef7613888565b91612f006138b9565b9160443593612f0d6138c8565b936084356001600160401b038111612b7f57612f2d9036906004016138de565b6001600a9692965414610f08576001600a55612f47614613565b9288156137085780156136c95783516001600160a01b0390811690891690811090816136ba575b50155b610e44578289139788156136b4576103e88a026103e7198b820401610cbf57620f4240612f9f91048b6147a2565b6040860151865190916001600160a01b03909116906001600160801b038316878213156135d8578561357957612ff093506001600160a01b03821161357057612fea9160601b613d2e565b906139d9565b6401000276a381101580613553575b156109a7576001600160a01b0316908215613543576001600160a01b031681105b610da557604085015185516001600160a01b0316906001600160801b0381169061306d9060601b600160601b600160e01b0316613067846130618784613d2e565b92613d2e565b906147a2565b928281101561352657613099926114f792916001600160a01b039161309291906151db565b16906147bb565b935b8482931560001461339757505050829088156000146133915750885b8998878b12613359575b1561334c576130da916130d391613d4e565b80936146f0565b956130e3614412565b91333b15610f1a57604051633a69946960e11b81529187918391829161310e918c8f60048601614786565b038183335af180156133415790869161332d575b5050858015918215613313575b5050610c84576001600160801b0361318560409861319c9360ff60c08701511680151560001461330a5761316291613d2e565b905b816132e6575b838b870151169161124b60018060a01b03885116918b6147a2565b9116838901526001600160a01b0381168352613d5b565b60020b60608201525b60018060a01b038151169283600554916001600160601b0360a01b602085015160a01b16921617176005556001600160801b0386820151166131e681613cf1565b60608201516006805460808086015160a087015160c08801516effffffffffffffffffffffffffffff60801b199094169286901b62ffffff60801b169290921760989190911b63ffffffff60981b161766ffffffffffffff60b81b60b89290921b919091161760f09190911b60ff60f01b161790559160e00151600680546001600160f81b031691151560f81b6001600160f81b03191691909117905586518681526020810186905280880194909452606084015260020b60808301526001600160a01b03169033907fc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca679060a090a36002600a5582519182526020820152f35b6008548480196132fb8286168460801c613c5a565b60801b1691161760085561316a565b50508690613164565b61331d92506139d9565b613325614412565b10853861312f565b61333690613921565b612b7f578438613122565b6040513d88823e3d90fd5b506130d36130da916155ba565b61338c6133658c614775565b887f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176155d7565b6130c1565b986130b7565b98999891945091508390886135205750895b8a98838c126134e8575b156134db576133cc916133c591613d4e565b80946146f0565b976133d5614381565b92333b1561176e57604051633a69946960e11b815291839183918291613400918f8f60048601614786565b038183335af180156120ab576134c7575b50508680159182156134ad575b5050610a6a576001600160801b036131856040986134789360ff60c0870151168015156000146134a55761345191613d2e565b80613485575b838b870151169061347260018060a01b03885116918c6147a2565b91614ba0565b60020b60608201526131a5565b60085484613497818416828416613c5a565b169085191617600855613457565b505086613451565b6134b792506139d9565b6134bf614381565b10863861341e565b6134d391929650613921565b933880613411565b506133c56133cc916155ba565b61351b6134f48d614775565b897f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146155d7565b6133b3565b996133a9565b61353d926001600160a01b039161309291906151db565b9361309b565b6001600160a01b03168111613020565b5073fffd8963efd1fc6a506488495d951d5263988d268110612fff565b612fea91614800565b506135c69261359890839060601b600160601b600160e01b0316613d2e565b90826001600160601b0382116135cb57816135ba6135c0926109f69594614c6c565b926139d9565b90613d2e565b612ff0565b610e24826109f6946139d9565b9092908561366157506135fb90829060601b600160601b600160e01b0316613d2e565b61360483614775565b811115610a025782826001600160601b036136216135c696614775565b1161364857612fea926109f66136426135c09361363d86614775565b614c6c565b93614775565b610e24612fea936109f661365b85614775565b94614775565b92905061366e82846147bb565b61367782614775565b1015610c25576135c6926001600160a01b0361369283614775565b116136a3576104ba6109f692614775565b6136af6109f692614775565b614800565b89612f9f565b6401000276a391501138612f6e565b83516001600160a01b0390811690891690811190816136ea575b5015612f71565b73fffd8963efd1fc6a506488495d951d5263988d26915010386136e3565b604051638713cd5760e01b8152600490fd5b5034610f3f5780600319360112610f3f576040517f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176001600160a01b03168152602090f35b5034610f3f576040366003190112610f3f5761179961377c613888565b6024359033613b58565b905034610aa45781600319360112610aa4578160035490600182811c91818416938415613835575b6020948585108114611c5157848752908115611c2f57506001146137dc57611bd285611bc6818903826139b8565b929450600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106138225750505081611bd293611bc6928201019385611bb6565b8054858501870152928501928101613805565b92607f16926137ae565b6020808252825181830181905290939260005b82811061387457505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501613852565b600435906001600160a01b038216820361389e57565b600080fd5b602435906001600160a01b038216820361389e57565b60243590811515820361389e57565b606435906001600160a01b038216820361389e57565b9181601f8401121561389e578235916001600160401b03831161389e576020838186019501011161389e57565b602435906001600160601b038216820361389e57565b6001600160401b03811161393457604052565b634e487b7160e01b600052604160045260246000fd5b61010081019081106001600160401b0382111761393457604052565b6101a081019081106001600160401b0382111761393457604052565b606081019081106001600160401b0382111761393457604052565b604081019081106001600160401b0382111761393457604052565b90601f801991011681019081106001600160401b0382111761393457604052565b919082018092116139e657565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03908116918215613b055716918215613ab457600082815280602052604081205491808310613a605760408282600080516020615874833981519152958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b03908116918215613c095716918215613bb95760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9190916001600160801b03808094169116019182116139e657565b6001600160401b0381116139345760051b60200190565b805115613c995760200190565b634e487b7160e01b600052603260045260246000fd5b805160011015613c995760400190565b6001600160801b0390811660001901919082116139e657565b6001600160801b0391821690821603919082116139e657565b6001600160801b03166001600160801b03196006541617600655565b908060209392818452848401376000828201840152601f01601f1916010190565b8115613d38570490565b634e487b7160e01b600052601260045260246000fd5b919082039182116139e657565b6001600160a01b03818116916401000276a383101580613ff3575b15613fe157640100000000600160c01b039060201b16806001600160801b03811160071b9181831c926001600160401b03841160061b93841c9363ffffffff851160051b94851c9461ffff861160041b95861c60ff9687821160031b91821c92600f841160021b93841c94600160038711811b96871c119617171717171717916080831015600014613fd55750607e1982011c5b8002607f928392828493841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c80029081881c82881c1c80029283891c84891c1c800294858a1c868a1c1c800296878b1c888b1c1c800298898c1c8a8c1c1c80029a8b8d1c8c821c1c8002809d1c8d821c1c8002809e81901c90821c1c80029e8f80911c911c1c800260cd1c6604000000000000169d60cc1c6608000000000000169c60cb1c6610000000000000169b60ca1c6620000000000000169a60c91c6640000000000000169960c81c6680000000000000169860c71c670100000000000000169760c61c670200000000000000169660c51c670400000000000000169560c41c670800000000000000169460c31c671000000000000000169360c21c672000000000000000169260c11c674000000000000000169160c01c6780000000000000001690607f190160401b1717171717171717171717171717693627a301d71055774c8502906f028f6481ab7f045a5af012a19d003aa919820160801d60020b916fdb2df09e81959a81455e260799a0632f0160801d60020b92600091848414600014613fbb5750505090505b90565b613fc485614010565b16119050613fd0575090565b905090565b905081607f031b613e0a565b6040516324c070df60e11b8152600490fd5b5073fffd8963efd1fc6a506488495d951d5263988d268310613d76565b60020b600081121561437b5780600003905b620d89e88211614369576001821615614357576001600160881b036ffffcb933bd6fad37aa2d162d1a5940015b16916002811661433b575b6004811661431f575b60088116614303575b601081166142e7575b602081166142cb575b604081166142af575b608090818116614294575b6101008116614279575b610200811661425e575b6104008116614243575b6108008116614228575b611000811661420d575b61200081166141f2575b61400081166141d7575b61800081166141bc575b6201000081166141a1575b620200008116614187575b62040000811661416d575b6208000016614152575b50600012614143575b63ffffffff811661413b576000905b60201c60ff91909116016001600160a01b031690565b600190614125565b8015613d385760001904614116565b6b048a170391f7dc42444e8fa26000929302901c919061410d565b6d2216e584f5fa1ea926041bedfe98909302811c92614103565b926e5d6af8dedb81196699c329225ee60402811c926140f8565b926f09aa508b5b7a84e1c677de54f3e99bc902811c926140ed565b926f31be135f97d08fd981231505542fcfa602811c926140e2565b926f70d869a156d2a1b890bb3df62baf32f702811c926140d8565b926fa9f746462d870fdf8a65dc1f90e061e502811c926140ce565b926fd097f3bdfd2022b8845ad8f792aa582502811c926140c4565b926fe7159475a2c29b7443b29c7fa6e889d902811c926140ba565b926ff3392b0822b70005940c7a398e4b70f302811c926140b0565b926ff987a7253ac413176f2b074cf7815e5402811c926140a6565b926ffcbe86c7900a88aedcffc83b479aa3a402811c9261409c565b926ffe5dee046a99a2a811c461f1969c305302811c92614092565b916fff2ea16466c96a3843ec78b326b528610260801c91614087565b916fff973b41fa98c081472e6896dfb254c00260801c9161407e565b916fffcb9843d60f6159c9db58835c9266440260801c91614075565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c9161406c565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c91614063565b916ffff97272373d413259a46990580e213a0260801c9161405a565b6001600160881b03600160801b61404f565b6040516315e4079d60e11b8152600490fd5b80614022565b6040516370a0823160e01b81523060048201526020816024817f00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f322176001600160a01b03165afa908115614406576000916143d8575090565b906020823d82116143fe575b816143f1602093836139b8565b81010312610f3f57505190565b3d91506143e4565b6040513d6000823e3d90fd5b6040516370a0823160e01b81523060048201526020816024817f000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b146001600160a01b03165afa908115614406576000916143d8575090565b60405163883bdbfd60e01b8152602060048201819052825160248301819052604483019382019060005b8181106145f957506001600160a01b039460009250849150819003817f000000000000000000000000733293ca9fd372712f7b6e83ad79087c6a29e26687165afa928315614406576000936144e9575b50505090565b9091923d8082863e6144fb81866139b8565b840191604085840312610aa45784516001600160401b0390818111610f1e5786019584601f88011215610f1e5786519661453488613c75565b97614542604051998a6139b8565b80895287808a019160051b83010191878311610f1a578801905b8282106145dc5750505085810151918211610f1e57019183601f84011215610f3f57825192858061458c86613c75565b61459960405191826139b8565b868152019460051b820101948511610aa4578501925b8484106145c4575050505050503880806144e3565b8351838116810361176e5781529285019285016145af565b81518060060b81036145f557815290880190880161455c565b8780fd5b825163ffffffff1686529483019491830191600101614493565b60405161461f8161394a565b60e06000918281528260208201528260408201528260608201528260808201528260a08201528260c082015201526040516146598161394a565b60055460018060a01b038116825260a01c60208201526006546001600160801b03811660408301528060801c60020b80606084015263ffffffff91828160981c169260808501928484528260b81c60060b9160a087019383855260ff8160f01c1660c089015260f81c151560e08801528042169586031680156146e75760060b0260060b0160060b90525290565b50505050505090565b919091600083820193841291129080158216911516176139e657565b6001600160801b0390818111614720571690565b60405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608490fd5b600160ff1b81146139e65760000390565b613fb89492606092825260208201528160408201520191613d0d565b818103929160001380158285131691841216176139e657565b60001982820990828102928380841093039280840393146147f757600160601b918383111561389e570990828211900360a01b910360601c1790565b50505060601c90565b90600160601b90600019828409928060601b9283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b505090613fb89250613d2e565b90620f424090600019828409928281029283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60001982820990828102928380841093039280840393146149465768010000000000000000918383111561389e570990828211900360c01b910360401c1790565b50505060401c90565b600019828209908281029283808410930392808403931461498b57600160801b918383111561389e570990828211900360801b910360801c1790565b50505060801c90565b60001982820990828102928380841093039280840393146149d057600160c01b918383111561389e570990828211900360401b910360c01c1790565b50505060c01c90565b90600160801b90600019828409928060801b9283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b90600160c01b90600019828409928060c01b9283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b91600019828409928281029283808610950394808603951461487d578483111561389e578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b9081602091031261389e57516001600160a01b038116810361389e5790565b9190613fb8906001600160a01b03166001600160801b03614b9982606087901b600160601b600160e01b0316613d2e565b94166147bb565b90614baa91614b68565b9190600082128080614c5a575b610a025760008512948580614c48575b610c2557614bf99461076d946104c29461031094614c365790614be9916139d9565b965b610c145790610bac916139d9565b6401000276a381101580614c19575b156109a75760018060a01b03169091565b5073fffd8963efd1fc6a506488495d951d5263988d268110614c08565b6109f6614c4292614775565b96614beb565b5084614c5382614775565b1015614bc7565b5081614c6584614775565b1015614bb7565b818102929181159184041417156139e657565b8015614db757614d4a816000908360801c80614dab575b508060401c80614d9e575b508060201c80614d91575b508060101c80614d84575b508060081c80614d77575b508060041c80614d6a575b508060021c80614d5d575b50600191828092811c614d56575b1c1b614cf28185613d2e565b01811c614cff8185613d2e565b01811c614d0c8185613d2e565b01811c614d198185613d2e565b01811c614d268185613d2e565b01811c614d338185613d2e565b01811c614d408185613d2e565b01901c8092613d2e565b80821015613fd0575090565b0181614ce6565b6002915091019038614cd8565b6004915091019038614ccd565b6008915091019038614cc2565b6010915091019038614cb7565b6020915091019038614cac565b6040915091019038614ca1565b91505060809038614c96565b50600090565b60405190614dca82613966565b816101806000918281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152826101608201520152565b90614e77614e6991614e2e614dbd565b5060405192839160208301958690916020926001600160601b03199060601b1682526001600160601b0360a01b9060a01b1660148201520190565b03601f1981018352826139b8565b51902060005260096020526040600020600460405191614e9683613966565b80546001600160801b0390818116855260801c60208501526001820154818116604086015260801c60608501526002820154818116608086015260ff8160801c16151560a086015260ff8160881c16151560c08601528060901c60020b60e086015263ffffffff8160a81c1661010086015260c81d60060b610120850152600382015490811661014085015260801c610160840152015461018082015290565b6040805160609290921b6bffffffffffffffffffffffff19166020830190815260a09390931b6001600160a01b0319166034830152614f789082908101614e69565b519020600090815260096020908152604091829020835191840151608090811b6fffffffffffffffffffffffffffffffff199081166001600160801b03948516178355938501516060860151908416911b8416176001820155926004926101809261507f91908060808501511660ff60801b60a0860151151560801b169060ff60881b60c0870151151560881b1660e087015160901b9063ffffffff60a81b61010089015160a81b169266ffffffffffffff60c81b6101208a015160c81b169417179062ffffff60901b1617171760028801556003870191816101408601511690835416178255610160840151166001600160801b0382549181199060801b169116179055565b0151910155565b92919091615092614dbd565b5061010084019063ffffffff80835116818616948186146151d15760069303830b950316810b61039802810b60a086015115600014615173576150f79162049d409186610120890151830b03820b8181136000146151475750905b0b0560020b614010565b602085015160408601516001600160801b0391821692615127926104c2926001600160a01b0390921691166147bb565b6001600160801b0380921660208701521660408501525261012082015290565b919061515281615437565b820b8312615161575b506150ed565b61516c919250615437565b903861515b565b61519e9162049d4091610120880151820b8703820b8181136000146151475750900b0560020b614010565b60208501516001600160801b03916151c5916104c2916001600160a01b03169084166147bb565b90604086015116615127565b5050505050505090565b6001600160a01b0391821690821603919082116139e657565b9091921560001461523d57613fb8926104c29290916109f69160609190911b600160601b600160e01b0316906001600160a01b039061523590821683613d2e565b931690613d2e565b613fb8926104c2926001600160801b03916001600160a01b039161526191906151db565b1691166147bb565b6001600160801b03166103e8908181029181830414901517156139e657620f4240900490565b906152a060e083015160020b614010565b60a0830151615338576001600160801b03918260408501511662ffffff620f4240921682018083116139e6576152d591614c6c565b6001600160a01b03909216910482821161531f576152f6826152fc93614c6c565b90614a56565b915b5116906000828211156153195750613fb8916104c291613d4e565b91505090565b61532c8261533293614905565b906149d9565b916152fe565b6001600160801b03918260208501511662ffffff620f4240921682018083116139e65761536491614c6c565b6001600160a01b03909216910482821161538b57615385826152fc93614c6c565b90614994565b6153988261533293614905565b9061494f565b9060a0820151156000146153f2576001600160801b0360806153eb6153de6153d1848751168561014089015116906139d9565b84602088015116906139d9565b83606087015116906139d9565b9301511690565b613fb86001600160801b03928360608201511693608061542d615420838551168461014087015116906139d9565b83604086015116906139d9565b92015116906139d9565b60060b667fffffffffffff1981146139e65760000390565b919060a0830151156000146154cb576001600160801b0392836040820151169062ffffff620f424094168401908185116139e6576154c6946154976154aa936154bd95614c6c565b04958061014083015116915116906139d9565b6001600160a01b039092169182906147bb565b9260601b613d2e565b111590565b6001600160801b0392836020820151169062ffffff620f424094168401908185116139e6576154c6946154976155049361551a95614c6c565b6001600160a01b0390921691829060601b613d2e565b926147bb565b60009080156155b65780806001146155ae576002146155a6576001918261013383101683600b841016176155965760028392935b80821161556d575050826000190482116109d657500290565b909380600019048111610ef45781851661558d575b800293811c90615554565b80930292615582565b929150600283910a926109d65750565b509060049150565b505050600190565b5090565b6103e8908181029181830414901517156139e657620f3e58900490565b6040516370a0823160e01b81523060048201526020936001600160a01b0393928416918581602481865afa9081156144065760009161572e575b5080821161572757505b604051938585019363a9059cbb60e01b855216602485015260448401526044835260808301918383106001600160401b0384111761393457600080916156a595856040526156688661399d565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460a0820152519082855af161569f61575b565b9161579a565b8051806156b157505050565b8183918101031261389e5781015180159081150361389e576156d05750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b905061561b565b908682813d8311615754575b61574481836139b8565b81010312610f3f57505138615611565b503d61573a565b3d15615795573d906001600160401b0382116139345760405191615789601f8201601f1916602001846139b8565b82523d6000602084013e565b606090565b919290156157fc57508151156157ae575090565b3b156157b75790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561580f5750805190602001fd5b60405162461bcd60e51b815290819061582b906004830161383f565b0390fd5b600080809381935af161584061575b565b501561584857565b60405162461bcd60e51b815260206004820152600360248201526253544560e81b6044820152606490fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122082ba88c317067c02e9de94b32a09683cc78a8a4895fe99de0b150608ed761c9664736f6c63430008110033

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

000000000000000000000000a85d1a8f20d1d51612ffa969f8594166a855c3c200000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f32217000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b14000000000000000000000000000000000000000000000000000000000003d090000000000000000000000000733293ca9fd372712f7b6e83ad79087c6a29e266

-----Decoded View---------------
Arg [0] : _factory (address): 0xa85D1A8f20d1D51612Ffa969f8594166A855c3C2
Arg [1] : _token0 (address): 0x43Bdd46b310a78C8f077c162D45dBe7e70F32217
Arg [2] : _token1 (address): 0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14
Arg [3] : _maintenance (uint24): 250000
Arg [4] : _oracle (address): 0x733293CA9fd372712F7B6e83AD79087C6A29E266

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000a85d1a8f20d1d51612ffa969f8594166a855c3c2
Arg [1] : 00000000000000000000000043bdd46b310a78c8f077c162d45dbe7e70f32217
Arg [2] : 000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b14
Arg [3] : 000000000000000000000000000000000000000000000000000000000003d090
Arg [4] : 000000000000000000000000733293ca9fd372712f7b6e83ad79087c6a29e266


Deployed Bytecode Sourcemap

1461:31315:18:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2792:6;1461:31315;2792:6;;;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;;:::i;:::-;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;:::i;:::-;;;;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;8642:5811;;;9077:13;;;:::i;:::-;1461:31315;-1:-1:-1;;;;;1461:31315:18;;;9117:19;:89;;;;1461:31315;9100:147;;9274:276;;;;2885:5;;-1:-1:-1;;;;;1461:31315:18;;;;;;9305:39;;;;;:111;;9274:276;9303:114;;9274:276;9257:337;;-1:-1:-1;;;;;1461:31315:18;9680:16;;2885:5;1461:31315;;;;;;2885:5;;1461:31315;1503:73:33;-1:-1:-1;;;;;1549:26:33;1461:31315:18;;1549:26:33;;:::i;:::-;1461:31315:18;-1:-1:-1;;;;;1461:31315:18;;;1503:73:33;:::i;:::-;1461:31315:18;9795:11;1461:31315;1611:3:33;1461:31315:18;;;1611:3:33;1461:31315:18;;;1593:50:33;;;;:::i;:::-;1461:31315:18;;;:::i;:::-;;-1:-1:-1;;;;;1461:31315:18;;;;;;1907:16:33;1461:31315:18;1848:34:33;1461:31315:18;1870:1:33;1461:31315:18;1848:34:33;;:::i;:::-;1907:16;:::i;:::-;1952:11;;;2037:25;-1:-1:-1;;;;;2092:26:33;2037:25;;;;;;:::i;:::-;1461:31315:18;;;2092:26:33;;:::i;:::-;3895:1:18;1461:31315;;;;;1978:155:33;;;;;:::i;:::-;1952:351;;458:10;2319:25;;;:53;;;1952:351;2317:56;2313:102;;9843:120:18;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;9872:36;9843:120;9826:181;;1461:31315;;10101:41;:38;1461:31315;;458:10:33;;;:::i;:::-;3895:1:18;458:10:33;;1461:31315:18;;458:10:33;;;;10101:38:18;:::i;:::-;:41;:::i;:::-;458:10:33;-1:-1:-1;;;;;1461:31315:18;9680:16;;2885:5;1461:31315;;;;;;;2885:5;;1461:31315;10361:11;1461:31315;10361:11;;458:10:33;1870:1;1461:31315:18;;;10386:21;;458:10:33;1461:31315:18;;10421:21;;458:10:33;1461:31315:18;;;;:::i;:::-;1952:11:33;;;;1461:31315:18;;7606:19:32;;1461:31315:18;7648:13:32;2792:6:18;7678:23:32;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;12415:117:32;-1:-1:-1;;;;;1461:31315:18;;;;11355:132:32;1461:31315:18;11384:25:32;1461:31315:18;;;11341:168:32;1461:31315:18;;;12414:131:32;1461:31315:18;12563:145:32;1461:31315:18;12564:131:32;1461:31315:18;;;;;;;;;7733:28:32;;;1461:31315:18;;;;;7845:24:32;;;3000:5:18;1461:31315;7913:117:32;1461:31315:18;;;;;;;;;;7913:117:32;;:::i;:::-;1461:31315:18;3000:5;;-1:-1:-1;1952:11:33;;10826:133:32;;-1:-1:-1;;;;;1461:31315:18;;10855:26:32;1461:31315:18;;10855:26:32;;:::i;:::-;1461:31315:18;10826:133:32;:::i;:::-;11221:97;11222:83;11224:25;;;;;:::i;:::-;1461:31315:18;1027:49:17;11222:83:32;:::i;:::-;11221:97;:::i;:::-;11384:25;;:::i;:::-;11355:132;:::i;11341:168::-;1461:31315:18;8062:19:32;;1461:31315:18;8062:19:32;;3000:5:18;1461:31315;;;;8041:19:32;;3000:5:18;1461:31315;12415:83:32;1461:31315:18;;;;;;;1027:49:17;;;1461:31315:18;;;1027:49:17;;12415:83:32;:::i;:::-;:117;:::i;12414:131::-;1461:31315:18;12564:109:32;-1:-1:-1;;;;;1461:31315:18;;;;;;12564:109:32;:::i;12563:145::-;1461:31315:18;8263:14:32;1461:31315:18;8263:14:32;;3000:5:18;-1:-1:-1;;;;;1461:31315:18;;;8247:14:32;;3000:5:18;2885;;;-1:-1:-1;;;;;2885:5:18;;1461:31315;10513:28;:73;;;;;10800:352:32;10513:118:18;;;;;10800:352:32;10513:168:18;;;;;10800:352:32;10513:218:18;;;;10800:352:32;10496:270:18;;;-1:-1:-1;;;;;10801:35:18;9795:11;10801:35;;:::i;:::-;1461:31315;10850:18;;:44;;;;;10800:352:32;10846:88:18;;;-1:-1:-1;;;;;1461:31315:18;;10944:15;;;3000:5;2701:4;11045:13;;13966:30:32;:63;2701:4:18;;;11045:13;;13966:63:32;2792:6:18;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1611:3:33;2792:6:18;;11164:9;:26;11160:59;;11164:9;11229:16;;;2792:6;-1:-1:-1;;;;;11268:34:18;1461:31315;;9680:16;1461:31315;9680:16;;2885:5;1461:31315;11268:34;:::i;:::-;1461:31315;;9680:16;;3000:5;-1:-1:-1;;;;;1461:31315:18;2792:6;;11361:33;1461:31315;-1:-1:-1;;;;;11361:33:18;1461:31315;;;;;11361:33;:::i;:::-;1461:31315;2792:6;-1:-1:-1;;;;;2792:6:18;;;11361:33;2792:6;1952:11:33;;11443:2535:18;1952:11:33;;;2885:5:18;11565:33;-1:-1:-1;;;;;2885:5:18;;1461:31315;11565:33;:::i;:::-;1461:31315;11622:23;1461:31315;-1:-1:-1;;;;;1461:31315:18;;11622:23;:::i;:::-;11685:10;;;;:::i;:::-;11733;;11709:138;;;;1461:31315;;;2792:6;1461:31315;;2792:6;;;;;;;;11709:138;;1461:31315;11709:138;;1461:31315;2792:6;1461:31315;2792:6;;1461:31315;;;2792:6;;;1461:31315;2792:6;;;;:::i;:::-;11709:138;11733:10;;;11709:138;;;;;;;;;;;11443:2535;11865:24;;;;;:::i;:::-;11892:10;;:::i;:::-;-1:-1:-1;11861:86:18;;1461:31315;;12017:18;;2792:6;1461:31315;12017:22;12013:190;;11443:2535;9680:16;3126:68:30;-1:-1:-1;;;;;1461:31315:18;9680:16;;2885:5;1461:31315;;;;;;2885:5;;1461:31315;3126:68:30;;:::i;:::-;3209:11;;;;;;;:44;;11443:2535:18;3205:107:30;;3463:97;;:12;;3490:27;;;;:::i;:::-;3463:97;;1461:31315:18;;1920:19:30;1910:42;:30;1920:19;1987:70;1920:19;;;:::i;1910:42::-;1027:49:17;;;;;-1:-1:-1;;;;;;;1027:49:17;1987:70:30;:::i;:::-;2086:45;458:10:33;2086:45:30;;;:109;;;3463:97;2084:112;2067:182;;-1:-1:-1;;;;;1461:31315:18;;9680:16;;3000:5;-1:-1:-1;;;;;1461:31315:18;2792:6;;;12659:46;;;:::i;:::-;1870:1:33;1461:31315:18;;10361:11;;2792:6;11443:2535;-1:-1:-1;;;;;1461:31315:18;13993:21;;2792:6;1461:31315;2885:5;-1:-1:-1;;;;;2885:5:18;;1461:31315;14061:44;;;;;14164:8;-1:-1:-1;;;;;1461:31315:18;8247:14:32;;2885:5:18;1461:31315;14061:44;;14164:8;;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;13993:21;;2792:6;1461:31315;-1:-1:-1;;;;;2792:6:18;;;;1461:31315;2792:6;;-1:-1:-1;;;;;2792:6:18;;;;;1461:31315;2792:6;3895:1;14286:160;2792:6;;-1:-1:-1;;;;;1461:31315:18;;;13993:21;;2792:6;1461:31315;;;;;;2885:5;;1461:31315;2792:6;;14256:14;2792:6;;1461:31315;-1:-1:-1;;;;;2792:6:18;;;1461:31315;2792:6;;;;;;14256:14;2792:6;1461:31315;9680:16;1461:31315;9680:16;;2885:5;1461:31315;2792:6;;;;:::i;:::-;1461:31315;10361:11;;458:10:33;1461:31315:18;2792:6;;;;10386:21;;;458:10:33;2792:6:18;;;10421:21;1461:31315;10421:21;;458:10:33;2792:6:18;;;;;;;;;;;;;;;-1:-1:-1;;;;;2792:6:18;;;;;;;1461:31315;2792:6;;1461:31315;;2792:6;;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;;;;;;1461:31315;2792:6;;-1:-1:-1;;;;;2792:6:18;1461:31315;;;2792:6;;-1:-1:-1;;;;;;2792:6:18;;;;;;;1461:31315;;;14304:10;1461:31315;;;2792:6;;1461:31315;;;;2792:6;;1461:31315;;;2792:6;;1461:31315;-1:-1:-1;;1461:31315:18;;;;;;14286:160;1870:1:33;3883:8:18;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;2792:6;-1:-1:-1;;;1461:31315:18;;;;;;;;14061:44;14164:8;-1:-1:-1;;;;;1461:31315:18;8263:14:32;;2885:5:18;1461:31315;14061:44;;;2067:182:30;1461:31315:18;;-1:-1:-1;;;2214:35:30;;1461:31315:18;;2214:35:30;2086:109;2151:44;525:49:33;2151:44:30;;2086:109;;1461:31315:18;-1:-1:-1;;;1461:31315:18;;;;;;;;3463:97:30;3551:8;3532:28;3551:8;;:::i;:::-;3532:28;;:::i;:::-;3463:97;;;3205:107;1461:31315:18;;-1:-1:-1;;;3274:38:30;;1461:31315:18;;3274:38:30;3209:44;3232:8;;;;;:::i;:::-;3224:29;;3209:44;;12013:190:18;12075:26;12119:14;12075:26;;;:::i;:::-;12119:14;;;:::i;:::-;1461:31315;-1:-1:-1;;;;;12151:37:18;1461:31315;12151:12;1461:31315;;;;;;12151:37;:::i;:::-;1461:31315;2792:6;-1:-1:-1;;;;;2792:6:18;;;12151:12;2792:6;12013:190;;;11861:86;1461:31315;;-1:-1:-1;;;11927:20:18;;1461:31315;;11927:20;11709:138;;;;;;:::i;:::-;1461:31315;;11709:138;;;;;1461:31315;;;;11709:138;1461:31315;;;2792:6;;;;;;;;11709:138;1461:31315;;;11443:2535;2885:5;;;12827:33;-1:-1:-1;;;;;2885:5:18;;1461:31315;12827:33;:::i;:::-;1461:31315;12884:23;1461:31315;-1:-1:-1;;;;;1461:31315:18;;12884:23;:::i;:::-;12947:10;;;;:::i;:::-;12995;;12971:138;;;;1461:31315;;;2792:6;1461:31315;;2792:6;;;;;;;;12971:138;;;1461:31315;12971:138;;1461:31315;;2792:6;;1461:31315;;;2792:6;;;1461:31315;2792:6;;;;:::i;:::-;12971:138;12995:10;;;12971:138;;;;;;;;;;;11443:2535;13127:24;;;;;:::i;:::-;13154:10;;:::i;:::-;-1:-1:-1;13123:86:18;;1461:31315;;13279:18;;2792:6;1461:31315;13279:22;13275:190;;11443:2535;9680:16;3126:68:30;-1:-1:-1;;;;;1461:31315:18;9680:16;;2885:5;1461:31315;;;;;;2885:5;;1461:31315;3126:68:30;;:::i;:::-;3326:11;;;;;;;;:44;;11443:2535:18;3322:107:30;;1461:31315:18;;;3593:97:30;1920:19;1987:70;3593:97;1910:42;3593:97;1910:30;3593:97;:12;:97;:12;;;3620:27;;;;:::i;:::-;1920:19;;:::i;1987:70::-;2086:45;458:10:33;2086:45:30;;;:109;;;3593:97;2084:112;2067:182;;-1:-1:-1;;;;;1461:31315:18;;9680:16;;3000:5;-1:-1:-1;;;;;1461:31315:18;2792:6;;;13921:46;;;:::i;:::-;1870:1:33;1461:31315:18;;10361:11;;2792:6;11443:2535;;2086:109:30;2151:44;525:49:33;2151:44:30;;2086:109;;3593:97;3681:8;3662:28;3681:8;;:::i;3662:28::-;3593:97;;3322:107;1461:31315:18;;-1:-1:-1;;;3391:38:30;;1461:31315:18;;3391:38:30;3326:44;3349:8;;;;;:::i;:::-;3341:29;;3326:44;;13275:190:18;13337:26;13381:14;13337:26;;;:::i;13381:14::-;1461:31315;-1:-1:-1;;;;;13413:12:18;1461:31315;2792:6;13413:37;2792:6;;;1461:31315;;;;;13413:37;:::i;:::-;1461:31315;2792:6;;;;;13413:12;2792:6;13275:190;;;13123:86;1461:31315;;-1:-1:-1;;;13189:20:18;;1461:31315;;13189:20;12971:138;;;;;;:::i;:::-;1461:31315;;12971:138;;;;;11160:59;1461:31315;;-1:-1:-1;;;11199:20:18;;1461:31315;;11199:20;1461:31315;-1:-1:-1;;;1461:31315:18;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;13966:63:32;;;10846:88:18;1461:31315;;-1:-1:-1;;;10915:19:18;;1461:31315;;10915:19;10850:44;1461:31315;;-1:-1:-1;;;;;1461:31315:18;;10872:22;10850:44;;;10496:270;1461:31315;;-1:-1:-1;;;10749:17:18;;1461:31315;;10749:17;10513:218;8062:19:32;;-1:-1:-1;;;;;1461:31315:18;8062:19:32;;2885:5:18;1461:31315;10697:34;10513:218;;;:168;8041:19:32;;;-1:-1:-1;;;;;1461:31315:18;8041:19:32;;2885:5:18;1461:31315;10647:34;10513:168;;;:118;10602:29;;;;10513:118;;;;:73;-1:-1:-1;;;;;1461:31315:18;10557:29;-1:-1:-1;10557:29:18;-1:-1:-1;10513:73:18;;;10800:352:32;-1:-1:-1;11019:133:32;;-1:-1:-1;;;;;1461:31315:18;;;11048:26:32;1461:31315:18;;11048:26:32;;:::i;11019:133::-;10800:352;;1461:31315:18;-1:-1:-1;;;;1461:31315:18;;;;;;;;9826:181;1461:31315;;-1:-1:-1;;;9981:26:18;;1461:31315;;9981:26;9843:120;-1:-1:-1;;;;;1461:31315:18;;;;;;9927:36;9843:120;;2319:53:33;2348:24;525:49;2348:24;;2319:53;;1461:31315:18;-1:-1:-1;;;1461:31315:18;;;;;;;;1952:351:33;1461:31315:18;2264:25:33;2148:155;1461:31315:18;;-1:-1:-1;;;;;2219:26:33;1461:31315:18;;2219:26:33;;:::i;:::-;3895:1:18;1461:31315;;;2264:25:33;;:::i;:::-;2148:155;;:::i;:::-;1952:351;;;1461:31315:18;-1:-1:-1;;;1461:31315:18;;;;;;;;9257:337;1461:31315;;-1:-1:-1;;;9568:26:18;;1461:31315;;9568:26;9305:111;458:10:33;9368:48:18;;;9305:111;;;9274:276;2885:5;;-1:-1:-1;;;;;1461:31315:18;;;;;;9438:39;;;;;:111;;9274:276;9436:114;;9274:276;;9438:111;525:49:33;9501:48:18;;;9438:111;;;9100:147;1461:31315;;-1:-1:-1;;;9224:23:18;;1461:31315;;9224:23;9117:89;1461:31315;-1:-1:-1;;;;;1461:31315:18;;;;;2885:5;;;;-1:-1:-1;;;;;1461:31315:18;9190:16;;2885:5;1461:31315;-1:-1:-1;;;;;1461:31315:18;;;;;2885:5;1461:31315;9152:54;;9117:89;;2885:5;-1:-1:-1;;;1461:31315:18;;;;;;;;3879:34;1461:31315;;-1:-1:-1;;;3905:8:18;;1461:31315;;3905:8;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;2083:4;1461:31315;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;;;;;:::i;:::-;;;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1903:31;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;1682:32;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;3421:18;1461:31315;3421:18;1461:31315;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;3421:18;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;:::i;:::-;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;:::i;:::-;;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;16707:4293;;;16908:13;;:::i;:::-;16977:10;16963:29;16977:10;;16963:29;:::i;:::-;-1:-1:-1;;;;;2885:5:18;;1461:31315;17006:18;17002:48;;17243:189;1461:31315;17144:41;:38;1461:31315;;458:10:33;;;:::i;17144:41:18:-;458:10:33;17270:21:18;1461:31315;16707:4293;17270:21;;458:10:33;1461:31315:18;;;;17305:21;;;;458:10:33;1461:31315:18;;17243:189;;:::i;:::-;17462:24;-1:-1:-1;;;;;17462:24:18;;;2885:5;1461:31315;-1:-1:-1;;;;;17443:43:18;;1461:31315;;;;;17443:43;:::i;:::-;1461:31315;2792:6;-1:-1:-1;;;;;2792:6:18;;;17443:43;2792:6;17549:37;;;:::i;:::-;17683:16;;;;;;1461:31315;17751:7;;;;;:::i;:::-;17792:19;17305:21;17792:19;;2792:6;1461:31315;17787:2854;17305:21;;;2885:5;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;17895:15;;;2885:5;-1:-1:-1;;;;;1461:31315:18;17862:49;;;:::i;:::-;17837:88;;;:::i;:::-;17827:98;;16707:4293;17827:98;17985:14;1461:31315;17985:14;;2885:5;-1:-1:-1;;;;;1461:31315:18;18031:11;;;;;;18027:176;-1:-1:-1;;;;;18027:176:18;18270:451;18027:176;18847:45;18027:176;;;17787:2854;18348:16;;18648:33;1461:31315;18348:16;;2885:5;18459:123;2885:5;;;1461:31315;;;17895:15;18459:68;1461:31315;;;;;2885:5;;;1461:31315;2885:5;;;;1461:31315;18459:68;;:::i;:::-;17895:15;;2885:5;1461:31315;18459:123;;:::i;:::-;18648:33;;:::i;:::-;18270:451;;:::i;:::-;1461:31315;;3000:5;;1461:31315;;2792:6;;18847:45;:::i;:::-;1461:31315;;;18833:11;;2792:6;18932:10;;:::i;:::-;16977;;18956:148;;;;;1461:31315;;;;;2792:6;;;;;;;;18956:148;;;16707:4293;18956:148;1461:31315;18956:148;;;:::i;:::-;;16977:10;;;18956:148;;;;;;;;;;;;17787:2854;19122:33;;;;;:::i;:::-;19158:10;;:::i;:::-;-1:-1:-1;19118:95:18;;1461:31315;17787:2854;20681:17;-1:-1:-1;;;;;17787:2854:18;;1461:31315;;:::i;:::-;17792:19;17305:21;17792:19;;2792:6;1461:31315;;17305:21;5926:24:32;;1461:31315:18;6009:19:32;;;2792:6:18;1461:31315;;6009:19:32;5982:24;;1461:31315:18;;6059:13:32;;458:10:33;1461:31315:18;;;6038:18:32;;2792:6:18;6113:23:32;1461:31315:18;6113:23:32;;;458:10:33;1461:31315:18;6082:28:32;;;1461:31315:18;6182:28:32;;;;458:10:33;1461:31315:18;;6146:33:32;;;1461:31315:18;16977:10;;20681:17;:::i;:::-;1461:31315;;;;;2885:5;;;1461:31315;2792:6;;20749:14;2792:6;;;;;1461:31315;2792:6;;;17305:21;2792:6;;;;;;20749:14;2792:6;1461:31315;-1:-1:-1;;;;;1461:31315:18;2792:6;;2885:5;1461:31315;2792:6;;;;:::i;:::-;;;;458:10:33;1461:31315:18;2792:6;;;;16707:4293;17270:21;;458:10:33;2792:6:18;;;17305:21;;;;458:10:33;2792:6:18;;;;;;;;;;;16707:4293;2792:6;;;-1:-1:-1;;;;;2792:6:18;;;;;;;1461:31315;2792:6;;1461:31315;6009:19:32;2792:6:18;;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;;;;;;1461:31315;;;2792:6;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;1461:31315;2792:6;1461:31315;;;;;;;;;;;;;;16707:4293;1461:31315;;;;;;16707:4293;1461:31315;;;;17305:21;1461:31315;;;;16977:10;20779:214;6009:19:32;16977:10:18;20779:214;;1461:31315;3883:8;1461:31315;;;;16707:4293;1461:31315;;;;;;;;;;;;18956:148;;;;;;:::i;:::-;1461:31315;;18956:148;;;;;;1461:31315;;2792:6;1461:31315;;2792:6;;;;18027:176;18176:8;18168:17;18176:8;;:::i;:::-;18109:6;;18168:17;:::i;:::-;18027:176;;;;17787:2854;-1:-1:-1;;;;;19269:14:18;20264:45;19269:14;;1461:31315;19269:14;;;;;2885:5;1461:31315;16707:4293;19244:41;19687:451;19320:88;19345:49;2885:5;;19378:15;2885:5;;;1461:31315;19378:15;;2885:5;1461:31315;19345:49;;:::i;:::-;19320:88;:::i;:::-;19448:11;;;;;19444:176;;17787:2854;19765:16;1461:31315;19765:16;;2885:5;;;;1461:31315;;19953:123;1461:31315;;19378:15;19953:68;19844:33;1461:31315;;;;;2885:5;;;1461:31315;19844:33;16707:4293;19844:33;;;:::i;:::-;2885:5;;;;1461:31315;19953:68;;:::i;20264:45::-;1461:31315;;;20250:11;;2792:6;20349:10;;:::i;:::-;16977;;20373:148;;;;;1461:31315;;;;;2792:6;;;;;;;;20373:148;;;16707:4293;20373:148;1461:31315;20373:148;;;:::i;:::-;;16977:10;;;20373:148;;;;;;;;;;;17787:2854;-1:-1:-1;;16707:4293:18;20556:16;20539:33;;;:::i;:::-;20575:10;;:::i;:::-;-1:-1:-1;20535:95:18;;1461:31315;17787:2854;20681:17;-1:-1:-1;;;;;17787:2854:18;;;20373:148;;;;:::i;:::-;1461:31315;;20373:148;;;;19444:176;19593:8;19585:17;19593:8;;:::i;:::-;19526:6;;19585:17;:::i;:::-;19444:176;;;1461:31315;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;;;;;;;;;;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;;;-1:-1:-1;;;4037:35:18;;-1:-1:-1;;;;;1461:31315:18;;;;;4056:7;1461:31315;;4037:35;;;;;;;;;;;1461:31315;;;4023:10;:49;4019:88;;31869:16;;:59;;;;1461:31315;31867:62;31863:107;;31985:46;1461:31315;32000:17;1461:31315;;;;;;;;;;;;;;;;31985:46;-1:-1:-1;;;;2792:6:18;;;;;;;;-1:-1:-1;;;2792:6:18;;32000:17;2792:6;3967:1;3883:8;1461:31315;;;31863:107;1461:31315;;-1:-1:-1;;;31950:20:18;;1461:31315;;31950:20;31869:59;31890:16;1461:31315;31890:16;;;:37;;31869:59;31890:37;31910:17;3883:8;31910:17;;;31869:59;;4019:88;1461:31315;;-1:-1:-1;;;4093:14:18;;1461:31315;;4093:14;4037:35;;;;1461:31315;4037:35;;;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;1461:31315;;2792:6;1461:31315;;2792:6;;;;1461:31315;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;3881:6:0;1461:31315:18;;:::i;:::-;;;719:10:6;;3881:6:0;:::i;:::-;1461:31315:18;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;;:::i;:::-;;;;;719:10:6;;1461:31315:18;;;;;;;;;;;;;;;;;;;6809:35:0;;;;1461:31315:18;;6945:34:0;1461:31315:18;;719:10:6;;6945:34:0;:::i;1461:31315:18:-;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;;;;3883:8;1461:31315;3883:13;3879:34;;31050:55;1461:31315;;3883:8;1461:31315;30771:13;;:::i;:::-;1461:31315;3329:12:0;1461:31315:18;30968:16;1461:31315;30968:16;;1461:31315;-1:-1:-1;;;;;2885:5:18;;;;;30968:34;2885:5;;;1461:31315;;30987:15;1461:31315;;30968:34;;:::i;31050:55::-;1461:31315;2885:5;;;;1461:31315;31129:33;;31125:69;;2885:5;;-1:-1:-1;;;;;1461:31315:18;;;2792:6;;31226:94;;1461:31315;;31226:94;;:::i;:::-;2885:5;;;;31330:34;2885:5;;;;1461:31315;31330:34;:::i;:::-;1461:31315;3000:5;;31379:11;31375:84;;1461:31315;31473:11;31469:84;;1461:31315;2885:5;;1461:31315;2792:6;31603:14;2792:6;1461:31315;2792:6;;-1:-1:-1;;;;;2792:6:18;;;;;;1461:31315;2792:6;;;;;;31603:14;2792:6;2885:5;1461:31315;2792:6;:::i;:::-;;;;458:10:33;2792:6:18;;;;;;;;458:10:33;2792:6:18;;;;1461:31315;2792:6;;458:10:33;2792:6:18;;;;;;;;;;;;;;;-1:-1:-1;;;;;2792:6:18;;;;;;;;;;1461:31315;2792:6;;;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;;;;;;;;;-1:-1:-1;;;;;2792:6:18;1461:31315;;;2792:6;;-1:-1:-1;;;;;;2792:6:18;;;;;;;31634:10;9505:21:0;1461:31315:18;;31634:10;1461:31315;;;;;;;;;9696:24:0;;;;1461:31315:18;;31634:10;2792:6;31634:10;;1461:31315;;;;;;;;;;;3329:12:0;1461:31315:18;;3329:12:0;1461:31315:18;;;;;;-1:-1:-1;;;;;;;;;;;31634:10:18;;9978:37:0;;1461:31315:18;;;-1:-1:-1;;;;;1461:31315:18;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;31634:10;;31669:61;;1461:31315;;31669:61;3329:12:0;3883:8:18;1461:31315;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;31469:84;31545:7;31526:6;;;31545:7;:::i;:::-;31469:84;;31375;31451:7;31432:6;;;31451:7;:::i;:::-;31375:84;;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;-1:-1:-1;1461:31315:18;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;:::i;:::-;;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;3329:12:0;1461:31315:18;28708:17;;;28736:30;;1461:31315;28799:13;;:::i;:::-;28855:36;28708:17;;;-1:-1:-1;;;;;2885:5:18;28855:36;1461:31315;-1:-1:-1;;;;;1461:31315:18;;;28906:39;;28902:87;;2885:5;;29021:94;;-1:-1:-1;;;;;1461:31315:18;;;29021:94;:::i;:::-;1461:31315;;;3895:1;1461:31315;;;;;;3895:1;1461:31315;;;;;;29346:75;-1:-1:-1;;;;;1461:31315:18;29346:16;;2885:5;1461:31315;29346:46;1461:31315;;;-1:-1:-1;;;;;29377:15:18;1461:31315;;29346:46;;:::i;:::-;:75;:::i;:::-;28708:17;;;-1:-1:-1;;;;;1461:31315:18;29440:202;;29431:211;1461:31315;-1:-1:-1;;;;;29653:34:18;1461:31315;;29346:16;1461:31315;29346:16;;2885:5;1461:31315;29653:34;:::i;:::-;1461:31315;;29346:16;;3000:5;29760:10;;;:::i;:::-;29805;;;:::i;:::-;29849;;29825:128;;;;1461:31315;;-1:-1:-1;;;29825:128:18;;3895:1;1461:31315;;;;29825:128;;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;29825:128;29849:10;;;29825:128;;;;;;;;29440:202;1461:31315;;29967:24;1461:31315;3895:1;1461:31315;;29967:24;;:::i;:::-;29994:10;;:::i;:::-;-1:-1:-1;29963:70:18;;30047:24;1461:31315;3895:1;1461:31315;;30047:24;;:::i;:::-;30074:10;;:::i;:::-;-1:-1:-1;30043:70:18;;1461:31315;;;;;;;2885:5;;1461:31315;30163:14;2792:6;1461:31315;;2792:6;-1:-1:-1;;;;;2792:6:18;;;;;;1461:31315;2792:6;;;;;;30163:14;2792:6;;-1:-1:-1;;;;;1461:31315:18;29346:16;;2885:5;1461:31315;2792:6;:::i;:::-;1461:31315;2792:6;;458:10:33;2792:6:18;;;;;;;;458:10:33;2792:6:18;;;;1461:31315;2792:6;;458:10:33;2792:6:18;;;;;;;;;;;;;;;-1:-1:-1;;;;;2792:6:18;;;;;;;;;;1461:31315;2792:6;;;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;;;;;;;;;-1:-1:-1;;;;;2792:6:18;1461:31315;;;2792:6;;-1:-1:-1;;;;;;2792:6:18;;;;;;;28708:17;30267:132;;29440:202;-1:-1:-1;;;;;;1461:31315:18;;8650:21:0;;1461:31315:18;;3895:1;1461:31315;;;;;;;;8778:22:0;1461:31315:18;3329:12:0;1461:31315:18;8778:22:0;:::i;:::-;3329:12;1461:31315:18;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1461:31315:18;;;;;;8999:37:0;1461:31315:18;;;29849:10;1461:31315;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;30449:61;;1461:31315;;30449:61;3329:12:0;3883:8:18;1461:31315;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;30267:132;2792:6;;-1:-1:-1;;;2792:6:18;;;;;;;30363:4;;8650:21:0;1461:31315:18;;3329:12:0;1461:31315:18;;;;;;;;;;;3329:12:0;1461:31315:18;30363:4;1461:31315;;;;;;;;;;;;;;;;;;;30363:4;-1:-1:-1;;;;;;;;;;;30363:4:18;;8999:37:0;;30267:132:18;;;1461:31315;-1:-1:-1;;;1461:31315:18;;;;;;;;2792:6;-1:-1:-1;;;1461:31315:18;;;;;;;;29825:128;;;;:::i;:::-;1461:31315;;29825:128;;;;;1461:31315;;2792:6;1461:31315;;2792:6;;;;29440:202;-1:-1:-1;;;;;29592:36:18;29501:141;1461:31315;;;29592:36;;:::i;:::-;1461:31315;-1:-1:-1;;;;;1461:31315:18;;;29501:141;;:::i;:::-;29440:202;;;1461:31315;-1:-1:-1;;;1461:31315:18;;;;;;;;28855:36;-1:-1:-1;;;;;28855:36:18;;;28736:30;7444:31;1461:31315;;;458:10:33;;;:::i;:::-;3329:12:0;458:10:33;;1461:31315:18;;;458:10:33;;;2463:5:18;941:47:31;6711:56:18;2463:5;6631:27;;;;;:::i;:::-;1461:31315;6711:56;:::i;:::-;6947:28;;;;:::i;:::-;458:10:33;1461:31315:18;6993:28;1461:31315;;;;6993:28;;:::i;:::-;458:10:33;1461:31315:18;;;;;;3329:12:0;1461:31315:18;941:47:31;:::i;:::-;7092:42:18;;;;:::i;:::-;3895:1;1461:31315;;;458:10:33;;;;:::i;:::-;1461:31315:18;;;;;;2792:6;;;;7153:276;1461:31315;7153:276;;2792:6;7153:276;;;;3000:5;1461:31315;3329:12:0;1461:31315:18;7153:276;;1461:31315;7153:276;;2792:6;1461:31315;7578:15;1461:31315;7153:276;;;1461:31315;7153:276;1461:31315;7153:276;;1461:31315;7153:276;;;1461:31315;7153:276;1461:31315;2792:6;;7145:284;2792:6;;;7145:284;2792:6;;;;:::i;:::-;;;7578:15;2792:6;;-1:-1:-1;;;2792:6:18;-1:-1:-1;;;;2792:6:18;;;;;;;;-1:-1:-1;;;2792:6:18;;;;;;;;;;;-1:-1:-1;;;;2792:6:18;;;;;-1:-1:-1;;;2792:6:18;;;;;;-1:-1:-1;;;;;2792:6:18;-1:-1:-1;;;2792:6:18;;;1461:31315;;;;;;;;;7444:31;28736:30;;1461:31315;;;;;;;;;;;;;;;1756:31;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;2580:6;1461:31315;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1976:35;1461:31315;;;;;;;;;;;;;;;;;;;;2463:5;1461:31315;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;;:::i;:::-;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;21208:13;;:::i;:::-;1461:31315;21263:24;1461:31315;;21263:24;;:::i;:::-;2885:5;-1:-1:-1;;;;;2885:5:18;;1461:31315;21301:18;21297:48;;22172:46;21941:217;1461:31315;;458:10:33;;;;:::i;:::-;21470:1:18;458:10:33;;1461:31315:18;;;458:10:33;;;941:47:31;21563:56:18;2463:5;21482:27;;;;;:::i;21563:56::-;21761:28;;;;:::i;:::-;458:10:33;1461:31315:18;;21807:28;;;:::i;:::-;458:10:33;1461:31315:18;;;;;;21470:1;1461:31315;941:47:31;:::i;:::-;21968:21:18;1461:31315;21968:21;;;458:10:33;1461:31315:18;22038:28;22003:21;;;458:10:33;1461:31315:18;;22038:28;;:::i;:::-;458:10:33;1461:31315:18;;21941:217;;:::i;:::-;22206:11;;22172:46;;;:::i;:::-;22168:85;;1461:31315;22283:24;-1:-1:-1;;;;;22283:24:18;;;2885:5;1461:31315;-1:-1:-1;;;;;22264:43:18;;1461:31315;;;;;22264:43;:::i;:::-;1461:31315;2792:6;-1:-1:-1;;;;;2792:6:18;;;22264:43;2792:6;22658:48;-1:-1:-1;;;;;22431:203:18;22354:24;;;:::i;:::-;1461:31315;22501:16;;2885:5;;;22501:16;;;-1:-1:-1;;;;;1461:31315:18;;;;22431:203;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;2792:6;;;1461:31315;;;22501:16;;3000:5;22658:48;:::i;:::-;21470:1;1461:31315;;22644:11;;2792:6;22856:20;22727:16;;;1461:31315;22795:7;;;;;:::i;:::-;1461:31315;;:::i;:::-;5414:19:32;22003:21:18;5414:19:32;;2792:6:18;1461:31315;;22003:21;5387:24:32;;1461:31315:18;3895:1;5443:24:32;;;1461:31315:18;;5505:13:32;;458:10:33;21470:1:18;1461:31315;;5484:18:32;;2792:6:18;5559:23:32;1461:31315:18;5559:23:32;;;458:10:33;1461:31315:18;5528:28:32;;;1461:31315:18;5628:28:32;;;;458:10:33;1461:31315:18;;5592:33:32;;;1461:31315:18;;;22856:20;;:::i;:::-;1461:31315;;;;;2885:5;;1461:31315;2792:6;;22927:14;2792:6;;-1:-1:-1;;;;;2792:6:18;;;;;;22003:21;2792:6;;;;;;22927:14;2792:6;1461:31315;-1:-1:-1;;;;;1461:31315:18;22501:16;;2885:5;1461:31315;2792:6;;;;:::i;:::-;1461:31315;22644:11;;458:10:33;1461:31315:18;2792:6;;;;21968:21;;;458:10:33;2792:6:18;;;22003:21;;;;458:10:33;2792:6:18;;;;;;;;;;;21968:21;2792:6;;;-1:-1:-1;;;;;2792:6:18;;;;;;;1461:31315;2792:6;;1461:31315;5443:24:32;2792:6:18;;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;;;;;;1461:31315;2792:6;;-1:-1:-1;;;;;2792:6:18;1461:31315;;;2792:6;;-1:-1:-1;;;;;;2792:6:18;;;;;;;1461:31315;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;22957:170;;21968:21;;22957:170;21470:1;3883:8;1461:31315;;;;;;;22168:85;1461:31315;;-1:-1:-1;;;22239:14:18;;1461:31315;;22239:14;1461:31315;;;;;;;;;;;;;;-1:-1:-1;;;;;3482:30:18;1461:31315;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;;;;;;3710:50;1461:31315;;;;;;3710:50;;1461:31315;3710:50;;;;1461:31315;3710:50;1461:31315;;3710:50;;1461:31315;3710:50;;1461:31315;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3710:50;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;:::i;:::-;;;;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;14495:2170;;14709:13;;;:::i;:::-;14778:10;14764:29;14778:10;;14764:29;:::i;:::-;1461:31315;-1:-1:-1;;;;;2885:5:18;;;;1461:31315;14807:18;14803:48;;14997:35;15020:11;14997:35;;:::i;:::-;15074:15;;;;2885:5;;15059:54;2885:5;;;;1461:31315;15059:54;:::i;:::-;1461:31315;;-1:-1:-1;15042:153:18;;15267:19;;;2792:6;15267:19;;2885:5;15337:54;2885:5;;;;1461:31315;15337:54;:::i;:::-;2885:5;15444:63;2885:5;;;1461:31315;15472:6;;15444:63;:::i;:::-;15547:10;;:::i;:::-;14778;;15571:142;;;;1461:31315;;;2792:6;1461:31315;;2792:6;;;;;;;;15571:142;;1461:31315;15571:142;;1461:31315;2792:6;1461:31315;2792:6;;1461:31315;;;2792:6;;;1461:31315;2792:6;;;;:::i;:::-;15571:142;14778:10;;;15571:142;;;;;;;;;;;;15262:1208;15731:24;;;;;:::i;:::-;15758:10;;:::i;:::-;-1:-1:-1;15727:86:18;;1461:31315;-1:-1:-1;;;;;15846:19:18;16510:8;1461:31315;15846:19;;;;;:::i;:::-;1461:31315;3000:5;;15262:1208;14778:10;;16510:8;:::i;:::-;1461:31315;;;;;2885:5;;;;1461:31315;16569:14;2792:6;;;;;1461:31315;2792:6;;;15267:19;2792:6;;;;;;16569:14;2792:6;;;;;;2885:5;1461:31315;2792:6;:::i;:::-;1461:31315;2792:6;;458:10:33;2792:6:18;;;;;1461:31315;2792:6;;458:10:33;2792:6:18;;;;15267:19;2792:6;;458:10:33;2792:6:18;;;;;;;;;;;1461:31315;2792:6;;;-1:-1:-1;;;;;2792:6:18;;;;;;;;;;1461:31315;2792:6;;;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;;1461:31315;2792:6;;;;;;;;;;;;;;-1:-1:-1;;;;;2792:6:18;1461:31315;;;2792:6;;-1:-1:-1;;;;;;2792:6:18;;;;;;;2885:5;1461:31315;;;;;;;;;;;;;;;14778:10;;16599:59;;1461:31315;;16599:59;1461:31315;3883:8;1461:31315;;;;;;;;;;;15571:142;;;;;;:::i;:::-;1461:31315;;15571:142;;;;;;1461:31315;;;15262:1208;2885:5;;;15931:54;2885:5;;;;1461:31315;15931:54;:::i;:::-;2885:5;16038:63;2885:5;;;1461:31315;16066:6;;16038:63;:::i;:::-;16141:10;;:::i;:::-;14778;;16165:142;;;;1461:31315;;;2792:6;1461:31315;;2792:6;;;;;;;;16165:142;;;1461:31315;16165:142;;1461:31315;;2792:6;;1461:31315;;;2792:6;;;1461:31315;2792:6;;;;:::i;:::-;16165:142;14778:10;;;16165:142;;;;;;;;;;;;15262:1208;16325:24;;;;;:::i;:::-;16352:10;;:::i;:::-;-1:-1:-1;16321:86:18;;1461:31315;-1:-1:-1;;;;;16440:19:18;16510:8;1461:31315;16440:19;;;;;:::i;:::-;1461:31315;3000:5;;15262:1208;;16165:142;;;;;;:::i;:::-;1461:31315;;16165:142;;;;;1461:31315;;;;;;;;;;;;;;;;;;;;2195:7;1461:31315;;;;;;;;;;;;;;;;;;;2329:3;1461:31315;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;6038:38:0;;1461:31315:18;;;;:::i;:::-;719:10:6;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;6038:38:0;:::i;:::-;719:10:6;;6038:38:0;:::i;1461:31315:18:-;;;;;;;;;;;;;;;;3173:2:0;1461:31315:18;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;719:10:6;1461:31315:18;;;;;;;;;;;;11351:37:0;;11347:243;;1461:31315:18;5441:6:0;;;;:::i;11347:243::-;11412:26;;;1461:31315:18;;11539:25:0;1461:31315:18;5441:6:0;1461:31315:18;;719:10:6;11539:25:0;;:::i;:::-;11347:243;;1461:31315:18;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;3895:1;3883:8;1461:31315;3883:13;3879:34;;3895:1;3883:8;1461:31315;;;-1:-1:-1;;;4037:35:18;;-1:-1:-1;;;;;1461:31315:18;2792:6;1461:31315;;;;4056:7;1461:31315;;4037:35;;;;;;;;;;;;1461:31315;;;4023:10;:49;4019:88;;32388:12;1461:31315;;32711:56;1461:31315;-1:-1:-1;;;;;1461:31315:18;32388:23;1461:31315;;;32388:23;:::i;:::-;1461:31315;3895:1;32474:23;1461:31315;;;32474:23;:::i;:::-;2792:6;-1:-1:-1;;;;;2792:6:18;;;32388:12;2792:6;1461:31315;;;32569:6;32541:55;32569:6;;;32541:55;:::i;:::-;32388:12;2792:6;;;;-1:-1:-1;;;2792:6:18;;;1461:31315;;32640:55;1461:31315;32668:6;;32640:55;:::i;:::-;1461:31315;;4023:10;;1461:31315;;;;;;;;;;;32711:56;;3967:1;3883:8;1461:31315;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;4037:35;;;;1461:31315;4037:35;;;;;;;;;:::i;:::-;;;;;1461:31315;;2792:6;;;;;;;;1461:31315;;;;;;;;;;;;;3635:32;1461:31315;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3329:12:0;1461:31315:18;;;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;:::i;:::-;;3883:8;1461:31315;;;;3883:13;3879:34;;1461:31315;3883:8;1461:31315;23431:13;;:::i;:::-;23458:20;;;23454:57;;23538:276;;;;2885:5;;-1:-1:-1;;;;;1461:31315:18;;;;;;23569:39;;;;;:111;;23538:276;23567:114;;23538:276;23521:337;;23947:19;;;;24008:152;;;;1461:31315;;;-1:-1:-1;;1461:31315:18;;;;;;2374:3:34;24033:97:18;2792:6;;24033:97;;:::i;:::-;1461:31315;24246:16;;2885:5;;;;;-1:-1:-1;;;;;1461:31315:18;;;;-1:-1:-1;;;;;1461:31315:18;;3165:19:33;;;1461:31315:18;;;3254:11:33;;;3816:28;;-1:-1:-1;;;;;;3402:45:33;;1461:31315:18;;3474:93:33;1027:49:17;1461:31315:18;1027:49:17;3474:93:33;:::i;:::-;3402:368;3816:28;:::i;:::-;458:10;6516:25;;;:53;;;3220:3281;6514:56;6510:102;;-1:-1:-1;;;;;1461:31315:18;;24392:120;;;;-1:-1:-1;;;;;1461:31315:18;24421:36;;24392:120;24375:181;;1461:31315;24246:16;;2885:5;;;-1:-1:-1;;;;;1461:31315:18;;-1:-1:-1;;;;;1461:31315:18;;;1082:239:34;;1027:49:17;;-1:-1:-1;;;;;;;1027:49:17;1245:62:34;1461:31315:18;1106:86:34;;1027:49:17;1106:86:34;:::i;:::-;1245:62;;:::i;:::-;1082:239;;:::i;:::-;1346:419;1014:31;;;1461:31315:18;;;1371:190:34;;1396:151;;1461:31315:18;-1:-1:-1;;;;;1461:31315:18;1460:31:34;;1461:31315:18;1460:31:34;:::i;:::-;1461:31315:18;1396:151:34;;:::i;1371:190::-;1346:419;;24599:144:18;;24819:11;;24815:3315;24819:11;;;24856:39;;;;;:11;;:39;:11;;;:39;;;24846:49;24943:11;;;;24939:176;;24856:39;25146:137;;;25297:24;25175:43;;;;:::i;:::-;25146:137;;25297:24;:::i;:::-;25361:10;;;:::i;:::-;25409;;25385:144;;;;1461:31315;;-1:-1:-1;;;25385:144:18;;1461:31315;;;;;;;25385:144;;1461:31315;;;25385:144;;;:::i;:::-;;25409:10;;;25385:144;;;;;;;;;;;25146:137;25547:12;;;;;:62;;;;;25146:137;25543:111;;;;-1:-1:-1;;;;;26034:259:18;1461:31315;25736:18;26421:46;25736:18;1461:31315;25736:18;;;2792:6;1461:31315;25736:22;;;:87;1461:31315;;;25777:26;;;:::i;:::-;25736:87;;25841:9;25837:52;;25736:87;24246:16;;;;2885:5;1461:31315;;26220:23;1461:31315;;;;;2885:5;;1461:31315;26220:23;;;:::i;26034:259::-;1461:31315;;24246:16;;;3000:5;-1:-1:-1;;;;;1461:31315:18;;2792:6;;26421:46;:::i;:::-;1461:31315;;1027:49:17;26407:11:18;;2792:6;24815:3315;1461:31315;;;;;2885:5;;1461:31315;2792:6;;28179:14;2792:6;;-1:-1:-1;;;;;2792:6:18;;1461:31315;2792:6;;;1461:31315;2792:6;;;;;;28179:14;2792:6;-1:-1:-1;;;;;24246:16:18;;;2885:5;1461:31315;2792:6;;;:::i;:::-;1027:49:17;2792:6:18;;458:10:33;2792:6:18;;;1461:31315;2792:6;;;458:10:33;1461:31315:18;2792:6;;458:10:33;2792:6:18;;;;-1:-1:-1;;;;2792:6:18;;;;;;;-1:-1:-1;;;2792:6:18;;;;;;;;;;-1:-1:-1;;;2792:6:18;;-1:-1:-1;;;2792:6:18;;;;;;;;;;;;;;;-1:-1:-1;;;2792:6:18;;;;458:10:33;1461:31315:18;2792:6;;;;;-1:-1:-1;;;;;2792:6:18;1461:31315;;;2792:6;;-1:-1:-1;;;;;;2792:6:18;;;;;;;1461:31315;;;;;;;;;;;;;;;;;;1027:49:17;1461:31315:18;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;28227:10;;28209:191;;1461:31315;;28209:191;1461:31315;3883:8;1461:31315;;;;;;;;;;;25837:52;25852:12;1461:31315;2792:6;;;25852:37;1461:31315;;;;;;25852:37;:::i;:::-;1461:31315;2792:6;;;;;25852:12;2792:6;25837:52;;25736:87;;;;;;;25547:62;25563:33;;;;:::i;:::-;25599:10;;:::i;:::-;-1:-1:-1;25547:62:18;;;;25385:144;;;;:::i;:::-;1461:31315;;25385:144;;;;;1461:31315;;2792:6;1461:31315;;2792:6;;;;25146:137;25237:46;;25297:24;25237:46;;:::i;24939:176::-;25080:17;25088:8;;;:::i;:::-;25021:6;;25080:17;:::i;:::-;24939:176;;24856:39;;;;24815:3315;26508:39;;;;;-1:-1:-1;26508:39:18;-1:-1:-1;26508:39:18;;:11;;;:39;;;26498:49;26595:11;;;;26591:176;;26508:39;26798:137;;;26949:24;26827:43;;;;:::i;:::-;26798:137;;26949:24;:::i;:::-;27013:10;;;:::i;:::-;27061;;27037:144;;;;1461:31315;;-1:-1:-1;;;27037:144:18;;1461:31315;;;;;;;27037:144;;1461:31315;;;27037:144;;;:::i;:::-;;27061:10;;;27037:144;;;;;;;;26798:137;27199:12;;;;;:62;;;;;26798:137;27195:111;;;;-1:-1:-1;;;;;27686:259:18;1461:31315;27388:18;28073:46;27388:18;1461:31315;27388:18;;;2792:6;1461:31315;27388:22;;;:87;1461:31315;;;27429:26;;;:::i;:::-;27493:9;27489:52;;27388:87;24246:16;;;;2885:5;1461:31315;;27843:23;1461:31315;;;;;2885:5;;1461:31315;27843:23;;;:::i;:::-;27686:259;;:::i;28073:46::-;1461:31315;;1027:49:17;28059:11:18;;2792:6;24815:3315;;27489:52;27504:12;1461:31315;;27504:37;1461:31315;;;;;;27504:37;:::i;:::-;1461:31315;2792:6;;;;;27504:12;2792:6;27489:52;;27388:87;;;;;;27199:62;27215:33;;;;:::i;:::-;27251:10;;:::i;:::-;-1:-1:-1;27199:62:18;;;;27037:144;;;;;;;:::i;:::-;;;;;;26798:137;26889:46;;26949:24;26889:46;;:::i;26591:176::-;26732:17;26740:8;;;:::i;:::-;26673:6;;26732:17;:::i;:::-;26591:176;;26508:39;;;;1346:419:34;1600:151;;-1:-1:-1;;;;;1461:31315:18;1664:31:34;;1461:31315:18;1664:31:34;:::i;1600:151::-;1346:419;;;24392:120:18;-1:-1:-1;;;;;1461:31315:18;24476:36;;24392:120;;6516:53:33;6545:24;525:49;6545:24;;6516:53;;3402:368;3594:176;;;:::i;3250:1404::-;-1:-1:-1;4611:28:33;;4014:82;;1027:49:17;;;;-1:-1:-1;;;;;;;1027:49:17;4014:82:33;:::i;:::-;4151:414;:44;-1:-1:-1;;;;;4151:44:33;;1461:31315:18;;4223:48:33;;4304:35;4223:48;4222:118;4223:48;;;:::i;:::-;4304:35;;:::i;:::-;4222:118;;:::i;4611:28::-;3250:1404;;4151:414;4504:35;;4367:198;4504:35;;:::i;3220:3281::-;4688:11;;;;;;-1:-1:-1;4850:82:33;;1027:49:17;;;;-1:-1:-1;;;;;;;1027:49:17;4850:82:33;:::i;:::-;4974:16;;;:::i;:::-;4954:37;;;4950:94;;5108:16;;-1:-1:-1;;;;;5108:16:33;5565:28;5108:16;;:::i;:::-;5100:45;:419;;5172:120;5181:16;5274;5173:49;5255:36;5181:16;;;;:::i;:::-;5173:49;:::i;:::-;5274:16;;:::i;5100:419::-;5457:36;5319:200;5368:16;5476;5368;;;:::i;:::-;5476;;:::i;4684:1807::-;5731:132;;;;;;;:::i;:::-;5905:16;;;:::i;:::-;-1:-1:-1;5885:37:33;5881:94;;6448:28;;-1:-1:-1;;;;;6039:16:33;;;:::i;:::-;6031:46;:371;;6113:16;6104:94;6113:16;;:::i;6031:371::-;6274:16;6225:177;6274:16;;:::i;:::-;6225:177;:::i;24008:152:18:-;;;;23569:111;458:10:33;23632:48:18;;;23569:111;;;23538:276;2885:5;;-1:-1:-1;;;;;1461:31315:18;;;;;;23702:39;;;;;:111;;23538:276;23700:114;;23538:276;;23702:111;525:49:33;23765:48:18;;;23702:111;;;23454:57;1461:31315;;-1:-1:-1;;;23487:24:18;;1461:31315;;23487:24;1461:31315;;;;;;;;;;;;;;;1830:31;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;-1:-1:-1;;1461:31315:18;;;;4593:6:0;1461:31315:18;;:::i;:::-;;;719:10:6;;4593:6:0;:::i;1461:31315:18:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;:::o;:::-;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;:::o;:::-;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;:::o;:::-;-1:-1:-1;;;;;1461:31315:18;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;;;7473:818:0;-1:-1:-1;;;;;1461:31315:18;;;;7599:18:0;;1461:31315:18;;;7677:16:0;;;1461:31315:18;;7615:1:0;1461:31315:18;;;;;;;;;;7848:21:0;;;;1461:31315:18;;;;;-1:-1:-1;;;;;;;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;8210:26:0;7473:818::o;1461:31315:18:-;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;10504:370:0;-1:-1:-1;;;;;1461:31315:18;;;;10635:19:0;;1461:31315:18;;;10713:21:0;;;1461:31315:18;;;10835:32:0;1461:31315:18;;10652:1:0;1461:31315:18;;;;;10652:1:0;1461:31315:18;;10652:1:0;1461:31315:18;;;;;10652:1:0;1461:31315:18;;;;;;;10835:32:0;10504:370::o;1461:31315:18:-;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;2885:5;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;2885:5;;;;;;:::o;458:10:33:-;-1:-1:-1;;;;;458:10:33;;;;;;;;;:::o;:::-;1461:31315:18;;458:10:33;;;;;;:::o;:::-;1461:31315:18;;;;458:10:33;;;;;1461:31315:18;458:10:33;;1461:31315:18;;3895:1;458:10:33;;;;;;;:::o;2792:6:18:-;-1:-1:-1;;;;;1461:31315:18;;;-1:-1:-1;;2792:6:18;;;;;;;:::o;:::-;-1:-1:-1;;;;;1461:31315:18;;;;;;2792:6;;;;;;;:::o;:::-;-1:-1:-1;;;;;1461:31315:18;-1:-1:-1;;;;;2792:6:18;;;;;;;:::o;:::-;;;1461:31315;2792:6;;1461:31315;;;;;;2792:6;-1:-1:-1;2792:6:18;;;;;;1461:31315;;-1:-1:-1;;1461:31315:18;2792:6;;;:::o;:::-;;;;;;;:::o;:::-;1461:31315;;;2792:6;;;;;;;;;;;;;;;;;;:::o;4563:4852:17:-;-1:-1:-1;;;;;1461:31315:18;;;;458:10:33;4791:30:17;;;;:63;;4563:4852;4789:66;4785:82;;1027:49;1461:31315:18;1027:49:17;;;;4922:2;1027:49;;4939:17;-1:-1:-1;;;;;5000:164:17;;;;;;;;5177:148;-1:-1:-1;;;;;5177:148:17;;;;;;;5338:140;;;;;;;;;5491:136;;;;;;;;;1461:31315:18;5640:134:17;;;;;;;;;5787:133;;;;;;;;;5933;1461:31315:18;5640:134:17;5933:133;;;;;;;6079:94;5177:148;;5338:140;5491:136;5640:134;5787:133;5933;6079:94;6191:10;6198:3;6191:10;;;6187:83;6198:3;;;-1:-1:-1;;;1461:31315:18;;;6187:83:17;6340:180;;;;;;;;;;;;;;;6533;;;;;;;;;6726;;;;;;;;;6919;;;;;;;;;7112;;;;;;;;;;7305;;;;;;;;;;7498;;;;;;;;;;7691;;;;;;;;;;7884;;;;;;;;;;8077;;;;;;;;;;8270;;;;;;;;;8463;;;;;;;;;;;8656;;;;;;;;;;8849:149;;;;;;8656:180;;;;;8463;;;;;8270;;;;;8077;;;;;7884;;;;;7691;;;;;7498;;;;;7305;;;;;7112;;;;;6919;;;;;6726;;;;;6533;;;;;6340;1027:49;6340:180;;;1027:49;;;;6323:2;1027:49;6340:180;6533;6726;6919;7112;7305;7498;7691;7884;8077;8270;8463;8656;8849:149;9043:24;1027:49;;;;;;6198:3;1027:49;5787:133;1461:31315:18;1027:49:17;9237:39;1027:49;6198:3;1027:49;5787:133;1461:31315:18;9307:91:17;-1:-1:-1;9307:17:17;;;;:91;1461:31315:18;;;9307:91:17;;;;;;4563:4852;:::o;9307:91::-;9337:26;;;:::i;:::-;1461:31315:18;9337:42:17;;-1:-1:-1;9337:61:17;;;4563:4852;:::o;9337:61::-;;;4563:4852;:::o;6187:83::-;1461:31315:18;;;6260:3:17;1461:31315:18;1027:49:17;6187:83;;4785:82;1461:31315:18;;-1:-1:-1;;;4864:3:17;;;;;4791:63;4825:29;525:49:33;4825:29:17;;4791:63;;1385:2759;1461:31315:18;;1529:1:17;1522:8;;1529:1;;;1461:31315:18;1529:1:17;1461:31315:18;1522:57:17;;507:7;1597:35;;1593:51;;1685:3;1675:13;;:18;1685:3;;-1:-1:-1;;;;;1712:34:17;1675:125;667:9;1818:13;1461:31315:18;1818:13:17;;1814:83;;1675:125;1925:3;1915:13;;1911:83;;1675:125;2022:3;2012:13;;2008:83;;1675:125;2119:4;2109:14;;2105:84;;1675:125;2217:4;2207:14;;2203:84;;1675:125;2315:4;2305:14;;2301:84;;1675:125;2413:4;2403:14;;;;2399:84;;1675:125;2511:5;2501:15;;2497:85;;1675:125;2610:5;2600:15;;2596:85;;1675:125;2709:5;2699:15;;2695:85;;1675:125;2808:5;2798:15;;2794:85;;1675:125;2907:6;2897:16;;2893:86;;1675:125;3007:6;2997:16;;2993:86;;1675:125;3107:6;3097:16;;3093:86;;1675:125;3207:6;3197:16;;3193:86;;1675:125;3307:7;3297:17;;3293:86;;1675:125;3407:7;3397:17;;3393:85;;1675:125;3506:7;3496:17;;3492:83;;1675:125;3603:7;3593:17;3589:78;;1675:125;3686:8;1529:1;-1:-1:-1;3682:47:17;;1675:125;667:9;;;;;1529:1;4095:30;;2217:4;1461:31315:18;;;;;;;-1:-1:-1;;;;;1461:31315:18;;1385:2759:17:o;4095:30::-;1685:3;4095:30;;;3682:47;2792:6:18;;;;-1:-1:-1;;2792:6:18;3682:47:17;;3589:78;3634:25;1529:1;667:9;;;1461:31315:18;;3589:78:17;;;;3492:83;3537:30;667:9;;;1461:31315:18;;;3492:83:17;;3393:85;667:9;3438:32;667:9;1461:31315:18;;3393:85:17;;;3293:86;667:9;3338:33;667:9;1461:31315:18;;3293:86:17;;;3193;667:9;3237:34;667:9;1461:31315:18;;3193:86:17;;;3093;667:9;3137:34;667:9;1461:31315:18;;3093:86:17;;;2993;667:9;3037:34;667:9;1461:31315:18;;2993:86:17;;;2893;667:9;2937:34;667:9;1461:31315:18;;2893:86:17;;;2794:85;667:9;2837:34;667:9;1461:31315:18;;2794:85:17;;;2695;667:9;2738:34;667:9;1461:31315:18;;2695:85:17;;;2596;667:9;2639:34;667:9;1461:31315:18;;2596:85:17;;;2497;667:9;2540:34;667:9;1461:31315:18;;2497:85:17;;;2399:84;667:9;2441:34;667:9;1461:31315:18;;2399:84:17;;;2301;667:9;2343:34;667:9;2382:3;1461:31315:18;2301:84:17;;;2203;667:9;2245:34;667:9;2284:3;1461:31315:18;2203:84:17;;;2105;667:9;2147:34;667:9;2186:3;1461:31315:18;2105:84:17;;;2008:83;667:9;2049:34;667:9;2088:3;1461:31315:18;2008:83:17;;;1911;667:9;1952:34;667:9;1991:3;1461:31315:18;1911:83:17;;;1814;667:9;1855:34;667:9;1894:3;1461:31315:18;1814:83:17;;;1675:125;-1:-1:-1;;;;;;;;1675:125:17;;1593:51;1461:31315:18;;-1:-1:-1;;;1641:3:17;;;;;1522:57;;;;7607:114:18;1461:31315;;-1:-1:-1;;;7675:39:18;;7708:4;7675:39;;;1461:31315;7675:39;1461:31315;;;7682:6;-1:-1:-1;;;;;1461:31315:18;7675:39;;;;;;;-1:-1:-1;7675:39:18;;;7668:46;7607:114;:::o;7675:39::-;;;;;;;;;;;;;;;;:::i;:::-;;;1461:31315;;;;;;7607:114;:::o;7675:39::-;;;-1:-1:-1;7675:39:18;;;1461:31315;;2792:6;-1:-1:-1;2792:6:18;;;;;7727:114;1461:31315;;-1:-1:-1;;;7795:39:18;;7828:4;7795:39;;;1461:31315;7795:39;1461:31315;;;7802:6;-1:-1:-1;;;;;1461:31315:18;7795:39;;;;;;;-1:-1:-1;7795:39:18;;;7788:46;7727:114;:::o;7847:263::-;1461:31315;;-1:-1:-1;;;8006:65:18;;1461:31315;8006:65;;;1461:31315;;;;;;;;;;;;;;;;;;-1:-1:-1;1461:31315:18;;;;;;-1:-1:-1;;;;;;1461:31315:18;8006:65;;-1:-1:-1;1461:31315:18;;-1:-1:-1;8006:65:18;;;1461:31315;8021:6;1461:31315;;8006:65;;;;;;;;;;;1461:31315;8081:22;;;7847:263;:::o;8006:65::-;;;;;;;;;;;;;:::i;:::-;;;1461:31315;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;458:10:33;1461:31315:18;;458:10:33;;;:::i;:::-;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;458:10:33;1461:31315:18;;458:10:33;;;:::i;:::-;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;8006:65;;;;;;;;;;;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8116:484;1461:31315;;458:10:33;;;:::i;:::-;1461:31315:18;-1:-1:-1;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;458:10:33;;;:::i;:::-;8207:5:18;1461:31315;;;;;;;;2792:6;;1461:31315;;;;;2792:6;1461:31315;;-1:-1:-1;;;;;1461:31315:18;;;;;3000:5;1461:31315;;;;;;;;;2792:6;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7578:15;;1461:31315;;;;;8345:10;;8341:29;;1461:31315;;;;;;;;;;;8116:484;:::o;8341:29::-;8357:13;;;;;;;:::o;1461:31315::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;9088:192:8:-;-1:-1:-1;;;;;9172:26:8;;;;1461:31315:18;;;9088:192:8;:::o;1461:31315:18:-;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;1461:31315:18;;;;;;;;;;;;;:::o;1667:3925:7:-;-1:-1:-1;;2269:166:7;;;;;;;;;;;;;;;;;;2516:10;;2512:75;;-1:-1:-1;;;1027:49:17;2697:19:7;;;1461:31315:18;;;3004:300:7;;;;;;;667:9:17;;3004:300:7;;1027:49:17;3672:371:7;4109:21;1667:3925;:::o;2512:75::-;2792:6:18;;;;;2546:26:7;:::o;1667:3925::-;;-1:-1:-1;;;1027:49:17;-1:-1:-1;;1027:49:17;1667:3925:7;2269:166;;;1027:49:17;2269:166:7;;;;;;;;;;;;2516:10;;2512:75;;2697:19;;;1461:31315:18;;;3004:300:7;;;1461:31315:18;3641:12:7;;1461:31315:18;3626:32:7;;3672:371;;;4486:1;667:9:17;;4467:1:7;667:9:17;4466:21:7;667:9:17;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;3672:371:7;1461:31315:18;3672:371:7;;11371:17:0;3672:371:7;;;3004:300;;;;;;667:9:17;3004:300:7;;3672:371;4109:21;667:9:17;1667:3925:7;:::o;2512:75::-;2553:19;;;;;;;:::i;1667:3925::-;;1611:3:33;;-1:-1:-1;;1611:3:33;1667:3925:7;2269:166;;;;;;;;;;;;;;;;2516:10;;2512:75;;2697:19;;;1461:31315:18;;;3004:300:7;;;3656:1;3641:12;;1461:31315:18;3626:32:7;;3672:371;;;4486:1;667:9:17;;4467:1:7;667:9:17;4466:21:7;667:9:17;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;3672:371:7;3656:1;3672:371;;11371:17:0;3672:371:7;;;3004:300;;;;;;667:9:17;3004:300:7;;3672:371;4109:21;667:9:17;1667:3925:7;:::o;:::-;-1:-1:-1;;2269:166:7;;;;;;;;;;;;;;;;;;2516:10;;2512:75;;306:19:28;2697::7;;;;1461:31315:18;;;3004:300:7;;;;;;;667:9:17;;3004:300:7;;3672:371;;4109:21;1667:3925;:::o;2512:75::-;2792:6:18;;;;;2546:26:7;:::o;1667:3925::-;-1:-1:-1;;2269:166:7;;;;;;;;;;;;;;;;;;2516:10;;2512:75;;-1:-1:-1;;;2792:6:18;2697:19:7;;;1461:31315:18;;;3004:300:7;;;;;;;2792:6:18;667:9:17;3004:300:7;;2792:6:18;3672:371:7;4109:21;1667:3925;:::o;2512:75::-;2792:6:18;;;;;2546:26:7;:::o;1667:3925::-;-1:-1:-1;;2269:166:7;;;;;;;;;;;;;;;;;;2516:10;;2512:75;;-1:-1:-1;;;318:51:27;2697:19:7;;;1461:31315:18;;;3004:300:7;;;;;;;667:9:17;;3004:300:7;;318:51:27;3672:371:7;4109:21;1667:3925;:::o;2512:75::-;2792:6:18;;;;;2546:26:7;:::o;1667:3925::-;;-1:-1:-1;;;2792:6:18;-1:-1:-1;;2792:6:18;1667:3925:7;2269:166;;;2792:6:18;2269:166:7;;;;;;;;;;;;2516:10;;2512:75;;2697:19;;;1461:31315:18;;;3004:300:7;;;1461:31315:18;3641:12:7;;1461:31315:18;3626:32:7;;3672:371;;;4486:1;667:9:17;;4467:1:7;667:9:17;4466:21:7;667:9:17;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;3672:371:7;1461:31315:18;3672:371:7;;11371:17:0;3672:371:7;;;3004:300;;;;;;667:9:17;3004:300:7;;3672:371;4109:21;667:9:17;1667:3925:7;:::o;:::-;;-1:-1:-1;;;318:51:27;-1:-1:-1;;318:51:27;1667:3925:7;2269:166;;;318:51:27;2269:166:7;;;;;;;;;;;;2516:10;;2512:75;;2697:19;;;1461:31315:18;;;3004:300:7;;;1461:31315:18;3641:12:7;;1461:31315:18;3626:32:7;;3672:371;;;4486:1;667:9:17;;4467:1:7;667:9:17;4466:21:7;667:9:17;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;3672:371:7;1461:31315:18;3672:371:7;;11371:17:0;3672:371:7;;;3004:300;;;;;;667:9:17;3004:300:7;;3672:371;4109:21;667:9:17;1667:3925:7;:::o;:::-;;-1:-1:-1;;2269:166:7;1667:3925;2269:166;;;;;;;;;;;;;;;;2516:10;;2512:75;;2697:19;;;1461:31315:18;;;3004:300:7;;;3656:1;3641:12;;1461:31315:18;3626:32:7;;3672:371;;;4486:1;667:9:17;;4467:1:7;667:9:17;4466:21:7;667:9:17;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;;;;1461:31315:18;;667:9:17;3672:371:7;3656:1;3672:371;;11371:17:0;3672:371:7;;;3004:300;;;;;;667:9:17;3004:300:7;;3672:371;4109:21;667:9:17;1667:3925:7;:::o;1461:31315:18:-;;;;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;:::o;864:370:30:-;;;1173:54;;-1:-1:-1;;;;;1461:31315:18;-1:-1:-1;;;;;1079:74:30;1461:31315:18;1027:49:17;;;;-1:-1:-1;;;;;;;1027:49:17;1079:74:30;:::i;:::-;1461:31315:18;;1173:54:30;:::i;2859:970::-;;3126:68;2859:970;3126:68;:::i;:::-;3209:11;;3219:1;3209:11;;;;:44;;2859:970;3205:107;;3219:1;3326:11;;;;;:44;;2859:970;3322:107;;1987:70;;1910:42;;:30;;1920:19;;3463:12;;3490:27;;;;:::i;:::-;3463:97;;3593:12;;3620:27;;;;:::i;1987:70::-;458:10:33;2086:45:30;;;:109;;;3593:97;2084:112;2067:182;;1461:31315:18;;;;;;3701:121:30;2859:970;:::o;2086:109::-;2151:44;525:49:33;2151:44:30;;2086:109;;3463:97;3551:8;3532:28;3551:8;;:::i;3532:28::-;3463:97;;;3326:44;3349:8;;;;;:::i;:::-;3341:29;;3326:44;;3209;3232:8;;;;;:::i;:::-;3224:29;;3209:44;;1461:31315:18;;;;;;;;;;;;;;;;:::o;6280:1642:7:-;6351:6;;6347:45;;7894:10;7094:7;6356:1;1461:31315:18;;8519:3:7;1461:31315:18;8510:16:7;8506:99;;6280:1642;1461:31315:18;;8631:2:7;1461:31315:18;8622:15:7;8618:96;;6280:1642;1461:31315:18;;8740:2:7;1461:31315:18;8731:15:7;8727:96;;6280:1642;1461:31315:18;;8849:2:7;1461:31315:18;8840:15:7;8836:96;;6280:1642;1461:31315:18;;8958:1:7;1461:31315:18;8949:14:7;8945:93;;6280:1642;1461:31315:18;;9064:1:7;1461:31315:18;9055:14:7;9051:93;;6280:1642;1461:31315:18;;9170:1:7;1461:31315:18;9161:14:7;9157:93;;6280:1642;9276:1;;1461:31315:18;;;;;;9263:64:7;;6280:1642;1461:31315:18;1027:49:17;7551:10:7;;;;:::i;:::-;1461:31315:18;;;7600:10:7;;;;:::i;:::-;1461:31315:18;;;7649:10:7;;;;:::i;:::-;1461:31315:18;;;7698:10:7;;;;:::i;:::-;1461:31315:18;;;7747:10:7;;;;:::i;:::-;1461:31315:18;;;7796:10:7;;;;:::i;:::-;1461:31315:18;;;7845:10:7;;;;:::i;:::-;1461:31315:18;;;7894:10:7;;;:::i;:::-;672:5;;;;;;:13;6280:1642;:::o;9263:64::-;1461:31315:18;9263:64:7;;;9157:93;9170:1;9195:11;;1461:31315:18;;9157:93:7;;;;9051;9064:1;9089:11;;1461:31315:18;;9051:93:7;;;;8945;8958:1;8983:11;;1461:31315:18;;8945:93:7;;;;8836:96;8849:2;8875:12;;1461:31315:18;;8836:96:7;;;;8727;8740:2;8766:12;;1461:31315:18;;8727:96:7;;;;8618;8631:2;8657:12;;1461:31315:18;;8618:96:7;;;;8506:99;8546:13;;;8519:3;8506:99;;;;6347:45;6373:8;6356:1;6373:8;:::o;1461:31315:18:-;;;458:10:33;;;;:::i;:::-;1461:31315:18;;-1:-1:-1;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2598:222:32:-;;2784:27;;2598:222;1461:31315:18;;:::i;:::-;;;;2784:27:32;;;;;;;;1461:31315:18;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;-1:-1:-1;;;;;2792:6:18;;;;;;1461:31315;;;;;;;2784:27:32;;1461:31315:18;;2784:27:32;;;;;;:::i;:::-;1461:31315:18;2774:38:32;;-1:-1:-1;1461:31315:18;14764:9;2784:27:32;1461:31315:18;;-1:-1:-1;1461:31315:18;;;;458:10:33;;;;:::i;:::-;1461:31315:18;;-1:-1:-1;;;;;1461:31315:18;;;;3000:5;;1461:31315;;2784:27:32;1461:31315:18;;3000:5;1461:31315;;;;;;;;;;3000:5;1461:31315;;;;;3000:5;1461:31315;;;;;;;;;;3000:5;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2792:6;1461:31315;;;;;;;;;;;;;;;;;;;;;;;;;;;3000:5;1461:31315;;;;;3000:5;1461:31315;;;;;2792:6;2598:222:32;:::o;3187:229::-;1461:31315:18;;;;;;;;-1:-1:-1;;1461:31315:18;3369:27:32;;;1461:31315:18;;;2792:6;;;;;-1:-1:-1;;;;;;2792:6:18;1461:31315;;;;3369:27:32;;1461:31315:18;;;;3369:27:32;1461:31315:18;3369:27:32;1461:31315:18;3359:38:32;;-1:-1:-1;1461:31315:18;;;14764:9;3369:27:32;1461:31315:18;;;;;;;;2885:5;;1461:31315;;;2885:5;2792:6;;;;-1:-1:-1;;2792:6:18;;;-1:-1:-1;;;;;1461:31315:18;;;2792:6;;;1461:31315;;;2885:5;1461:31315;;;2885:5;1461:31315;;;2792:6;;;;;1461:31315;;;2792:6;1461:31315;;;;;;;2792:6;1461:31315;;;;2885:5;1461:31315;;;;;;;2792:6;1461:31315;;;2792:6;1461:31315;;;;;;;;2792:6;1461:31315;;;;;;;;458:10:33;1461:31315:18;;;2792:6;1461:31315;;;;;458:10:33;1461:31315:18;;;;2792:6;1461:31315;;;;;458:10:33;1461:31315:18;;;;;;;2792:6;1461:31315;;;;;;;;;;;;;;;;;;2885:5;1461:31315;2792:6;;;;;;;1461:31315;;;2885:5;1461:31315;-1:-1:-1;;;;;2792:6:18;;;;;;;;;;;;;;;1461:31315;;;;;;3187:229:32:o;4071:1038::-;;;;;1461:31315:18;;:::i;:::-;;4413:23:32;;;1461:31315:18;;458:10:33;;;1461:31315:18;;;;4391:45:32;;;;4387:66;;1461:31315:18;;;;;4714:180:32;1461:31315:18;;;;;;;;18986:19:32;;;2792:6:18;1461:31315;18981:1940:32;18986:19;;;941:47:31;19309:28:32;1461:31315:18;19309:28:32;;;;;458:10:33;1461:31315:18;;;;;19369:16:32;;;19365:97;19369:16;;;19387;19365:97;;1461:31315:18;;;;941:47:31;:::i;:::-;19809:14:32;;;2885:5:18;19874:14:32;;;2885:5:18;-1:-1:-1;;;;;1461:31315:18;;;;19845:105:32;;:76;;-1:-1:-1;;;;;1461:31315:18;;;;;19845:76:32;:::i;:105::-;-1:-1:-1;;;;;1461:31315:18;;;4905:14:32;;;3000:5:18;1461:31315;4937:14:32;;;3000:5:18;1461:31315;5023:28:32;;;1461:31315:18;4071:1038:32;:::o;19365:97::-;19434:9;;;;;:::i;:::-;1461:31315:18;;19426:17:32;;19422:40;;19365:97;;;;19422:40;19453:9;;;;;:::i;:::-;19422:40;;;;18981:1940;941:47:31;20228:28:32;1461:31315:18;20228:28:32;;;;458:10:33;1461:31315:18;;;;;;20329:16:32;;;20325:97;20329:16;;;20347;20325:97;1461:31315:18;;;;941:47:31;:::i;:::-;20798:14:32;;;2885:5:18;-1:-1:-1;;;;;1461:31315:18;20769:105:32;;:76;;-1:-1:-1;;;;;1461:31315:18;;;;20769:76:32;:::i;:105::-;20896:14;;;;2885:5:18;1461:31315;18981:1940:32;;4387:66;4438:15;;;;;;;;:::o;1461:31315:18:-;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;:::o;8964:811:32:-;;;;9146:11;9142:627;9146:11;;;9238:205;;9239:191;;1027:49:17;;9344:86:32;;1027:49:17;;;;;-1:-1:-1;;;;;;;1027:49:17;;-1:-1:-1;;;;;1461:31315:18;9239:82:32;;1461:31315:18;;1027:49:17;9239:82:32;:::i;:::-;1461:31315:18;;9344:86:32;;:::i;9142:627::-;9539:219;;9561:167;;-1:-1:-1;;;;;1461:31315:18;-1:-1:-1;;;;;1461:31315:18;9633:31:32;;1461:31315:18;9633:31:32;:::i;:::-;1461:31315:18;;;9561:167:32;:::i;12995:123::-;-1:-1:-1;;;;;1461:31315:18;;;;;;;;;;;;;;;;;13108:3:32;2792:6:18;;12995:123:32;:::o;14662:1889::-;;14814:42;14842:13;;;458:10:33;1461:31315:18;;14814:42:32;:::i;:::-;14892:19;;;2792:6:18;14892:19:32;;-1:-1:-1;;;;;15001:14:32;;;;;2885:5:18;1461:31315;;15036:3:32;1461:31315:18;;;;;;;;;14993:70:32;;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;;;;2792:6;15100:33:32;;;1461:31315:18;;15260:45:32;;15152:171;15260:45;;:::i;:::-;15152:171;;:::i;:::-;15100:425;;2885:5:18;1461:31315;;-1:-1:-1;15562:29:32;;;;;;15615;15614:43;15615:29;;;;:::i;15562:119::-;;;;15539:142;:::o;15100:425::-;15450:57;;15342:183;15450:57;;:::i;:::-;15342:183;;:::i;:::-;15100:425;;;14887:1658;-1:-1:-1;;;;;15820:14:32;;;;;2885:5:18;1461:31315;;15855:3:32;1461:31315:18;;;;;;;;;15812:70:32;;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;;;;2792:6;15919:33:32;;;1461:31315:18;;16039:45:32;;15971:171;16039:45;;:::i;:::-;15971:171;;:::i;15919:425::-;16229:57;;16161:183;16229:57;;:::i;:::-;16161:183;;:::i;16878:660::-;;17009:19;;;2792:6:18;1461:31315;17004:528:32;17009:19;;;-1:-1:-1;;;;;17248:19:32;17070:154;:107;:65;2885:5:18;;;1461:31315;17119:15:32;;;;2885:5:18;1461:31315;17070:65:32;;:::i;:::-;17162:14;;;;2885:5:18;1461:31315;17070:107:32;;:::i;:::-;17204:19;;;;2885:5:18;1461:31315;17070:154:32;;:::i;:::-;17248:19;;2885:5:18;1461:31315;17004:528:32;16878:660::o;17004:528::-;17367:154;-1:-1:-1;;;;;17308:19:32;;;;;2885:5:18;1461:31315;2885:5;17501:19:32;17367:107;:65;2885:5:18;;;1461:31315;17416:15:32;;;;2885:5:18;1461:31315;17367:65:32;;:::i;:::-;17459:14;;;;2885:5:18;1461:31315;17367:107:32;;:::i;:::-;17501:19;;2885:5:18;1461:31315;17367:154:32;;:::i;1461:31315:18:-;;;-1:-1:-1;;1461:31315:18;;;;;;;:::o;21599:1193:32:-;;;21751:19;;;2792:6:18;1461:31315;21746:1040:32;21751:19;;;-1:-1:-1;;;;;21819:14:32;;;;;2885:5:18;1461:31315;21854:3:32;1461:31315:18;21854:3:32;1461:31315:18;;;;;;;;;;22126:73:32;21811:70;;21961:49;21811:70;21932:156;21811:70;;:::i;:::-;2792:6:18;21969:15:32;;;;;2885:5:18;1461:31315;2885:5;;1461:31315;21961:49:32;;:::i;:::-;-1:-1:-1;;;;;1461:31315:18;;;;;;21932:156:32;:::i;:::-;1027:49:17;266:2:29;1027:49:17;22126:73:32;:::i;:::-;-1:-1:-1;22220:36:32;22213:43;:::o;21746:1040::-;-1:-1:-1;;;;;22320:14:32;;;;;2885:5:18;1461:31315;22355:3:32;1461:31315:18;22355:3:32;1461:31315:18;;;;;;;;;;22598:120:32;22312:70;;22435:65;22312:70;22433:127;22312:70;;:::i;22435:65::-;-1:-1:-1;;;;;1461:31315:18;;;;;;266:2:29;1027:49:17;22433:127:32;:::i;:::-;22598:120;;:::i;1461:31315:18:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11371:17:0;;;;;1461:31315:18;;;;;;;;:::o;:::-;11371:17:0;;;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;:::o;:::-;;;;;;:::o;:::-;;;:::o;2206:210:34:-;1461:31315:18;;;;;;;;;;;;;;;;;2792:6;;2206:210:34;:::o;685:329:35:-;1461:31315:18;;-1:-1:-1;;;860:38:35;;892:4;860:38;;;1461:31315:18;860:38:35;;-1:-1:-1;;;;;1461:31315:18;685:329:35;1461:31315:18;;;860:38:35;1461:31315:18;;;;860:38:35;;;;;;;-1:-1:-1;860:38:35;;;685:329;-1:-1:-1;925:16:35;;;;;:34;;1461:31315:18;;902:58:4;;;;2792:6:18;;;;902:58:4;;1461:31315:18;;902:58:4;;1461:31315:18;;;;;;902:58:4;;1461:31315:18;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;-1:-1:-1;1461:31315:18;;5330:69:5;1461:31315:18;;;;458:10:33;;;:::i;:::-;1461:31315:18;;;;;;;;5282:31:5;;;;;;;;:::i;:::-;5330:69;;:::i;:::-;1461:31315:18;;4275:21:4;4271:176;;685:329:35;;;:::o;4271:176:4:-;4359:30;;;;;1461:31315:18;;;;4359:30:4;;1461:31315:18;;;;;;;;;;;685:329:35;:::o;1461:31315:18:-;;;;;;;;;;;860:38:35;1461:31315:18;;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;925:34:35;;;;;860:38;;;;;;;;;;;;;;;:::i;:::-;;;1461:31315:18;;;;;;860:38:35;;;;;;;;1461:31315:18;;;;;;;-1:-1:-1;;;;;1461:31315:18;;;;;;;458:10:33;1461:31315:18;;;-1:-1:-1;;1461:31315:18;;;;458:10:33;:::i;:::-;1461:31315:18;;;-1:-1:-1;1461:31315:18;;;;:::o;:::-;;;:::o;7466:628:5:-;;;;7670:418;;;1461:31315:18;;;7701:22:5;7697:286;;7996:17;;:::o;7697:286::-;1465:19;:23;1461:31315:18;;7996:17:5;:::o;1461:31315:18:-;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;;;;;;;;;7670:418:5;1461:31315:18;;;;-1:-1:-1;8775:21:5;:17;;8947:142;;;;;;;8771:379;1461:31315:18;;-1:-1:-1;;;9119:20:5;;1461:31315:18;;;9119:20:5;;;;;;:::i;:::-;;;;1276:155:35;1366:25;1276:155;;;;;1366:25;;;;:::i;:::-;;1461:31315:18;;;1276:155:35:o;1461:31315:18:-;;;-1:-1:-1;;;1461:31315:18;;;;;;;;;;;;-1:-1:-1;;;1461:31315:18;;;;;;

Swarm Source

ipfs://82ba88c317067c02e9de94b32a09683cc78a8a4895fe99de0b150608ed761c96

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.